
/* ============================================================
   BOSIA DESIGN FOUNDATION — design system (bosia-*)
   ============================================================ */
:root {
  --bosia-bg: #0a0e17;
  --bosia-bg-2: #0e1420;
  --bosia-panel: #121a2a;
  --bosia-border: #22304a;
  --bosia-border-2: #2e3f5e;
  --bosia-text: #e8eefc;
  --bosia-muted: #8b9cc0;
  --bosia-accent: #4f8cff;
  --bosia-ok: #2fd46e;
  --bosia-fail: #ff5c66;
  --bosia-warn: #ffb648;
  --bosia-radius: 12px;
  --bosia-font: "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  --bosia-mono: "Cascadia Code", Consolas, monospace;
  --fs-1: 12px; --fs-2: 14px; --fs-3: 16px; --fs-4: 19px; --fs-5: 24px; --fs-6: 32px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px;
  --shadow-1: 0 1px 2px rgba(0,0,0,.28);
  --shadow-2: 0 8px 24px rgba(0,0,0,.34);
  --shadow-3: 0 18px 48px rgba(0,0,0,.42);
  --ring: 0 0 0 3px color-mix(in srgb, var(--bosia-accent) 45%, transparent);
  --motion: 160ms cubic-bezier(.2,.8,.2,1);
  --bosia-maxw: 1200px;
}
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: none; box-shadow: var(--ring); border-radius: 8px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bosia-bg); color: var(--bosia-text);
  font-family: var(--bosia-font); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: #7ab0ff; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { color: var(--bosia-text); line-height: 1.25; margin: 0 0 10px; }
