/* ============================================================
   Project Dot — web console
   Professional role-aware dashboard. Pure layout/restyle:
   every class/id below is consumed by client.js (scoped to
   section.dot) or the inline shell nav. No JS contract changed.
   ============================================================ */

:root {
  --bg:          #090b10;
  --bg-grad:     radial-gradient(1100px 560px at 18% -8%, #141a28 0%, #090b10 58%);
  --surface:     #11151d;
  --surface-2:   #161b26;
  --surface-3:   #1b2230;
  --sunken:      #060810;
  --border:      #232b3a;
  --border-soft: #1a212d;
  --border-hi:   #2e394d;

  --text:        #e8ecf3;
  --text-dim:    #9aa5b8;
  --text-faint:  #69748a;

  --primary:        #6c7bff;
  --primary-bright: #8b97ff;
  --primary-deep:   #4f5bd5;
  --primary-soft:   rgba(108,123,255,0.14);
  --primary-line:   rgba(108,123,255,0.42);
  --grad:           linear-gradient(135deg, #6c7bff 0%, #9b6cff 100%);

  --green:  #2fd47a;  --green-soft: rgba(47,212,122,0.14);
  --red:    #ff6b6b;  --red-soft:   rgba(255,107,107,0.12);
  --amber:  #ffb84d;  --amber-soft: rgba(255,184,77,0.12);
  --blue:   #5ab0ff;
  --violet: #b794ff;

  --r-lg: 14px; --r: 10px; --r-sm: 7px; --r-xs: 5px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow:    0 2px 6px rgba(0,0,0,0.35), 0 16px 40px -16px rgba(0,0,0,0.6);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.45), 0 32px 64px -24px rgba(0,0,0,0.7);
  --ring:      0 0 0 3px var(--primary-soft);

  --sidebar-w: 260px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, "Cascadia Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 14px;
  line-height: 1.5;
}
::selection { background: var(--primary-line); color: #fff; }
* { scrollbar-width: thin; scrollbar-color: var(--border-hi) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb {
  background: var(--border-hi); border-radius: 8px;
  border: 2px solid transparent; background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: #3a465c; background-clip: padding-box; }

/* ════════════════════════  App shell  ════════════════════════ */
.dot {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

/* ───────── Sidebar ───────── */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 20px 16px;
  background: linear-gradient(180deg, #0f131b, #0c0f16);
  border-right: 1px solid var(--border-soft);
}
.brand {
  display: flex; align-items: center; gap: 11px;
  font-size: 16px; font-weight: 680; letter-spacing: -0.01em;
  padding: 4px 8px 2px;
}
.brand-dot {
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 0 4px var(--primary-soft), 0 0 16px var(--primary-line);
  flex: none;
}
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  color: var(--text-dim);
  font-size: 13.5px; font-weight: 550;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 120ms, color 120ms, border-color 120ms;
  user-select: none;
}
.nav-item .nav-ico {
  font-size: 14px; width: 18px; text-align: center;
  color: var(--text-faint);
  transition: color 120ms;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item:hover .nav-ico { color: var(--text-dim); }
.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary-bright);
  border-color: var(--primary-line);
}
.nav-item.active .nav-ico { color: var(--primary-bright); }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r);
}
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--grad);
  flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.logged-in {
  font-size: 12.5px; font-weight: 550; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.foot-links { display: flex; gap: 8px; }
.logout-link {
  flex: 1; text-align: center;
  font-size: 11.5px; font-weight: 550; color: var(--text-dim);
  text-decoration: none;
  padding: 7px 8px; border-radius: var(--r-sm);
  border: 1px solid var(--border);
  transition: background 120ms, color 120ms, border-color 120ms;
}
.logout-link:hover { color: var(--text); background: var(--surface-2); border-color: var(--border-hi); }

/* ───────── Workspace + topbar ───────── */
.workspace { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: 60px; padding: 0 28px;
  display: flex; align-items: center; gap: 14px;
  background: rgba(13,17,25,0.78);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border-soft);
}
.page-title { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -0.01em; }
.topbar .status {
  font-size: 11px; font-weight: 600; color: var(--violet);
  padding: 4px 10px; border-radius: 999px;
  background: rgba(183,148,255,0.10); border: 1px solid rgba(183,148,255,0.28);
}
.topbar .health {
  margin-left: auto;
  font-family: var(--mono); font-size: 11px; color: var(--text-dim);
  padding: 5px 11px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52vw;
}

