/* ============================================================
   VANTORX CLIENT HUB — styles.css
   Premium dark SaaS design system (shared VantorX tokens)
   ============================================================ */

:root {
  --bg: #0a0a0d;
  --bg-soft: #101014;
  --bg-card: #14141a;
  --bg-hover: #1b1b22;
  --border: rgba(255, 255, 255, 0.08);
  --border-soft: rgba(255, 255, 255, 0.05);
  --gold: #d4af37;
  --gold-bright: #f0d060;
  --gold-dim: rgba(212, 175, 55, 0.14);
  --text: #f0efe9;
  --text-soft: #a8a699;
  --text-dim: #6d6b60;
  --green: #4ade80;
  --green-dim: rgba(74, 222, 128, 0.12);
  --blue: #60a5fa;
  --blue-dim: rgba(96, 165, 250, 0.12);
  --purple: #a78bfa;
  --purple-dim: rgba(167, 139, 250, 0.12);
  --red: #f87171;
  --red-dim: rgba(248, 113, 113, 0.12);
  --orange: #fbbf24;
  --orange-dim: rgba(251, 191, 36, 0.12);
  --teal: #2dd4bf;
  --teal-dim: rgba(45, 212, 191, 0.12);
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --font-display: 'Sora', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --sidebar-w: 248px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

::selection { background: var(--gold-dim); color: var(--gold-bright); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }

/* ============================================================
   APP SHELL
   ============================================================ */

.app { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--bg-soft);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  gap: 4px;
  z-index: 40;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 18px;
  user-select: none;
}
.brand-mark {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--gold) 0%, #9a7b1f 100%);
  display: grid; place-items: center;
  color: #0a0a0d;
  font-weight: 800;
  font-family: var(--font-display);
  font-size: 0.95rem;
  box-shadow: 0 0 18px rgba(212, 175, 55, 0.35);
}
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; letter-spacing: 0.06em; }
.brand-name .gold { color: var(--gold-bright); }
.brand-sub { font-size: 0.68rem; color: var(--text-dim); letter-spacing: 0.14em; text-transform: uppercase; }

.nav-section-label {
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 12px 10px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--text-soft);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
  background: none;
  width: 100%;
  text-align: left;
  font-size: 0.88rem;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text); }
.nav-item.active {
  background: var(--gold-dim);
  color: var(--gold-bright);
  border-color: rgba(212, 175, 55, 0.25);
}
.nav-item .ico { width: 20px; text-align: center; font-size: 1rem; }
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--gold);
  color: #0a0a0d;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 99px;
}
.nav-item .nav-badge.red { background: var(--red); color: #fff; }

.sidebar-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.sidebar-biz {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  cursor: pointer;
  transition: border-color 0.15s var(--ease);
}
.sidebar-biz:hover { border-color: rgba(212, 175, 55, 0.4); }
.biz-avatar {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--gold-dim);
  color: var(--gold-bright);
  display: grid; place-items: center;
  font-weight: 700; font-size: 0.8rem;
}
.biz-name { font-size: 0.82rem; font-weight: 600; }
.biz-plan { font-size: 0.68rem; color: var(--text-dim); }
.biz-caret { margin-left: auto; color: var(--text-dim); font-size: 0.7rem; }

.demo-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 99px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: var(--orange-dim);
  color: var(--orange);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  width: fit-content;
}
.demo-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--orange); animation: pulse-dot 2s infinite; }
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ---------- topbar ---------- */

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 58px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(10, 10, 13, 0.8);
  backdrop-filter: blur(12px);
  z-index: 30;
}
.topbar-title { font-family: var(--font-display); font-weight: 600; font-size: 1rem; }
.topbar-spacer { flex: 1; }

.icon-btn {
  position: relative;
  width: 36px; height: 36px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-soft);
  display: grid; place-items: center;
  font-size: 1rem;
  transition: all 0.15s var(--ease);
}
.icon-btn:hover { color: var(--gold-bright); border-color: rgba(212, 175, 55, 0.4); }
.icon-btn .dot-badge {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid var(--bg-soft);
  display: none;
}
.icon-btn .dot-badge.show { display: block; }

.topbar-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 7px 12px;
  width: 300px;
  color: var(--text-dim);
}
.topbar-search input {
  background: none; border: none; outline: none;
  color: var(--text);
  width: 100%;
  font-size: 0.85rem;
}
.topbar-search kbd {
  font-family: inherit;
  font-size: 0.66rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 5px;
}

