/* Jalsa workspace */
.app-body { min-height: 100vh; }

/* ---------------------------------------------------------------- auth */
.auth-wrap {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px;
  background: var(--bg);
}
.auth-card { width: min(420px, 100%); padding: 36px 32px 28px; border-radius: var(--r-xl); background: var(--bg-elev); display: flex; flex-direction: column; gap: 16px; animation: sheet-in 0.5s var(--spring); }
.auth-mark { display: flex; justify-content: center; margin-bottom: 4px; }
.auth-card h2 { text-align: center; font-size: 28px; letter-spacing: -0.03em; }
.auth-card > p { text-align: center; }
.auth-foot { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-3); }
.auth-foot svg { width: 14px; height: 14px; }
.spinner.on-primary { border-color: rgba(0, 0, 0, 0.15); border-top-color: var(--primary-fg); width: 18px; height: 18px; }

/* ---------------------------------------------------------------- shell */
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; padding: 18px 12px 14px;
  background: var(--surface); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border-inline-end: 1px solid var(--line);
}
.side-brand { padding: 2px 8px 20px; }
.side-brand .brand { font-size: 18px; gap: 11px; }
.side-brand .brand-mark { height: 32px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; height: 36px; padding: 0 10px; border-radius: 9px; border: 0; background: transparent;
  color: var(--text); font-size: 14.5px; font-weight: 500; text-align: start; width: 100%; position: relative; transition: background 0.15s;
}
.nav-item svg { width: 19px; height: 19px; color: var(--text-2); flex: none; }
.nav-item:hover { background: var(--hover); }
.nav-item.active { background: var(--accent-soft); color: var(--text); }
.nav-item.active svg { color: var(--accent); }
.nav-item .nav-badge { margin-inline-start: auto; min-width: 20px; height: 20px; border-radius: 10px; padding: 0 6px; font-size: 11.5px; font-weight: 700; display: grid; place-items: center; background: var(--danger); color: #fff; }
.nav-item .nav-badge.warn { background: #ff9f0a; }
.nav-sep { height: 1px; background: var(--line); margin: 10px 8px; }
.sidebar-foot { margin-top: auto; }
.account-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border-radius: 12px; border: 0; background: transparent; color: var(--text); text-align: start; }
.account-btn:hover { background: var(--hover); }
.account-btn > svg { width: 18px; height: 18px; color: var(--text-3); flex: none; }
.acc-name { display: block; font-size: 14px; font-weight: 600; }
.acc-role { display: block; font-size: 12px; color: var(--text-3); }

.content { min-width: 0; padding: 30px clamp(18px, 4vw, 48px) 64px; max-width: 1280px; width: 100%; }
.content-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.content-head h1 { font-size: 32px; letter-spacing: -0.03em; }
.content-head .sub { color: var(--text-2); margin-top: 6px; font-size: 14.5px; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.page { animation: fade-in 0.3s var(--ease); display: flex; flex-direction: column; gap: 20px; }

/* ---------------------------------------------------------------- home */
.quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.quick-card {
  display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: var(--r-lg); border: 0;
  background: var(--bg-elev); color: var(--text); text-align: start; transition: transform 0.5s var(--spring), background-color 0.2s;
}
.quick-card:hover { transform: translateY(-2px); }
.quick-card:active { transform: scale(0.98); }
.quick-card strong { display: block; font-size: 15.5px; }
.quick-card span span { display: block; font-size: 13px; color: var(--text-2); }
.q-icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.q-icon svg { width: 22px; height: 22px; }
.quick-card.primary { background: var(--primary-bg); color: var(--primary-fg); border-color: transparent; }
.quick-card.primary span span { color: inherit; opacity: 0.72; }
.quick-card.primary .q-icon { background: rgba(0, 0, 0, 0.12); color: inherit; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat { padding: 18px 20px; border-radius: var(--r-lg); background: var(--bg-elev); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stat-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); font-weight: 500; }
.stat-label svg { width: 16px; height: 16px; color: var(--accent); }
.stat-value { font-size: 30px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat-foot { font-size: 12.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; }
.grid-2e { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h3 { font-size: 17px; display: flex; align-items: center; gap: 8px; }
.card-head h3 svg { width: 19px; height: 19px; color: var(--accent); }
.empty.compact { padding: 22px 10px; }

.chart { position: relative; }
.chart svg { display: block; width: 100%; height: 190px; overflow: visible; }
.chart .bar { fill: var(--accent); transition: opacity 0.15s; }
.chart .hit { fill: transparent; }
.chart g:hover .bar { opacity: 0.78; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis-label { fill: var(--text-3); font-size: 11px; font-family: var(--font); }
.chart-tip { position: absolute; pointer-events: none; transform: translate(-50%, -100%); padding: 7px 10px; border-radius: 10px; font-size: 12.5px; background: var(--surface-strong); backdrop-filter: var(--blur); border: 1px solid var(--line); box-shadow: var(--shadow); white-space: nowrap; color: var(--text); }
.chart-tip strong { display: block; font-size: 14px; }

.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 14px; padding: 11px 2px; border-top: 1px solid var(--line); min-width: 0; }
.list-row:first-child { border-top: 0; }

/* ---------------------------------------------------------------- meetings */
.meeting-row {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 16px;
  border-radius: var(--r-lg); background: var(--bg-elev); transition: background-color 0.2s var(--ease);
}
.mr-main { min-width: 0; }
.meeting-row .title { font-weight: 600; font-size: 15.5px; }
.meeting-row .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 4px; font-size: 13px; color: var(--text-2); }
.meeting-row .actions { display: flex; gap: 8px; align-items: center; }
.meeting-row.disabled { opacity: 0.55; }
.when { width: 56px; text-align: center; border-radius: 12px; padding: 6px 0; background: var(--hover); }
.when .d { font-size: 19px; font-weight: 600; line-height: 1.1; }
.when .m { font-size: 11px; color: var(--danger); font-weight: 600; }
.when-icon { width: 56px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.when-icon svg { width: 22px; height: 22px; }
.card .meeting-row { box-shadow: none; background: var(--bg); }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar .search { position: relative; flex: 1; min-width: 180px; max-width: 340px; }
.toolbar .search .input { padding-inline-start: 38px; height: 36px; }
.toolbar .search svg { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); }

.share-grid { display: grid; grid-template-columns: minmax(0, 1fr) 176px; gap: 20px; align-items: start; }
.link-field { display: flex; gap: 8px; align-items: center; padding: 5px 5px 5px 14px; border-radius: var(--r-sm); background: var(--hover); font-family: var(--mono); font-size: 12.5px; min-width: 0; }
.link-field span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.qr-box { width: 176px; height: 176px; padding: 8px; background: #fff; border-radius: 16px; justify-self: center; align-self: center; box-shadow: 0 0 0 1px var(--line); }
.qr-box svg { width: 100%; height: 100%; display: block; }
.ready-hero { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ready-hero .check { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--success-soft); color: var(--success); }
.ready-hero .check svg { width: 26px; height: 26px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.callout { display: flex; gap: 12px; align-items: flex-start; padding: 13px 15px; border-radius: var(--r); background: var(--accent-soft); font-size: 13.5px; line-height: 1.45; }
.callout > svg { width: 18px; height: 18px; color: var(--accent); flex: none; margin-top: 1px; }
.callout.warn { background: var(--warning-soft); }
.callout.warn > svg { color: var(--warning); }
.callout.ok { background: var(--success-soft); }
.callout.ok > svg { color: var(--success); }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; border-radius: var(--r); background: var(--bg-elev); }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: start; font-weight: 500; color: var(--text-3); font-size: 11.5px; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; background: var(--bg-elev); }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--hover); }
.table .num { font-variant-numeric: tabular-nums; text-align: end; }
.warn-row td:nth-child(3) { color: var(--warning); }

/* ---------------------------------------------------------------- live */
.live-card { padding: 0; overflow: hidden; }
.live-head { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.live-head h3 { font-size: 17px; }
.live-controls { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--bg-sunken); }
.live-body { padding: 6px 8px 12px; }
.lobby-strip { margin: 10px 12px; padding: 12px 14px; border-radius: var(--r); background: var(--warning-soft); display: flex; flex-direction: column; gap: 8px; }
.qos { display: inline-flex; align-items: center; gap: 6px; }
.qos i { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.qos.fair i { background: #ff9f0a; }
.qos.poor i { background: var(--danger); }
.mini-ic { display: inline-grid; color: var(--text-2); }
.mini-ic svg { width: 16px; height: 16px; }
.mini-ic.off { color: var(--danger); }

/* ---------------------------------------------------------------- calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-radius: var(--r-lg); overflow: hidden; background: var(--line); gap: 1px; }
.cal-dow { background: var(--bg-elev); padding: 10px; font-size: 12px; font-weight: 600; color: var(--text-3); }
.cal-day { background: var(--bg-elev); min-height: 108px; padding: 8px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; transition: background 0.15s; min-width: 0; }
.cal-day:hover { background: var(--hover); }
.cal-day.other { background: var(--bg-sunken); color: var(--text-3); }
.cal-num { font-size: 13px; font-weight: 600; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; }
.cal-day.today .cal-num { background: var(--accent); color: var(--primary-fg); }
:root:not([data-theme="dark"]) .cal-day.today .cal-num { color: #fff; }
.cal-ev { font-size: 12px; padding: 3px 7px; border-radius: 6px; background: var(--accent-soft); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.cal-ev.live { background: var(--danger-soft); color: var(--danger); }

/* ---------------------------------------------------------------- people */
.people-list { display: flex; flex-direction: column; border-radius: var(--r-lg); background: var(--bg-elev); overflow: hidden; }
.person-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto 130px 32px; align-items: center; gap: 14px; padding: 12px 16px; }
.person-row + .person-row { border-top: 1px solid var(--line); }
.person-meta { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.person-stats { text-align: end; line-height: 1.5; }
.profile-card { display: flex; align-items: center; gap: 18px; }
.profile-card h2 { font-size: 22px; }
.inline-input { max-width: 240px; height: 36px; }
.range { width: 140px; accent-color: var(--accent); }
.num-input { max-width: 110px; text-align: end; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- history */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 -24px; padding: 0 24px; overflow-x: auto; }
.tab { border: 0; background: transparent; padding: 10px 12px; font-weight: 500; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.chat-log { display: flex; flex-direction: column; gap: 10px; max-height: 52vh; overflow: auto; }
.chat-log .entry { display: flex; gap: 10px; }
.chat-log .entry .body { background: var(--hover); padding: 8px 12px; border-radius: 14px; font-size: 14px; }
.transcript { max-height: 52vh; overflow: auto; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.transcript .line strong { color: var(--accent); font-weight: 600; margin-inline-end: 6px; }
.summary h4 { margin: 14px 0 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.summary ul { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 4px; }
.artifact { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r); background: var(--hover); flex-wrap: wrap; }
.artifact .a-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.artifact .a-icon svg { width: 20px; height: 20px; }
.player video { width: 100%; border-radius: var(--r); background: #000; max-height: 60vh; margin-top: 12px; }

/* ---------------------------------------------------------------- settings */
.net-card .group { box-shadow: none; }
.save-bar { display: flex; justify-content: flex-end; }
.server-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 20px; }
.server-grid .mono { word-break: break-all; }
details.help { margin-top: 14px; font-size: 13.5px; color: var(--text-2); }
details.help summary { cursor: pointer; display: flex; align-items: center; gap: 6px; color: var(--text); font-weight: 500; list-style: none; }
details.help summary svg { width: 16px; height: 16px; color: var(--accent); }
details.help ul { margin: 10px 0 0; padding-inline-start: 22px; display: flex; flex-direction: column; gap: 6px; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-2e { grid-template-columns: 1fr; }
  .person-row { grid-template-columns: 40px minmax(0, 1fr) auto 32px; }
  .person-stats { display: none; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 50; flex-direction: row; align-items: center;
    padding: 6px 4px max(6px, env(safe-area-inset-bottom)); border-inline-end: 0; border-top: 1px solid var(--line);
  }
  .side-brand, .nav-sep { display: none; }
  .nav { flex-direction: row; flex: 1; overflow-x: auto; gap: 0; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav-item { flex-direction: column; height: auto; gap: 3px; padding: 6px 4px; font-size: 10.5px; min-width: 62px; flex: 1; justify-content: center; text-align: center; }
  .nav-item svg { width: 22px; height: 22px; }
  .nav-item.active { background: transparent; color: var(--accent); }
  .nav-item .nav-badge { position: absolute; top: 2px; inset-inline-end: 10px; min-width: 16px; height: 16px; font-size: 10px; }
  .sidebar-foot { margin: 0; flex: none; }
  .account-btn { padding: 6px; }
  .account-btn .grow, .account-btn > svg { display: none; }
  .content { padding: 20px 16px 120px; }
  .content-head { margin-bottom: 18px; }
  .content-head h1 { font-size: 28px; }
  .head-actions { width: 100%; }
  .head-actions .btn { flex: 1; }
  .quick { grid-template-columns: 1fr; gap: 10px; }
  .quick-card { padding: 14px 16px; }
  .stats { gap: 10px; }
  .stat { padding: 14px; }
  .stat-value { font-size: 24px; }
  .meeting-row { grid-template-columns: minmax(0, 1fr) auto; padding: 12px 14px; gap: 10px; }
  .meeting-row .when, .meeting-row .when-icon { display: none; }
  .meeting-row .actions .hide-sm { display: none; }
  .form-grid, .share-grid { grid-template-columns: 1fr; }
  .cal-day { min-height: 64px; padding: 4px; }
  .cal-ev { font-size: 0; height: 6px; padding: 0; border-radius: 3px; }
  .cal-dow { padding: 8px 4px; font-size: 10px; text-align: center; }
  .person-row { grid-template-columns: 40px minmax(0, 1fr) 32px; }
  .person-meta { grid-column: 2; justify-content: flex-start; }
  .person-row > [data-more], .person-row > span:last-child { grid-row: 1; grid-column: 3; }
  .profile-card { flex-direction: column; text-align: center; }
  .inline-input { max-width: 52%; }
  .toolbar .search { max-width: none; }
  .tabs { margin: 0 -16px; padding: 0 16px; }
}