/* ───────── Views / panes ───────── */
.views { flex: 1; padding: 26px 28px 56px; overflow-y: auto; }
.pane { display: none; }
.pane.active { display: block; animation: fade-in 220ms ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* details.settings is just a JS container — strip its box entirely */
details.settings { border: 0; padding: 0; margin: 0; }
details.settings > summary { display: none; }
details.settings .settings-body { display: block; margin: 0; gap: 0; }

.pane-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 18px;
  align-items: start;
}
.pane[data-pane="profile"] .settings-section[data-section="profile"] { grid-column: 1 / -1; }

/* ───────── Overview hero ───────── */
.hero {
  display: flex; align-items: center; gap: 18px;
  padding: 6px 4px 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border-soft);
}
.hero-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--grad); flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; color: #fff;
  box-shadow: 0 0 0 5px var(--primary-soft), 0 8px 22px -8px var(--primary-line);
}
.hero-id h2 {
  margin: 0 0 3px; font-size: 22px; font-weight: 680; letter-spacing: -0.02em;
  display: flex; align-items: center; gap: 11px; flex-wrap: wrap;
}
.hero-id .dot-position { color: var(--text-dim); font-size: 13.5px; font-weight: 500; }

.lang-badge {
  display: inline-flex; align-items: center;
  font-size: 10px; font-weight: 700; letter-spacing: 0.6px;
  padding: 3px 8px; border-radius: 999px; font-family: var(--mono);
  border: 1px solid transparent;
}
.lang-badge[data-lang="en"] { background: var(--primary-soft); color: var(--primary-bright); border-color: var(--primary-line); }
.lang-badge[data-lang="ar"] { background: rgba(183,148,255,0.14); color: var(--violet); border-color: rgba(183,148,255,0.4); }

