/* EMP · Employee app. Reuses the DueDesk 3.5 material language and theme tokens (light + dark), mobile-first. */
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("/fonts/Inter-Regular.woff") format("woff"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("/fonts/Inter-Medium.woff") format("woff"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("/fonts/Inter-SemiBold.woff") format("woff"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("/fonts/Inter-Bold.woff") format("woff"); }

:root {
  color-scheme: light;
  --bg: #d3d8d4;
  --card-top: #fdfdfb; --card-bot: #edefeb;
  --metal-top: #f8f9f8; --metal-bot: #d6dbda; --metal-line: #b4bcb9;
  --well: #e0e4e0; --well-deep: #d2d7d2;
  --ink: #101a17; --ink-2: #1f2d29; --muted: #40504b;
  --line: #c3cac6; --edge: #98a39e;
  --engrave: rgb(255 255 255 / .85);
  --hi: rgb(255 255 255 / .95);
  --lo-1: rgb(25 40 35 / .20); --lo-2: rgb(25 40 35 / .16); --lo-3: rgb(25 40 35 / .22); --lo-in: rgb(25 40 35 / .28);
  --accent: #0d6650; --accent-soft: #d3eae0;
  --green: #14633f; --green-soft: #d9efe2;
  --red: #a2262f; --red-soft: #f8dfe0;
  --amber: #7a4d05; --amber-soft: #f7e8c4;
  --blue: #1d5576; --blue-soft: #d8e9f3;
  --violet: #5d3f7c; --violet-soft: #eadff4;
  --grey-soft: #e3e7e4;
  --overlay: rgb(14 28 24 / .55);
  --k-top: #fdfdfc; --k-bot: #dcdfdd; --k-edge: #9aa5a0; --k-ink: #14201c; --k-hi: #fff;
  --kp-top: #34977a; --kp-bot: #17634e; --kp-edge: #0b4334; --kp-ink: #fff; --kp-hi: rgb(255 255 255 / .38);
  --kd-top: #d4545c; --kd-bot: #a02731; --kd-edge: #6f161e; --kd-ink: #fff; --kd-hi: rgb(255 255 255 / .34);
  --hero-top: #2f6a5a; --hero-bot: #1d4b3f; --hero-ink: #fbfffd; --hero-muted: #d6e8e1; --hero-stitch: rgb(255 255 255 / .34);
  --brushed: repeating-linear-gradient(90deg, rgb(255 255 255 / .22) 0 1px, rgb(0 0 0 / .018) 1px 2px, transparent 2px 4px);
  --sh-panel: inset 0 1px 0 var(--hi), inset 0 -1px 0 rgb(25 40 35 / .06), 0 1px 1px var(--lo-1), 0 4px 8px -2px var(--lo-2), 0 14px 26px -14px var(--lo-3);
  --sh-well: inset 0 2px 4px var(--lo-in), inset 0 0 0 1px rgb(25 40 35 / .06), 0 1px 0 var(--hi);
  --sh-float: inset 0 1px 0 var(--hi), 0 2px 3px var(--lo-1), 0 18px 44px -8px rgb(10 25 20 / .45);
  --r-panel: 18px; --r-control: 12px; --control: 46px; --compact: 38px;
  --bar: 64px; --tab: 66px;
  --face: linear-gradient(180deg, var(--card-top), var(--card-bot));
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #15191d;
  --card-top: #3b434a; --card-bot: #2b3238;
  --metal-top: #444c54; --metal-bot: #252b30; --metal-line: #0f1317;
  --well: #1a1f23; --well-deep: #13171a;
  --ink: #f5f8fa; --ink-2: #e5ebef; --muted: #bfc9d0;
  --line: #14181c; --edge: #5a656e;
  --engrave: rgb(0 0 0 / .65);
  --hi: rgb(255 255 255 / .11);
  --lo-1: rgb(0 0 0 / .55); --lo-2: rgb(0 0 0 / .42); --lo-3: rgb(0 0 0 / .5); --lo-in: rgb(0 0 0 / .6);
  --accent: #86e5c2; --accent-soft: #1f463a;
  --green: #a3ebc3; --green-soft: #1f3f31;
  --red: #ffb7b9; --red-soft: #4c2b32;
  --amber: #f8d98f; --amber-soft: #433720;
  --blue: #b3dcf6; --blue-soft: #243d4e;
  --violet: #e0caf7; --violet-soft: #3b3049;
  --grey-soft: #2a3036;
  --overlay: rgb(2 6 9 / .72);
  --k-top: #565f68; --k-bot: #3a4147; --k-edge: #0d1114; --k-ink: #f5f8fa; --k-hi: rgb(255 255 255 / .2);
  --kp-top: #3f9d80; --kp-bot: #1f6a55; --kp-edge: #0a2e25; --kp-ink: #fff; --kp-hi: rgb(255 255 255 / .3);
  --kd-top: #c24c55; --kd-bot: #8d2530; --kd-edge: #36090e; --kd-ink: #fff; --kd-hi: rgb(255 255 255 / .26);
  --hero-top: #24574a; --hero-bot: #173a31; --hero-muted: #d2e6de; --hero-stitch: rgb(255 255 255 / .26);
  --brushed: repeating-linear-gradient(90deg, rgb(255 255 255 / .05) 0 1px, rgb(0 0 0 / .05) 1px 2px, transparent 2px 4px);
  --sh-panel: inset 0 1px 0 var(--hi), inset 0 -1px 0 rgb(0 0 0 / .3), 0 1px 1px var(--lo-1), 0 5px 10px -2px var(--lo-2), 0 16px 30px -14px var(--lo-3);
  --sh-well: inset 0 2px 5px var(--lo-in), inset 0 0 0 1px rgb(0 0 0 / .25), 0 1px 0 rgb(255 255 255 / .07);
  --sh-float: inset 0 1px 0 var(--hi), 0 2px 3px var(--lo-1), 0 22px 50px -8px rgb(0 0 0 / .75);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; color: var(--ink); background: radial-gradient(1000px 560px at 30% -10%, rgb(255 255 255 / .5), transparent 62%), var(--bg);
  background-attachment: fixed; font: 400 15px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased; font-feature-settings: "calt", "kern";
}
:root[data-theme="dark"] body { background: radial-gradient(1000px 560px at 30% -10%, rgb(255 255 255 / .06), transparent 62%), var(--bg); background-attachment: fixed; }
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: 24px; letter-spacing: -.02em; line-height: 1.2; }
h2 { font-size: 18px; letter-spacing: -.01em; }
h3 { font-size: 15.5px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; opacity: .55; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.num { font-variant-numeric: tabular-nums; }
.noscript { padding: 24px; text-align: center; }

/* ---------- keys ---------- */
.btn, .icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--control); padding: 10px 18px;
  color: var(--k-ink); font-size: 15px; font-weight: 650; line-height: 1.2; text-decoration: none; white-space: nowrap;
  background: linear-gradient(180deg, var(--k-top), var(--k-bot)); border: 1px solid var(--k-edge); border-radius: var(--r-control);
  box-shadow: inset 0 1px 0 var(--k-hi), inset 0 -1px 0 rgb(0 0 0 / .07), 0 2px 0 var(--k-edge), 0 6px 9px -3px var(--lo-2);
  text-shadow: 0 1px 0 var(--engrave); transition: transform .08s, box-shadow .08s, filter .12s;
}
.btn:active:enabled, .icon-btn:active:enabled { transform: translateY(2px); box-shadow: inset 0 2px 5px rgb(0 0 0 / .3), 0 0 0 var(--k-edge); }
.btn.primary { --k-top: var(--kp-top); --k-bot: var(--kp-bot); --k-edge: var(--kp-edge); --k-ink: var(--kp-ink); --k-hi: var(--kp-hi); text-shadow: 0 -1px 0 rgb(0 0 0 / .3); }
.btn.danger { --k-top: var(--kd-top); --k-bot: var(--kd-bot); --k-edge: var(--kd-edge); --k-ink: var(--kd-ink); --k-hi: var(--kd-hi); text-shadow: 0 -1px 0 rgb(0 0 0 / .3); }
.btn.small { min-height: var(--compact); padding: 6px 13px; font-size: 14px; }
.btn.block { width: 100%; }
.btn.busy { position: relative; color: transparent !important; text-shadow: none; }
.btn.busy::after { content: ""; position: absolute; width: 18px; height: 18px; border: 2.5px solid var(--k-ink); border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.icon-btn { width: var(--control); padding: 0; flex: none; }
.icon-btn.small { width: var(--compact); min-height: var(--compact); }
.link { background: none; border: 0; padding: 8px 4px; color: var(--accent); font-weight: 650; text-decoration: underline; text-underline-offset: 3px; justify-self: center; min-height: 44px; }

/* ---------- fields ---------- */
.field {
  display: block; width: 100%; min-height: var(--control); padding: 10px 14px; color: var(--ink); font-size: 16px; line-height: 1.35;
  background: linear-gradient(180deg, var(--well-deep), var(--well) 60%); border: 1px solid var(--edge); border-radius: var(--r-control); box-shadow: var(--sh-well);
}
textarea.field { resize: vertical; min-height: 92px; }
select.field { appearance: none; padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%), linear-gradient(180deg, var(--well-deep), var(--well) 60%);
  background-position: calc(100% - 20px) 52%, calc(100% - 14px) 52%, 0 0; background-size: 6px 6px, 6px 6px, 100% 100%; background-repeat: no-repeat; }
