/* Sortd Ops. Brand tokens and app shell. Light by default, dark via data-theme or system. */

@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:wght@600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  --accent: #2563EB;
  --accent-2: #7C3AED;
  --grad: linear-gradient(96deg, #2563EB 0%, #7C3AED 100%);
  --accent-soft: rgba(37, 99, 235, 0.10);
  --accent-soft-2: rgba(124, 58, 237, 0.22);
  --bg: #F5F6F8;
  --bg-2: #FCFCFD;
  --surface: #FCFCFD;
  --surface-2: #F0F2F5;
  --line: rgba(11, 13, 18, 0.08);
  --line-2: rgba(11, 13, 18, 0.14);
  --track: rgba(11, 13, 18, 0.08);
  --stripe-a: #D5D9E1; --stripe-b: #E7EAEF;
  --text: #0B0D12;
  --muted: #6E7684;
  --dim: #A3AAB6;
  --green: #16A34A;
  --amber: #D97706;
  --red: #DC2626;
  --blue: #0EA5E9;
  --shadow: 0 16px 40px rgba(11, 13, 18, 0.08);
  --r: 16px;
  --r-sm: 10px;
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', system-ui, sans-serif;
  --head: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter Tight', 'Inter', system-ui, sans-serif;
  --side-bg: #0B0D12; --side-text: #C3C8D1; --side-dim: #6B7280; --side-line: rgba(255,255,255,0.08);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent-soft: rgba(37, 99, 235, 0.18); --accent-soft-2: rgba(124, 58, 237, 0.35);
    --bg: #0B0D12; --bg-2: #101218; --surface: #14161C; --surface-2: #1B1E26;
    --line: rgba(255,255,255,0.08); --line-2: rgba(255,255,255,0.14); --track: rgba(255,255,255,0.09);
    --stripe-a: #2A2F3A; --stripe-b: #1F232C;
    --text: #F3F4F6; --muted: #8A93A3; --dim: #5F6675;
    --green: #4ADE80; --amber: #FBBF24; --red: #F87171; --blue: #38BDF8;
    --shadow: 0 16px 40px rgba(0,0,0,0.45);
    --side-bg: #07080B;
  }
}
:root[data-theme="dark"] {
  --accent-soft: rgba(37, 99, 235, 0.18); --accent-soft-2: rgba(124, 58, 237, 0.35);
  --bg: #0B0D12; --bg-2: #101218; --surface: #14161C; --surface-2: #1B1E26;
  --line: rgba(255,255,255,0.08); --line-2: rgba(255,255,255,0.14); --track: rgba(255,255,255,0.09);
  --stripe-a: #2A2F3A; --stripe-b: #1F232C;
  --text: #F3F4F6; --muted: #8A93A3; --dim: #5F6675;
  --green: #4ADE80; --amber: #FBBF24; --red: #F87171; --blue: #38BDF8;
  --shadow: 0 16px 40px rgba(0,0,0,0.45);
  --side-bg: #07080B;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; min-height: 100vh; overflow-x: hidden; transition: background .3s, color .3s; }
h1, h2, h3, h4, .num { font-family: var(--head); letter-spacing: -0.02em; }
a { color: inherit; text-decoration: none; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }
button { font: inherit; }
:where(button, input, [tabindex]):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Layout */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { background: var(--side-bg); color: var(--side-text); border-right: 1px solid var(--side-line); padding: 22px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; color: #fff; }
.brand svg { width: 26px; height: auto; }
.brand .bt { font-family: var(--head); font-weight: 700; font-size: 1.2rem; line-height: 1; letter-spacing: -0.03em; }
.brand .bt small { display: block; font-weight: 500; font-size: 0.62rem; letter-spacing: 0.14em; color: #A78BFA; text-transform: uppercase; margin-top: 4px; }
.nav-group { font-size: 0.64rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--side-dim); padding: 16px 12px 7px; font-weight: 600; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: var(--r-sm); color: var(--side-text); font-size: 0.86rem; font-weight: 500; cursor: pointer; position: relative; transition: color .18s, background .18s; margin-bottom: 1px; }
.nav-item .ic { width: 18px; height: 18px; display: inline-grid; place-items: center; opacity: 0.8; }
.nav-item .ic svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,0.05); }
.nav-item.active { color: #fff; background: rgba(255,255,255,0.08); }
.nav-item.active::before { content: ''; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--grad); }
.nav-item.ask { margin-top: 8px; background: var(--grad); color: #fff; }
.nav-item.ask:hover { filter: brightness(1.08); }
.nav-foot { margin-top: auto; padding: 14px 12px 4px; font-size: 0.7rem; color: var(--side-dim); border-top: 1px solid var(--side-line); line-height: 1.5; }

.content { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 14px 30px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px); }
.topbar .crumb { font-size: 0.84rem; color: var(--muted); }
.topbar .crumb b { color: var(--text); font-weight: 600; }
.topbar .spacer { flex: 1; }
.search { background: var(--surface); border: 1px solid var(--line-2); border-radius: 999px; padding: 8px 16px; color: var(--text); font-size: 0.84rem; width: 230px; outline: none; transition: border .2s, width .2s; font-family: var(--font); }
.search:focus { border-color: var(--accent); width: 280px; }
.search::placeholder { color: var(--dim); }
.theme { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); display: grid; place-items: center; cursor: pointer; }
.theme svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.theme .sun { display: none; }
:root[data-theme="dark"] .theme .sun { display: block; } :root[data-theme="dark"] .theme .moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme .sun { display: block; } :root:not([data-theme="light"]) .theme .moon { display: none; } }
.av { width: 34px; height: 34px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; font-family: var(--head); font-weight: 700; font-size: 0.78rem; color: #fff; }

.view { padding: 28px 30px 60px; animation: viewIn .42s cubic-bezier(.2,.7,.2,1); }
@keyframes viewIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.page-head { margin-bottom: 22px; }
.eyebrow { font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-2); font-weight: 600; }
.page-head h1 { font-size: 1.9rem; font-weight: 700; margin-top: 6px; letter-spacing: -0.03em; }
.page-head p { color: var(--muted); margin-top: 6px; max-width: 720px; font-size: 0.92rem; }