.avatar-btn {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 10px 5px 6px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  transition: border-color 0.15s var(--ease);
}
.avatar-btn:hover { border-color: rgba(212, 175, 55, 0.4); }
.avatar-circle {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #9a7b1f);
  color: #0a0a0d;
  display: grid; place-items: center;
  font-weight: 800; font-size: 0.72rem;
}
.avatar-name { font-size: 0.8rem; font-weight: 600; }
.avatar-caret { color: var(--text-dim); font-size: 0.65rem; }

.content {
  flex: 1;
  overflow-y: auto;
  padding: 26px 28px 60px;
}
.page { max-width: 1200px; margin: 0 auto; animation: page-in 0.3s var(--ease); }
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.page-head { margin-bottom: 22px; }
.page-title { font-family: var(--font-display); font-size: 1.45rem; font-weight: 700; letter-spacing: -0.01em; }
.page-sub { color: var(--text-soft); font-size: 0.9rem; margin-top: 4px; }

/* ============================================================
   COMPONENTS
   ============================================================ */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title .link { margin-left: auto; }

.link-btn {
  background: none; border: none;
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 2px 4px;
  border-radius: 6px;
  transition: color 0.15s;
}
.link-btn:hover { color: var(--gold-bright); text-decoration: underline; }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 15px;
  border-radius: 9px;
  font-size: 0.84rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: all 0.15s var(--ease);
  text-decoration: none;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-gold { background: linear-gradient(135deg, var(--gold), #b8942a); color: #0a0a0d; }
.btn-gold:hover:not(:disabled) { filter: brightness(1.12); box-shadow: 0 4px 18px rgba(212, 175, 55, 0.3); }
.btn-ghost { background: var(--bg-card); border-color: var(--border); color: var(--text-soft); }
.btn-ghost:hover:not(:disabled) { color: var(--text); border-color: rgba(255,255,255,0.2); }
.btn-sm { padding: 5px 11px; font-size: 0.78rem; border-radius: 8px; }
.btn-red { background: var(--red-dim); color: var(--red); border-color: rgba(248, 113, 113, 0.3); }
.btn-red:hover:not(:disabled) { background: rgba(248, 113, 113, 0.2); }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--text-soft);
}

.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 700;
}
.status-pill .sdot { width: 6px; height: 6px; border-radius: 50%; }
.status-green { background: var(--green-dim); color: var(--green); }
.status-green .sdot { background: var(--green); }
.status-gold { background: var(--gold-dim); color: var(--gold-bright); }
.status-gold .sdot { background: var(--gold-bright); }
.status-blue { background: var(--blue-dim); color: var(--blue); }
.status-blue .sdot { background: var(--blue); }
.status-purple { background: var(--purple-dim); color: var(--purple); }
.status-purple .sdot { background: var(--purple); }
.status-red { background: var(--red-dim); color: var(--red); }
.status-red .sdot { background: var(--red); }
.status-orange { background: var(--orange-dim); color: var(--orange); }
.status-orange .sdot { background: var(--orange); }
.status-dim { background: var(--bg-hover); color: var(--text-dim); }
.status-dim .sdot { background: var(--text-dim); }

/* ---------- KPI grid ---------- */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.kpi {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 16px;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.kpi:hover { border-color: rgba(212, 175, 55, 0.3); transform: translateY(-2px); }
.kpi-label { font-size: 0.72rem; color: var(--text-dim); letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; }
.kpi-value { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; margin-top: 5px; }
.kpi-hint { font-size: 0.72rem; color: var(--text-soft); margin-top: 2px; }
.kpi.accent-gold { border-color: rgba(212, 175, 55, 0.35); }

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th {
  text-align: left;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td { padding: 10px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.12s; }
tbody tr:hover { background: var(--bg-hover); }
tr[data-clickable] { cursor: pointer; }

.cell-main { font-weight: 600; }
.cell-dim { color: var(--text-dim); font-size: 0.78rem; }

.score-bar { width: 54px; height: 5px; background: var(--bg-hover); border-radius: 3px; overflow: hidden; display: inline-block; vertical-align: middle; margin-right: 7px; }
.score-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-bright)); border-radius: 3px; }

/* ---------- lists ---------- */

