/* Cyberou dashboard — SnowUI-style tokens & components. Light theme only.
   Marketing site css/site.css is NOT loaded on dashboard pages. */
:root {
  --bg: #ffffff; --card: #F7F9FB; --ink: #1C1C1C;
  --ink-60: rgba(28,28,28,.6); --ink-40: rgba(28,28,28,.4);
  --ink-20: rgba(28,28,28,.2); --ink-10: rgba(28,28,28,.1); --ink-05: rgba(28,28,28,.05);
  --tile-blue: #E3F5FF; --tile-grey: #E5ECF6;
  --indigo: #95A4FC; --mint: #BAEDBD; --sky: #B1E3FF; --steel: #A8C5DA;
  --peri: #C6C7F8; --sun: #FFE999; --red: #FF4747; --brand: #f96f4b;
  --side-bg: #171717;
  --r-lg: 16px; --r-md: 12px; --r-sm: 8px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased;
}

/* buttons & fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 500; border: none; cursor: pointer; border-radius: var(--r-sm); }
.btn-primary { background: var(--ink); color: #fff; padding: 10px 16px; font-size: 13px; }
.btn-primary.wide { width: 100%; padding: 12px; font-size: 14px; }
.btn-ghost { background: transparent; color: var(--ink-60); padding: 8px 12px; font-size: 13px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--ink-60); margin-bottom: 6px; font-weight: 500; }
.field input, .field select {
  width: 100%; font: inherit; font-size: 14px; padding: 11px 14px;
  border: 1px solid var(--ink-10); border-radius: var(--r-sm); background: #fff; color: var(--ink); }
.field input::placeholder { color: var(--ink-20); }
.form-error { color: var(--red); font-size: 12.5px; margin: 8px 0 0; min-height: 1.2em; }

/* auth layout (form left, brand panel right) */
.auth { display: flex; flex-direction: row-reverse; min-height: 100vh; }
.auth-side { flex: 0 0 42%; background: var(--card); border-left: 1px solid var(--ink-05);
  padding: 44px; display: flex; flex-direction: column; }
.auth-side .quote { margin-top: auto; font-size: 17px; font-weight: 500;
  letter-spacing: -.01em; line-height: 1.5; max-width: 34ch; }
.auth-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 44px; }
.auth-card { width: 360px; }
.auth-card h1 { font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin: 0 0 6px; }
.auth-card .sub { color: var(--ink-40); font-size: 13.5px; margin: 0 0 26px; }
.auth-alt { margin-top: 18px; text-align: center; font-size: 13px; color: var(--ink-40); }
.auth-alt a { color: var(--ink); font-weight: 500; text-decoration: none; border-bottom: 1px solid var(--ink-20); }
.magic { margin-top: 14px; text-align: center; }
.magic a { font-size: 13px; color: var(--ink-60); text-decoration: none; border-bottom: 1px dashed var(--ink-20); }
.pending-note { background: var(--tile-blue); border-radius: var(--r-md); padding: 12px 14px;
  font-size: 12.5px; color: var(--ink-60); margin-top: 18px; }

/* app shell */
.dash-shell { display: flex; min-height: 100vh; }
.dash-sidebar { flex: 0 0 220px; background: var(--side-bg); padding: 20px 16px;
  display: flex; flex-direction: column; gap: 2px; }
.side-logo { display: block; padding: 4px 10px 20px; color: #fff; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 16px 8px 10px;
  border-top: 1px solid rgba(255,255,255,.08); margin-top: auto; }
.side-user b { font-size: 13.5px; font-weight: 600; display: block; color: #fafafa; }
.side-user span { font-size: 11.5px; color: rgba(255,255,255,.45); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; flex-shrink: 0; }
.side-label { font-size: 11.5px; color: rgba(255,255,255,.38); padding: 14px 10px 6px; }
.side-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px;
  border-radius: var(--r-sm); font-size: 13.5px; color: rgba(255,255,255,.72);
  cursor: pointer; border: none; background: transparent; font: inherit; text-align: left; width: 100%; }
