/* Crew · design tokens — warm SaaS, friendly but professional */

:root {
  /* Surfaces */
  --bg:        #f5f1e8;
  --surface:   #ffffff;
  --surface-2: #faf6ec;
  --surface-3: #efe9da;
  --line:      rgba(29, 26, 22, 0.09);
  --line-2:    rgba(29, 26, 22, 0.16);
  --line-strong: rgba(29, 26, 22, 0.32);

  /* Ink */
  --ink:   #1d1a16;
  --ink-2: #4a4239;
  --ink-3: #8a8175;
  --ink-4: #b8b0a3;

  /* Brand / semantic */
  --primary:       #2a5a3a;  /* deep sage — primary action */
  --primary-soft:  #d9e6dc;
  --primary-ink:   #ffffff;
  --accent:        #c87b2a;  /* warm amber — attention */
  --accent-soft:   #f5e6cf;
  --danger:        #b14b3a;
  --danger-soft:   #f1d8d2;
  --info:          #4a6f8a;
  --info-soft:     #d8e3ec;
  --warn:          #d4a82a;
  --warn-soft:     #f5ecc9;
  --warn-ink:      #8a6a14;
  --ok:            #3d7d54;

  /* Department palette — soft tinted shift blocks */
  --dept-server:  #6f9656;  /* sage green */
  --dept-server-bg: #e5ede0;
  --dept-kitchen: #c4882a;  /* amber */
  --dept-kitchen-bg: #f5ead4;
  --dept-bar:     #9d5870;  /* plum */
  --dept-bar-bg:  #ecdce2;
  --dept-host:    #4a6f8a;  /* slate */
  --dept-host-bg: #d8e3ec;
  --dept-mgr:     #7a6a48;
  --dept-mgr-bg:  #ebe5d4;

  /* Radii */
  --r-1: 4px;
  --r-2: 6px;
  --r-3: 10px;
  --r-4: 14px;
  --r-5: 20px;
  --r-full: 999px;

  /* Shadow */
  --sh-1: 0 1px 0 rgba(29,26,22,0.04), 0 1px 2px rgba(29,26,22,0.04);
  --sh-2: 0 1px 0 rgba(29,26,22,0.05), 0 2px 8px rgba(29,26,22,0.06);
  --sh-3: 0 4px 12px rgba(29,26,22,0.08), 0 12px 32px rgba(29,26,22,0.10);
  --sh-pop: 0 12px 36px rgba(29,26,22,0.18), 0 2px 6px rgba(29,26,22,0.10);

  /* Type — R-011: self-hosted via next/font/google (set as CSS custom
     properties on <html> in app/layout.tsx); the original family name is kept
     as a fallback within each var() so anything rendered outside that <html>
     scope (e.g. a standalone script/tool) still degrades sanely. */
  --f-display: var(--font-instrument-serif, "Instrument Serif"), Georgia, serif;
  --f-ui: var(--font-geist, "Geist"), "Geist Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --f-mono: var(--font-jetbrains-mono, "JetBrains Mono"), ui-monospace, "SF Mono", Menlo, monospace;

  /* Sizes */
  --topbar-h: 56px;
  --sidebar-w: 220px;
  --sidebar-w-collapsed: 64px;
}

/* Theme variants ----------------------------------------------------------- */

/* PREMIUM BUSINESS — warm dark + brass, serif-led, restrained */
[data-theme="premium"] {
  --bg:        #14110d;
  --surface:   #1b1713;
  --surface-2: #221d17;
  --surface-3: #2a241d;
  --line:      rgba(235, 227, 210, 0.06);
  --line-2:    rgba(235, 227, 210, 0.12);
  --line-strong: rgba(235, 227, 210, 0.28);

  --ink:   #ebe3d2;
  --ink-2: #b8ad97;
  --ink-3: #837964;
  --ink-4: #524a3d;

  --primary:       #c8a263;   /* brass */
  --primary-soft:  rgba(200, 162, 99, 0.16);
  --primary-ink:   #14110d;
  --accent:        #cc8a4a;   /* burnished copper */
  --accent-soft:   rgba(204, 138, 74, 0.18);
  --danger:        #cf5a4a;
  --danger-soft:   rgba(207, 90, 74, 0.16);
  --info:          #7a9ab2;
  --info-soft:     rgba(122, 154, 178, 0.16);
  --warn:          #d4a82a;
  --warn-soft:     rgba(212, 168, 42, 0.16);
  --warn-ink:      #d4a82a;
  --ok:            #8ec19a;

  --dept-server:  #8ec19a;
  --dept-server-bg: rgba(142, 193, 154, 0.14);
  --dept-kitchen: #d4a566;
  --dept-kitchen-bg: rgba(212, 165, 102, 0.14);
  --dept-bar:     #c08a9e;
  --dept-bar-bg:  rgba(192, 138, 158, 0.14);
  --dept-host:    #8aa6c2;
  --dept-host-bg: rgba(138, 166, 194, 0.14);
  --dept-mgr:     #c2b48a;
  --dept-mgr-bg:  rgba(194, 180, 138, 0.14);

  --sh-1: 0 1px 0 rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.25);
  --sh-2: 0 1px 0 rgba(0,0,0,0.45), 0 4px 12px rgba(0,0,0,0.35);
  --sh-3: 0 8px 24px rgba(0,0,0,0.55), 0 24px 64px rgba(0,0,0,0.4);
  --sh-pop: 0 18px 48px rgba(0,0,0,0.65), 0 4px 10px rgba(0,0,0,0.4);
}