.field:focus { outline: none; border-color: var(--accent); box-shadow: var(--sh-well), 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.fieldset { display: grid; gap: 6px; min-width: 0; }
.fieldset > label { font-size: 13.5px; font-weight: 650; color: var(--ink-2); }
.hint { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.reveal { position: relative; }
.reveal .field { padding-right: 54px; }
.reveal-btn { position: absolute; right: 4px; top: 4px; width: 38px; min-height: 38px; height: 38px; box-shadow: none; background: transparent; border-color: transparent; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stack { display: grid; gap: 14px; }
.choice { display: grid; gap: 8px; }
.choice label { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; padding: 12px 14px; border-radius: var(--r-control);
  background: linear-gradient(180deg, var(--well-deep), var(--well)); border: 1px solid var(--edge); box-shadow: var(--sh-well); cursor: pointer; }
.choice label:has(input:checked) { border-color: var(--accent); box-shadow: var(--sh-well), 0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent); }
.choice input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); }
.choice b { display: block; font-size: 14.5px; }
.choice small { color: var(--muted); font-size: 13px; }

/* ---------- auth ---------- */
.auth { min-height: 100dvh; display: grid; align-content: center; justify-items: center; gap: 18px; padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); }
.auth-card { width: min(100%, 430px); padding: 26px; background: var(--face); border: 1px solid var(--edge); border-radius: 22px; box-shadow: var(--sh-float); display: grid; gap: 18px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { border-radius: 12px; box-shadow: 0 2px 6px var(--lo-2); }
.brand strong { display: block; font-size: 19px; letter-spacing: -.02em; }
.brand span { display: block; color: var(--muted); font-size: 13px; font-weight: 500; }
.auth-card .brand { padding-bottom: 16px; border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 var(--hi); }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: linear-gradient(180deg, var(--well-deep), var(--well)); border: 1px solid var(--edge); box-shadow: var(--sh-well); }
.segmented button { min-height: 40px; border: 1px solid transparent; border-radius: 10px; background: transparent; font-weight: 650; font-size: 14px; color: var(--muted); }
.segmented button[aria-pressed="true"] { color: var(--k-ink); background: linear-gradient(180deg, var(--k-top), var(--k-bot)); border-color: var(--k-edge); box-shadow: inset 0 1px 0 var(--k-hi), 0 2px 3px var(--lo-2); }
.lead { color: var(--muted); font-size: 14px; }
.auth-msg:empty { display: none; }
.auth-msg { padding: 10px 12px; border-radius: 10px; background: var(--green-soft); color: var(--green); font-weight: 600; font-size: 14px; }
.auth-msg.error { background: var(--red-soft); color: var(--red); }
.auth-foot { color: var(--muted); font-size: 12.5px; text-align: center; max-width: 380px; }