.side-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .75; }
.side-item:hover { background: rgba(255,255,255,.07); }
.side-item[aria-current="page"] { background: rgba(255,255,255,.12); font-weight: 500; color: #fff; }
.side-logout { margin-top: 2px; }
.dash-main { flex: 1; min-width: 0; padding: 24px 28px 40px; }
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.crumb { font-size: 13.5px; color: var(--ink-40); }
.crumb b { color: var(--ink); font-weight: 500; }
.topbar .spacer { flex: 1; }
.client-switch { display: flex; align-items: center; gap: 8px; background: var(--card);
  border: none; font: inherit; border-radius: var(--r-sm); padding: 8px 12px;
  font-size: 13px; font-weight: 500; cursor: pointer; }
.client-logo { height: 16px; width: auto; display: block; }

/* cards, KPIs, tables, pills */
.card { background: var(--card); border-radius: var(--r-lg); padding: 22px; margin-bottom: 16px; }
.card h2 { font-size: 13.5px; font-weight: 600; margin: 0 0 16px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.kpi { border-radius: var(--r-lg); padding: 20px 22px; }
.kpi .k-label { font-size: 13px; font-weight: 500; margin-bottom: 8px; }
.kpi .k-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.kpi .k-num { font-size: 24px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .k-delta { font-size: 12px; }
.k-blue { background: var(--tile-blue); } .k-grey { background: var(--tile-grey); }
.dash-table { width: 100%; border-collapse: collapse; }
.dash-table th { font-size: 11.5px; font-weight: 500; color: var(--ink-40); text-align: left;
  padding: 0 12px 10px; border-bottom: 1px solid var(--ink-10); }
.dash-table td { padding: 13px 12px; border-bottom: 1px solid var(--ink-05); font-size: 13px; vertical-align: middle; }
.dash-table tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px;
  font-weight: 500; padding: 3px 10px; border-radius: 999px; }
.p-high { background: var(--mint); } .p-med { background: var(--sun); }
.p-low, .p-standard { background: var(--tile-grey); color: var(--ink-60); }
.p-pending { background: var(--sun); } .p-approved { background: var(--mint); }
.p-admin { background: var(--peri); } .p-rejected { background: var(--tile-grey); color: var(--ink-60); }

/* kanban + todos */
.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.col { background: var(--card); border-radius: var(--r-lg); padding: 16px; min-height: 120px; }
.col.dragover { outline: 2px dashed var(--ink-20); outline-offset: -6px; }
.col-h { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 13px; font-weight: 600; }
.col-h .count { background: #fff; border-radius: 999px; font-size: 11.5px; padding: 2px 9px;
  color: var(--ink-60); font-weight: 500; }
.kcard { background: #fff; border-radius: var(--r-md); padding: 14px 16px; margin-bottom: 10px;
  box-shadow: 0 1px 2px rgba(28,28,28,.05); cursor: grab; }
.kcard .kt { font-size: 13px; font-weight: 500; line-height: 1.4; }
.kcard .km { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 11px; color: var(--ink-40); }
.kcard .km .mv { margin-left: auto; display: flex; gap: 4px; }
.kcard .km .mv button { border: none; background: var(--card); border-radius: 5px;
  cursor: pointer; font-size: 11px; padding: 2px 7px; color: var(--ink-60); }
.add-card { width: 100%; border: 1px dashed var(--ink-20); background: transparent;
  border-radius: var(--r-md); padding: 10px; font: inherit; font-size: 12.5px;
  color: var(--ink-40); cursor: pointer; }
.todo-item { display: flex; align-items: center; gap: 10px; background: #fff;
  border-radius: var(--r-md); padding: 11px 14px; margin-bottom: 8px; font-size: 13px;
  box-shadow: 0 1px 2px rgba(28,28,28,.05); }
.todo-item.done { color: var(--ink-40); text-decoration: line-through; }
.todo-item .tag { margin-left: auto; font-size: 11px; background: var(--peri);
  border-radius: 999px; padding: 2px 9px; text-decoration: none; }
.check { width: 16px; height: 16px; border: 1.5px solid var(--ink-20); border-radius: 5px;
  flex-shrink: 0; background: transparent; cursor: pointer; padding: 0; }
.check.ok { background: var(--ink); border-color: var(--ink); }
.todo-title { border: none; background: transparent; font: inherit; font-size: 13px;
  color: inherit; text-align: left; cursor: pointer; padding: 0; }
.todo-item.done .todo-title { text-decoration: line-through; }
.todo-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.todo-item[draggable="true"] { cursor: grab; }

/* calendar */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal .dow { font-size: 11px; color: var(--ink-40); text-align: center; padding: 4px 0 8px; }
.day { background: #fff; border-radius: var(--r-sm); min-height: 74px; padding: 8px;
  font-size: 11.5px; color: var(--ink-40); box-shadow: 0 1px 2px rgba(28,28,28,.04); cursor: pointer; }
.day.blank { background: transparent; box-shadow: none; }
.day.today { outline: 2px solid var(--ink); outline-offset: -2px; color: var(--ink); font-weight: 600; }
.day .ev { display: block; margin-top: 6px; font-size: 10.5px; font-weight: 500; color: var(--ink);
  background: var(--sky); border-radius: 5px; padding: 3px 6px; border: none; font: inherit; width: 100%; text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }

/* charts & misc */
.bars { display: flex; align-items: flex-end; gap: 26px; height: 170px; padding: 0 6px; }
.bar-g { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px;
  height: 100%; justify-content: flex-end; }
.bar { width: 26px; border-radius: 6px 6px 4px 4px; }
.bar-g img { height: 14px; max-width: 64px; object-fit: contain; }
.bar-g span { font-size: 11.5px; color: var(--ink-40); }
.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.empty { text-align: center; padding: 44px 20px; color: var(--ink-40); font-size: 13.5px; }
.empty .e-icon { font-size: 22px; opacity: .5; display: block; margin-bottom: 10px; }
.empty .btn-primary { margin-top: 14px; }
.loading { padding: 80px 0; text-align: center; color: var(--ink-40); font-size: 13.5px; }

@media (max-width: 900px) {
  .auth-side { display: none; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .board { grid-template-columns: 1fr; }
}

/* --- UI primitives: modal, drawer, toast, palette, polish --- */
.ui-modal { border: none; border-radius: var(--r-lg); padding: 24px; width: 400px;
  max-width: 92vw; box-shadow: 0 24px 60px -20px rgba(28,28,28,.35); }
.ui-modal::backdrop { background: rgba(28,28,28,.35); }
.ui-modal h2 { font-size: 15px; font-weight: 600; margin: 0 0 16px; }
.ui-modal textarea, .ui-modal select { width: 100%; font: inherit; font-size: 14px;
  padding: 11px 14px; border: 1px solid var(--ink-10); border-radius: var(--r-sm);
  background: #fff; color: var(--ink); resize: vertical; }
.ui-note { font-size: 12px; color: var(--ink-40); margin: -8px 0 14px; }
.ui-check { display: flex; align-items: center; gap: 8px; font-size: 13px;
  margin-bottom: 14px; cursor: pointer; }
.ui-actions { display: flex; gap: 8px; margin-top: 16px; align-items: center; }
.btn-danger { background: transparent; color: var(--red); padding: 8px 12px; font-size: 13px; }
.ui-drawer-wrap { position: fixed; inset: 0; z-index: 40; }
.ui-drawer-overlay { position: absolute; inset: 0; background: rgba(28,28,28,.25); }
.ui-drawer { position: absolute; top: 0; right: 0; bottom: 0; width: 380px; max-width: 92vw;
  background: #fff; box-shadow: -12px 0 40px rgba(28,28,28,.18); padding: 22px;
  display: flex; flex-direction: column; transform: translateX(100%);
  transition: transform .18s ease; }
.ui-drawer-wrap.open .ui-drawer { transform: none; }
.ui-drawer-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.ui-drawer-h h2 { font-size: 15px; font-weight: 600; margin: 0; }
.ui-drawer-body { flex: 1; overflow-y: auto; }
.ui-drawer-body .meta { font-size: 12px; color: var(--ink-40); margin-top: 12px; }
.ui-toast { position: fixed; right: 20px; bottom: 20px; background: var(--ink); color: #fff;
  font-size: 13px; padding: 10px 16px; border-radius: 999px;
  box-shadow: 0 8px 24px rgba(28,28,28,.3); z-index: 60; }
.palette { padding: 10px; width: 480px; }
.palette input { width: 100%; font: inherit; font-size: 14px; padding: 12px 14px;
  border: none; outline: none; border-bottom: 1px solid var(--ink-10);
  border-radius: 0; margin-bottom: 6px; }
.palette-list { max-height: 300px; overflow-y: auto; }
.palette-item { padding: 10px 12px; border-radius: var(--r-sm); font-size: 13.5px;
  cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.palette-item[aria-selected="true"], .palette-item:hover { background: var(--card); }
.palette-meta { font-size: 11px; color: var(--ink-40); }
.palette-empty { padding: 14px; font-size: 13px; color: var(--ink-40); }
.search { display: flex; align-items: center; gap: 8px; background: var(--card);
  border: none; font: inherit; border-radius: var(--r-sm); padding: 8px 12px;
  font-size: 13px; color: var(--ink-40); cursor: pointer; width: 200px; text-align: left; }
.side-item, .btn, .kcard { transition: background .15s ease, color .15s ease,
  box-shadow .15s ease, opacity .15s ease; }
.kcard:hover { box-shadow: 0 4px 12px rgba(28,28,28,.1); }
@media (prefers-reduced-motion: reduce) {
  .side-item, .btn, .kcard, .ui-drawer { transition: none; }
}

/* --- Trello-style card panel, labels, date chips --- */
.ui-cardpanel { width: 420px; }
.cp-labels { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; min-height: 24px; }
.cp-none { font-size: 12px; color: var(--ink-40); }
.cp-label-toggle { padding: 4px 0; font-size: 12.5px; }
.cp-picker { background: var(--card); border-radius: var(--r-md); padding: 10px; margin-top: 8px; }
.cp-pick-row { display: flex; align-items: center; gap: 6px; }
.cp-pick { flex: 1; display: flex; align-items: center; justify-content: space-between;
  border: none; background: transparent; font: inherit; padding: 6px; cursor: pointer;
  border-radius: var(--r-sm); }
.cp-pick:hover { background: #fff; }
.cp-tick { font-size: 12px; color: var(--ink-60); width: 16px; }
.cp-label-del { padding: 4px 8px; font-size: 11px; }
.cp-new { display: flex; align-items: center; gap: 8px; margin-top: 10px;
  border-top: 1px solid var(--ink-10); padding-top: 10px; }
.cp-new-name { flex: 1; font: inherit; font-size: 12.5px; padding: 7px 10px;
  border: 1px solid var(--ink-10); border-radius: var(--r-sm); }
.cp-swatches { display: flex; gap: 4px; }
.cp-swatch { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--ink-10);
  cursor: pointer; padding: 0; }
.card-pills { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.card-pills .pill { font-size: 10px; padding: 2px 8px; }
.date-chip { display: inline-flex; align-items: center; font-size: 10.5px; font-weight: 500;
  background: var(--tile-grey); color: var(--ink-60); border-radius: 5px; padding: 2px 7px; }
.date-chip.overdue { background: rgba(255,71,71,.12); color: var(--red); }
.notes-glyph { font-size: 11px; color: var(--ink-40); }