/* Premium-specific refinements that don't fit pure token swaps */
[data-theme="premium"] body {
  background:
    radial-gradient(900px 600px at 80% 0%, rgba(200,162,99,0.06), transparent 60%),
    radial-gradient(700px 500px at 0% 100%, rgba(122,154,178,0.04), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
[data-theme="premium"] .topbar { background: rgba(20, 17, 13, 0.85); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
[data-theme="premium"] .sidebar { background: rgba(27, 23, 19, 0.4); }
[data-theme="premium"] .nav-item:hover { background: rgba(235, 227, 210, 0.04); }
[data-theme="premium"] .nav-item.active { background: var(--primary-soft); color: var(--primary); }
[data-theme="premium"] .nav-item.active .nav-icon { color: var(--primary); }
[data-theme="premium"] .card { background: var(--surface); border-color: var(--line); }
[data-theme="premium"] .btn { background: var(--surface-2); border-color: var(--line-2); color: var(--ink); }
[data-theme="premium"] .btn:hover { background: var(--surface-3); border-color: var(--line-strong); }
[data-theme="premium"] .btn-primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
[data-theme="premium"] .btn-primary:hover { background: color-mix(in srgb, var(--primary) 88%, white 12%); }
[data-theme="premium"] .btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
[data-theme="premium"] .btn-ghost:hover { background: rgba(235,227,210,0.04); }
[data-theme="premium"] .tabbar { background: var(--surface-2); border-color: var(--line); }
[data-theme="premium"] .tab.active { background: var(--surface-3); color: var(--primary); }
[data-theme="premium"] .topbar-search { background: var(--surface-2); border-color: var(--line); }
[data-theme="premium"] .topbar-search .kbd { background: var(--surface-3); border-color: var(--line-2); }
[data-theme="premium"] .chip { background: var(--surface-2); border-color: var(--line); color: var(--ink-2); }
[data-theme="premium"] .scrim { background: rgba(0,0,0,0.55); backdrop-filter: blur(4px); }
[data-theme="premium"] .drawer { background: var(--surface); border-left-color: var(--line); }
[data-theme="premium"] .ds-input { background: var(--surface-2); border-color: var(--line-2); color: var(--ink); }
[data-theme="premium"] input, [data-theme="premium"] select, [data-theme="premium"] textarea {
  background: var(--surface-2); border-color: var(--line-2); color: var(--ink);
}
[data-theme="premium"] input:focus, [data-theme="premium"] select:focus { outline-color: var(--primary); }
[data-theme="premium"] .toast { background: var(--surface-3); color: var(--ink); border: 1px solid var(--line); }
[data-theme="premium"] .brand-mark { background: var(--primary); color: var(--bg); }

/* INDIGO (legacy daylight variant) */
[data-theme="indigo"] {
  --primary: #3a4280;
  --primary-soft: #dee0ee;
  --accent: #8a4a8c;
  --accent-soft: #e8d8e8;
  --dept-server: #4a5fa6;
  --dept-server-bg: #dee2ee;
}
[data-theme="plum"] {
  --primary: #7a3a4e;
  --primary-soft: #eed8de;
  --accent: #c47a4a;
  --accent-soft: #f1e0ce;
  --dept-server: #8a4a5a;
  --dept-server-bg: #eed8de;
}

/* FRIENDLY TEAM — warm cream paper, peach + sage, soft rounded, slightly playful */
[data-theme="friendly"] {
  --bg:        #fbf3e6;
  --surface:   #ffffff;
  --surface-2: #fbece0;
  --surface-3: #f5dec9;
  --line:      rgba(118, 78, 38, 0.10);
  --line-2:    rgba(118, 78, 38, 0.18);
  --line-strong: rgba(118, 78, 38, 0.32);

  --ink:   #2a1f15;
  --ink-2: #5a4636;
  --ink-3: #8e7460;
  --ink-4: #b8a594;

  --primary:       #d97757;
  --primary-soft:  #fde2d4;
  --primary-ink:   #ffffff;
  --accent:        #7a9e6e;
  --accent-soft:   #dde6d4;
  --danger:        #c84e4e;
  --danger-soft:   #f5d5d5;
  --info:          #6e8aa4;
  --info-soft:     #dbe3ec;
  --warn:          #d4a566;
  --warn-soft:     #f5e6cf;
  --warn-ink:      #8a5a14;
  --ok:            #5d8a5f;

  --dept-server:  #6e9a4a;
  --dept-server-bg: #dde6d4;
  --dept-kitchen: #c46a3a;
  --dept-kitchen-bg: #fbe2d2;
  --dept-bar:     #a85a78;
  --dept-bar-bg:  #f3dce4;
  --dept-host:    #4a7aa8;
  --dept-host-bg: #dbe6f0;
  --dept-mgr:     #8a6a32;
  --dept-mgr-bg:  #f0e3c8;

  /* Softer, more rounded */
  --r-1: 6px;
  --r-2: 10px;
  --r-3: 14px;
  --r-4: 18px;
  --r-5: 24px;

  /* Peach-tinted shadows */
  --sh-1: 0 1px 0 rgba(217,119,87,0.06), 0 1px 3px rgba(118,78,38,0.06);
  --sh-2: 0 2px 0 rgba(217,119,87,0.05), 0 4px 12px rgba(118,78,38,0.08);
  --sh-3: 0 6px 18px rgba(118,78,38,0.10), 0 18px 40px rgba(118,78,38,0.10);
  --sh-pop: 0 16px 40px rgba(118,78,38,0.20), 0 4px 10px rgba(118,78,38,0.10);
}

/* Friendly-specific refinements */
[data-theme="friendly"] body {
  background:
    radial-gradient(700px 500px at 100% 0%, rgba(217,119,87,0.10), transparent 60%),
    radial-gradient(600px 400px at 0% 100%, rgba(122,158,110,0.08), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
[data-theme="friendly"] .topbar { background: rgba(255,255,255,0.7); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-bottom-color: var(--line); }
[data-theme="friendly"] .sidebar { background: rgba(255,255,255,0.4); }
[data-theme="friendly"] .nav-item.active { background: var(--primary-soft); color: var(--primary); }
[data-theme="friendly"] .card { border-radius: var(--r-4); border-color: var(--line); box-shadow: var(--sh-1); }
[data-theme="friendly"] .btn { border-radius: var(--r-3); }
[data-theme="friendly"] .btn-primary { box-shadow: 0 2px 0 rgba(217,119,87,0.20), var(--sh-1); }
[data-theme="friendly"] .brand-mark { background: var(--primary); color: #fff; border-radius: 10px; transform: rotate(-3deg); }
[data-theme="friendly"] .avatar { font-weight: 700; }
[data-theme="friendly"] .nav-item { border-radius: var(--r-2); }
[data-theme="friendly"] .chip { border-radius: 999px; }

/* Density */
[data-density="compact"] {
  --row-h: 56px;
  --pad: 10px;
}
[data-density="cozy"] {
  --row-h: 72px;
  --pad: 14px;
}

/* Global ------------------------------------------------------------------- */
* { box-sizing: border-box; }
html, body, #root { height: 100%; margin: 0; }
body {
  font-family: var(--f-ui);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }

/* Utility classes ---------------------------------------------------------- */
.mono { font-family: var(--f-mono); letter-spacing: 0.01em; }
.serif { font-family: var(--f-display); font-weight: 500; letter-spacing: -0.01em; }
.muted { color: var(--ink-3); }
.dim { color: var(--ink-4); }
.eyebrow { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.12em; color: var(--ink-3); text-transform: uppercase; }

/* App shell ---------------------------------------------------------------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  height: 100vh;
  background: var(--bg);
}

.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  padding: 0 18px 0 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  gap: 12px;
  z-index: 5;
}
.topbar .brand {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--f-display);
  font-size: 22px;
  font-weight: 500;
  width: calc(var(--sidebar-w) - 18px);
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 17px;
  font-style: italic;
}
.topbar-search {
  flex: 0 1 360px;
  display: flex; align-items: center; gap: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: 6px 10px;
  font-size: 13px;
  color: var(--ink-3);
}
.topbar-search .kbd {
  font-family: var(--f-mono); font-size: 10.5px;
  background: var(--surface); border: 1px solid var(--line);
  padding: 1px 5px; border-radius: 4px;
  color: var(--ink-3);
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 16px 12px;
  display: flex; flex-direction: column;
  gap: 2px;
  overflow: auto;
}
.nav-section { font-family: var(--f-mono); font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-4); padding: 14px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  border-radius: var(--r-2);
  font-size: 13.5px;
  color: var(--ink-2);
  cursor: pointer;
  border: none;
  background: transparent;
  text-align: left;
  width: 100%;
  transition: background 0.12s;
}
.nav-item:hover { background: var(--surface-2); }
.nav-item.active { background: var(--surface-3); color: var(--ink); font-weight: 500; }
.nav-item .nav-icon { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.8; }
.nav-item.active .nav-icon { opacity: 1; }
.nav-item .nav-badge {
  margin-left: auto;
  font-family: var(--f-mono); font-size: 10.5px;
  background: var(--accent); color: #fff;
  padding: 1px 6px; border-radius: 999px;
  line-height: 1.4;
}

.workspace {
  overflow: auto;
  display: flex; flex-direction: column;
  min-width: 0;
}

/* Generic */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px;
  border-radius: var(--r-2);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.05s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(0.5px); }
.btn-primary {
  background: var(--primary); color: var(--primary-ink);
  border-color: var(--primary);
}
.btn-primary:hover { background: color-mix(in srgb, var(--primary) 88%, black); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-sm { padding: 4px 9px; font-size: 12px; gap: 5px; }
.btn-icon { padding: 6px; width: 30px; height: 30px; justify-content: center; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px;
  font-size: 11.5px;
  border-radius: var(--r-full);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
}
.chip.solid-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.chip.solid-accent  { background: var(--accent); color: #fff; border-color: var(--accent); }
.chip.solid-danger  { background: var(--danger); color: #fff; border-color: var(--danger); }
.chip.soft-primary { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.chip.soft-accent  { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.chip.soft-danger  { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.chip.soft-info    { background: var(--info-soft); color: var(--info); border-color: transparent; }
.chip.soft-warn    { background: var(--warn-soft); color: var(--warn-ink); border-color: transparent; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-4);
  box-shadow: var(--sh-1);
}

.tabbar {
  display: inline-flex;
  background: var(--surface-2);
  border-radius: var(--r-2);
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--line);
}
.tab {
  border: none;
  background: transparent;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
  border-radius: 5px;
  cursor: pointer;
}
.tab.active { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }

.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--surface-3);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 500; font-size: 12px;
  color: var(--ink);
  flex-shrink: 0;
}
.avatar-sm { width: 24px; height: 24px; font-size: 10.5px; }
.avatar-lg { width: 44px; height: 44px; font-size: 15px; }
.avatar-xl { width: 60px; height: 60px; font-size: 20px; }

.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block;
}
.status-dot.ok { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent); }
.status-dot.warn { background: var(--warn); }
.status-dot.busy { background: var(--accent); }
.status-dot.off { background: var(--ink-4); }

/* Toast */
.toast-host {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 1000;
}
.toast {
  background: var(--ink);
  color: #fff;
  padding: 11px 16px;
  border-radius: var(--r-3);
  font-size: 13px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--sh-3);
  animation: toast-in 0.22s ease-out;
  min-width: 240px;
}
.toast .toast-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.toast.success .toast-dot { background: #8ad19a; }
.toast.warn .toast-dot { background: var(--warn); }
@keyframes toast-in {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Drawer / modal */
.scrim {
  position: fixed; inset: 0;
  background: rgba(29, 26, 22, 0.25);
  backdrop-filter: blur(2px);
  z-index: 50;
  animation: scrim-in 0.18s ease-out;
}
@keyframes scrim-in { from { opacity: 0; } to { opacity: 1; } }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 460px;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: var(--sh-pop);
  z-index: 51;
  display: flex; flex-direction: column;
  animation: drawer-in 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes drawer-in { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Hide scrollbar visually in workspace */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { scrollbar-width: none; }

/* Hover lift for cards in dashboards */
.lift { transition: transform 0.15s, box-shadow 0.15s; }
.lift:hover { transform: translateY(-1px); box-shadow: var(--sh-2); }

/* Focus ring */
.btn:focus-visible, .nav-item:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

/* ─── Now indicator pulse + live ──────────────────────────────────────────── */
@keyframes now-pulse-ring {
  0%   { transform: scale(1);   opacity: 0.75; }
  80%  { transform: scale(2.6); opacity: 0;    }
  100% { transform: scale(2.6); opacity: 0;    }
}
@keyframes now-line-glow {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--danger) 0%, transparent); }
  50%      { box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 18%, transparent); }
}
.now-line {
  animation: now-line-glow 2.2s ease-in-out infinite;
}
@keyframes live-ring {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 35%, transparent); }
  50%      { box-shadow: 0 0 0 5px color-mix(in srgb, var(--ok) 0%, transparent); }
}
.live-ring {
  animation: live-ring 1.8s ease-in-out infinite;
}

/* ─── AI button gradient ──────────────────────────────────────────────────── */
.btn-ai {
  background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 55%, var(--accent))) !important;
  color: var(--primary-ink) !important;
  border: none !important;
  position: relative;
  overflow: hidden;
}
.btn-ai::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.22) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}
.btn-ai:hover::before { transform: translateX(100%); }
.btn-ai:hover { filter: brightness(1.06); }