.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border-soft);
}
.list-row:last-child { border-bottom: none; }
.row-ico {
  width: 34px; height: 34px;
  border-radius: 9px;
  display: grid; place-items: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.row-main { min-width: 0; flex: 1; }
.row-title { font-size: 0.86rem; font-weight: 600; }
.row-sub { font-size: 0.76rem; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-time { font-size: 0.72rem; color: var(--text-dim); white-space: nowrap; }

/* ---------- forms ---------- */

.form-group { margin-bottom: 15px; }
.form-label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--text-soft); margin-bottom: 6px; }
.form-label .req { color: var(--gold); }
.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  padding: 9px 12px;
  font-size: 0.86rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: rgba(212, 175, 55, 0.5);
  box-shadow: 0 0 0 3px var(--gold-dim);
}
.form-textarea { resize: vertical; min-height: 110px; }
.form-hint { font-size: 0.74rem; color: var(--text-dim); margin-top: 5px; }
.form-error { color: var(--red); font-size: 0.76rem; margin-top: 5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

.toggle {
  position: relative;
  width: 40px; height: 22px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 99px;
  cursor: pointer;
  transition: background 0.2s var(--ease);
  flex-shrink: 0;
}
.toggle::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--text-soft);
  transition: transform 0.2s var(--ease), background 0.2s;
}
.toggle.on { background: var(--gold-dim); border-color: rgba(212, 175, 55, 0.4); }
.toggle.on::after { transform: translateX(18px); background: var(--gold-bright); }

/* ---------- tabs ---------- */

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
  overflow-x: auto;
}
.tab {
  background: none;
  border: none;
  color: var(--text-soft);
  padding: 9px 14px;
  font-size: 0.84rem;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color 0.15s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--gold-bright); border-bottom-color: var(--gold); }
.tab .tab-count { font-size: 0.7rem; color: var(--text-dim); margin-left: 5px; }

.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.select-input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  padding: 8px 12px;
  font-size: 0.82rem;
  outline: none;
}
.select-input:focus { border-color: rgba(212, 175, 55, 0.5); }
.search-input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  padding: 8px 12px;
  font-size: 0.82rem;
  outline: none;
  min-width: 220px;
}
.search-input:focus { border-color: rgba(212, 175, 55, 0.5); }
.result-count { font-size: 0.78rem; color: var(--text-dim); margin-left: auto; }

.seg {
  display: inline-flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 3px;
  gap: 2px;
}
.seg button {
  background: none; border: none;
  color: var(--text-soft);
  padding: 6px 13px;
  border-radius: 7px;
  font-size: 0.78rem;
  font-weight: 600;
  transition: all 0.15s;
}
.seg button.active { background: var(--gold-dim); color: var(--gold-bright); }

/* ---------- modal / drawer ---------- */

.modal-overlay, .drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(3px);
  z-index: 100;
  animation: fade-in 0.18s var(--ease);
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 40px));
  max-height: min(82vh, 720px);
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  z-index: 101;
  animation: modal-in 0.22s var(--ease);
}
@keyframes modal-in { from { opacity: 0; transform: translate(-50%, -48%) scale(0.97); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.modal-head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
  background: var(--bg-card);
  z-index: 2;
}
.modal-title { font-family: var(--font-display); font-weight: 700; font-size: 1rem; }
.modal-body { padding: 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 9px; }
.modal-x { margin-left: auto; }

.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(480px, 94vw);
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow);
  z-index: 101;
  display: flex;
  flex-direction: column;
  animation: drawer-in 0.24s var(--ease);
}
@keyframes drawer-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px; }
.drawer-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 9px; justify-content: flex-end; }

/* ---------- toast ---------- */

