/*
 * negotio theme
 * Modelled on the monday.dev board capture (2026-11-24): pale mint chrome around a
 * white work surface, a violet → blue → sky run of stage colours, amber for
 * "pushed", soft grey chips carrying a coloured left bar.
 *
 * Use the tokens, never raw hex, in templates. Every colour token has a dark value.
 */

:root {
  /* Chrome & surfaces */
  --chrome:          #ebf3ef;   /* app frame behind the panels (pale mint-grey) */
  --surface:         #ffffff;   /* sidebar, main panel, cards */
  --surface-sunken:  #f6f7fb;   /* chip fill, table header, input fill */
  --surface-hover:   #dcdfec;
  --surface-selected:#cce5ff;

  /* Text */
  --text:            #323338;   /* headings, card titles */
  --text-muted:      #676879;   /* ids, meta, sidebar items */
  --text-on-accent:  #ffffff;

  /* Lines */
  --border:          #d0d4e4;
  --border-strong:   #c3c6d4;

  /* Accent (links, focus, primary action, "New" badge) */
  --accent:          #0073ea;
  --accent-hover:    #0060b9;
  --accent-soft:     #cce5ff;

  /* Stage run, left → right as on the board */
  --stage-1: #5b3fa0;   /* Backlog      — deep violet  */
  --stage-2: #9d6ddb;   /* In Progress  — lavender     */
  --stage-3: #579bcf;   /* For Review   — steel blue   */
  --stage-4: #8ecbf2;   /* Done         — sky          */
  --stage-5: #a7b3e2;   /* Roadblocked  — periwinkle (muted, empty state) */
  --stage-6: #f3be6b;   /* Pushed       — amber        */
  --on-stage-dark:  #ffffff;   /* text on stage-1..3 */
  --on-stage-light: #1f2a44;   /* text on stage-4..6 (white fails contrast there) */

  /* Chip bars */
  --tag-planned:   #8ecbf2;
  --tag-unplanned: #f3be6b;
  --tag-link:      #c3c6d4;

  /* Status */
  --danger:  #e2445c;   /* notification count, destructive */
  --success: #00c875;
  --warning: #fdab3d;

  /* Avatars */
  --avatar-1: #bb3354;
  --avatar-2: #1f2a44;
  --avatar-3: #5b3fa0;

  /* Shape & type */
  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 12px;
  --shadow-card: 0 1px 2px rgba(15, 20, 45, .06);
  --shadow-pop:  0 6px 20px rgba(15, 20, 45, .14);
  --font: "Figtree", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

/* Dark: same hues, dimmer chrome. Opt in with data-theme="dark" or follow the OS. */
[data-theme="dark"] {
  --chrome:          #181b34;
  --surface:         #292f4c;
  --surface-sunken:  #30324e;
  --surface-hover:   #3a3f63;
  --surface-selected:#133774;
  --text:            #d5d8df;
  --text-muted:      #9699a6;
  --border:          #4b4e69;
  --border-strong:   #5e6283;
  --accent:          #579bfc;
  --accent-hover:    #7bb1fd;
  --accent-soft:     #133774;
  --stage-1: #7a5cc4;
  --stage-2: #a57de0;
  --stage-3: #4a8cc0;
  --stage-4: #5aa9da;
  --stage-5: #7b86b8;
  --stage-6: #d9a24e;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-pop:  0 6px 20px rgba(0, 0, 0, .45);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --chrome:#181b34; --surface:#292f4c; --surface-sunken:#30324e; --surface-hover:#3a3f63;
    --surface-selected:#133774; --text:#d5d8df; --text-muted:#9699a6; --border:#4b4e69;
    --border-strong:#5e6283; --accent:#579bfc; --accent-hover:#7bb1fd; --accent-soft:#133774;
    --stage-1:#7a5cc4; --stage-2:#a57de0; --stage-3:#4a8cc0; --stage-4:#5aa9da;
    --stage-5:#7b86b8; --stage-6:#d9a24e;
    --shadow-card:0 1px 2px rgba(0,0,0,.3); --shadow-pop:0 6px 20px rgba(0,0,0,.45);
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--chrome); color: var(--text); font: 14px/1.45 var(--font); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 500; color: var(--text); }
h1 { font-size: 28px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--text-muted); }

/* ---------- Shell: top bar, sidebar, main panel ---------- */
.shell { display: grid; grid-template-rows: 52px 1fr; grid-template-columns: 264px 1fr; height: 100vh; }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; padding: 0 20px; }
.topbar .brand { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 700; color: var(--text); }

/* ---------- Icons: stroke-only, one weight, inherit text colour ---------- */
.i { flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.iconed { display: inline-flex; align-items: center; gap: 4px; }
.topbar .actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.sidebar { background: var(--surface); margin: 0 8px 12px 12px; border-radius: var(--radius-lg); padding: 12px 8px; overflow: auto; }
.sidebar .section { margin: 16px 12px 6px; font-size: 13px; font-weight: 600; color: var(--text); }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: var(--radius-sm); color: var(--text); border: 1px solid transparent; }
.nav-item:hover { background: var(--surface-hover); text-decoration: none; }
.nav-item[aria-current="page"] { background: var(--surface-selected); border-color: var(--accent); }
.nav-item .i { color: var(--text-muted); }

.main { background: var(--surface); margin: 0 12px 12px 0; border-radius: var(--radius-lg); overflow: auto; display: flex; flex-direction: column; }
.page-head { padding: 20px 32px 0; }
.page-head h1 { display: flex; align-items: center; gap: 8px; }
.page-body { padding: 16px 32px 32px; }