h1 { font-size: var(--fs-5); letter-spacing: -0.02em; } h2 { font-size: var(--fs-4); } h3 { font-size: var(--fs-3); }
p { margin: 6px 0; }
small { color: var(--bosia-muted); }
code, pre { font-family: var(--bosia-mono); }
.bosia-card {
  background: var(--bosia-panel); border: 1px solid var(--bosia-border);
  border-radius: var(--bosia-radius); padding: 16px; margin-bottom: 14px;
}
.bosia-btn {
  display: inline-block; padding: 8px 16px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--bosia-border-2); background: #1b2740; color: var(--bosia-text);
  font-family: inherit; font-size: 13px; transition: background 0.15s, transform 0.1s, border-color 0.15s;
}
.bosia-btn:hover { background: #243354; border-color: var(--bosia-accent); }
.bosia-btn:active { transform: translateY(1px); }
.bosia-btn:focus-visible { outline: 2px solid #7ab0ff; outline-offset: 2px; }
.bosia-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.bosia-btn-primary { background: var(--bosia-accent); border-color: transparent; color: #fff; font-weight: 600; }
.bosia-btn-success { background: #1f9e4d; border-color: transparent; color: #04210f; font-weight: 600; }
.bosia-btn-danger { background: #c22f3b; border-color: transparent; color: #fff; font-weight: 600; }
.bosia-input {
  width: 100%; background: var(--bosia-bg-2); color: var(--bosia-text);
  border: 1px solid var(--bosia-border-2); border-radius: 9px; padding: 9px 12px;
  font-size: 13px; font-family: inherit;
}
.bosia-input:focus { outline: none; border-color: var(--bosia-accent); box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.15); }
.bosia-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px;
  border-radius: 999px; font-size: 11px; font-weight: 650;
  background: #1b2740; border: 1px solid var(--bosia-border-2);
}
.bosia-badge.ok { background: rgba(47, 212, 110, 0.12); color: var(--bosia-ok); border-color: rgba(47, 212, 110, 0.4); }
.bosia-badge.fail { background: rgba(255, 92, 102, 0.12); color: var(--bosia-fail); border-color: rgba(255, 92, 102, 0.4); }
.bosia-badge.warn { background: rgba(255, 182, 72, 0.12); color: var(--bosia-warn); border-color: rgba(255, 182, 72, 0.4); }
.bosia-table { width: 100%; border-collapse: collapse; }
.bosia-table th, .bosia-table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--bosia-border); font-size: 13px; }
.bosia-table th { color: var(--bosia-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.bosia-table tr:hover td { background: rgba(79, 140, 255, 0.04); }
.bosia-empty {
  text-align: center; padding: 48px 16px; color: var(--bosia-muted);
  border: 1px dashed var(--bosia-border-2); border-radius: var(--bosia-radius);
}
.bosia-spinner {
  display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.2);
  border-top-color: #7ab0ff; border-radius: 50%; animation: bosia-spin 0.7s linear infinite; vertical-align: -2px;
}
@keyframes bosia-spin { to { transform: rotate(360deg); } }
.bosia-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bosia-muted { color: var(--bosia-muted); }
.bosia-mt { margin-top: 10px; } .bosia-mb { margin-bottom: 10px; }
.bosia-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.bosia-label { font-size: 12px; color: var(--bosia-muted); letter-spacing: .02em; }
.bosia-hint { font-size: 11px; color: var(--bosia-muted); }
.bosia-alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--bosia-radius); border: 1px solid var(--bosia-border-2); background: var(--bosia-bg-2); }
.bosia-alert.info { border-color: rgba(79,140,255,.4); }
.bosia-alert.ok { border-color: rgba(47,212,110,.4); }
.bosia-alert.warn { border-color: rgba(255,182,72,.45); }
.bosia-alert.error { border-color: rgba(255,92,102,.45); }
.bosia-kpi { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: var(--bosia-radius); background: var(--bosia-panel); border: 1px solid var(--bosia-border); box-shadow: var(--shadow-1); }
.bosia-kpi .kpi-value { font-size: var(--fs-6); font-weight: 700; letter-spacing: -.02em; }
.bosia-kpi .kpi-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--bosia-muted); }
.bosia-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--bosia-border); }
.bosia-tab { padding: 9px 14px; border: none; background: transparent; color: var(--bosia-muted); cursor: pointer; border-bottom: 2px solid transparent; font-size: 13px; }
.bosia-tab:hover { color: var(--bosia-text); }
.bosia-tab.active { color: var(--bosia-text); border-bottom-color: var(--bosia-accent); }
.bosia-modal-backdrop { position: fixed; inset: 0; background: rgba(3,6,12,.6); display: grid; place-items: center; padding: 16px; }
.bosia-modal { width: min(520px, 100%); background: var(--bosia-panel); border: 1px solid var(--bosia-border); border-radius: var(--bosia-radius); box-shadow: var(--shadow-3); padding: 20px; }
.bosia-skeleton { background: linear-gradient(90deg, #182238 25%, #22304a 37%, #182238 63%); background-size: 400% 100%; animation: bosia-shimmer 1.4s ease infinite; border-radius: 8px; height: 14px; }
@keyframes bosia-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.bosia-btn-ghost { background: transparent; border-color: transparent; color: var(--bosia-muted); }
.bosia-btn-ghost:hover { color: var(--bosia-text); background: rgba(255,255,255,.04); }
.bosia-btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.bosia-app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.bosia-sidebar { background: var(--bosia-bg-2); border-right: 1px solid var(--bosia-border); padding: 16px; }
.bosia-main { padding: 24px; max-width: var(--bosia-maxw); }
.bosia-stack { display: flex; flex-direction: column; gap: var(--sp-4); }
.bosia-grid { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
@media (max-width: 820px) { .bosia-app { grid-template-columns: 1fr; } .bosia-sidebar { border-right: none; border-bottom: 1px solid var(--bosia-border); } }
@media (max-width: 600px) {
  body { font-size: 13px; }
  .bosia-table { display: block; overflow-x: auto; }
  .bosia-card { padding: 12px; }
  .bosia-main { padding: 16px; }
}


:root {
  --bosia-bg: #0f0b18;
  --bosia-bg-2: #171024;
  --bosia-panel: #201732;
  --bosia-border: #2e2146;
  --bosia-border-2: #3d2c5c;
  --bosia-text: #f0eaff;
  --bosia-muted: #b3a6c9;
  --bosia-accent: #8b5cf6;
  --bosia-ok: #34d399;
  --bosia-fail: #fb7185;
  --bosia-warn: #fbbf24;
  --bosia-radius: 14px;
  --bosia-font: Inter, "Segoe UI", system-ui, sans-serif;
  --bosia-serif: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --bosia-mono: "Cascadia Code", Consolas, monospace;
  --bosia-maxw: 1480px;
}


a { color: var(--bosia-accent); }
h1, h2, h3 { font-family: var(--bosia-serif); letter-spacing: -0.01em; }
h1 { font-size: 30px; } h2 { font-size: 21px; } h3 { font-size: 16px; }
.bosia-app { grid-template-columns: 248px minmax(0, 1fr); }
.bosia-shell { min-width: 0; display: flex; flex-direction: column; }
.bosia-sidebar { display: flex; flex-direction: column; gap: 20px; padding: 20px 16px; }
.bosia-main { padding: 28px 32px 48px; max-width: 1480px; width: 100%; }
.bosia-btn { background: var(--bosia-panel); }
.bosia-btn:hover { background: var(--bosia-panel); border-color: var(--bosia-accent); }
.bosia-btn-primary { background: var(--bosia-accent); border-color: transparent; color: var(--bosia-bg); font-weight: 700; }
.bosia-btn-primary:hover { background: var(--bosia-accent); border-color: var(--bosia-bg-2); }
.bosia-btn-success { background: var(--bosia-ok); color: var(--bosia-bg); }
.bosia-btn-danger { background: var(--bosia-fail); color: var(--bosia-bg); }
.bosia-badge { background: var(--bosia-panel); }
.bosia-alert { background: var(--bosia-bg-2); }
.bosia-topbar { background: var(--bosia-panel); border-bottom: 1px solid var(--bosia-border); padding: 12px 32px; display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--bosia-accent); color: var(--bosia-bg); font-weight: 800; font-size: 18px; flex: 0 0 auto; }
.brand-name { font-family: var(--bosia-serif); font-size: 19px; font-weight: 700; color: var(--bosia-text); line-height: 1.1; }
.brand-sub { font-size: 11px; color: var(--bosia-muted); letter-spacing: .06em; text-transform: uppercase; }
.side-label { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--bosia-muted); margin: 4px 0 8px 10px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--bosia-muted); text-decoration: none; font-size: 13px; border: 1px solid transparent; }
.nav-link:hover { color: var(--bosia-text); text-decoration: none; background: var(--bosia-panel); }
.nav-link[aria-current="page"] { background: var(--bosia-panel); border-color: var(--bosia-border); color: var(--bosia-text); font-weight: 600; }
.nav-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--bosia-border-2); flex: 0 0 auto; }
.nav-link[aria-current="page"] .nav-dot { background: var(--bosia-accent); }
.side-context { margin-top: auto; }
.side-context .k { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--bosia-border); font-size: 12px; }
.side-context .k:last-child { border-bottom: none; }
.side-context .k span:last-child { color: var(--bosia-text); font-weight: 600; }
.crumbs { font-size: 11px; color: var(--bosia-muted); letter-spacing: .08em; text-transform: uppercase; }
.search { flex: 1; min-width: 160px; max-width: 420px; }
.top-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-wrap: wrap; }
.account { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border: 1px solid var(--bosia-border); border-radius: 999px; background: var(--bosia-bg-2); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--bosia-bg-2); border: 1px solid var(--bosia-border-2); color: var(--bosia-text); font-weight: 700; font-size: 12px; flex: 0 0 auto; }
.avatar.lg { width: 38px; height: 38px; font-size: 13px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head p { max-width: 680px; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.grid-2 > .bosia-card { margin-bottom: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.list { display: flex; flex-direction: column; gap: 2px; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 10px; border-bottom: 1px solid var(--bosia-border); border-radius: 10px; text-decoration: none; color: var(--bosia-text); }
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: var(--bosia-bg-2); text-decoration: none; }
.list-main { min-width: 0; flex: 1; }
.list-title { font-weight: 600; font-size: 13px; }
.list-meta { font-size: 12px; color: var(--bosia-muted); }
.num-chip { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--bosia-bg-2); border: 1px solid var(--bosia-border-2); font-size: 12px; font-weight: 700; color: var(--bosia-muted); flex: 0 0 auto; }
.field-row { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--bosia-border); font-size: 13px; }
.field-row:last-child { border-bottom: none; }
.field-row .k { color: var(--bosia-muted); flex: 0 0 auto; }
.field-row .v { color: var(--bosia-text); text-align: right; overflow-wrap: anywhere; }
.mask { font-family: var(--bosia-mono); letter-spacing: .08em; }
.table-wrap { width: 100%; overflow-x: auto; }
.status-line { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; background: var(--bosia-border-2); }
.dot.ok { background: var(--bosia-ok); } .dot.fail { background: var(--bosia-fail); } .dot.warn { background: var(--bosia-warn); }
.chat { display: flex; flex-direction: column; gap: 14px; max-height: 460px; overflow-y: auto; padding-right: 4px; }
.msg { display: flex; gap: 10px; align-items: flex-start; }
.msg.user { flex-direction: row-reverse; }
.bubble { background: var(--bosia-bg-2); border: 1px solid var(--bosia-border); border-radius: 12px; padding: 12px 14px; max-width: 82%; }
.bubble.user { border-color: var(--bosia-border-2); }
.bubble.err { border-color: var(--bosia-fail); }
.msg-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.ai-name { font-weight: 700; color: var(--bosia-accent); font-size: 12px; }
.msg-time { font-size: 11px; color: var(--bosia-muted); }
.msg-body { font-size: 13px; }
.composer { display: flex; gap: 10px; align-items: flex-end; border-top: 1px solid var(--bosia-border); padding-top: 16px; margin-top: 16px; }
.composer textarea { min-height: 48px; resize: vertical; }
.composer .send { min-height: 44px; white-space: nowrap; }
.participants { display: flex; flex-direction: column; gap: 10px; }
.participant { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--bosia-border); border-radius: 12px; background: var(--bosia-bg-2); }
.participant .p-main { min-width: 0; flex: 1; }
.participant .p-name { font-size: 13px; font-weight: 600; }
.participant .p-sub { font-size: 11px; color: var(--bosia-muted); }
.login-wrap { max-width: 920px; margin: 0 auto; }
.login-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 24px; align-items: stretch; }
.login-grid > .bosia-card { margin-bottom: 0; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.hero-list { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.hero-item { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; }
.hero-bullet { width: 22px; height: 22px; border-radius: 7px; background: var(--bosia-bg-2); border: 1px solid var(--bosia-border-2); display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--bosia-accent); flex: 0 0 auto; }
.screen[hidden] { display: none !important; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 40; max-width: 340px; }
.toast[hidden] { display: none; }
.stack-8 { display: flex; flex-direction: column; gap: 8px; }
.stack-16 { display: flex; flex-direction: column; gap: 16px; }
.mono { font-family: var(--bosia-mono); }
.url { overflow-wrap: anywhere; }
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 980px) {
  .grid-2, .login-grid { grid-template-columns: 1fr; }
  .bosia-main { padding: 24px; }
  .bosia-topbar { padding: 12px 20px; }
}
@media (max-width: 820px) {
  .bosia-app { grid-template-columns: 1fr; }
  .bosia-sidebar { flex-direction: column; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .side-context { margin-top: 8px; }
}
@media (max-width: 600px) {
  h1 { font-size: 24px; }
  .kpi-grid { grid-template-columns: 1fr; }
  .bosia-topbar { flex-wrap: wrap; padding: 12px 16px; gap: 10px; }
  .bosia-topbar > div:first-child { flex: 1 1 100%; }
  .search { order: 3; flex: 1 1 100%; max-width: 100%; }
  .top-actions { margin-left: 0; width: 100%; }
  .account { max-width: 100%; }
  .bubble { max-width: 100%; }
  .composer { flex-direction: column; align-items: stretch; }
  .composer .send { width: 100%; }
  .toast { left: 16px; right: 16px; bottom: 16px; max-width: none; }
}