/* Grid + cards */
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1150px) { .cols-4 { grid-template-columns: repeat(2,1fr);} .cols-3{grid-template-columns:repeat(2,1fr);} }

.hamburger { display: none; background: none; border: none; color: var(--text); font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 2px 6px; margin-right: 2px; }
.sidebar-scrim { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 65; opacity: 0; pointer-events: none; transition: opacity .2s; }
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .hamburger { display: block; }
  .sidebar { position: fixed; top: 0; left: 0; height: 100vh; width: 250px; z-index: 70; transform: translateX(-100%); transition: transform .24s cubic-bezier(.2,.7,.2,1); }
  .sidebar.open { transform: none; box-shadow: 14px 0 50px rgba(0,0,0,0.5); }
  .sidebar-scrim.open { opacity: 1; pointer-events: auto; }
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
  .grid > [style*="span 2"] { grid-column: auto !important; }
  .view { padding: 20px 16px 50px; }
  .topbar { padding: 12px 16px; gap: 10px; }
  .search { display: none; }
  .page-head h1 { font-size: 1.5rem; }
  .card-head { flex-wrap: wrap; gap: 4px 8px; }
  .crumb { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .card:has(> table.tbl) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .card table.tbl { min-width: 560px; }
  #gantt, .sched-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; transition: transform .22s cubic-bezier(.2,.7,.2,1), border-color .22s, box-shadow .22s; }
.card.hover:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-head h3 { font-size: 0.98rem; font-weight: 600; letter-spacing: -0.01em; }
.card-head .sub { font-size: 0.74rem; color: var(--muted); }

.kpi { position: relative; overflow: hidden; }
.kpi .label { font-size: 0.72rem; color: var(--muted); font-weight: 600; letter-spacing: 0.02em; }
.kpi .val { font-family: var(--head); font-weight: 700; font-size: 2rem; margin: 6px 0 2px; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.kpi .delta { font-size: 0.74rem; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.delta.up { color: var(--green); } .delta.down { color: var(--red); }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 0.7rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.pill.green  { background: rgba(34,197,94,0.14); color: var(--green); }
.pill.amber  { background: rgba(245,158,11,0.16); color: var(--amber); }
.pill.red    { background: rgba(239,68,68,0.14); color: var(--red); }
.pill.blue   { background: rgba(14,165,233,0.14); color: var(--blue); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.st-onsite { background: var(--accent); } .st-office { background: var(--blue); } .st-avail { background: var(--green); } .st-leave { background: var(--dim); }

.btn { font-family: var(--font); font-weight: 600; font-size: 0.82rem; padding: 8px 15px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); cursor: pointer; transition: transform .12s, background .18s, border-color .18s; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { transform: translateY(-1px); background: var(--surface-2); }
.btn:active { transform: translateY(0); }
.btn.sm { font-size: 0.74rem; padding: 6px 11px; }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 6px 20px -6px rgba(124,58,237,0.5); }

table.tbl { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
table.tbl th { text-align: left; font-weight: 600; color: var(--muted); font-size: 0.72rem; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line); }
table.tbl tbody tr { transition: background .15s; }
table.tbl tbody tr:hover { background: var(--surface-2); }
.tbl .strong { font-weight: 600; }
.tbl .muted { color: var(--muted); font-size: 0.78rem; }

.bar { height: 7px; border-radius: 5px; background: var(--track); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 5px; background: var(--grad); width: 0; transition: width 1s cubic-bezier(.2,.8,.2,1); }

.av-sm { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 0.66rem; font-weight: 700; font-family: var(--head); color: var(--text); border: 2px solid var(--surface); background: var(--surface-2); }
.av-stack { display: flex; } .av-stack .av-sm:not(:first-child) { margin-left: -9px; }

.seg { display: inline-flex; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.seg button { border: none; background: none; color: var(--muted); font-size: 0.78rem; font-weight: 500; padding: 6px 14px; border-radius: 999px; cursor: pointer; transition: all .18s; }
.seg button.active { background: var(--text); color: var(--bg); }

.scrim { position: fixed; inset: 0; background: rgba(0,0,0,0.5); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 60; }
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; height: 100%; width: min(460px, 94vw); z-index: 61; background: var(--surface); border-left: 1px solid var(--line-2); box-shadow: -20px 0 60px rgba(0,0,0,0.25); transform: translateX(100%); transition: transform .26s cubic-bezier(.2,.7,.2,1); overflow-y: auto; padding: 24px 26px; }
.drawer.open { transform: none; }
.drawer .x { position: absolute; top: 16px; right: 18px; background: none; border: none; color: var(--muted); font-size: 1.5rem; cursor: pointer; }

.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.muted { color: var(--muted); } .dim { color: var(--dim); }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; }
.tag-cal-ok { color: var(--green); } .tag-cal-soon { color: var(--amber); } .tag-cal-over { color: var(--red); }

.stagger > * { opacity: 0; animation: upIn .5s forwards; transform: translateY(10px); }
@keyframes upIn { to { opacity: 1; transform: none; } }
.stagger > *:nth-child(1){animation-delay:.02s} .stagger>*:nth-child(2){animation-delay:.06s}
.stagger>*:nth-child(3){animation-delay:.10s} .stagger>*:nth-child(4){animation-delay:.14s}
.stagger>*:nth-child(5){animation-delay:.18s} .stagger>*:nth-child(6){animation-delay:.22s}
.stagger>*:nth-child(7){animation-delay:.26s} .stagger>*:nth-child(8){animation-delay:.30s}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } .stagger > * { opacity: 1; transform: none; } }

