/* Golden Tool — design tokens & components (mobile-first) */
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #edf2f4;
  --bg-2: #e6f0ef;
  --card: #fdfdfd;
  --card-2: #f4f8f8;
  --border: #e1e9eb;
  --border-strong: #cfdadd;
  --text: #17262d;
  --muted: #5d6e76;
  --primary: #0c8888;
  --primary-600: #0a7272;
  --primary-soft: #d8ebeb;
  --primary-ink: #0a6f6f;
  --danger: #d42a2a;
  --danger-soft: #fbe4e4;
  --warn: #c58a12;
  --warn-soft: #fdf1d6;
  --ok: #1f9a52;
  --ok-soft: #dcf3e5;
  --info-soft: #e1ecfa;
  --shadow: 0 1px 2px rgba(20, 40, 50, .05), 0 6px 20px rgba(20, 40, 50, .05);
  --shadow-pop: 0 10px 40px rgba(10, 30, 40, .25);
  --overlay: rgba(12, 22, 27, .55);
  --header-h: 48px;
  --radius: 16px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0e171a;
  --bg-2: #101c1f;
  --card: #162226;
  --card-2: #1b2a2f;
  --border: #25363c;
  --border-strong: #35494f;
  --text: #e5eef0;
  --muted: #93a7ad;
  --primary: #18aaa3;
  --primary-600: #129891;
  --primary-soft: #16383a;
  --primary-ink: #5fd6cf;
  --danger: #ea4a4a;
  --danger-soft: #3b1e20;
  --warn: #e3a730;
  --warn-soft: #3a2f14;
  --ok: #3cc17a;
  --ok-soft: #173525;
  --info-soft: #172a3f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-pop: 0 10px 40px rgba(0, 0, 0, .6);
  --overlay: rgba(0, 0, 0, .65);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%) fixed;
  overscroll-behavior-y: none;
}
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary-ink); }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 16px; height: 16px; }
svg.i.lg { width: 24px; height: 24px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.sm { gap: 8px; }
.stack.lg { gap: 20px; }
.gap-16 { gap: 16px; }

/* ---------- App shell ---------- */
#app { min-height: 100%; }
.header {
  position: sticky; top: 0; z-index: 30;
  height: calc(var(--header-h) + var(--safe-t));
  padding: var(--safe-t) calc(12px + var(--safe-r)) 0 calc(12px + var(--safe-l));
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.header .actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 40px; height: 40px; border: 0; background: transparent; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center; color: var(--muted); cursor: pointer; position: relative;
}
.icon-btn:hover { background: var(--card-2); }
.icon-btn:active { background: var(--primary-soft); }
.badge {
  position: absolute; top: 3px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; background: #d8232a; color: #fff; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.avatar {
  width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; overflow: hidden; flex: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 64px; height: 64px; font-size: 26px; }
.avatar-btn { display: inline-flex; align-items: center; gap: 2px; border: 0; background: transparent; padding: 6px; border-radius: 10px; color: var(--muted); cursor: pointer; }

.layout { display: block; }
.main { padding: 16px calc(16px + var(--safe-r)) calc(40px + var(--safe-b)) calc(16px + var(--safe-l)); max-width: 1180px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 4px 0 16px; }
.page-head h1 { font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.page-head p { color: var(--muted); margin-top: 2px; }
.page-head .head-actions { display: flex; gap: 8px; flex: none; }

.sidebar-overlay { position: fixed; inset: 0; z-index: 40; background: var(--overlay); opacity: 0; pointer-events: none; transition: opacity .2s; }
.sidebar {
  position: fixed; z-index: 41; top: 0; bottom: 0; left: 0; width: 262px; max-width: 84vw;
  background: var(--card); padding: calc(14px + var(--safe-t)) 10px calc(14px + var(--safe-b)) calc(10px + var(--safe-l));
  transform: translateX(-102%); transition: transform .22s ease; display: flex; flex-direction: column; overflow-y: auto;
  box-shadow: var(--shadow-pop);
}
body.nav-open .sidebar { transform: none; }
body.nav-open .sidebar-overlay { opacity: 1; pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; font-weight: 600; font-size: 17px; }
.brand .logo { height: 36px; width: auto; flex: none; display: block; }
.login .brand .logo { height: 56px; }
.login .brand { gap: 12px; }
.brand .icon-btn { margin-left: auto; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 14px; padding: 8px 12px; border-radius: 10px; text-decoration: none;
  color: var(--text); font-weight: 450;
}
.nav a svg { color: var(--muted); }
.nav a:hover { background: var(--card-2); }
.nav a.active { background: var(--primary-soft); color: var(--primary-ink); font-weight: 550; }
.nav a.active svg { color: var(--primary-ink); }
.nav .spacer { flex: 1; min-height: 12px; }

@media (min-width: 1024px) {
  body { --sbw: 262px; }
  .sidebar { transform: none; box-shadow: none; border-right: 1px solid var(--border); }
  .sidebar-overlay { display: none; }
  .sidebar .brand .icon-btn { display: none; }
  .header, .main-wrap { margin-left: var(--sbw); }
  #menuBtn { display: none; }
}

/* ---------- Cards, stats ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card.flush { padding: 0; overflow: hidden; }
.card > h2, .card-title { font-size: 16px; font-weight: 600; }
.card-sub { color: var(--muted); font-size: 13px; margin-top: 1px; }
.card + .card, .stack > .card { margin-top: 0; }
.grid { display: grid; gap: 12px; }
.grid.cols-2 { grid-template-columns: 1fr; }
.grid.cols-3 { grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid.cols-2 { grid-template-columns: 1fr 1fr; } .grid.cols-3 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; } .grid.cols-4 { grid-template-columns: repeat(4, 1fr); } }
.grid.cols-4 { grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid.cols-4 { grid-template-columns: 1fr 1fr; } }

.stat { padding: 18px 20px; }
.stat .top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.stat .chip-i { width: 32px; height: 32px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--primary-soft); color: var(--primary-ink); }
.stat .chip-i.warn { background: var(--warn-soft); color: var(--warn); }
.stat .chip-i.danger { background: var(--danger-soft); color: var(--danger); }
.stat .chip-i.ok { background: var(--ok-soft); color: var(--ok); }
.stat .chip-i.info { background: var(--info-soft); color: #3b6fb5; }
.stat .label { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.stat .value { font-size: 30px; font-weight: 500; letter-spacing: -.01em; line-height: 1.15; }
.stat .value small { font-size: 14px; color: var(--muted); font-weight: 400; letter-spacing: 0; margin-left: 8px; }
.stat .value.amber { color: var(--warn); font-weight: 600; }
.stat .value.teal { color: var(--primary); font-weight: 600; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px;
  border-radius: 10px; border: 1px solid var(--border-strong); background: var(--card); color: var(--text);
  font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap; line-height: 1.2;
}
.btn:hover { background: var(--card-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-600); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { filter: brightness(.94); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--card-2); }
.btn.sm { min-height: 32px; padding: 4px 12px; font-size: 13.5px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn.lg { min-height: 52px; font-size: 17px; border-radius: 14px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn svg.i { width: 16px; height: 16px; }
.btn.sm svg.i { width: 14px; height: 14px; }

/* ---------- Chips, pills, tabs ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 500; padding: 2px 10px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary-ink); white-space: nowrap;
}
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.gray { background: var(--card-2); color: var(--muted); border: 1px solid var(--border); }
.pill.info { background: var(--info-soft); color: #3b6fb5; }
.tabs {
  display: inline-flex; gap: 2px; padding: 3px; background: var(--card); border: 1px solid var(--border); border-radius: 11px; max-width: 100%; overflow-x: auto;
}
.tabs button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.tabs button.active { background: var(--primary-soft); color: var(--primary-ink); }
.tabs.flat { background: transparent; border: 0; padding: 0; }
.tabs.flat button { color: var(--muted); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > label, .lbl { font-size: 14px; font-weight: 500; }
.field .hint { font-size: 12.5px; color: var(--muted); }
.field .err { font-size: 12.5px; color: var(--danger); }
.fields-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fields-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]), select, textarea {
  width: 100%; min-height: 42px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--card-2); font-size: 16px; outline: none; appearance: none; -webkit-appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2393a7ad' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent); background: var(--card); }
input[type=date], input[type=time] { min-height: 42px; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--primary); flex: none; }
.check-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--card-2); cursor: pointer; font-weight: 500; }
.check-card input { width: 20px; height: 20px; accent-color: var(--primary); flex: none; }
.dropzone {
  border: 1.5px dashed var(--border-strong); border-radius: 12px; padding: 18px 12px; text-align: center; color: var(--muted); cursor: pointer; background: var(--card-2);
}
.dropzone.drag { border-color: var(--primary); background: var(--primary-soft); }
.dropzone svg { display: block; margin: 0 auto 6px; }
.dropzone a { color: var(--primary-ink); font-weight: 500; }
.dropzone .previews { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }
.dropzone .previews img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }
.seg { display: inline-flex; padding: 3px; background: var(--card-2); border: 1px solid var(--border); border-radius: 10px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; cursor: pointer; }
.seg button.active { background: var(--primary-soft); color: var(--primary-ink); }

/* ---------- Modal ---------- */
.modal-root { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--overlay); animation: fade .15s ease; }
.modal {
  width: 100%; max-width: 480px; max-height: calc(100dvh - 32px - var(--safe-t) - var(--safe-b)); background: var(--card); border-radius: 18px; box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column; animation: pop .18s ease; overflow: hidden;
}
.modal.wide { max-width: 720px; }
.modal-head { padding: 18px 20px 6px; font-size: 18px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.modal-body { padding: 10px 20px 4px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.modal-foot { padding: 12px 20px 16px; display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.modal-foot .btn.text { border: 0; background: transparent; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes pop { from { transform: scale(.96); opacity: 0 } to { transform: none; opacity: 1 } }

.menu-pop {
  position: fixed; z-index: 60; min-width: 190px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-pop); padding: 6px;
}
.menu-pop button, .menu-pop a { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: transparent; padding: 10px 12px; border-radius: 8px; cursor: pointer; text-decoration: none; color: var(--text); }
.menu-pop button:hover, .menu-pop a:hover { background: var(--card-2); }
.notif-pop { width: min(340px, calc(100vw - 24px)); padding: 0; overflow: hidden; }
.notif-pop .head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; font-weight: 600; border-bottom: 1px solid var(--border); }
.notif-pop .head button { width: auto; padding: 0; color: var(--primary-ink); font-size: 13px; font-weight: 500; }
.notif-item { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); align-items: flex-start; }
.notif-item.unread { background: color-mix(in srgb, var(--primary-soft) 55%, transparent); }
.notif-item .ico { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: var(--warn-soft); color: var(--warn); flex: none; }
.notif-item .ico.danger { background: var(--danger-soft); color: var(--danger); }
.notif-item .ico.info { background: var(--primary-soft); color: var(--primary-ink); }
.notif-list { max-height: 60vh; overflow-y: auto; }

.toast-root { position: fixed; left: 0; right: 0; bottom: calc(24px + var(--safe-b)); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 200; pointer-events: none; }
.toast { background: #17262d; color: #fff; padding: 11px 16px; border-radius: 12px; box-shadow: var(--shadow-pop); display: flex; align-items: center; gap: 10px; animation: pop .18s ease; max-width: calc(100vw - 32px); font-size: 14px; }
:root[data-theme="dark"] .toast { background: #e5eef0; color: #0e171a; }
.toast svg { color: #4cd68d; }
.toast.err svg { color: #ff7373; }

/* ---------- Lists / tables ---------- */
.list-card { padding: 18px; }
.list-card h3 { font-size: 18px; font-weight: 500; }
.list-card .sub { color: var(--muted); }
.list-card .chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.list-card .btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.divider { height: 1px; background: var(--border); margin: 12px 0; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-weight: 500; color: var(--muted); font-size: 13px; padding: 10px 8px; }
.tbl td { padding: 10px 8px; border-top: 1px solid var(--border); vertical-align: top; }
.tbl th.r, .tbl td.r { text-align: right; }
.empty { text-align: center; color: var(--muted); padding: 32px 16px; }
.empty svg { width: 34px; height: 34px; display: block; margin: 0 auto 10px; opacity: .8; }
.progress { height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; flex: 1; }
.progress > i { display: block; height: 100%; background: var(--primary); border-radius: 3px; }
.kv { display: grid; gap: 14px; }
.kv .k { font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.kv .v { font-size: 15px; word-break: break-word; }
.kv .v.na { color: var(--muted); font-style: italic; }

/* ---------- Edit Hours week grid ---------- */
.week-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -6px; padding: 0 6px 6px; }
.week-grid { display: grid; grid-template-columns: 74px repeat(7, minmax(112px, 1fr)); min-width: 860px; }
.week-grid .hd { text-align: center; padding: 10px 4px; color: var(--muted); font-size: 13px; }
.week-grid .hd b { display: block; color: var(--text); font-weight: 500; font-size: 14px; }
.week-grid .hd.today b { color: var(--primary-ink); }
.week-grid .rl { padding: 10px 4px; display: flex; gap: 6px; align-items: flex-start; color: var(--muted); font-weight: 500; }
.week-grid .cell { padding: 8px 5px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.week-grid .cell.today { background: color-mix(in srgb, var(--primary-soft) 40%, transparent); }
.ent { border: 1px solid var(--border); background: var(--card-2); border-radius: 10px; padding: 6px 7px; text-align: center; font-size: 13px; line-height: 1.3; }
.ent .t { font-weight: 500; }
.ent .s { color: var(--muted); font-size: 12px; }
.ent .acts { display: flex; justify-content: center; gap: 4px; margin-top: 4px; }
.ent .acts button { border: 0; background: transparent; color: var(--muted); padding: 4px; border-radius: 6px; cursor: pointer; }
.ent .acts button:hover { background: var(--border); }
.ent.live { border-color: var(--primary); }
.add-cell { border: 1px dashed var(--border-strong); background: transparent; border-radius: 9px; padding: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
.add-cell:hover { background: var(--card-2); color: var(--text); }
.week-nav { display: flex; align-items: center; gap: 8px; }
.week-nav .lbl { font-weight: 500; }
.week-nav .icon-btn { border: 1px solid var(--border); width: 34px; height: 34px; background: var(--card); }

/* ---------- Clock history ---------- */
.hist-item { padding: 14px 0; border-top: 1px solid var(--border); }
.hist-item:first-child { border-top: 0; }
.hist-item .who { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.hist-item .who b { font-weight: 550; font-size: 16px; }
.hist-line { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: start; margin-top: 6px; font-size: 14px; }
.hist-line .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-right: 6px; }
.hist-line .dot.brk { background: #e39d1f; }
.proofs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; padding: 12px; background: var(--card-2); border-radius: 12px; }
.proof img { width: 100%; height: 96px; object-fit: cover; border-radius: 8px; background: var(--border); }
.proof .cap { font-size: 11px; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; display: flex; justify-content: space-between; margin-bottom: 4px; }
.linkbtn { border: 0; background: none; color: var(--primary-ink); padding: 0; cursor: pointer; font-weight: 500; font-size: 13.5px; display: inline-flex; align-items: center; gap: 4px; }

/* ---------- Dashboard shortcuts ---------- */
.shortcuts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px 4px; }
.shortcut { display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; color: var(--muted); font-size: 12.5px; text-align: center; min-width: 0; }
.shortcut .tile { width: 54px; height: 54px; border-radius: 16px; background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center; }
.shortcut .tile i { width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center; color: #fff; font-style: normal; font-weight: 700; font-size: 16px; }
.shortcut .tile img { width: 34px; height: 34px; object-fit: contain; display: block; }
.shortcut span { max-width: 100%; line-height: 1.15; overflow-wrap: anywhere; }
@media (min-width: 640px) { .shortcuts { grid-template-columns: repeat(11, 1fr); } }

.map { width: 100%; height: 340px; border-radius: 12px; overflow: hidden; background: var(--card-2); z-index: 0; }
.map.tall { height: min(62vh, 520px); }
.map-pin { display: flex; flex-direction: column; align-items: center; gap: 2px; transform: translate(-50%, -100%); width: max-content; }
.pin-label { background: #101315; color: #fff; padding: 3px 8px; border-radius: 7px; font-size: 12px; font-weight: 600; line-height: 1.2; white-space: nowrap; }
.pin-label small { display: block; font-weight: 400; opacity: .8; font-size: 10.5px; }
.pin-dot { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; border: 2px solid #fff; display: flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 700; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.pin-dot.site { background: #f0a51b; }
.pin-dot.off { background: #7b8a90; }
.leaflet-container { font-family: inherit; }
.leaflet-div-icon.pin { background: transparent; border: 0; }

/* ---------- Weather ---------- */
.wx { border-radius: 18px; overflow: hidden; border: 1px solid var(--border); background: var(--card); box-shadow: var(--shadow); }
.wx .sky { padding: 18px 20px; color: #fff; position: relative; }
.wx .sky.night { background: linear-gradient(180deg, #17163c 0%, #04040d 100%); }
.wx .sky.day { background: linear-gradient(180deg, #2f7fd6 0%, #7cc0ee 100%); }
.wx .sky.cloud { background: linear-gradient(180deg, #4b5d73 0%, #8fa1b3 100%); }
.wx .temp { display: flex; align-items: center; gap: 8px; font-size: 26px; font-weight: 500; }
.wx .temp small { font-size: 16px; opacity: .85; }
.wx .wind { display: flex; align-items: baseline; gap: 10px; margin-top: 8px; font-size: 40px; font-weight: 600; }
.wx .wind small { font-size: 17px; font-weight: 400; opacity: .9; }
.wx .meta { font-size: 13.5px; opacity: .9; }
.wx .status { position: absolute; top: 16px; right: 16px; background: rgba(255,255,255,.18); border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; letter-spacing: .05em; }
.wx .status.alert { background: #e5484d; }
.wx .foot { padding: 14px 20px 16px; }
.wx .foot b { font-size: 16px; font-weight: 600; }

/* ---------- Worker cards ---------- */
.wcard { display: flex; align-items: center; gap: 16px; padding: 18px; }
.wcard .qr { width: 78px; height: 78px; flex: none; background: #fff; padding: 4px; border-radius: 6px; }
.wcard .qr svg, .wcard .qr img { width: 100%; height: 100%; display: block; }
.wcard h3 { font-size: 19px; font-weight: 600; }
.wcard .scan { letter-spacing: .08em; font-size: 12px; text-transform: uppercase; color: var(--muted); margin-top: 8px; }

/* ---------- Calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal .dow { text-align: center; font-size: 13px; color: var(--muted); letter-spacing: .04em; padding: 6px 0; text-transform: uppercase; }
.cal .day { min-height: 60px; border: 1px solid var(--border); background: var(--card-2); border-radius: 9px; padding: 4px 6px; text-align: right; font-size: 14px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; align-items: flex-end; }
.cal .day.other { opacity: .45; }
.cal .day.today { border: 2px solid var(--primary); }
.cal .day .ev { font-size: 10.5px; background: var(--primary); color: #fff; padding: 1px 5px; border-radius: 4px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; align-self: stretch; text-align: left; }
.cal .day .ev.delivery { background: #e39d1f; }
.cal .day .ev.note { background: #7a6ad8; }
@media (min-width: 720px) { .cal .day { min-height: 92px; } }

/* ---------- Charts ---------- */
.chart svg { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font-size: 11px; font-family: inherit; }
.legend { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 8px; font-size: 13px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------- Clock-in ---------- */
.clock-big { text-align: center; padding: 26px 18px; }
.clock-big .time { font-size: 44px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.clock-big .state { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.clock-big .state i { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.clock-big .state.on i { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.clock-big .state.brk i { background: #e39d1f; box-shadow: 0 0 0 4px var(--warn-soft); }

/* ---------- First-login profile ---------- */
.onboard { min-height: 100dvh; display: flex; justify-content: center; padding: calc(20px + var(--safe-t)) 16px calc(40px + var(--safe-b)); }
.onboard .card { width: 100%; max-width: 560px; align-self: flex-start; padding: 22px; }
.onboard .brand { padding: 0; font-size: 20px; gap: 12px; }
.onboard .brand .logo { height: 48px; }
.steps { display: flex; gap: 6px; }
.step { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 8px 8px; border-radius: 10px; background: var(--card-2); color: var(--muted); font-size: 12.5px; line-height: 1.15; }
.step > span { width: 20px; height: 20px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--border-strong); color: var(--card); font-size: 11px; font-weight: 700; }
.step.on { color: var(--text); font-weight: 600; box-shadow: inset 0 0 0 2px var(--primary); }
.step.on > span, .step.done > span { background: var(--primary); }
@media (max-width: 420px) { .step { font-size: 11.5px; padding: 8px 6px; } }

/* Faint company logo behind every worker page (sits above the cards, ignores taps) */
.watermark { position: fixed; inset: 0; z-index: 20; pointer-events: none; display: grid; place-items: center; }
.watermark img { width: min(62vw, 420px); max-height: 62vh; object-fit: contain; opacity: .06; }
:root[data-theme="dark"] .watermark img { opacity: .1; }
@media print { .watermark { display: none; } }

/* ---------- Login & misc ---------- */
.login { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login .card { width: 100%; max-width: 420px; padding: 26px; }
.login .brand { padding: 0 0 8px; font-size: 20px; }
.acct { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 1px solid var(--border); background: var(--card-2); border-radius: 12px; padding: 10px 12px; cursor: pointer; }
.acct:hover { border-color: var(--primary); }
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--primary-soft); color: var(--primary-ink); margin-bottom: 14px; }
.banner.info { background: var(--info-soft); color: #3b6fb5; }
.banner .grow { font-size: 14px; }
.sig-pad { width: 100%; height: 160px; border: 1.5px dashed var(--border-strong); border-radius: 12px; background: #fff; touch-action: none; display: block; }
.role-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg) } }
.loading { text-align: center; padding: 40px; color: var(--muted); }
.card-quiz { padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; }
.report { background: #fff; color: #111; padding: 20px; border-radius: 12px; }
.report table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.report th, .report td { border-bottom: 1px solid #ddd; padding: 5px 6px; text-align: left; }

@media print {
  body { background: #fff !important; }
  .header, .sidebar, .sidebar-overlay, .no-print, .toast-root { display: none !important; }
  .main-wrap { margin: 0 !important; }
  .main { max-width: none; padding: 0; }
  .card { box-shadow: none; }
  .print-cards { display: grid; grid-template-columns: repeat(2, 70mm); gap: 6mm; }
  .print-cards .wcard { width: 70mm; height: 40mm; padding: 3mm; break-inside: avoid; border: 1px solid #999; border-radius: 3mm; box-shadow: none; }
  .print-cards .wcard .qr { width: 26mm; height: 26mm; }
  .print-cards .wcard h3 { font-size: 11pt; }
  .print-cards .wcard .scan { font-size: 6pt; }
}

/* ---------- worker dashboard ---------- */
.btn.green { background: #2f9e5b; border-color: #2f9e5b; color: #fff; }
.btn.green:hover { background: #288a4f; }
.btn.amber { background: #f0b429; border-color: #f0b429; color: #3d2b00; }
.btn.amber:hover { filter: brightness(.95); }
.card.today .label { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.today-timer { text-align: center; font-size: 46px; font-weight: 500; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin: 14px 0 2px; }
.today-timer.on { color: var(--ok); }
.today-timer.brk { color: var(--warn); }
.today-sub { text-align: center; color: var(--muted); font-size: 13px; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }
.session { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--ok-soft); color: var(--ok); font-size: 13.5px; }
.session.brk { background: var(--warn-soft); color: var(--warn); }
.session svg { margin-top: 2px; }
.thumb { position: relative; }
.thumb img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; display: block; }
.thumb .x { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: #e5484d; color: #fff; font-size: 14px; line-height: 1; cursor: pointer; padding: 0; }