.toast-zone { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 9px; z-index: 200; }
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 0.84rem;
  box-shadow: var(--shadow);
  animation: toast-in 0.25s var(--ease);
  max-width: 380px;
}
.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--red); }
.toast.info { border-left-color: var(--blue); }
.toast.leaving { animation: toast-out 0.25s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* ---------- empty / skeleton ---------- */

.empty-state { text-align: center; padding: 40px 20px; color: var(--text-dim); }
.empty-ico { font-size: 2rem; margin-bottom: 10px; opacity: 0.75; }
.empty-title { font-weight: 700; color: var(--text-soft); margin-bottom: 4px; }
.empty-msg { font-size: 0.82rem; max-width: 340px; margin: 0 auto; }

.skeleton {
  background: linear-gradient(90deg, var(--bg-hover) 25%, var(--bg-card) 50%, var(--bg-hover) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 8px;
  height: 14px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- timeline (activity) ---------- */

.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ''; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 1px; background: var(--border); }
.tl-item { position: relative; padding-bottom: 18px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute;
  left: -26px; top: 3px;
  width: 19px; height: 19px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  font-size: 0.62rem;
}
.tl-title { font-size: 0.86rem; font-weight: 600; }
.tl-desc { font-size: 0.78rem; color: var(--text-soft); }
.tl-meta { font-size: 0.7rem; color: var(--text-dim); margin-top: 2px; }

/* ---------- transcript ---------- */

.transcript { display: flex; flex-direction: column; gap: 9px; }
.tr-line { display: flex; gap: 9px; }
.tr-who { font-size: 0.66rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; width: 58px; flex-shrink: 0; padding-top: 2px; }
.tr-who.ai { color: var(--gold); }
.tr-who.human { color: var(--blue); }
.tr-who.system { color: var(--text-dim); }
.tr-text {
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 0.82rem;
  flex: 1;
}
.tr-time { font-size: 0.66rem; color: var(--text-dim); margin-top: 3px; }

/* ---------- calendar ---------- */

.cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.cal-title { font-family: var(--font-display); font-weight: 700; font-size: 1rem; min-width: 150px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim); text-align: center; padding: 4px 0; }
.cal-cell {
  min-height: 86px;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  padding: 6px;
  font-size: 0.72rem;
  transition: border-color 0.15s;
}
.cal-cell:hover { border-color: rgba(212, 175, 55, 0.35); }
.cal-cell.other { opacity: 0.35; }
.cal-cell.today .cal-num { background: var(--gold); color: #0a0a0d; }
.cal-num {
  width: 20px; height: 20px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.7rem;
  margin-bottom: 4px;
}
.cal-evt {
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--gold-dim);
  color: var(--gold-bright);
  font-size: 0.66rem;
  margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: pointer;
}
.cal-evt.cancelled { background: var(--red-dim); color: var(--red); text-decoration: line-through; }
.cal-evt.other-type { background: var(--blue-dim); color: var(--blue); }

.cal-day-list { display: flex; flex-direction: column; gap: 9px; }
.cal-day-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
}
.cal-day-time { font-family: var(--font-display); font-weight: 700; color: var(--gold-bright); width: 88px; flex-shrink: 0; }
.cal-day-line { flex: 1; }
.cal-day-name { font-weight: 600; font-size: 0.88rem; }

.week-cols { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.week-col { background: var(--bg-soft); border: 1px solid var(--border-soft); border-radius: 10px; padding: 8px; min-height: 160px; }
.week-col.today-col { border-color: rgba(212, 175, 55, 0.4); }
.week-dow { font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); text-align: center; margin-bottom: 6px; }
.week-date { text-align: center; font-family: var(--font-display); font-weight: 700; margin-bottom: 8px; }
.week-col.today-col .week-date { color: var(--gold-bright); }

/* ---------- knowledge / settings list ---------- */

.kv-list { display: flex; flex-direction: column; }
.kv-row { display: flex; align-items: flex-start; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--border-soft); }
.kv-row:last-child { border-bottom: none; }
.kv-label { width: 150px; flex-shrink: 0; font-size: 0.78rem; color: var(--text-dim); font-weight: 600; padding-top: 2px; }
.kv-value { flex: 1; font-size: 0.86rem; }

.cap-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cap-card {
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 12px;
  display: flex; align-items: center; gap: 10px;
  font-size: 0.82rem;
  font-weight: 600;
}
.cap-card .cap-ico { font-size: 1.1rem; }

.section-stack { display: flex; flex-direction: column; gap: 18px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-side { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }

/* ---------- AI test area ---------- */

.ai-test-box { border: 1px solid rgba(212, 175, 55, 0.3); border-radius: var(--radius); background: linear-gradient(180deg, rgba(212,175,55,0.05), transparent); padding: 18px; }
.test-chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.test-chip {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 6px 13px;
  font-size: 0.78rem;
  color: var(--text-soft);
  transition: all 0.15s;
}
.test-chip:hover { color: var(--gold-bright); border-color: rgba(212, 175, 55, 0.4); }

.sim-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--orange);
  border: 1px dashed rgba(251, 191, 36, 0.4);
  padding: 3px 9px;
  border-radius: 6px;
  margin-bottom: 12px;
}