/* ───────── Cards ───────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: var(--shadow);
}
.card-h {
  font-size: 11px; font-weight: 700; letter-spacing: 0.7px; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 14px;
}
.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
@media (max-width: 1080px) { .overview-grid { grid-template-columns: 1fr; } }

/* ───────── Device mock ───────── */
.device {
  background: linear-gradient(180deg, var(--surface-2), var(--sunken));
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
  display: grid;
  grid-template-columns: 36px 1fr;
  grid-template-rows: auto auto;
  gap: 14px; align-items: center;
}
.led {
  width: 26px; height: 26px; border-radius: 50%;
  background: #2a3142; grid-row: 1 / 3;
  align-self: center; justify-self: center;
  border: 1px solid rgba(255,255,255,0.06);
  transition: background 140ms ease, box-shadow 140ms ease;
}
.led[data-color="red"]   { background: var(--red);   box-shadow: 0 0 16px var(--red),   0 0 0 4px var(--red-soft); }
.led[data-color="green"] { background: var(--green); box-shadow: 0 0 16px var(--green), 0 0 0 4px var(--green-soft); }
.led[data-color="blue"]  { background: var(--blue);  box-shadow: 0 0 16px var(--blue),  0 0 0 4px rgba(90,176,255,0.18); }
.led[data-color="off"]   { background: #2a3142; box-shadow: none; }
.led[data-pattern="pulse"] { animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

.screen {
  background: var(--sunken); border: 1px solid var(--border-soft);
  border-radius: var(--r-sm); padding: 12px 14px; min-height: 54px;
  font-family: var(--mono);
  display: flex; flex-direction: column; justify-content: center; gap: 3px;
}
.screen-text { font-size: 13.5px; color: var(--text); line-height: 1.4; }
.screen-text[dir="rtl"] { text-align: right; font-size: 14.5px; }
.screen-sub { font-size: 11px; color: var(--text-dim); word-break: break-word; }
.screen-sub[dir="rtl"] { text-align: right; font-size: 12px; }

.buttons { grid-column: 1 / 3; display: flex; gap: 10px; }
.buttons button {
  flex: 1; padding: 11px 16px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border-hi); border-radius: var(--r-sm);
  cursor: pointer; font-size: 13.5px; font-weight: 550; font-family: inherit;
  user-select: none;
  transition: background 120ms, border-color 120ms, box-shadow 120ms, transform 60ms;
}
.buttons button:hover:not(:disabled) { background: var(--surface-3); border-color: #384458; }
.buttons button:active:not(:disabled) { transform: translateY(1px); }
.buttons button.pressed, .buttons button.ptt:active:not(:disabled) {
  background: var(--primary-deep); border-color: var(--primary); color: #fff;
  box-shadow: 0 0 0 3px var(--primary-soft), 0 0 18px var(--primary-line);
}
.buttons button:disabled { opacity: 0.45; cursor: not-allowed; }
.buttons button.attention {
  background: linear-gradient(135deg, #1f9d54, #2fd47a);
  border-color: var(--green); color: #04140b; font-weight: 650;
  animation: glow 1.2s ease-in-out infinite;
}
@keyframes glow {
  0%,100% { box-shadow: 0 0 0 0 rgba(47,212,122,0), 0 0 8px rgba(47,212,122,0.5); }
  50%     { box-shadow: 0 0 0 4px var(--green-soft), 0 0 20px rgba(47,212,122,0.85); }
}

/* ───────── Conversation ───────── */
.convo {
  display: flex; flex-direction: column; gap: 10px;
  padding: 4px; min-height: 220px; max-height: 440px;
  overflow-y: auto; scroll-behavior: smooth;
}
.convo:empty::before {
  content: "Nothing said yet. Hold PTT to start.";
  color: var(--text-faint); font-size: 12.5px; font-style: italic;
  padding: 40px 16px; text-align: center; margin: auto;
}
.bubble {
  max-width: 86%; padding: 10px 14px; border-radius: 16px;
  font-size: 14px; line-height: 1.5; word-break: break-word; white-space: pre-wrap;
  box-shadow: var(--shadow-sm); animation: bubble-in 180ms ease;
}
@keyframes bubble-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.bubble .bubble-meta { display: block; font-size: 10px; margin-top: 5px; opacity: 0.65; font-family: var(--mono); }
.bubble.you { align-self: flex-end; background: var(--grad); color: #fff; border-bottom-right-radius: 5px; }
.bubble.dot { align-self: flex-start; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-bottom-left-radius: 5px; }
.bubble.incoming { align-self: flex-start; background: linear-gradient(135deg, #178a4a, #1f9d54); color: #fff; border-bottom-left-radius: 5px; }
.bubble.incoming::before {
  content: "📨 " attr(data-from);
  display: block; font-size: 10px; font-weight: 700; opacity: 0.9;
  margin-bottom: 3px; text-transform: uppercase; letter-spacing: 0.5px;
}
.bubble[dir="rtl"] { text-align: right; }
.bubble.you[dir="rtl"] { align-self: flex-start; border-bottom-right-radius: 16px; border-bottom-left-radius: 5px; }
.bubble.dot[dir="rtl"], .bubble.incoming[dir="rtl"] { align-self: flex-end; border-bottom-left-radius: 16px; border-bottom-right-radius: 5px; }

/* ───────── Settings sections (cards) ───────── */
.settings-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: var(--shadow);
}
.settings-section h4 {
  margin: 0 0 14px; font-size: 12px; color: var(--text);
  font-weight: 650; letter-spacing: 0.3px;
  display: flex; align-items: center; gap: 8px;
}
.section-tag {
  font-size: 9px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
  color: var(--blue); background: rgba(90,176,255,0.12); border: 1px solid rgba(90,176,255,0.3);
  padding: 2px 6px; border-radius: 999px;
}
.section-hint { margin: -6px 0 12px; font-size: 12px; color: var(--text-faint); line-height: 1.5; }
.settings-section .static-info {
  font-size: 12px; color: var(--text-dim); margin-bottom: 12px;
  font-family: var(--mono); line-height: 1.6;
  padding: 8px 10px; background: var(--sunken); border: 1px solid var(--border-soft); border-radius: var(--r-sm);
}
.settings-section ul.rows {
  list-style: none; margin: 0 0 12px; padding: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.settings-section ul.rows:empty::before {
  content: "(none yet)"; color: var(--text-faint); font-size: 11.5px; font-style: italic;
}
.settings-section .row {
  display: flex; gap: 10px; align-items: center;
  padding: 8px 10px; background: var(--surface-2);
  border: 1px solid var(--border-soft); border-radius: var(--r-sm);
  font-size: 13px; transition: border-color 120ms;
}
.settings-section .row:hover { border-color: var(--border-hi); }
.settings-section .row .row-text { flex: 1; min-width: 0; word-break: break-word; overflow-wrap: anywhere; }
.settings-section .row .row-meta { font-size: 10px; color: var(--text-faint); font-family: var(--mono); }
.settings-section .row button {
  padding: 4px 9px; background: transparent; color: var(--text-dim);
  border: 1px solid var(--border-hi); border-radius: var(--r-xs);
  font-size: 11px; font-weight: 550; cursor: pointer;
  transition: background 120ms, color 120ms, border-color 120ms;
}
.settings-section .row button:hover { background: var(--surface-3); color: var(--text); }
.settings-section .row button.danger { color: var(--red); border-color: rgba(255,107,107,0.32); }
.settings-section .row button.danger:hover { background: var(--red-soft); }
.settings-section .row .private-tag {
  background: var(--amber-soft); color: var(--amber);
  font-size: 9px; padding: 2px 6px; border-radius: 999px;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  border: 1px solid rgba(255,184,77,0.3);
}

/* ───────── Inline forms ───────── */
.inline-form { display: flex; flex-wrap: wrap; gap: 9px; align-items: flex-end; }
.inline-form label {
  display: flex; flex-direction: column; gap: 5px;
  font-size: 10.5px; font-weight: 600; color: var(--text-dim);
  flex: 1 1 180px; min-width: 0; text-transform: uppercase; letter-spacing: 0.4px;
}
.inline-form label.checkbox {
  flex-direction: row; align-items: center; gap: 7px;
  font-size: 11.5px; text-transform: none; letter-spacing: 0; flex: 0 0 auto;
}
.inline-form input[type="text"], .inline-form input[type="password"], .inline-form select {
  background: var(--sunken); border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 9px 11px; font-size: 12.5px; color: var(--text); font-family: inherit; width: 100%;
  transition: border-color 120ms, box-shadow 120ms;
}
.inline-form input::placeholder { color: var(--text-faint); }
.inline-form input:focus, .inline-form select:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.inline-form input[type="checkbox"] { accent-color: var(--primary); width: 15px; height: 15px; }
.inline-form button {
  padding: 9px 15px; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border-hi); border-radius: var(--r-sm);
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: background 120ms, border-color 120ms, transform 60ms, filter 120ms;
}
.inline-form button:active { transform: translateY(1px); }
.inline-form button[type="submit"] {
  background: var(--grad); border-color: transparent; color: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3), 0 6px 16px -8px var(--primary-line);
}
.inline-form button[type="submit"]:hover { filter: brightness(1.08); }
.inline-form button:hover:not([type="submit"]) { background: var(--surface-3); border-color: #384458; }

.row.editing { display: none; }
.row + .row-edit-form { display: none; }
.row + .row-edit-form.active { display: flex; margin-top: -2px; }
.row.editing + .row-edit-form { display: flex; }

/* ───────── Diagnostics ───────── */
details.debug { border: 0; padding: 0; }
details.debug > summary { display: none; }
.conn {
  display: flex; gap: 12px; margin: 0 0 14px;
  font-size: 11px; font-family: var(--mono); color: var(--text-dim); flex-wrap: wrap;
}
.conn span { padding: 6px 12px; background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 999px; }
.conn .ok { color: var(--green); }
.conn .err { color: var(--red); }
.log {
  background: var(--sunken); border: 1px solid var(--border-soft); border-radius: var(--r);
  padding: 14px 16px; margin: 0; height: 60vh; min-height: 320px; overflow-y: auto;
  font-size: 10.5px; line-height: 1.7; font-family: var(--mono); color: var(--text-dim);
  white-space: pre-wrap; word-break: break-word;
}
.log .in { color: var(--blue); }
.log .out { color: var(--green); }
.log .err { color: var(--red); }
.log .sys { color: var(--text-faint); }

/* ───────── Admin console ───────── */
details.admin { border: 0; padding: 0; }
details.admin > summary { display: none; }
.admin-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin: 10px 0; }
.admin-row label {
  display: flex; flex-direction: column; gap: 5px;
  font-size: 10.5px; font-weight: 600; color: var(--text-dim); flex: 1 1 160px;
  text-transform: uppercase; letter-spacing: 0.4px;
}
.admin-row input[type="number"], .admin-row select {
  background: var(--sunken); border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 9px 11px; font-size: 12.5px; color: var(--text); font-family: inherit;
  transition: border-color 120ms, box-shadow 120ms;
}
.admin-row input[type="number"]:focus, .admin-row select:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.admin-row button {
  padding: 9px 16px; font-size: 12.5px; font-weight: 600; cursor: pointer;
  background: var(--grad); color: #fff; border: 1px solid transparent; border-radius: var(--r-sm);
  box-shadow: 0 1px 2px rgba(0,0,0,0.3), 0 6px 16px -8px var(--primary-line);
  transition: filter 120ms, transform 60ms;
}
.admin-row button:hover { filter: brightness(1.08); }
.admin-row button:active { transform: translateY(1px); }
.admin-row button.danger { background: transparent; color: var(--red); border-color: rgba(255,107,107,0.32); box-shadow: none; }
.admin-row button.danger:hover { background: var(--red-soft); filter: none; }
#adm-system-prompt {
  width: 100%; min-height: 280px;
  background: var(--sunken); color: var(--text-dim);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 12px; font-family: var(--mono); font-size: 11px; line-height: 1.6; resize: vertical;
  transition: border-color 120ms, box-shadow 120ms;
}
#adm-system-prompt:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.prompt-preview {
  background: var(--sunken); border: 1px solid var(--border-soft); border-radius: var(--r-sm);
  padding: 12px; margin-top: 10px; max-height: 360px; overflow-y: auto;
  font-size: 10.5px; color: var(--text-dim); font-family: var(--mono); line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
}
.admin-meta { font-size: 10.5px; color: var(--text-faint); margin: 6px 0; line-height: 1.6; }
.admin-meta code { background: var(--surface-2); padding: 1px 5px; border-radius: var(--r-xs); font-size: 10px; color: var(--violet); font-family: var(--mono); }
/* In the admin pane, lay the four setting cards out in a responsive grid */
.pane[data-pane="admin"] .settings-body {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 18px; align-items: start;
}
.pane[data-pane="admin"] .settings-section:nth-child(3) { grid-column: 1 / -1; }

/* ───────── Responsive: collapse sidebar to a top bar ───────── */
@media (max-width: 860px) {
  .dot { grid-template-columns: 1fr; }
  .sidebar {
    position: static; height: auto;
    flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px;
    border-right: 0; border-bottom: 1px solid var(--border-soft);
  }
  .brand { flex: 1 1 auto; }
  .nav { flex-direction: row; flex-wrap: wrap; flex: 1 1 100%; gap: 4px; }
  .nav-item { padding: 8px 11px; }
  .sidebar-foot { margin-top: 0; flex-direction: row; align-items: center; gap: 10px; flex: 1 1 100%; }
  .user-chip { flex: 1; }
  .views { padding: 20px 16px 48px; }
}

/* ════════════════════════  Login page  ════════════════════════ */
.login-body { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 24px; }
.login-card {
  position: relative; max-width: 440px; width: 100%;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 36px 32px 30px; box-shadow: var(--shadow-lg); overflow: hidden;
}
.login-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--grad); }
.login-card h1 {
  margin: 0 0 8px; font-size: 23px; font-weight: 700; letter-spacing: -0.02em;
  display: flex; align-items: center; gap: 11px;
}
.login-card h1::before {
  content: ""; width: 16px; height: 16px; border-radius: 50%;
  background: var(--grad); box-shadow: 0 0 0 5px var(--primary-soft), 0 0 16px var(--primary-line); flex: none;
}
.login-card .login-sub { color: var(--text-dim); font-size: 13px; margin: 0 0 22px; line-height: 1.55; }
.login-card .login-meta { color: var(--text-faint); font-size: 11.5px; margin-top: 16px; line-height: 1.55; }
.login-card form { display: flex; flex-direction: column; gap: 14px; }
.login-card label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 11px; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px;
}
.login-card select, .login-card input[type="password"] {
  padding: 11px 12px; font-size: 13.5px;
  background: var(--sunken); border: 1px solid var(--border); border-radius: var(--r-sm);
  color: var(--text); font-family: inherit; transition: border-color 120ms, box-shadow 120ms;
}
.login-card select:focus, .login-card input[type="password"]:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.login-card button {
  margin-top: 4px; padding: 12px; font-size: 14px; font-weight: 650; cursor: pointer;
  background: var(--grad); color: #fff; border: 1px solid transparent; border-radius: var(--r-sm);
  box-shadow: 0 1px 2px rgba(0,0,0,0.3), 0 10px 24px -10px var(--primary-line);
  transition: filter 120ms, transform 60ms;
}
.login-card button:hover { filter: brightness(1.08); }
.login-card button:active { transform: translateY(1px); }
.login-card .login-error {
  background: var(--red-soft); color: #ffb4b4; font-size: 12.5px;
  padding: 9px 12px; border-radius: var(--r-sm); border: 1px solid rgba(255,107,107,0.35);
}