/* Ask Sortd */
.ask-wrap { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .ask-wrap { grid-template-columns: 1fr; } }
.ask-panel { background: #0B0D12; color: #F3F4F6; border: 1px solid #2A2E3A; border-radius: var(--r); padding: 22px; display: grid; gap: 16px; }
.ask-form { display: flex; gap: 10px; }
.ask-form input { flex: 1; background: #171A21; border: 1px solid #2A2E3A; border-radius: 999px; padding: 12px 18px; color: #fff; font: inherit; font-size: 0.92rem; outline: none; }
.ask-form input:focus { border-color: var(--accent); }
.ask-form input::placeholder { color: #6B7280; }
.ask-answer { font-size: 0.92rem; line-height: 1.65; color: #C9CED8; min-height: 120px; white-space: pre-wrap; }
.ask-answer b { color: #fff; font-weight: 600; }
.ask-answer .src { display: block; margin-top: 12px; font-size: 0.76rem; color: #8A93A3; }
.ask-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ask-actions .btn { background: #171A21; border-color: #2A2E3A; color: #C9CED8; }
.ask-actions .btn.primary { background: var(--grad); color: #fff; border-color: transparent; }
.ask-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ask-chips button { border: 1px solid var(--line-2); background: var(--surface); color: var(--text); border-radius: 999px; padding: 9px 14px; font-size: 0.82rem; cursor: pointer; text-align: left; transition: background .15s, border-color .15s; }
.ask-chips button:hover { border-color: var(--accent); background: var(--accent-soft); }
.cursor { display: inline-block; width: 7px; height: 14px; background: #A78BFA; vertical-align: -2px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.ask-mini { background: #0B0D12; color: #F3F4F6; border: 1px solid #2A2E3A; }
.ask-mini h3 { color: #fff; } .ask-mini .sub { color: #8A93A3; }
.ask-mini .q { display: flex; gap: 10px; align-items: center; background: #171A21; border: 1px solid #2A2E3A; border-radius: 12px; padding: 10px 14px; font-size: 0.86rem; cursor: pointer; margin-bottom: 8px; color: #E5E7EB; }
.ask-mini .q i { width: 9px; height: 9px; border-radius: 50%; background: var(--grad); flex: none; }
.ask-mini .q:hover { border-color: var(--accent); }
