/* PubliKrea Hub design system — employee workspace, admin and sign-in pages.
   Three layers: calm opaque content, a floating glass navigation, and glass
   control capsules. Glass is only for navigation and controls, never content.
   Orange (--work) is the brand and "the clock is running"; amber (--xp) means
   progress and rewards; status colours are reserved for state, never decoration. */

:root {
  /* Neutrals: warm stone, never blue-grey */
  --ground: #f8f4ef;
  --surface: #fffdfa;
  --surface-2: #fbf7f2;
  --surface-3: #f2ebe3;
  --ink: #221913;
  --ink-2: #4a3f37;
  --muted: #7d7067;
  --faint: #968a7e;
  --line: rgba(31, 23, 18, .08);
  --line-2: rgba(31, 23, 18, .15);
  /* Brand: PubliKrea orange. --work-ink is the text-safe shade for small type */
  --work: #ff5a1f;
  --work-2: #ff9259;
  --work-ink: #c93c0a;
  --work-soft: rgba(255, 90, 31, .1);
  /* Progress & rewards: honey amber, distinct from the brand orange */
  --xp: #e08a00;
  --xp-2: #ffc24b;
  --xp-soft: rgba(224, 138, 0, .12);
  --xp-ink: #9a5b00;
  --gold: #8a6400;
  --gold-soft: rgba(214, 160, 20, .15);
  /* Status */
  --ok: #267a43; --ok-soft: rgba(45, 143, 78, .1);
  --warn: #a85400; --warn-soft: rgba(214, 138, 20, .13);
  --crit: #c62f3f; --crit-soft: rgba(198, 47, 63, .09);
  --info: #0b7468; --info-soft: rgba(14, 147, 132, .1);
  /* Complement: lagoon teal — people, calm and information. Sparingly. */
  --cool: #0e9384;
  --cool-2: #4cc9b8;
  --cool-ink: #0b7468;
  --cool-soft: rgba(14, 147, 132, .1);
  /* Smooth multi-stop gradients (upgraded to oklch below where supported) */
  --grad-work: linear-gradient(125deg, #ff4d1a 0%, #ff6a2e 35%, #ff8a4a 70%, #ffa468 100%);
  --grad-xp: linear-gradient(90deg, #e8890a 0%, #f5a524 50%, #ffc95e 100%);
  --grad-cool: linear-gradient(125deg, #0b8a7d 0%, #16a697 50%, #4cc9b8 100%);
  --grad-ribbon: linear-gradient(90deg, #ff5a1f 0%, #ff8a4a 30%, #f5b041 55%, #7fcfae 80%, #1aa593 100%);  /* Ambient + materials */
  --orb-a: rgba(255, 110, 40, .20);
  --orb-b: rgba(255, 178, 120, .22);
  --orb-c: rgba(40, 190, 170, .10);
  --orb-work: rgba(255, 100, 40, .28);
  --glass: rgba(255, 252, 248, .6);
  --glass-strong: rgba(255, 253, 250, .82);
  --glass-edge: rgba(255, 255, 255, .8);
  --glass-rim: rgba(31, 23, 18, .06);
  --glass-tint: linear-gradient(160deg, rgba(255,255,255,.55) 0%, rgba(255,255,255,.08) 38%, rgba(255,150,90,.08) 100%);
  --glass-spec: rgba(255,255,255,.55);
  --night: rgba(26, 17, 11, .93);
  --scrim: rgba(31, 18, 8, .38);
  --shadow-card: 0 1px 2px rgba(50, 28, 14, .04), 0 8px 24px -12px rgba(50, 28, 14, .12);
  --shadow-hero: 0 1px 2px rgba(50, 28, 14, .05), 0 24px 48px -24px rgba(90, 44, 14, .24);
  --shadow-glass: 0 1px 0 rgba(255,255,255,.7) inset, 0 0 0 1px var(--glass-rim), 0 12px 32px -12px rgba(90, 44, 14, .22);
  --shadow-pop: 0 24px 60px -18px rgba(50, 26, 10, .35), 0 0 0 1px var(--line);
  --shadow-nav: 0 4px 12px -6px rgba(90, 44, 14, .25);
  --display: "Bricolage Grotesque", "Geist", ui-sans-serif, system-ui, sans-serif;
  --ui: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Noto Sans Bengali", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --r-sm: 10px; --r: 14px; --r-lg: 20px; --r-xl: 22px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #110d0a; --surface: #1b1612; --surface-2: #221c17; --surface-3: #2b231d;
    --ink: #f7efe7; --ink-2: #dccfc3; --muted: #a69789; --faint: #726458;
    --line: rgba(255,240,225,.07); --line-2: rgba(255,240,225,.13);
    --work: #ff6a2b; --work-2: #ff9a62; --work-ink: #ff8a4c; --work-soft: rgba(255,106,43,.15);
    --xp: #ffb02e; --xp-2: #ffd27a; --xp-soft: rgba(255,176,46,.14); --xp-ink: #ffb02e;
    --gold: #f0c24f; --gold-soft: rgba(240,194,79,.14);
    --ok: #5cc98a; --ok-soft: rgba(86,201,138,.12);
    --warn: #f2a93b; --warn-soft: rgba(242,169,59,.12);
    --crit: #ff6d7c; --crit-soft: rgba(255,109,124,.12);
    --info: #5fd6c6; --info-soft: rgba(62,200,182,.13);
    --cool: #3ec8b6; --cool-2: #7fe3d3; --cool-ink: #5fd6c6; --cool-soft: rgba(62,200,182,.13);
    --orb-a: rgba(255,110,40,.16); --orb-b: rgba(255,150,90,.11); --orb-c: rgba(40,190,170,.07); --orb-work: rgba(255,100,40,.24);
    --glass: rgba(40, 32, 26, .56); --glass-strong: rgba(48, 39, 32, .84);
    --glass-edge: rgba(255,255,255,.12); --glass-rim: rgba(255,240,225,.07);
    --glass-tint: linear-gradient(160deg, rgba(255,255,255,.09) 0%, rgba(255,255,255,0) 40%, rgba(255,140,80,.06) 100%);
    --glass-spec: rgba(255,255,255,.10);
    --night: rgba(14, 9, 6, .94); --scrim: rgba(0, 0, 0, .5);
    --shadow-card: 0 1px 0 rgba(255,255,255,.03) inset, 0 8px 24px -14px rgba(0,0,0,.6);
    --shadow-hero: 0 1px 0 rgba(255,255,255,.04) inset, 0 28px 56px -28px rgba(0,0,0,.8);
    --shadow-glass: 0 1px 0 rgba(255,255,255,.1) inset, 0 0 0 1px var(--glass-rim), 0 16px 40px -14px rgba(0,0,0,.7);
    --shadow-pop: 0 24px 60px -18px rgba(0,0,0,.8), 0 0 0 1px var(--line-2);
    --shadow-nav: 0 4px 12px -6px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #110d0a; --surface: #1b1612; --surface-2: #221c17; --surface-3: #2b231d;
  --ink: #f7efe7; --ink-2: #dccfc3; --muted: #a69789; --faint: #726458;
  --line: rgba(255,240,225,.07); --line-2: rgba(255,240,225,.13);
  --work: #ff6a2b; --work-2: #ff9a62; --work-ink: #ff8a4c; --work-soft: rgba(255,106,43,.15);
  --xp: #ffb02e; --xp-2: #ffd27a; --xp-soft: rgba(255,176,46,.14); --xp-ink: #ffb02e;
  --gold: #f0c24f; --gold-soft: rgba(240,194,79,.14);
  --ok: #5cc98a; --ok-soft: rgba(86,201,138,.12);
  --warn: #f2a93b; --warn-soft: rgba(242,169,59,.12);
  --crit: #ff6d7c; --crit-soft: rgba(255,109,124,.12);
  --info: #5fd6c6; --info-soft: rgba(62,200,182,.13);
  --cool: #3ec8b6; --cool-2: #7fe3d3; --cool-ink: #5fd6c6; --cool-soft: rgba(62,200,182,.13);
  --orb-a: rgba(255,110,40,.16); --orb-b: rgba(255,150,90,.11); --orb-c: rgba(40,190,170,.07); --orb-work: rgba(255,100,40,.24);
  --glass: rgba(40, 32, 26, .56); --glass-strong: rgba(48, 39, 32, .84);
  --glass-edge: rgba(255,255,255,.12); --glass-rim: rgba(255,240,225,.07);
  --glass-tint: linear-gradient(160deg, rgba(255,255,255,.09) 0%, rgba(255,255,255,0) 40%, rgba(255,140,80,.06) 100%);
  --glass-spec: rgba(255,255,255,.10);
  --night: rgba(14, 9, 6, .94); --scrim: rgba(0, 0, 0, .5);
  --shadow-card: 0 1px 0 rgba(255,255,255,.03) inset, 0 8px 24px -14px rgba(0,0,0,.6);
  --shadow-hero: 0 1px 0 rgba(255,255,255,.04) inset, 0 28px 56px -28px rgba(0,0,0,.8);
  --shadow-glass: 0 1px 0 rgba(255,255,255,.1) inset, 0 0 0 1px var(--glass-rim), 0 16px 40px -14px rgba(0,0,0,.7);
  --shadow-pop: 0 24px 60px -18px rgba(0,0,0,.8), 0 0 0 1px var(--line-2);
  --shadow-nav: 0 4px 12px -6px rgba(0,0,0,.5);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 14px/1.5 var(--ui); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--work-ink); }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--work); outline-offset: 2px; border-radius: 10px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.nowrap { white-space: nowrap; }

/* ---------- living ambient ---------- */
.ambient { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.orb { position: absolute; border-radius: 50%; filter: blur(70px); transition: background 2.4s ease; }
.orb.a { width: 680px; height: 540px; left: -140px; top: -180px; background: radial-gradient(closest-side, var(--orb-a), transparent); animation: drift-a 46s ease-in-out infinite alternate; }
.orb.b { width: 780px; height: 620px; right: -200px; top: 260px; background: radial-gradient(closest-side, var(--orb-b), transparent); animation: drift-b 58s ease-in-out infinite alternate; }
.orb.c { width: 520px; height: 420px; left: 34%; bottom: -220px; background: radial-gradient(closest-side, var(--orb-c), transparent); animation: drift-c 52s ease-in-out infinite alternate; }
body.working .orb.b { background: radial-gradient(closest-side, var(--orb-work), transparent); }
@keyframes drift-a { to { transform: translate(120px, 90px) scale(1.12); } }
@keyframes drift-b { to { transform: translate(-140px, -60px) scale(.92); } }
@keyframes drift-c { to { transform: translate(-90px, -120px) scale(1.18); } }

/* ---------- glass material ---------- */
.glass { position: relative; background: var(--glass); -webkit-backdrop-filter: blur(22px) saturate(170%); backdrop-filter: blur(22px) saturate(170%); box-shadow: var(--shadow-glass); isolation: isolate; --mx: 30%; --my: 0%; }
.glass::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1; background: radial-gradient(240px circle at var(--mx) var(--my), var(--glass-spec), transparent 60%), var(--glass-tint); }
.glass::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; border: 1px solid var(--glass-edge); -webkit-mask: linear-gradient(180deg, #000 0%, transparent 55%); mask: linear-gradient(180deg, #000 0%, transparent 55%); }

/* ---------- floating sidebar ---------- */
.sidebar { position: fixed; z-index: 30; top: 16px; bottom: 16px; left: 16px; width: 232px; border-radius: var(--r-xl); padding: 18px 12px 14px; display: flex; flex-direction: column; gap: 20px; overflow-y: auto; scrollbar-width: none; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 10px; text-decoration: none; color: inherit; }
.brand img.mark { width: 30px; height: 30px; object-fit: contain; filter: drop-shadow(0 2px 6px rgba(255,90,31,.4)); flex-shrink: 0; }
.brand-name { font: 600 15px/1.1 var(--display); letter-spacing: -.01em; }
.brand-name small { display: block; font: 500 10.5px/1.3 var(--ui); color: var(--muted); letter-spacing: .06em; text-transform: uppercase; margin-top: 2px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font: 500 10.5px/1 var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 8px 12px; }
.nav a, .nav button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border: 0; border-radius: 12px; background: transparent; color: var(--ink-2); font-weight: 500; font-size: 13.5px; cursor: pointer; text-align: left; text-decoration: none; transition: background .2s ease, color .2s ease; }
.nav a:hover, .nav button:hover { background: rgba(255, 122, 51, .08); color: var(--ink); }
.nav [aria-current="page"] { background: var(--glass-strong); color: var(--ink); box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 0 0 1px var(--glass-rim), var(--shadow-nav); }
.nav svg { color: var(--work-2); opacity: .8; transition: opacity .2s ease, color .2s ease; }
.nav a:hover svg, .nav button:hover svg { opacity: 1; }
.nav [aria-current="page"] svg { color: var(--work); opacity: 1; }
.nav .count { margin-left: auto; font: 500 11px/1 var(--mono); color: var(--muted); }
.nav .count.hot { color: #fff; background: var(--work); border-radius: 999px; padding: 3px 6px; }
.side-card { border-radius: 16px; padding: 12px; background: rgba(255, 122, 51, .07); border: 1px solid var(--line); }
.side-card .k { font: 500 10.5px/1 var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); display: flex; align-items: center; gap: 6px; }
.side-card .v { font-size: 12px; color: var(--muted); margin-top: 6px; }
.side-card .v b { color: var(--ink); font-weight: 600; }
.beat { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); animation: beat 1.8s ease-in-out infinite; }
@keyframes beat { 0%, 100% { box-shadow: 0 0 0 0 rgba(86,201,138,.5); } 50% { box-shadow: 0 0 0 5px rgba(86,201,138,0); } }
.sidebar .foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }

/* ---------- control capsules ---------- */
.controls { position: fixed; z-index: 40; top: 16px; right: 24px; display: flex; align-items: center; gap: 10px; }
.capsule { height: 44px; border-radius: 999px; border: 0; display: inline-flex; align-items: center; gap: 10px; padding: 0 16px; cursor: pointer; color: var(--ink-2); white-space: nowrap; transition: transform .25s cubic-bezier(.2,.8,.2,1); text-decoration: none; }
.capsule:hover { transform: translateY(-1px); }
.capsule.icon { width: 44px; padding: 0; justify-content: center; }
.capsule .dot-badge { position: absolute; top: 9px; right: 9px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--work); color: #fff; font: 600 10px/16px var(--mono); text-align: center; box-shadow: 0 0 0 2px var(--glass-strong); }
.capsule.streak { padding: 0 14px 0 10px; gap: 8px; font: 500 13px/1 var(--ui); color: var(--ink); }
.flame { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: radial-gradient(circle at 50% 70%, #ffb347, #ff5a1f); animation: flicker 2.6s ease-in-out infinite; }
.flame svg { width: 13px; height: 13px; stroke-width: 2; }
.capsule.streak.cold .flame { background: var(--surface-3); color: var(--faint); animation: none; }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(0); } 40% { transform: scale(1.08) rotate(-4deg); } 70% { transform: scale(.96) rotate(3deg); } }
.capsule.me { padding: 0 14px 0 5px; gap: 10px; }
.lvl-avatar { position: relative; width: 36px; height: 36px; flex-shrink: 0; }
.lvl-avatar svg { position: absolute; inset: 0; width: 36px; height: 36px; transform: rotate(-90deg); }
.lvl-avatar circle { fill: none; stroke-width: 2.5; }
.lvl-avatar .bg { stroke: var(--line-2); }
.lvl-avatar .fg { stroke: url(#xpGrad); stroke-linecap: round; transition: stroke-dashoffset 1.2s cubic-bezier(.2,.8,.2,1); }
.avatar { display: grid; place-items: center; border-radius: 50%; color: #fff; font: 600 11px/1 var(--ui); background: linear-gradient(135deg, var(--work), var(--work-2)); flex-shrink: 0; }
.lvl-avatar .avatar { position: absolute; inset: 5px; }
.capsule.me .who { display: flex; flex-direction: column; gap: 3px; text-align: left; }
.capsule.me .who b { font: 600 13px/1 var(--ui); color: var(--ink); }
.capsule.me .who span { font: 500 11px/1 var(--mono); color: var(--xp-ink); }
.capsule.timer { color: var(--ink); padding: 0 6px 0 14px; gap: 10px; animation: capsuleIn .5s cubic-bezier(.2,.9,.2,1.1) both; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--work); box-shadow: 0 0 0 4px var(--work-soft); animation: breathe 2s ease-in-out infinite; flex-shrink: 0; }
.capsule.timer.paused .live-dot { animation: none; background: var(--faint); box-shadow: none; }
.capsule.timer .t-task { font-size: 12.5px; color: var(--muted); max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
.capsule.timer .t-time { font: 500 14px/1 var(--mono); font-variant-numeric: tabular-nums; }
.round-btn { width: 32px; height: 32px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; background: var(--work-soft); color: var(--work-ink); flex-shrink: 0; }
.round-btn svg { width: 15px; height: 15px; }
@keyframes capsuleIn { from { opacity: 0; transform: translateY(-8px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes breathe { 50% { box-shadow: 0 0 0 7px transparent; } }

/* ---------- stage + layout ---------- */
.stage { position: relative; z-index: 1; margin-left: 264px; padding: 92px 40px 64px 32px; max-width: 1200px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin: 14px 0 26px; }
.eyebrow { font: 500 11px/1 var(--ui); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.h-display { font: 500 44px/1.05 var(--display); letter-spacing: -.025em; margin: 12px 0 8px; text-wrap: balance; }
.h-page { font: 500 32px/1.1 var(--display); letter-spacing: -.02em; margin: 0 0 6px; text-wrap: balance; }
.sub { color: var(--muted); font-size: 15px; margin: 0; }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px; }
.c3 { grid-column: span 3; } .c4 { grid-column: span 4; } .c5 { grid-column: span 5; } .c6 { grid-column: span 6; }
.c7 { grid-column: span 7; } .c8 { grid-column: span 8; } .c12 { grid-column: span 12; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 36px 0 14px; flex-wrap: wrap; }
.section-head h2 { font: 500 23px/1.15 var(--display); letter-spacing: -.015em; margin: 0; }
.section-head p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }

.panel { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-card); border: 1px solid var(--line); padding: 22px; min-width: 0; }
.panel.flat { box-shadow: none; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head h2, .panel-head h3 { font: 600 15px/1.2 var(--ui); margin: 0; }
.panel-head .aside { font-size: 12.5px; color: var(--muted); }
.empty { padding: 26px 8px; text-align: center; color: var(--muted); font-size: 13.5px; }
.empty svg { width: 28px; height: 28px; color: var(--faint); display: block; margin: 0 auto 10px; }
.divider { height: 1px; background: var(--line); margin: 16px 0; border: 0; }

/* ---------- buttons ---------- */
.btn { height: 40px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; font-weight: 500; font-size: 13.5px; text-decoration: none; white-space: nowrap; transition: background .2s ease, border-color .2s ease, transform .15s ease, box-shadow .2s ease; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 10px; }
.btn.lg { height: 48px; padding: 0 20px; font-size: 14.5px; border-radius: 14px; }
.btn.primary { border: 0; color: #fff; background: linear-gradient(120deg, var(--work), var(--work-2)); box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 10px 24px -12px rgba(255, 90, 31, .7); font-weight: 600; }
.btn.primary:hover { box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 14px 30px -12px rgba(255, 90, 31, .85); }
.btn.violet { border: 0; color: #fff; background: linear-gradient(120deg, var(--xp), var(--xp-2)); font-weight: 600; box-shadow: 0 10px 24px -14px rgba(224,138,0,.75); }
.btn.success { border: 0; color: #fff; background: var(--ok); font-weight: 600; }
.btn.danger { border-color: transparent; color: var(--crit); background: var(--crit-soft); font-weight: 600; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn svg { width: 16px; height: 16px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--info); font-size: 12.5px; font-weight: 500; cursor: pointer; text-decoration: none; }

/* ---------- chips, pills, badges ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font: 500 12px/1.2 var(--ui); white-space: nowrap; }
.chip .pip { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.crit { background: var(--crit-soft); color: var(--crit); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.info { background: var(--info-soft); color: var(--info); }
.chip.xp { background: var(--xp-soft); color: var(--xp-ink); }
.chip.work { background: var(--work-soft); color: var(--work-ink); }
.chip.gold { background: var(--gold-soft); color: var(--gold); }
.chip.plain { background: var(--surface-2); color: var(--muted); }
.xp-pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; background: var(--xp-soft); color: var(--xp-ink); font: 600 11.5px/1 var(--mono); white-space: nowrap; }
.xp-pill.gold { background: var(--gold-soft); color: var(--gold); }
.coin { display: inline-block; width: 15px; height: 15px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3c4, #f4cf63 40%, #c98f0f); box-shadow: 0 0 0 1px rgba(150,100,0,.3) inset; flex-shrink: 0; vertical-align: -3px; }
.coins { display: inline-flex; align-items: center; gap: 6px; font: 600 13px/1 var(--mono); color: var(--gold); }
.proj-dot { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; display: inline-block; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 11.5px; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); font-size: 14px; transition: border-color .2s ease, box-shadow .2s ease; }
textarea.input { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:focus { outline: none; border-color: var(--xp); box-shadow: 0 0 0 3px var(--xp-soft); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--xp); width: 16px; height: 16px; }
.msg { padding: 10px 12px; border-radius: 12px; font-size: 13px; }
.msg.err { background: var(--crit-soft); color: var(--crit); }
.msg.ok { background: var(--ok-soft); color: var(--ok); }
.msg.warn { background: var(--warn-soft); color: var(--warn); }
.msg.info { background: var(--info-soft); color: var(--info); }
.file-drop { border: 1.5px dashed var(--line-2); border-radius: 14px; padding: 16px; text-align: center; color: var(--muted); font-size: 13px; cursor: pointer; transition: border-color .2s ease, background .2s ease; display: block; }
.file-drop:hover, .file-drop.drag { border-color: var(--xp); background: var(--xp-soft); color: var(--ink-2); }
.file-drop input { display: none; }
.file-drop img { max-height: 120px; border-radius: 10px; margin-top: 8px; }

/* ---------- progress ---------- */
.track { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; box-shadow: 0 0 0 1px var(--line) inset; }
.fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--xp), var(--xp-2)); transition: width 1s cubic-bezier(.2,.8,.2,1); position: relative; overflow: hidden; }
.fill::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent); transform: translateX(-100%); animation: sheen 3.8s ease-in-out infinite; }
.fill.ok { background: linear-gradient(90deg, #1e7f4a, #56c98a); }
.fill.work { background: linear-gradient(90deg, var(--work), var(--work-2)); }
@keyframes sheen { 60%, 100% { transform: translateX(100%); } }
.segs { display: grid; gap: 4px; }
.segs i { height: 7px; border-radius: 3px; background: var(--surface-2); box-shadow: 0 0 0 1px var(--line) inset; transition: background .5s ease; }
.segs i.on { background: linear-gradient(90deg, var(--xp), var(--xp-2)); box-shadow: none; }
.segs.ok i.on { background: linear-gradient(90deg, #1e7f4a, #56c98a); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-card); }
table.table { width: 100%; border-collapse: collapse; min-width: 640px; }
.table th, .table td { text-align: left; padding: 12px 16px; font-size: 13px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font: 600 11px/1 var(--ui); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .15s ease; }
.table tbody tr:hover { background: var(--surface-2); }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person .avatar { width: 32px; height: 32px; font-size: 11px; }
.person .n { font-weight: 600; font-size: 13.5px; }
.person .s { font-size: 12px; color: var(--muted); }

/* ---------- drawer + modal ---------- */
.scrim { position: fixed; inset: 0; z-index: 80; background: var(--scrim); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); opacity: 0; transition: opacity .25s ease; }
.scrim.on { opacity: 1; }
.drawer { position: fixed; z-index: 81; top: 12px; right: 12px; bottom: 12px; width: min(520px, calc(100vw - 24px)); background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-pop); display: flex; flex-direction: column; transform: translateX(110%); transition: transform .38s cubic-bezier(.2,.8,.2,1); }
.drawer.on { transform: none; }
.drawer-head { display: flex; align-items: center; gap: 12px; padding: 20px 22px 14px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font: 500 21px/1.2 var(--display); margin: 0; letter-spacing: -.01em; }
.drawer-body { padding: 18px 22px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 14px; }
.drawer-foot { padding: 14px 22px 18px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.modal { position: fixed; z-index: 81; left: 50%; top: 50%; width: min(460px, calc(100vw - 32px)); transform: translate(-50%, -46%) scale(.97); opacity: 0; background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-pop); padding: 22px; transition: transform .3s cubic-bezier(.2,.9,.25,1.2), opacity .2s ease; }
.modal.on { transform: translate(-50%, -50%); opacity: 1; }
.modal h2 { font: 500 20px/1.2 var(--display); margin: 0 0 8px; }
.modal p { color: var(--muted); margin: 0 0 16px; }
.x-btn { margin-left: auto; width: 34px; height: 34px; border-radius: 10px; border: 0; background: var(--surface-2); display: grid; place-items: center; cursor: pointer; color: var(--muted); }

/* ---------- toasts + notifications popover ---------- */
.toasts { position: fixed; z-index: 120; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { padding: 11px 18px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--ink); animation: toastIn .35s cubic-bezier(.2,.9,.25,1.2) both; max-width: min(520px, calc(100vw - 32px)); text-align: center; }
.toast.err { color: var(--crit); }
.toast.out { animation: toastOut .3s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }
.popover { position: fixed; z-index: 70; top: 68px; right: 24px; width: min(380px, calc(100vw - 32px)); max-height: min(560px, calc(100vh - 100px)); overflow-y: auto; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-pop); padding: 8px; animation: capsuleIn .25s ease both; }
.popover-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 8px; }
.popover-head b { font: 600 14px/1 var(--ui); }
.notif { display: grid; grid-template-columns: 32px 1fr; gap: 12px; padding: 10px 12px; border-radius: 12px; text-decoration: none; color: inherit; cursor: pointer; border: 0; background: none; width: 100%; text-align: left; }
.notif:hover { background: var(--surface-2); }
.notif.unread { background: var(--xp-soft); }
.notif .ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.notif .ic svg { width: 16px; height: 16px; }
.notif .t { font-size: 13px; font-weight: 600; line-height: 1.35; }
.notif .b { font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.notif .when { font: 500 11px/1 var(--mono); color: var(--faint); margin-top: 6px; }

/* ---------- auth pages ---------- */
body.auth { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px 16px; }
.auth-card { position: relative; z-index: 1; width: 100%; max-width: 420px; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 22px; }
.auth-brand img.mark { width: 34px; height: 34px; filter: drop-shadow(0 2px 8px rgba(255,90,31,.45)); }
.auth-brand img.word { height: 20px; }
:root[data-theme="dark"] .auth-brand img.word, .dark-word { filter: none; }
.auth-panel { border-radius: 24px; padding: 32px 30px; }
.auth-panel h1 { font: 500 26px/1.15 var(--display); letter-spacing: -.02em; margin: 0 0 6px; }
.auth-panel p.sub { font-size: 14px; margin-bottom: 22px; }
.auth-panel form { display: flex; flex-direction: column; gap: 14px; }
.auth-panel .btn.primary { width: 100%; margin-top: 6px; }
.auth-foot { text-align: center; font-size: 12.5px; color: var(--muted); margin-top: 18px; }
.who-card { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: var(--surface-2); border-radius: 12px; font-size: 13px; color: var(--muted); }
.who-card b { color: var(--ink); font-size: 14px; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .c3, .c4, .c5, .c7, .c8 { grid-column: span 12; }
  .c6 { grid-column: span 12; }
}
@media (min-width: 1281px) and (max-width: 1400px) { .c3 { grid-column: span 6; } }
@media (max-width: 1080px) {
  .sidebar { width: 72px; padding: 16px 10px; align-items: center; }
  .brand-name, .nav-label, .nav .lbl, .nav .count, .side-card, .sidebar .foot .lbl { display: none; }
  .brand { padding: 0; }
  .nav a, .nav button { justify-content: center; padding: 11px; }
  .stage { margin-left: 104px; padding-right: 24px; }
  .capsule.search .lbl, .capsule.search kbd { display: none; }
  .capsule.search { width: 44px; padding: 0; justify-content: center; }
  .capsule.timer .t-task { display: none; }
}
@media (max-width: 720px) {
  .sidebar { top: auto; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); left: 12px; right: 12px; width: auto; height: 64px; flex-direction: row; padding: 8px; gap: 0; overflow-x: auto; overflow-y: hidden; }
  .brand, .sidebar .foot { display: none; }
  .nav { flex-direction: row; width: 100%; justify-content: space-between; gap: 0; }
  .nav-label { display: none; }
  .nav a, .nav button { padding: 12px; width: auto; }
  .controls { left: 12px; right: 12px; top: calc(12px + env(safe-area-inset-top, 0px)); justify-content: flex-end; gap: 8px; }
  .capsule.me .who, .capsule.streak .st-lbl { display: none; }
  .capsule.me { padding: 0 5px; }
  .capsule.timer .t-task { display: none; }
  .stage { margin-left: 0; padding: 76px 16px 104px; }
  .h-display { font-size: 32px; }
  .h-page { font-size: 26px; }
  .form-grid { grid-template-columns: 1fr; }
  .popover { right: 12px; left: 12px; width: auto; }
  .drawer { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 92vh; transform: translateY(110%); }
  .drawer.on { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
.hidden { display: none !important; }

/* ---------- Sunset & Lagoon: smooth gradients + the teal complement ---------- */
@supports (background: linear-gradient(in oklch, red, blue)) {
  :root {
    --grad-work: linear-gradient(in oklch 125deg, #ff4d1a 0%, #ff8a4a 70%, #ffa468 100%);
    --grad-xp: linear-gradient(in oklch 90deg, #e8890a 0%, #ffc95e 100%);
    --grad-cool: linear-gradient(in oklch 125deg, #0b8a7d 0%, #4cc9b8 100%);
    --grad-ribbon: linear-gradient(in oklch 90deg, #ff5a1f 0%, #f5b041 50%, #1aa593 100%);
  }
}
body, .panel, .glass, .btn, .chip, .capsule { transition-property: background-color, color, border-color, box-shadow, transform; transition-duration: .35s; transition-timing-function: cubic-bezier(.2,.8,.2,1); }

.btn.primary { background: var(--grad-work); background-size: 140% 100%; background-position: 0% 0; transition: background-position .6s cubic-bezier(.2,.8,.2,1), box-shadow .35s ease, transform .2s ease; }
.btn.primary:hover { background-position: 100% 0; }
.btn.violet, .btn.cool { border: 0; color: #fff; background: linear-gradient(125deg, #0b7468, #0e8a7d); font-weight: 600; box-shadow: 0 1px 0 rgba(255,255,255,.3) inset, 0 10px 24px -14px rgba(14,147,132,.75); }
.fill { background: var(--grad-xp); }
.fill.work { background: var(--grad-work); }
.fill.cool { background: var(--grad-cool); }
.fill.ok, .segs.ok i.on { background: linear-gradient(90deg, #2d8f4e, #5cc98a); }
.segs i.on { background: var(--grad-xp); }
.chip.cool { background: var(--cool-soft); color: var(--cool-ink); }

/* Sidebar: active item gets a soft sunset wash + gradient marker */
.nav a, .nav button { position: relative; }
.nav [aria-current="page"] { background: linear-gradient(120deg, rgba(255,106,46,.14), rgba(255,164,104,.06)), var(--glass-strong); }
.nav [aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--grad-work); }
.nav a:hover, .nav button:hover { background: linear-gradient(120deg, rgba(255,122,51,.09), rgba(40,190,170,.05)); }

/* Greeting: the name glows in sunset */
.h-display .name { background: linear-gradient(100deg, #ff4d1a 0%, #ff7a3a 40%, #f5a524 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
:root[data-theme="dark"] .h-display .name { background-image: linear-gradient(100deg, #ff7a3a 0%, #ffa468 45%, #ffd27a 100%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .h-display .name { background-image: linear-gradient(100deg, #ff7a3a 0%, #ffa468 45%, #ffd27a 100%); } }

.side-card { background: var(--cool-soft); border-color: transparent; }
.kpi { position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; inset: auto 0 0 0; height: 3px; background: var(--grad-ribbon); opacity: .0; transition: opacity .3s ease; }
.kpi:hover::after { opacity: .9; }

/* ---------- UX review fixes ---------- */
/* Primary button: deep enough for white text (4.0–4.6:1 under the label) */
.btn.primary { background: linear-gradient(125deg, #d4420e 0%, #e04d14 55%, #f06626 100%); background-size: 140% 100%; text-shadow: 0 1px 1px rgba(110, 30, 0, .25); }
@supports (background: linear-gradient(in oklch, red, blue)) { .btn.primary { background-image: linear-gradient(in oklch 125deg, #d4420e 0%, #e04d14 55%, #f06626 100%); } }
.btn.primary:disabled { filter: saturate(.6); }

/* Top controls: a soft fade band so scrolled content never collides with the capsules */
.topfade { position: fixed; z-index: 35; top: 0; left: 264px; right: 0; height: 84px; pointer-events: none; opacity: 0; transition: opacity .3s ease;
  background: linear-gradient(180deg, var(--ground) 0%, color-mix(in srgb, var(--ground) 82%, transparent) 55%, transparent 100%); }
body.scrolled .topfade { opacity: 1; }
@media (max-width: 1100px) { .topfade { left: 0; } }

/* Calm motion: keeps feedback animations, stops ambient/looping ones */
:root[data-motion="calm"] .orb, :root[data-motion="calm"] .fill::after, :root[data-motion="calm"] .flame,
:root[data-motion="calm"] .pp .av::after, :root[data-motion="calm"] .season-hero::after,
:root[data-motion="calm"] .tier.ready .ti, :root[data-motion="calm"] body.working .hero.is-live { animation: none !important; }
:root[data-motion="calm"] .fill::after { display: none; }
