:root {
  --bg: #faf6f1;
  --panel: #ffffff;
  --ink: #231c18;
  --ink-2: #5c4f47;
  --muted: #9a8b80;
  --line: #ece3da;
  --line-2: #f4eee8;
  --flame: #d7261e;
  --flame-dark: #a8160f;
  --flame-soft: #fde9e7;
  --amber: #f29f05;
  --amber-soft: #fff3dc;
  --green: #2f9e6a;
  --green-soft: #e3f5ec;
  --char: #1c1714;
  --char-2: #2a221e;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(35, 28, 24, .05), 0 4px 16px rgba(35, 28, 24, .05);
  --closed-stripes: repeating-linear-gradient(135deg, #f3ece6 0 8px, #e9dfd6 8px 16px);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  color: var(--ink);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { display: grid; grid-template-columns: 240px 1fr; background: var(--bg); font-size: 14px; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
.tabular { font-variant-numeric: tabular-nums; }

/* ---------- Sidebar ---------- */
.sidebar { background: var(--char); color: #f6ede6; display: flex; flex-direction: column; padding: 20px 14px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 4px 8px 22px; }
.brand-mark { font-size: 28px; width: 44px; height: 44px; display: grid; place-items: center; background: var(--flame); border-radius: 12px; box-shadow: 0 0 0 3px rgba(215, 38, 30, .25); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 17px; font-weight: 800; letter-spacing: .01em; }
.brand-text small { color: #bba99c; font-size: 12px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: #d9cbc0; font-weight: 600; }
.nav a:hover { background: var(--char-2); color: #fff; }
.nav a.active { background: var(--flame); color: #fff; }
.nav .ico { width: 18px; text-align: center; opacity: .9; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; padding: 0 8px; }
.muted-light { color: #8f7f73; font-size: 12px; margin: 0 0 6px; }
.link-light { background: none; border: 0; color: #d9cbc0; text-align: left; padding: 4px 0; font-size: 13px; }
.link-light:hover { color: #fff; text-decoration: underline; }
.link-light { display: flex; align-items: center; gap: 8px; }
.link-light .ico { width: 18px; text-align: center; }
.nav-toggle { margin-top: 10px; display: flex; align-items: center; gap: 10px; background: var(--char-2); border: 0; color: #d9cbc0; border-radius: 10px; padding: 9px 12px; font-weight: 600; font-size: 13px; }
.nav-toggle:hover { color: #fff; background: #3a2f29; }
.nav-toggle .ico { width: 18px; text-align: center; font-size: 16px; }

/* Collapsed (icon-only) sidebar: the default on laptops/desktops */
@media (min-width: 821px) {
  body.nav-collapsed { grid-template-columns: 68px 1fr; }
  body.nav-collapsed .sidebar { padding: 20px 10px; align-items: center; }
  body.nav-collapsed .lbl, body.nav-collapsed .brand-text { display: none; }
  body.nav-collapsed .brand { padding: 4px 0 22px; }
  body.nav-collapsed .nav a, body.nav-collapsed .nav-toggle, body.nav-collapsed .link-light { justify-content: center; padding: 10px; gap: 0; }
  body.nav-collapsed .sidebar-foot { padding: 0; align-items: center; }
  body:not(.nav-collapsed) .nav-toggle .ico { transform: rotate(180deg); }
}

/* ---------- Main ---------- */
.main { padding: 28px 32px 60px; min-width: 0; outline: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 26px; font-weight: 800; }
.page-head .sub { color: var(--ink-2); margin-top: 2px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.btn { border: 1px solid var(--line); background: var(--panel); padding: 8px 14px; border-radius: 10px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn:hover { border-color: #d8cabe; background: #fffdfb; }
.btn.primary { background: var(--flame); border-color: var(--flame); color: #fff; }
.btn.primary:hover { background: var(--flame-dark); border-color: var(--flame-dark); }
.btn.danger { color: var(--flame); }
.btn.danger:hover { background: var(--flame-soft); border-color: #f5c2bd; }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); font-size: 18px; line-height: 1; display: grid; place-items: center; }
.icon-btn:hover { background: #fffdfb; border-color: #d8cabe; }

/* Week navigator */
.weeknav { display: inline-flex; align-items: center; gap: 8px; }
.weeklabel { min-width: 190px; text-align: center; display: flex; flex-direction: column; line-height: 1.2; }
.weeklabel strong { font-size: 15px; }
.weeklabel span { font-size: 12px; color: var(--muted); }
.weeklabel span.now { color: var(--flame); font-weight: 700; }

/* Cards & grid */
.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head h2 { font-size: 15px; font-weight: 700; }
.card-head .hint { color: var(--muted); font-size: 12px; }
.kpi .label { color: var(--ink-2); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.kpi .value { font-size: 28px; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi .value small { font-size: 14px; color: var(--muted); font-weight: 600; margin-left: 2px; }
.kpi .foot { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi.accent { background: var(--char); color: #fff; border-color: var(--char); }
.kpi.accent .label { color: #cdbdb1; }
.kpi.accent .foot { color: #b4a397; }
.delta.up { color: var(--green); font-weight: 700; }
.delta.down { color: var(--flame); font-weight: 700; }
.kpi.accent .delta.up { color: #6fe0a8; }
.kpi.accent .delta.down { color: #ff8a82; }

.dash-cols { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .dash-cols { grid-template-columns: 1fr; } }

/* Day bar chart */
.daychart { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; align-items: end; height: 220px; padding-top: 8px; }
.daybar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.daybar .val { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.daybar .bar-track { width: 100%; max-width: 54px; flex: 1; display: flex; align-items: flex-end; }
.daybar .bar { width: 100%; background: var(--flame); border-radius: 6px 6px 2px 2px; min-height: 3px; transition: height .3s; }
.daybar.today .bar { background: var(--amber); }
.daybar .bar.zero { background: var(--line); }
.daybar.closed .bar-track { background: var(--closed-stripes); border-radius: 6px; align-items: center; justify-content: center; }
.daybar.closed .bar-track::after { content: "CLOSED"; font-size: 10px; font-weight: 800; color: var(--flame); letter-spacing: .08em; writing-mode: vertical-rl; transform: rotate(180deg); }
.daybar .lbl { font-size: 12px; color: var(--ink-2); font-weight: 600; text-align: center; line-height: 1.2; }
.daybar .lbl small { display: block; color: var(--muted); font-weight: 500; }
.daybar.today .lbl { color: var(--amber); }

/* Ranked employee bars */
.rank { display: flex; flex-direction: column; gap: 4px; }
.rank-row { display: grid; grid-template-columns: 30px minmax(90px, 140px) 1fr 96px; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 10px; text-decoration: none; }
.rank-row:hover { background: var(--line-2); }
.rank-row .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row .name small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; }
.rank-row .track { height: 10px; background: var(--line-2); border-radius: 99px; overflow: hidden; position: relative; }
.rank-row .fill { display: block; height: 100%; border-radius: 99px; }
.rank-row .hrs { white-space: nowrap; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 12px; flex-shrink: 0; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.avatar.md { width: 44px; height: 44px; font-size: 15px; }

/* On the clock */
.onclock { display: flex; flex-direction: column; gap: 8px; }
.onclock-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--green-soft); border-radius: 10px; }
.onclock-row .who { flex: 1; min-width: 0; }
.onclock-row .who strong { display: block; }
.onclock-row .who span { font-size: 12px; color: var(--ink-2); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(47, 158, 106, .6); animation: pulse 1.8s infinite; flex-shrink: 0; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(47, 158, 106, 0); } 100% { box-shadow: 0 0 0 0 rgba(47, 158, 106, 0); } }
.quick-clock { display: flex; gap: 8px; margin-top: 12px; }
.quick-clock select { flex: 1; min-width: 0; }
.empty-mini { color: var(--muted); font-size: 13px; padding: 10px 0; }

.closed-banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; background: var(--closed-stripes); border: 1px solid #e2d5ca; margin-bottom: 16px; font-weight: 600; }
.closed-banner .tag { background: var(--flame); color: #fff; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 800; letter-spacing: .06em; }

/* ---------- Schedule table ---------- */
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.sched { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 1100px; }
.sched th, .sched td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line-2); vertical-align: top; }
.sched thead th { background: #fcf9f6; padding: 10px 8px; text-align: left; position: sticky; top: 0; z-index: 1; }
.sched th.emp-col { width: 190px; position: sticky; left: 0; z-index: 2; background: #fcf9f6; }
.sched td.emp-col { position: sticky; left: 0; background: var(--panel); z-index: 1; padding: 10px 12px; }
.sched .emp-cell { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.sched .emp-cell strong { display: block; font-size: 15px; }
.sched .emp-cell small { color: var(--muted); }
.sched .emp-cell:hover strong { color: var(--flame); text-decoration: underline; }
.dayhead .dn { font-weight: 800; font-size: 16px; }
.dayhead .dd { color: var(--ink-2); font-size: 13px; margin-bottom: 6px; }
.dayhead.today .dn { color: var(--flame); }
.dayhead.today .dd::after { content: " · Today"; color: var(--flame); font-weight: 700; }
.closebtn { border: 1px dashed #d8cabe; background: transparent; color: var(--ink-2); border-radius: 7px; padding: 2px 8px; font-size: 11px; font-weight: 700; }
.closebtn:hover { border-style: solid; color: var(--flame); border-color: var(--flame); }
.dayhead.closed { background: var(--closed-stripes) !important; }
.dayhead.closed .closebtn { background: var(--flame); color: #fff; border: 1px solid var(--flame); }
.dayhead .reason { font-size: 11px; color: var(--flame-dark); font-weight: 700; margin-top: 4px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cell { padding: 6px; min-width: 128px; height: 84px; cursor: pointer; position: relative; }
.cell:hover { background: #fffaf5; }
.cell .plus { position: absolute; inset: 0; display: grid; place-items: center; color: #d0bfb2; font-size: 20px; opacity: 0; transition: opacity .15s; pointer-events: none; }
.cell:hover .plus { opacity: 1; }
.cell.has .plus { inset: auto 4px 2px auto; font-size: 15px; }
.cell.today { background: #fffbf3; }
.cell.closed { background: var(--closed-stripes); cursor: default; }
.cell.closed:hover { background: var(--closed-stripes); }
.closed-tag { display: grid; place-items: center; height: 100%; min-height: 50px; font-size: 11px; font-weight: 800; color: var(--flame); letter-spacing: .1em; opacity: .75; }
.chip { display: block; width: 100%; text-align: left; border: 1px solid color-mix(in srgb, var(--c, var(--flame)) 35%, white); border-left: 6px solid var(--c, var(--flame)); background: color-mix(in srgb, var(--c, var(--flame)) 9%, white); border-radius: 8px; padding: 7px 9px; margin-bottom: 6px; line-height: 1.25; color: var(--ink); }
.chip:hover { background: color-mix(in srgb, var(--c, var(--flame)) 18%, white); }
.chip:focus-visible { outline: 3px solid var(--ink); outline-offset: 1px; }
.chip .t { display: block; font-size: 17px; font-weight: 800; color: #120d0a; white-space: nowrap; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.chip .t.to { font-size: 15px; font-weight: 700; color: #3b302a; }
.chip b { display: inline-block; margin-top: 5px; font-size: 14px; font-weight: 800; background: #fff; border-radius: 99px; padding: 1px 8px; color: #120d0a; font-variant-numeric: tabular-nums; }
.chip.open { background: var(--green-soft); border-color: #a9dcc2; border-left-color: var(--green); }
.chip.open b { color: #fff; background: var(--green); }
.sched td.total, .sched th.total { font-size: 15px; width: 110px; white-space: nowrap; text-align: right; padding: 10px 12px; font-weight: 800; font-variant-numeric: tabular-nums; background: #fcf9f6; }
.sched tfoot td { font-size: 15px; white-space: nowrap; background: #fcf9f6; padding: 10px 8px; font-weight: 700; font-variant-numeric: tabular-nums; border-bottom: 0; }
.sched tfoot td.closed { background: var(--closed-stripes); color: var(--flame); font-size: 12px; }
.sched tfoot td.grand { background: var(--char); color: #fff; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; color: var(--ink-2); font-size: 12px; margin-top: 12px; }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -3px; margin-right: 5px; }

/* ---------- Employees ---------- */
.emp-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.emp-card { display: flex; flex-direction: column; gap: 14px; text-decoration: none; transition: transform .12s, box-shadow .12s; cursor: pointer; }
.emp-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(35, 28, 24, .09); }
.emp-card .top { display: flex; gap: 12px; align-items: center; }
.emp-card .top strong { font-size: 16px; display: block; }
.emp-card .top span { color: var(--muted); font-size: 13px; }
.emp-card .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; border-top: 1px solid var(--line-2); padding-top: 12px; }
.emp-card .stats div { display: flex; flex-direction: column; }
.emp-card .stats b { font-size: 17px; font-variant-numeric: tabular-nums; }
.emp-card .stats small { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.status { white-space: nowrap; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 99px; margin-left: auto; align-self: flex-start; letter-spacing: .03em; }
.status.on { background: var(--green-soft); color: var(--green); }
.status.archived { background: var(--line-2); color: var(--muted); }
.search { padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); min-width: 220px; }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 28px 0 12px; font-weight: 700; }

.empty { text-align: center; padding: 56px 24px; }
.empty .big { font-size: 52px; }
.empty h2 { font-size: 20px; margin: 10px 0 6px; }
.empty p { color: var(--ink-2); margin: 0 auto 18px; max-width: 420px; }
.empty .row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- Employee detail ---------- */
.back { color: var(--ink-2); text-decoration: none; font-weight: 600; display: inline-block; margin-bottom: 14px; }
.back:hover { color: var(--flame); }
.profile { display: flex; align-items: center; gap: 16px; }
.profile h1 { font-size: 26px; font-weight: 800; }
.profile .meta { color: var(--ink-2); display: flex; gap: 14px; flex-wrap: wrap; margin-top: 2px; }
.detail-cols { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .detail-cols { grid-template-columns: 1fr; } }

.days { display: flex; flex-direction: column; }
.day-row { display: grid; grid-template-columns: 92px 1fr 92px 34px; gap: 12px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--line-2); }
.day-row:last-child { border-bottom: 0; }
.day-row .d strong { display: block; font-size: 15px; }
.day-row .d small { color: var(--muted); }
.day-row.today .d strong { color: var(--flame); }
.day-row .hrs { white-space: nowrap; text-align: right; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.day-row .hrs.zero { color: #cbbdb2; font-weight: 600; }
.day-row.closed { background: var(--closed-stripes); border-radius: 10px; border-bottom-color: transparent; margin: 2px 0; padding-left: 10px; }
.day-shifts { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.timeline { position: relative; height: 22px; background: var(--line-2); border-radius: 6px; }
.timeline .seg { position: absolute; top: 0; bottom: 0; border-radius: 6px; cursor: pointer; }
.timeline .seg.open { background: repeating-linear-gradient(90deg, var(--green) 0 6px, #5cc394 6px 12px) !important; }
.timeline .tick { position: absolute; top: 0; bottom: 0; width: 1px; background: #e2d7cd; }
.shift-lines { display: flex; flex-wrap: wrap; gap: 6px 10px; }
.shift-lines button { background: var(--line-2); border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; color: #120d0a; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.shift-lines button:hover { border-color: var(--flame); color: var(--flame-dark); }
.tl-scale { display: grid; grid-template-columns: 92px 1fr 92px 34px; gap: 12px; padding: 0 4px; font-size: 12px; color: var(--ink-2); }
.tl-scale .scale { position: relative; height: 14px; }
.tl-scale .scale span { position: absolute; transform: translateX(-50%); }
.closed-pill { font-size: 11px; font-weight: 800; color: var(--flame); letter-spacing: .08em; }
.closed-pill em { font-style: normal; font-weight: 600; letter-spacing: 0; color: var(--ink-2); margin-left: 6px; }

.trend { display: flex; align-items: stretch; gap: 8px; height: 180px; }
.trend .tcol { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; cursor: pointer; border: 0; background: none; padding: 0; }
.trend .tcol .v { font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.trend .tcol .b { width: 100%; max-width: 34px; background: #e8c9c5; border-radius: 5px 5px 2px 2px; min-height: 2px; }
.trend .tcol.sel .b { background: var(--flame); }
.trend .tcol:hover .b { background: var(--flame-dark); }
.trend .tcol .l { font-size: 10px; color: var(--muted); white-space: nowrap; }
.trend .tcol .bt { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; position: relative; }

.stat-list { display: flex; flex-direction: column; }
.stat-list div { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.stat-list div:last-child { border-bottom: 0; }
.stat-list span { color: var(--ink-2); }
.stat-list b { font-variant-numeric: tabular-nums; }

/* ---------- Modal ---------- */
.modal { border: 0; border-radius: 18px; padding: 0; width: min(480px, calc(100vw - 32px)); box-shadow: 0 24px 64px rgba(0, 0, 0, .25); color: var(--ink); }
.modal::backdrop { background: rgba(28, 23, 20, .5); backdrop-filter: blur(2px); }
.modal form { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.modal h2 { font-size: 19px; font-weight: 800; }
.modal .msub { color: var(--ink-2); margin-top: -8px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.field label small { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--muted); }
.field input, .field select, .field textarea, .quick-clock select { padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff; width: 100%; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid color-mix(in srgb, var(--flame) 35%, transparent); border-color: var(--flame); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.calc { background: var(--line-2); border-radius: 10px; padding: 10px 12px; display: flex; justify-content: space-between; font-weight: 600; }
.calc b { font-size: 16px; font-variant-numeric: tabular-nums; }
.calc.warn { background: var(--amber-soft); color: #9a5b00; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
.modal-actions .spacer { flex: 1; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches label { width: 28px; height: 28px; border-radius: 50%; cursor: pointer; position: relative; }
.swatches input { position: absolute; opacity: 0; }
.swatches input:checked + span { position: absolute; inset: -4px; border: 2px solid var(--ink); border-radius: 50%; }
.note-warn { background: var(--amber-soft); color: #7a4800; padding: 10px 12px; border-radius: 10px; font-size: 13px; }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--char); color: #fff; padding: 10px 18px; border-radius: 99px; font-weight: 600; opacity: 0; pointer-events: none; transition: all .25s; z-index: 50; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  body { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; padding: 10px 12px; gap: 6px; }
  .brand { padding: 0 8px 0 0; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav a { padding: 8px 10px; }
  .sidebar-foot { display: none; }
  body.nav-collapsed .lbl, body.nav-collapsed .brand-text { display: revert; }
  .main { padding: 20px 16px 48px; }
  .rank-row { grid-template-columns: 30px 1fr 90px; }
  .rank-row .track { display: none; }
  .day-row, .tl-scale { grid-template-columns: 70px 1fr 80px 30px; gap: 8px; }
}

/* ---------- Print (weekly schedule) ---------- */
@media print {
  body { display: block; background: #fff; }
  .sidebar, .head-actions, .closebtn, .plus, .legend, .no-print { display: none !important; }
  .main { padding: 0; }
  .table-wrap { box-shadow: none; border: 0; overflow: visible; }
  .sched { min-width: 0; font-size: 11px; }
  .cell { height: auto; }
}

/* ---------- Sync status ---------- */
.sync { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 4px 0 8px; color: #8f7f73; }
.sync .ico { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; flex-shrink: 0; }
.sync.saved .ico { background: #2f9e6a; color: #fff; }
.sync.saving .ico { background: #5c4f47; color: #fff; }
.sync.offline .ico { background: var(--amber); color: #231c18; }
.sync.offline { color: #ffcf7a; }

/* ---------- Loading & sign-in ---------- */
.loading { padding: 80px 0; text-align: center; color: var(--ink-2); font-size: 16px; }
body.locked { grid-template-columns: 1fr !important; }
body.locked .sidebar { display: none; }
.login-wrap { min-height: calc(100vh - 88px); display: grid; place-items: center; }
.login { width: min(380px, 100%); text-align: center; padding: 32px 28px; display: flex; flex-direction: column; gap: 14px; }
.login .brand-mark.big { width: 72px; height: 72px; font-size: 42px; margin: 0 auto; border-radius: 18px; display: grid; place-items: center; background: var(--flame); }
.login h1 { font-size: 26px; font-weight: 800; }
.login p { margin: -10px 0 4px; color: var(--ink-2); }
.login .field { text-align: left; }
.login input { font-size: 18px; padding: 12px 14px; }
.btn.big { justify-content: center; font-size: 17px; padding: 12px 16px; }
.login-error { background: var(--flame-soft); color: var(--flame-dark); border-radius: 10px; padding: 10px 12px; font-weight: 600; }