/* ---------- app shell ---------- */
.app { min-height: 100dvh; }
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: calc(var(--bar) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left));
  background: var(--brushed), linear-gradient(180deg, var(--metal-top), var(--metal-bot)); border-bottom: 1px solid var(--metal-line);
  box-shadow: inset 0 1px 0 var(--hi), 0 6px 14px -8px var(--lo-3);
}
.who { display: flex; align-items: center; gap: 10px; min-width: 0; background: none; border: 0; padding: 4px; border-radius: 12px; text-align: left; min-height: 48px; }
.who-text { min-width: 0; }
.who b { display: block; font-size: 15px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who small { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; font-weight: 700; font-size: 14.5px;
  color: #effff8; background: radial-gradient(circle at 32% 26%, #4aa98a, #25705a 62%, #1a5444); border: 1px solid #0d2f26; box-shadow: inset 0 1px 0 rgb(255 255 255 / .3), 0 2px 3px var(--lo-2); }
.top-actions { display: flex; gap: 8px; }
.bell { position: relative; }
.badge { position: absolute; top: -6px; right: -6px; min-width: 21px; height: 21px; padding: 0 6px; border-radius: 99px; display: grid; place-items: center;
  font-size: 11.5px; font-weight: 700; color: #fff; background: radial-gradient(circle at 35% 25%, #ff7a82, #b32a33 70%); border: 1px solid #6f161e; text-shadow: none; }
.view { width: min(100%, 720px); margin: 0 auto; padding: 18px 14px calc(var(--tab) + 28px + env(safe-area-inset-bottom)); display: grid; gap: 16px; outline: none; }
.tabbar {
  position: fixed; z-index: 6; inset: auto 0 0 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px;
  padding: 6px max(6px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
  background: var(--brushed), linear-gradient(180deg, var(--metal-top), var(--metal-bot)); border-top: 1px solid var(--metal-line); box-shadow: 0 -6px 16px -10px var(--lo-3);
}
.tabbar button { position: relative; display: grid; justify-items: center; gap: 3px; min-height: 54px; padding: 6px 2px 4px; border: 1px solid transparent; border-radius: 12px;
  background: transparent; color: var(--muted); font-size: 11.5px; font-weight: 650; }
.tabbar button[aria-current="page"] { color: var(--accent); background: linear-gradient(180deg, var(--well-deep), var(--well)); border-color: var(--edge); box-shadow: var(--sh-well); }
.tab-ic { display: grid; place-items: center; height: 24px; }
.tab-ic .ic { width: 22px; height: 22px; }
.tabbar .dot { position: absolute; top: 7px; right: calc(50% - 19px); width: 9px; height: 9px; border-radius: 50%; background: #e2545e; box-shadow: 0 0 0 2px var(--metal-bot); }
@media (min-width: 760px) {
  .tabbar { inset: auto 0 18px 0; width: min(640px, calc(100% - 32px)); margin: 0 auto; border: 1px solid var(--metal-line); border-radius: 20px; padding: 6px; box-shadow: var(--sh-float); }
  .view { padding-top: 26px; }
}

/* ---------- panels ---------- */
.panel { position: relative; padding: 18px; background: var(--face); border: 1px solid var(--edge); border-radius: var(--r-panel); box-shadow: var(--sh-panel); min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.panel-head h2 { font-size: 16.5px; }
.panel-head .muted { font-size: 13px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 2px 2px 0; }
.page-head p { color: var(--muted); font-size: 14px; margin-top: 2px; }
.hero {
  position: relative; overflow: hidden; padding: 22px 20px 20px; border-radius: 22px; color: var(--hero-ink, #fbfffd);
  background: radial-gradient(120% 90% at 20% 0%, rgb(255 255 255 / .14), transparent 60%), linear-gradient(170deg, var(--hero-top), var(--hero-bot));
  border: 1px solid #0b2a22; box-shadow: inset 0 1px 0 rgb(255 255 255 / .22), 0 2px 3px var(--lo-1), 0 18px 30px -14px rgb(5 30 22 / .7);
  display: grid; gap: 16px;
}
.hero::after { content: ""; position: absolute; inset: 8px; border: 2px dashed var(--hero-stitch); border-radius: 15px; pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.hero .eyebrow { color: var(--hero-muted); font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.hero h1 { color: #fff; font-size: 23px; }
.hero .sub { color: var(--hero-muted); font-size: 14.5px; }
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.clock { flex: none; font-size: 32px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: #fff; line-height: 1; text-align: right; white-space: nowrap; }
.clock small { font-size: 13px; font-weight: 650; color: var(--hero-muted); margin-left: 3px; letter-spacing: 0; }
.clock.duty small { display: block; margin: 6px 0 0; letter-spacing: .06em; text-transform: uppercase; font-size: 11.5px; }
.punch {
  display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 76px; padding: 14px 20px; border-radius: 20px;
  font-size: 21px; font-weight: 750; letter-spacing: -.01em; color: #10332a; text-shadow: 0 1px 0 rgb(255 255 255 / .5);
  background: linear-gradient(180deg, #f6fffb, #c9ecdc); border: 1px solid #08281f;
  box-shadow: inset 0 1px 0 #fff, inset 0 -2px 0 rgb(0 0 0 / .08), 0 3px 0 #08281f, 0 12px 18px -6px rgb(0 0 0 / .45);
  transition: transform .08s, box-shadow .08s;
}
.punch .ic { width: 28px; height: 28px; stroke-width: 2.2; }
.punch.out { color: #fff; text-shadow: 0 -1px 0 rgb(0 0 0 / .35); background: linear-gradient(180deg, #e2636b, #a02731); border-color: #4a0f15;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .35), 0 3px 0 #4a0f15, 0 12px 18px -6px rgb(0 0 0 / .45); }
.punch:active:enabled { transform: translateY(3px); box-shadow: inset 0 3px 8px rgb(0 0 0 / .35); }
.punch:disabled { opacity: .7; }
.punch.busy .ic { animation: pulse 1s ease-in-out infinite; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 5px 11px; border-radius: 99px; font-size: 13px; font-weight: 650;
  background: rgb(0 0 0 / .22); color: #f2fff9; border: 1px solid rgb(255 255 255 / .16); }
.chip .ic { width: 16px; height: 16px; }
.chip.good { background: rgb(20 120 80 / .55); border-color: rgb(150 255 210 / .35); }
.chip.warn { background: rgb(150 100 10 / .6); border-color: rgb(255 220 150 / .35); }
.chip.bad { background: rgb(160 35 45 / .6); border-color: rgb(255 180 185 / .35); }
.result { padding: 12px 14px; border-radius: 14px; font-weight: 600; font-size: 14.5px; background: rgb(0 0 0 / .25); border: 1px solid rgb(255 255 255 / .15); }
.result:empty { display: none; }
.result.ok { background: rgb(20 120 80 / .45); }
.result.warn { background: rgb(150 100 10 / .5); }
.result.error { background: rgb(160 35 45 / .55); }
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; font-size: 14px; border: 1px solid; }
.banner .ic { margin-top: 1px; }
.banner b { display: block; font-size: 14.5px; }
.banner.warn { background: var(--amber-soft); color: var(--amber); border-color: color-mix(in srgb, var(--amber) 35%, transparent); }
.banner.info { background: var(--blue-soft); color: var(--blue); border-color: color-mix(in srgb, var(--blue) 30%, transparent); }
.banner.bad { background: var(--red-soft); color: var(--red); border-color: color-mix(in srgb, var(--red) 30%, transparent); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat { padding: 12px 10px; border-radius: 14px; background: linear-gradient(180deg, var(--well-deep), var(--well)); border: 1px solid var(--edge); box-shadow: var(--sh-well); min-width: 0; }
.stat b { display: block; font-size: 21px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat span { display: block; color: var(--muted); font-size: 12px; font-weight: 600; margin-top: 3px; line-height: 1.25; }
.balances { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.balances .stat span { white-space: normal; font-size: 12.5px; color: var(--ink-2); }
.balances .stat small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile { position: relative; display: grid; gap: 6px; justify-items: start; padding: 14px; min-height: 92px; text-align: left; border-radius: 16px;
  background: var(--face); border: 1px solid var(--edge); box-shadow: var(--sh-panel); }
.tile .ic { color: var(--accent); width: 22px; height: 22px; }
.tile b { font-size: 22px; line-height: 1; font-variant-numeric: tabular-nums; }
.tile span { color: var(--muted); font-size: 12.5px; font-weight: 650; }
.tile.hot b { color: var(--red); }

.list { display: grid; }
.row { display: flex; align-items: center; gap: 12px; padding: 13px 2px; border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 var(--hi); min-height: 56px; }
.row:last-child { border-bottom: 0; box-shadow: none; }
.row .grow { flex: 1; min-width: 0; }
.row .grow b { display: block; font-size: 14.5px; }
.row .grow small, .row .grow p { display: block; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.row.tap { width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; color: inherit; font: inherit; }
.row .end { text-align: right; flex: none; display: grid; justify-items: end; gap: 4px; }
.row .end .link { min-height: 32px; padding: 2px 0; }
.row .end b { display: block; font-variant-numeric: tabular-nums; }
.row .end small { color: var(--muted); font-size: 12.5px; }
.lead-ic { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; color: var(--accent);
  background: linear-gradient(180deg, var(--well-deep), var(--well)); border: 1px solid var(--edge); box-shadow: var(--sh-well); }

.pill { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap;
  background: var(--grey-soft); color: var(--ink-2); border: 1px solid color-mix(in srgb, var(--edge) 60%, transparent); }
.pill.good { background: var(--green-soft); color: var(--green); }
.pill.warn { background: var(--amber-soft); color: var(--amber); }
.pill.bad { background: var(--red-soft); color: var(--red); }
.pill.info { background: var(--blue-soft); color: var(--blue); }
.pill.violet { background: var(--violet-soft); color: var(--violet); }

/* ---------- calendar ---------- */
.month-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.month-nav h2 { font-size: 17px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal .dow { text-align: center; font-size: 11.5px; font-weight: 700; color: var(--muted); padding: 2px 0 4px; letter-spacing: .04em; }
.cal .day { position: relative; aspect-ratio: 1 / 1.08; min-height: 44px; display: grid; align-content: space-between; justify-items: center; padding: 6px 2px 5px;
  border-radius: 11px; border: 1px solid var(--edge); background: linear-gradient(180deg, var(--well-deep), var(--well)); box-shadow: var(--sh-well); font-variant-numeric: tabular-nums; }
.cal .day b { font-size: 14px; }
.cal .day i { width: 8px; height: 8px; border-radius: 50%; background: transparent; }
.cal .day.blank { visibility: hidden; }
.cal .day.today { outline: 2px solid var(--accent); outline-offset: 1px; }
.cal .day.flag::after { content: ""; position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: #e2a73a; }
.st-present i, .lg-present { background: #2f9e6e !important; }
.st-half_day i, .lg-half_day { background: linear-gradient(90deg, #2f9e6e 50%, #d6a33c 50%) !important; }
.st-absent i, .lg-absent { background: #d6454f !important; }
.st-leave i, .lg-leave { background: #4f8fd1 !important; }
.st-weekly_off i, .st-holiday i, .st-covered i, .st-comp_off i, .lg-off { background: #8c979f !important; }
.st-off_day_worked i, .lg-worked { background: #9b6ad4 !important; }
.st-incomplete i, .lg-incomplete { background: #e2a73a !important; }
.st-upcoming i { background: transparent; }
.st-absent { background: linear-gradient(180deg, color-mix(in srgb, var(--red-soft) 70%, var(--well-deep)), var(--well)); }
.st-weekly_off, .st-holiday, .st-covered { opacity: .82; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

/* ---------- schedule ---------- */
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: linear-gradient(180deg, var(--well-deep), var(--well)); border: 1px solid var(--edge); box-shadow: var(--sh-well); overflow-x: auto; }
.tabs button { flex: 1; min-height: 40px; padding: 6px 12px; border-radius: 10px; border: 1px solid transparent; background: transparent; font-weight: 650; font-size: 14px; color: var(--muted); white-space: nowrap; position: relative; }
.tabs button[aria-selected="true"] { color: var(--k-ink); background: linear-gradient(180deg, var(--k-top), var(--k-bot)); border-color: var(--k-edge); box-shadow: inset 0 1px 0 var(--k-hi), 0 2px 3px var(--lo-2); }
.tabs .count { display: inline-grid; place-items: center; min-width: 19px; height: 19px; margin-left: 6px; padding: 0 5px; border-radius: 99px; font-size: 11px; background: #d6454f; color: #fff; }
.week-label { font-size: 12.5px; font-weight: 700; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; margin: 6px 2px 2px; }
.shift-bar { width: 5px; align-self: stretch; border-radius: 4px; flex: none; background: var(--edge); }
.daycell { display: grid; gap: 2px; min-width: 52px; text-align: center; padding: 6px 4px; border-radius: 10px; background: linear-gradient(180deg, var(--well-deep), var(--well)); border: 1px solid var(--edge); }
.daycell b { font-size: 16px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.daycell small { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.daycell.today { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.roster-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.roster-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.roster-table th, .roster-table td { padding: 8px 6px; text-align: center; border-bottom: 1px solid var(--line); white-space: nowrap; }
.roster-table th:first-child, .roster-table td:first-child { text-align: left; position: sticky; left: 0; background: var(--card-bot); z-index: 1; font-weight: 650; max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
.roster-table th { font-size: 11.5px; color: var(--muted); font-weight: 700; }
.roster-table .me td { font-weight: 700; }
.sh { display: inline-block; min-width: 34px; padding: 3px 6px; border-radius: 7px; font-size: 11.5px; font-weight: 700; color: #fff; }
.sh.off { background: transparent; color: var(--muted); border: 1px dashed var(--edge); }

/* ---------- sheets ---------- */
dialog.sheet { width: min(560px, calc(100% - 24px)); max-width: calc(100% - 24px); max-height: min(88dvh, 820px); padding: 0; color: var(--ink); background: var(--face); border: 1px solid var(--edge);
  border-radius: 22px; box-shadow: var(--sh-float); display: grid; grid-template-rows: auto 1fr auto; overflow: hidden; }
dialog.sheet:not([open]) { display: none; }
dialog.sheet::backdrop { background: var(--overlay); backdrop-filter: blur(2px); }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 18px 12px; border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 var(--hi); }
.sheet-head h2 { font-size: 18px; }
.sheet-sub { color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.sheet-x { width: var(--compact); min-height: var(--compact); }
.sheet-body { padding: 16px 18px; overflow-y: auto; display: grid; gap: 14px; align-content: start; }
.sheet-error:empty { display: none; }
.sheet-error { padding: 10px 12px; border-radius: 10px; background: var(--red-soft); color: var(--red); font-weight: 600; font-size: 14px; }
.sheet-actions .btn { white-space: normal; text-align: center; }
.sheet-actions { flex-wrap: wrap; }
.sheet-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 18px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); box-shadow: inset 0 1px 0 var(--hi); }
@media (max-width: 600px) {
  dialog.sheet { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 22px 22px 0 0; max-height: 92dvh; animation: rise .22s ease-out; }
  .sheet-actions > * { flex: 1 1 40%; }
  .sheet-actions > .btn:nth-child(3):last-child { flex-basis: 100%; order: -1; }
}
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.preview { padding: 12px 14px; border-radius: 14px; background: linear-gradient(180deg, var(--well-deep), var(--well)); border: 1px solid var(--edge); box-shadow: var(--sh-well); display: grid; gap: 6px; font-size: 14px; }
.preview:empty { display: none; }
.preview b { font-size: 15px; }
.preview .warnline { color: var(--amber); font-weight: 600; }
.notice-body { white-space: pre-wrap; font-size: 14.5px; line-height: 1.55; }
.privacy { display: grid; gap: 12px; font-size: 14.5px; }
.privacy ul { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.privacy li b { color: var(--ink); }
.slip-lines { display: grid; }
.slip-lines div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.slip-lines div small { display: block; color: var(--muted); font-size: 12px; }
.slip-lines .neg { color: var(--red); }
.net { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; margin-top: 10px; border-radius: 14px; background: var(--green-soft); color: var(--green); font-weight: 700; }
.net b { font-size: 22px; font-variant-numeric: tabular-nums; }

/* ---------- misc ---------- */
.empty { display: grid; justify-items: center; gap: 8px; padding: 26px 12px; color: var(--muted); text-align: center; font-size: 14px; }
.empty .ic { width: 30px; height: 30px; opacity: .7; }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 40px 0; color: var(--muted); font-weight: 600; }
.spin { width: 20px; height: 20px; border: 2.5px solid var(--edge); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.toasts { position: fixed; z-index: 50; left: 50%; transform: translateX(-50%); bottom: calc(var(--tab) + 20px + env(safe-area-inset-bottom)); display: grid; gap: 8px; width: min(440px, calc(100% - 24px)); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; font-weight: 600; font-size: 14px; color: #fff; background: #1f6a55; border: 1px solid #0a2e25;
  box-shadow: 0 12px 30px -8px rgb(0 0 0 / .55); animation: rise .2s ease-out; pointer-events: auto; }
.toast.error { background: #8d2530; border-color: #36090e; }
.toast.warn { background: #7a5208; border-color: #3a2703; }
.toast.leaving { opacity: 0; transform: translateY(8px); transition: .25s; }
.more-grid { display: grid; gap: 10px; }
.section-title { font-size: 12.5px; font-weight: 750; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; margin: 8px 4px -4px; }
.doc-up { display: grid; gap: 10px; }
.file-drop { display: grid; place-items: center; gap: 6px; padding: 18px; border-radius: 14px; border: 2px dashed var(--edge); color: var(--muted); text-align: center; font-weight: 600; cursor: pointer; min-height: 96px; }
.file-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-drop:focus-within { border-color: var(--accent); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { transform: scale(1.18); } }
@keyframes rise { from { transform: translateY(16px); opacity: .4; } }
@media (max-width: 380px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .tiles { grid-template-columns: repeat(3, 1fr); gap: 7px; }
  .tile { padding: 11px; min-height: 84px; }
  .clock { font-size: 28px; }
  .grid2 { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