/* Sparkle pulse */
@keyframes sparkle-spin {
  0%, 100% { transform: rotate(0); opacity: 0.85; }
  50%      { transform: rotate(180deg); opacity: 1; }
}
.sparkle { display: inline-block; animation: sparkle-spin 3.2s ease-in-out infinite; }

/* Kbd inline */
.kbd {
  font-family: var(--f-mono); font-size: 10.5px;
  background: var(--surface-2); border: 1px solid var(--line-2);
  padding: 1px 5px; border-radius: 4px;
  color: var(--ink-2);
}

/* Print stylesheet — used by the printable poster */
@media print {
  body { background: white !important; }
}

/* ─── Mobile responsive ───────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  :root { --sidebar-w: 64px; }
  .sidebar { padding: 12px 6px; }
  .sidebar .nav-section,
  .sidebar .nav-item > span:not(.nav-icon):not(.nav-badge),
  .sidebar .eyebrow,
  .sidebar .location-mark + div,
  .sidebar .location-mark + div + svg {
    display: none !important;
  }
  .sidebar .nav-item {
    justify-content: center;
    padding: 8px 4px;
  }
  .sidebar .nav-item .nav-badge {
    position: absolute;
    margin-left: 0;
    transform: translate(12px, -10px);
    font-size: 9px;
    padding: 0 4px;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .sidebar .nav-item { position: relative; }
  /* Hide "Add shift" text but keep the +  */
  .sidebar > .btn-primary {
    padding: 8px !important;
    justify-content: center !important;
  }
  .sidebar > .btn-primary > *:not(svg) {
    display: none;
  }
  /* Topbar shrinks */
  .topbar .brand { width: 56px; padding-left: 4px; font-size: 0; }
  .topbar .brand .brand-mark { font-size: 17px; }
  .topbar-search { display: none !important; }
  .topbar-right .mono { display: none !important; }
}

@media (max-width: 720px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: var(--topbar-h) 1fr auto;
  }
  .sidebar {
    grid-column: 1;
    grid-row: 3;
    flex-direction: row;
    border-right: none;
    border-top: 1px solid var(--line);
    padding: 6px 8px !important;
    gap: 6px;
    overflow-x: auto;
  }
  .sidebar > .btn-primary { display: none !important; }
  .sidebar .nav-section { display: none !important; }
  .sidebar .nav-item {
    flex-direction: column;
    gap: 2px;
    flex: 0 0 auto;
    padding: 6px 10px !important;
    font-size: 10px !important;
  }
  .sidebar .nav-item > span:not(.nav-icon):not(.nav-badge) {
    display: block !important;
    font-size: 10px;
    line-height: 1.1;
  }
  .sidebar > div:last-child { display: none; } /* location switcher */
  .workspace { padding-bottom: 12px; }
}

/* Schedule grid responsive — let it scroll horizontally on narrow screens */
@media (max-width: 900px) {
  .workspace > div {
    overflow-x: auto;
  }
}
