/* Sonora TimeHub — orange & black brand */
:root {
  --orange: #f28c28; --orange-d: #d9731a; --orange-t: #fff3e6;
  --grad: linear-gradient(135deg, #ef4b36 0%, #f47b3a 45%, #f7a440 100%);
  --ink: #141414; --ink2: #3a3a3a; --muted: #6f6f6f; --line: #e7e4df;
  --bg: #f6f4f1; --card: #ffffff; --side: #111111;
  --ok: #1f9d55; --warn: #e0a100; --over: #d93025; --disc: #9aa0a6;
  --r: 12px; --sh: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.04);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
a { color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
h2 { font-size: 22px; } h3 { font-size: 15px; margin-bottom: 10px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .mono { font-family: ui-monospace, Consolas, monospace; }
.mt { margin-top: 20px; } .nowrap { white-space: nowrap; } .num { text-align: right; }
code { background: #f1efec; padding: 1px 5px; border-radius: 4px; }

/* Shell */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--side); color: #ddd; display: flex; flex-direction: column; padding: 18px 12px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px 18px; }
.brand b { display: block; color: #fff; font-size: 15px; } .brand small { color: #999; font-size: 11px; }
.brand.big b { color: var(--ink); font-size: 20px; } .brand.big small { color: var(--muted); font-size: 12px; }
a.brand { text-decoration: none; }
.mark-img { width: 38px; height: 38px; object-fit: contain; flex: none; filter: drop-shadow(0 2px 6px rgba(242,140,40,.35)); }
.login-brand { text-align: center; padding: 4px 0 6px; }
.login-brand img { width: 100%; max-width: 300px; height: auto; display: block; margin: 0 auto 18px; }
.login-app { border-top: 1px solid var(--line); padding-top: 14px; }
.login-app b { display: block; font-size: 18px; letter-spacing: -.01em; }
.login-app b::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: linear-gradient(135deg, #ef4b36, #f7a440); margin-right: 8px; vertical-align: 2px; }
.login-app span { font-size: 12px; color: var(--muted); }
.mark { width: 36px; height: 36px; border-radius: 10px; background: var(--orange); color: #111; display: grid; place-items: center; font-weight: 800; font-size: 18px; flex: none; }
.side nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side nav a { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 8px; text-decoration: none; color: #cfcfcf; }
.side nav a:hover { background: #1f1f1f; color: #fff; }
.side nav a.on { background: var(--grad); color: #fff; font-weight: 600; box-shadow: 0 4px 14px rgba(239,75,54,.28); }
.side nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.me { border-top: 1px solid #262626; padding: 14px 8px 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.me b { display: block; color: #fff; font-size: 13px; } .me small { color: #999; font-size: 11px; }
main { padding: 22px 28px 48px; min-width: 0; }
.top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.top h1 { font-size: 24px; }
.clock { font-variant-numeric: tabular-nums; color: var(--ink2); background: var(--card); border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px; font-size: 13px; }

/* Cards & layout */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--sh); }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.empty { text-align: center; padding: 40px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 11px; font-weight: 700; color: var(--muted); margin: 0 0 8px; }
.hero h2 { margin-bottom: 16px; }
.narrow { max-width: 620px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 8px 14px; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: #cfcac3; }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; }
.btn.primary:hover { filter: brightness(.95); box-shadow: 0 4px 14px rgba(239,75,54,.3); }
.btn.danger { background: #fff; color: var(--over); border-color: #f2c6c2; }
.btn.danger:hover { background: #fdecea; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.huge { font-size: 20px; padding: 18px 44px; border-radius: 12px; margin: 4px 0 10px; }
.btn.block { width: 100%; padding: 11px; }
.btn.right { margin-left: auto; }
button.link { background: none; border: 0; color: #bbb; cursor: pointer; font: inherit; font-size: 12px; text-decoration: underline; }

/* Status now */
.status-now { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; background: color-mix(in srgb, var(--c) 12%, white); border: 1px solid color-mix(in srgb, var(--c) 40%, white); margin-bottom: 8px; }
.status-now .sname { font-size: 22px; font-weight: 700; flex: 1; }
.status-now .timer { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); flex: none; display: inline-block; }
.aux-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.aux-grid form { margin: 0; }
.aux { width: 100%; display: flex; align-items: center; gap: 8px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: inherit; font-weight: 600; cursor: pointer; text-align: left; }
.aux:hover { border-color: var(--c); background: color-mix(in srgb, var(--c) 7%, white); }
.aux.on { border: 2px solid var(--c); background: color-mix(in srgb, var(--c) 14%, white); cursor: default; color: var(--ink); }
.aux small { margin-left: auto; color: var(--muted); font-weight: 500; font-size: 11px; }

/* Meters */
.meter { margin-bottom: 12px; }
.mrow { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; gap: 8px; }
.bar { height: 8px; background: #efece8; border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ok); border-radius: 99px; }
.warn .bar i { background: var(--warn); } .over .bar i { background: var(--over); }
.over .mrow b:last-child, .over-txt { color: var(--over); }

/* Tables */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px; border-bottom: 1px solid #f1eeea; vertical-align: top; }
.tbl.compact td { padding: 7px 10px; font-size: 13px; }
.tbl tr.dim td { opacity: .5; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; background: #f0ede9; color: var(--ink2); font-weight: 600; }
.pill.ok { background: #e6f5ec; color: #17784a; } .pill.warn { background: #fff4d6; color: #8a6100; } .pill.live { background: var(--orange-t); color: #a4500c; }

/* Toolbar, forms */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
input, select { font: inherit; padding: 8px 10px; border: 1px solid #d9d4cd; border-radius: 8px; background: #fff; color: var(--ink); min-width: 0; }
input:focus, select:focus { outline: 2px solid var(--orange); outline-offset: -1px; border-color: var(--orange); }
input[type=search] { min-width: 280px; }
input[type=color] { padding: 2px; height: 36px; width: 48px; }
label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 13px; }
label.inline { flex-direction: row; align-items: center; gap: 8px; }
label.chk { flex-direction: row; align-items: center; gap: 6px; font-weight: 500; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.field > span { font-weight: 600; }
.field p { margin: 0; }
label.chk.big { font-weight: 600; align-self: end; padding-bottom: 8px; }
.form h3 { margin: 18px 0 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.form h3:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px 18px; }
.fields small { font-weight: 400; }
fieldset.days { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
fieldset.days legend { font-weight: 600; font-size: 13px; margin-bottom: 6px; padding: 0; }
.actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; border: 1px solid; }
.flash.ok { background: #e9f7ef; border-color: #bfe5cf; color: #14633c; }
.flash.error { background: #fdecea; border-color: #f4c7c3; color: #a52a1f; }
.flash.info { background: var(--orange-t); border-color: #f6d3ae; color: #8a4710; }

/* Settings rows */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs a { padding: 9px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--ink); border-image: var(--grad) 1; }
.rows { padding: 8px 12px; overflow-x: auto; }
.row { display: grid; gap: 8px; align-items: center; padding: 8px 4px; border-bottom: 1px solid #f1eeea; margin: 0; }
.row.head { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.row.new { background: var(--orange-t); border-radius: 8px; padding: 8px; }
.row input, .row select { width: 100%; }
.row .chk { justify-content: center; }
.row-actions { display: flex; gap: 6px; align-items: center; }
.aux-row { grid-template-columns: 90px minmax(140px, 1.4fr) 56px minmax(120px, 1fr) 90px 64px 44px 52px 120px; min-width: 860px; }
.shift-row { grid-template-columns: minmax(160px, 1.5fr) 110px 110px 90px 90px 70px 52px 90px; min-width: 820px; }
.team-row { grid-template-columns: 1fr 120px 100px; }

/* Board */
.counters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.counter { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; min-width: 96px; }
.counter b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.counter span { font-size: 12px; color: var(--muted); }
.counter.over b { color: var(--over); } .counter.disc b { color: var(--disc); }
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.agent { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--c); border-radius: 10px; padding: 12px 14px; box-shadow: var(--sh); }
.agent header b { display: block; } .agent header small { color: var(--muted); font-size: 12px; }
.agent .st { display: flex; align-items: center; gap: 8px; font-weight: 700; margin: 10px 0 8px; }
.agent .st .t { margin-left: auto; font-variant-numeric: tabular-nums; font-size: 18px; }
.agent.warn { background: #fffaf0; border-color: #f3dfaa; border-left-color: var(--warn); }
.agent.over { background: #fff5f4; border-color: #f4c7c3; border-left-color: var(--over); }
.agent.disc { border-style: dashed; opacity: .75; }
.agent footer { font-size: 12px; color: var(--muted); margin-top: 6px; }
.mini { font-size: 12px; display: grid; grid-template-columns: 1fr auto; gap: 2px 6px; margin-bottom: 6px; }
.mini .bar { grid-column: 1 / -1; height: 5px; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 16px; }
.lg { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -2px; }
.lg.warn { background: var(--warn); } .lg.over { background: var(--over); } .lg.disc { border: 2px dashed var(--disc); }

/* Help */
.help-h { margin: 18px 0 10px; }
.help-list { display: grid; gap: 8px; }
.guide { padding: 0; }
.guide summary { cursor: pointer; padding: 14px 18px; font-weight: 600; }
.guide ol { margin: 0; padding: 0 22px 16px 40px; } .guide li { margin-bottom: 6px; }

/* Login */
body.bare { background: radial-gradient(circle at 20% 10%, #2a2a2a, #0d0d0d 60%); }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 14px; padding: 28px; }
.login .brand { padding: 0 0 6px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .side nav { flex-direction: row; flex-wrap: wrap; }
  .grid2 { grid-template-columns: 1fr; }
  main { padding: 16px; }
  input[type=search] { min-width: 0; width: 100%; }
}

/* ---------- Batch 1 additions ---------- */
.status-now.warn { background: #fffaf0; border-color: #f3dfaa; }
.status-now.over { background: #fff1ef; border-color: #f4c7c3; }
.status-now.over .timer { color: var(--over); }
.punch-row { display: flex; gap: 10px; flex-wrap: wrap; }
.punch-row form { margin: 0; }
.btn.big { padding: 14px 22px; font-size: 16px; border-radius: 10px; flex-direction: column; gap: 2px; min-width: 170px; }
.btn.big small { font-weight: 500; font-size: 11px; opacity: .75; }
.btn.disabled { opacity: .45; pointer-events: none; }
.last-shift { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 4px; }
.kv { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 6px 14px; font-size: 13px; }
.kv span { color: var(--muted); }
.pill.bad { background: #fdecea; color: #a52a1f; }
.scroll-x { overflow-x: auto; }
.st-row { grid-template-columns: 170px 90px minmax(140px, 1.3fr) 56px 100px 80px 50px 40px 80px; min-width: 860px; }
.switches { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 14px; }
.switches .locked { opacity: .55; }
.link-btn { background: none; border: 0; color: var(--over); cursor: pointer; font: inherit; font-size: 12px; text-decoration: underline; padding: 0; }
form.stack { display: flex; flex-direction: column; gap: 12px; }
.allow-note { margin: -2px 0 8px; }

.att-sum td:first-child { min-width: 170px; }
.att-sum th { white-space: normal; vertical-align: bottom; }

/* ---------- Batch 2: requests ---------- */
.badge { margin-left: auto; background: var(--grad); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 8px; }
.side nav a.on .badge { background: #111; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.seg a { padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 13px; color: var(--ink2); background: #fff; }
.seg a.on { background: var(--grad); color: #fff; border-color: transparent; }
.fields.two { grid-template-columns: 1fr 1fr; }
textarea { font: inherit; padding: 8px 10px; border: 1px solid #d9d4cd; border-radius: 8px; resize: vertical; }
textarea:focus { outline: 2px solid var(--orange); outline-offset: -1px; }
.credit { display: flex; align-items: baseline; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
.credit span { flex: 1; color: var(--ink2); } .credit b { font-size: 18px; }
.credits-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.decide { display: flex; flex-direction: column; gap: 6px; min-width: 210px; }
.decide input { font-size: 13px; padding: 6px 8px; }
.actions-cell { min-width: 120px; }
.inline-form { display: inline-flex; gap: 6px; }
.lt-row { grid-template-columns: 90px minmax(180px, 1.5fr) 140px 50px 90px 110px 40px 80px; min-width: 860px; }
.lt-row span small { display: block; margin-top: 2px; }
/* Pay setup */
.card button.link { color: var(--muted); padding: 0; }
.card button.link:hover { color: var(--over); }
/* Payslip */
.payslip .ps-head { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.payslip .ps-head h2 { margin: 0; letter-spacing: .08em; }
.payslip .kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 13px; }
.payslip .kv span { color: var(--muted); }
.payslip .ps-net { display: flex; justify-content: flex-end; align-items: baseline; gap: 16px; margin-top: 14px; padding-top: 12px; border-top: 2px solid var(--ink); }
.payslip .ps-net b { font-size: 24px; }
@media print {
  .side, header.top, .noprint, .flash { display: none !important; }
  .shell, main { display: block; padding: 0; margin: 0; }
  .card { box-shadow: none; border: 0; }
}
/* Google sign-in */
.btn.google { display: flex; align-items: center; justify-content: center; gap: 10px; background: #fff; color: #1f1f1f; border: 1px solid #dadce0; box-shadow: none; }
.btn.google:hover { background: #f8f9fa; }
.login .center { text-align: center; }
.login details.pw { margin-top: 10px; }
.login details.pw summary { cursor: pointer; margin-bottom: 8px; }