/* ---------- Tabs (view switcher under the title) ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-top: 12px; }
.tab { padding: 8px 12px; color: var(--text); border-bottom: 2px solid transparent; }
.tab:hover { background: var(--surface-hover); border-radius: var(--radius-sm) var(--radius-sm) 0 0; text-decoration: none; }
.tab[aria-selected="true"] { border-bottom-color: var(--accent); }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; align-items: center; gap: 8px; padding: 12px 0; }
.toolbar .spacer { flex: 1; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--radius-sm);
       border: 1px solid transparent; background: transparent; color: var(--text); font: inherit; cursor: pointer; }
.btn:hover { background: var(--surface-hover); text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--text-on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { border-color: var(--border); }
.btn-soft { background: var(--accent-soft); color: var(--text); }
.btn-danger { background: var(--danger); color: var(--text-on-accent); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- Inputs ---------- */
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 13px; color: var(--text-muted); }
.input, select.input, textarea.input { height: 32px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; }
textarea.input { height: auto; padding: 8px 10px; }
.input:hover { border-color: var(--text-muted); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

/* ---------- Badges & chips ---------- */
.badge { display: inline-flex; align-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
         font-size: 11px; font-weight: 600; background: var(--danger); color: var(--text-on-accent); justify-content: center; }
.badge-new { background: transparent; color: var(--accent); border: 1px solid var(--accent); border-radius: var(--radius-sm); font-weight: 400; }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px 0 6px; border-radius: var(--radius-sm);
        background: var(--surface-sunken); color: var(--text); font-size: 14px; white-space: nowrap; max-width: 100%;
        overflow: hidden; text-overflow: ellipsis; border-left: 3px solid var(--chip-bar, var(--tag-link)); }
.chip-1 { --chip-bar: var(--stage-1); } .chip-2 { --chip-bar: var(--stage-2); } .chip-3 { --chip-bar: var(--stage-3); }
.chip-4 { --chip-bar: var(--stage-4); } .chip-5 { --chip-bar: var(--stage-5); } .chip-6 { --chip-bar: var(--stage-6); }
.chip-planned { --chip-bar: var(--tag-planned); } .chip-unplanned { --chip-bar: var(--tag-unplanned); }
.chip-link { border-left: 0; padding-left: 8px; }
.chip-link::before { content: "↗"; color: var(--text-muted); }

/* ---------- Avatars ---------- */
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%;
          font-size: 12px; font-weight: 600; color: var(--text-on-accent); background: var(--avatar-1); }
.avatar-2 { background: var(--avatar-2); } .avatar-3 { background: var(--avatar-3); }

/* ---------- Board (kanban) ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: 280px; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.column { display: flex; flex-direction: column; border-radius: var(--radius); min-height: 320px;
          background: color-mix(in srgb, var(--col) 9%, var(--surface)); }
.column-head { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px; border-radius: var(--radius) var(--radius) 0 0;
               background: var(--col); color: var(--col-text); font-weight: 600; font-size: 16px; }
.column-head .count { font-weight: 400; opacity: .9; font-size: 14px; }
.column-body { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
.column-add { color: var(--text-muted); padding: 4px 6px; }
.col-1 { --col: var(--stage-1); --col-text: var(--on-stage-dark); }
.col-2 { --col: var(--stage-2); --col-text: var(--on-stage-dark); }
.col-3 { --col: var(--stage-3); --col-text: var(--on-stage-dark); }
.col-4 { --col: var(--stage-4); --col-text: var(--on-stage-light); }
.col-5 { --col: var(--stage-5); --col-text: var(--on-stage-light); }
.col-6 { --col: var(--stage-6); --col-text: var(--on-stage-light); }

/* ---------- Card ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-card);
        padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-pop); }
.card .ref { color: var(--text-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.card .title { color: var(--text); }
.card .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.card .foot { display: flex; align-items: center; gap: 12px; margin-top: 4px; color: var(--text-muted); }
.card .foot .meta { margin-left: auto; display: flex; gap: 12px; }

/* ---------- Table ---------- */
.table { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.table th { background: var(--surface-sunken); color: var(--text-muted); font-weight: 500; text-align: left; font-size: 13px; }
.table th, .table td { padding: 8px 12px; border-bottom: 1px solid var(--border); }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-hover); }
.table td.status { padding: 0; text-align: center; color: var(--col-text); background: var(--col); }

/* ---------- Ask bar (floating) ---------- */
.ask { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px;
       padding: 10px 18px; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow-pop); color: var(--text-muted); }

/* ---------- Swatches (styleguide only) ---------- */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.swatch { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.swatch .fill { height: 56px; background: var(--sw); }
.swatch .name { padding: 6px 10px; font-size: 13px; }
.stack { display: flex; flex-direction: column; gap: 32px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* ---------- Sign-in ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop);
              padding: 32px; display: flex; flex-direction: column; gap: 20px; }
.login-card .brand { display: flex; align-items: center; gap: 12px; font-size: 26px; font-weight: 700; color: var(--text); }
.login-sso { justify-content: center; height: 40px; }
.login-local summary { cursor: pointer; margin-bottom: 12px; }
.login-error { margin: 0; padding: 8px 12px; border-radius: var(--radius-sm); border-left: 3px solid var(--danger);
               background: color-mix(in srgb, var(--danger) 10%, var(--surface)); }

/* ---------- Notices (flash messages) ---------- */
.notice { margin: 0; padding: 8px 12px; border-radius: var(--radius-sm); border-left: 3px solid var(--accent);
          background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.notice-error { border-left-color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, var(--surface)); }
.notice-success { border-left-color: var(--success); background: color-mix(in srgb, var(--success) 10%, var(--surface)); }