.sim-bubble {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 15px;
  font-size: 0.88rem;
  line-height: 1.6;
  animation: page-in 0.3s var(--ease);
}
.sim-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.typing-dots { display: inline-flex; gap: 4px; align-items: center; height: 20px; }
.typing-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); animation: tdot 1s infinite; }
.typing-dots i:nth-child(2) { animation-delay: 0.15s; }
.typing-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes tdot { 0%, 100% { opacity: 0.25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

/* ---------- onboarding ---------- */

.onboard-overlay {
  position: fixed; inset: 0;
  background: rgba(4, 4, 6, 0.82);
  backdrop-filter: blur(6px);
  z-index: 300;
  display: grid; place-items: center;
  animation: fade-in 0.25s var(--ease);
  padding: 20px;
}
.onboard-card {
  width: min(620px, 100%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow);
  animation: modal-in 0.3s var(--ease);
}
.onboard-progress { display: flex; gap: 6px; margin-bottom: 22px; }
.onboard-progress span { height: 4px; flex: 1; border-radius: 3px; background: var(--bg-hover); transition: background 0.25s; }
.onboard-progress span.done { background: var(--gold); }
.onboard-title { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; margin-bottom: 6px; }
.onboard-sub { color: var(--text-soft); font-size: 0.88rem; margin-bottom: 20px; }
.onboard-option {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  text-align: left;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 9px;
  color: var(--text);
  font-size: 0.86rem;
  transition: all 0.15s;
}
.onboard-option:hover { border-color: rgba(212, 175, 55, 0.4); }
.onboard-option.selected { border-color: rgba(212, 175, 55, 0.55); background: var(--gold-dim); }
.onboard-ico { font-size: 1.15rem; width: 26px; text-align: center; }

/* ---------- request status colors ---------- */

.req-status-submitted { background: var(--blue-dim); color: var(--blue); }
.req-status-in-review { background: var(--orange-dim); color: var(--orange); }
.req-status-in-progress { background: var(--gold-dim); color: var(--gold-bright); }
.req-status-waiting { background: var(--purple-dim); color: var(--purple); }
.req-status-completed { background: var(--green-dim); color: var(--green); }

/* ---------- help ---------- */

.help-topic {
  width: 100%;
  text-align: left;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  color: var(--text);
  margin-bottom: 10px;
  transition: all 0.15s;
  font-size: 0.88rem;
  font-weight: 600;
  display: flex; align-items: center; gap: 11px;
}
.help-topic:hover { border-color: rgba(212, 175, 55, 0.4); }
.help-topic .hp-ico { font-size: 1.1rem; }
.help-topic .hp-arrow { margin-left: auto; color: var(--text-dim); }
.help-answer { font-size: 0.84rem; color: var(--text-soft); line-height: 1.65; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1080px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .cap-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.25s var(--ease);
    box-shadow: var(--shadow);
  }
  .sidebar.mobile-open { transform: none; }
  .grid-2, .grid-side { grid-template-columns: 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .content { padding: 18px 16px 60px; }
}

@media (max-width: 560px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi-value { font-size: 1.3rem; }
  .topbar-search { width: 100%; }
  .topbar { padding: 0 12px; gap: 8px; }
  .avatar-name, .topbar-search kbd { display: none; }
  .cal-cell { min-height: 58px; }
  .cal-evt { display: none; }
  .cal-cell .cal-count { display: block; font-size: 0.62rem; color: var(--gold-bright); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ============================================================
   SHELL EXTRAS — menu btn, scrim, global search results, settings nav
   ============================================================ */
.menu-btn { display: none; }
@media (max-width: 900px) { .menu-btn { display: grid; } }
.mobile-scrim { position: fixed; inset: 0; background: rgba(4,4,6,0.7); backdrop-filter: blur(2px); z-index: 35; }

.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow); max-height: 340px;
  overflow: auto; z-index: 80; padding: 5px;
}
.search-results .sr-item { display: flex; justify-content: space-between; gap: 12px; align-items: center;
  padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 0.84rem; }
.search-results .sr-item:hover { background: var(--bg-hover); }
.sr-kind { color: var(--text-dim); font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.1em; white-space: nowrap; }
#topbarSearchWrap { position: relative; }

.settings-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.settings-nav button { background: var(--bg-card); border: 1px solid var(--border); color: var(--text-soft);
  padding: 7px 15px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; }
.settings-nav button.active { border-color: rgba(212,175,55,0.45); color: var(--gold-bright); background: var(--gold-dim); }
