:root {
  --navy: #0a1d36;
  --navy-2: #12335a;
  --blue: #1f5f9e;
  --blue-soft: #eaf2fb;
  --bg: #f4f6f9;
  --card: #ffffff;
  --ink: #162033;
  --muted: #738096;
  --line: #e7ebf1;
  --green: #1d8a62;
  --green-soft: #e8f6ef;
  --red: #c44545;
  --red-soft: #fdeeee;
  --amber: #a56c16;
  --amber-soft: #fbf2df;
  --gold: #d9b46a;
  --radius: 18px;
  --shadow: 0 10px 28px rgba(10, 29, 54, .08);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 "PingFang SC", "PingFang TC", "Hiragino Sans GB", -apple-system, BlinkMacSystemFont, "Microsoft YaHei", sans-serif;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: var(--blue); text-decoration: none; }
img { max-width: 100%; }

.boot { min-height: 100vh; display: grid; place-items: center; align-content: center; gap: 12px; background: var(--navy); color: #fff; }
.boot-logo { width: 88px; height: 88px; border-radius: 50%; }
.boot-name { font-weight: 700; letter-spacing: .08em; }
.boot-dots { display: flex; gap: 5px; }
.boot-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.7); animation: pulse 1s infinite alternate; }
.boot-dots i:nth-child(2) { animation-delay: .2s; }
.boot-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes pulse { to { opacity: .18; transform: translateY(-3px); } }

.app-shell { min-height: 100vh; padding-bottom: calc(84px + var(--safe-bottom)); }
.app-width { width: min(100%, 820px); margin: 0 auto; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  padding: calc(10px + var(--safe-top)) 16px 10px;
  background: rgba(244, 246, 249, .92);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(231, 235, 241, .8);
}
.topbar-row { display: flex; align-items: center; gap: 10px; }
.brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.brand img { width: 34px; height: 34px; border-radius: 50%; background: var(--navy); }
.brand-copy { min-width: 0; }
.brand-name { font-weight: 750; font-size: 16px; color: var(--navy); letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--blue-soft); color: var(--navy); font-weight: 750; font-size: 13px; border: 1px solid #d9e7f5; }
.icon-btn { width: 36px; height: 36px; border: 0; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--navy); box-shadow: 0 2px 10px rgba(10,29,54,.06); }
.icon-btn svg { width: 18px; height: 18px; }

.page { padding: 14px 16px 24px; }
.page-title { font-size: 22px; font-weight: 780; color: var(--navy); margin: 2px 0 4px; letter-spacing: -.02em; }
.page-sub { color: var(--muted); font-size: 12.5px; margin-bottom: 14px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 18px 0 9px; }
.section-title h2 { margin: 0; font-size: 14px; color: var(--navy); letter-spacing: .01em; }
.section-title .link-btn { border: 0; background: transparent; color: var(--blue); padding: 2px 0; font-size: 12px; }

.hero {
  position: relative; overflow: hidden;
  border-radius: 22px; padding: 18px;
  color: #fff;
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(217,180,106,.26), transparent 46%),
    linear-gradient(135deg, #0a1d36, #12335a 62%, #1b497b);
  box-shadow: var(--shadow);
}
.hero::after { content: ""; position: absolute; right: -8px; bottom: -18px; width: 140px; height: 140px; border-radius: 50%; border: 1px solid rgba(255,255,255,.12); }
.hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.hero-eyebrow { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: rgba(255,255,255,.62); }
.hero-title { font-size: 24px; font-weight: 780; line-height: 1.2; margin-top: 6px; }
.hero-sub { color: rgba(255,255,255,.68); font-size: 12px; margin-top: 6px; }
.hero-logo { width: 56px; height: 56px; border-radius: 50%; opacity: .95; }
.hero-actions { display: flex; gap: 8px; margin-top: 16px; position: relative; z-index: 1; flex-wrap: wrap; }
.hero .btn-primary { background: #fff; color: var(--navy); }
.hero .btn-ghost { background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.2); }

.link-btn { border: 0; background: transparent; color: var(--blue); padding: 5px 2px; font-size: 12px; font-weight: 650; display: inline-flex; align-items: center; gap: 4px; }
.link-btn svg { width: 14px; height: 14px; }

.btn {
  border: 0; border-radius: 13px; min-height: 42px; padding: 0 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-weight: 680; font-size: 14px; color: var(--navy); background: #eef2f7;
  white-space: nowrap; flex-shrink: 0;
  transition: transform .18s cubic-bezier(.34,1.56,.64,1), filter .12s ease;
}
.btn:active { transform: scale(.94); }
.icon-btn, .chip, .nav-item, .choice-card, .request-card, .avatar, .sheet-close, .line-remove, .pin-eye {
  transition: transform .18s cubic-bezier(.34,1.56,.64,1), background-color .12s ease, opacity .12s ease;
}
.icon-btn:active, .chip:active, .nav-item:active, .choice-card:active, .avatar:active, .sheet-close:active, .line-remove:active, .pin-eye:active { transform: scale(.92); }
.request-card:active { transform: scale(.985); }
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-blue { background: var(--blue); color: #fff; }
.btn-ghost { background: #fff; border: 1px solid var(--line); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-sm { min-height: 34px; padding: 0 11px; font-size: 12.5px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px; box-shadow: 0 4px 16px rgba(10,29,54,.03); }
.stat-label { color: var(--muted); font-size: 11.5px; display: flex; align-items: center; gap: 5px; }
.stat-value { font-size: 22px; font-weight: 780; color: var(--navy); margin-top: 4px; line-height: 1.1; letter-spacing: -.02em; }
.stat-value small { font-size: 11px; font-weight: 600; color: var(--muted); }
.stat.red .stat-value { color: var(--red); }
.stat.amber .stat-value { color: var(--amber); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: 0 4px 16px rgba(10,29,54,.03); }
.card + .card { margin-top: 10px; }
.card-title { font-weight: 740; color: var(--navy); font-size: 14px; }
.card-sub { color: var(--muted); font-size: 12px; margin-top: 3px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row { display: flex; align-items: center; gap: 8px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 700; white-space: nowrap; }
.badge.pending { background: var(--amber-soft); color: var(--amber); }
.badge.received { background: var(--green-soft); color: var(--green); }
.badge.paid { background: #e8f2ff; color: #1e5fa6; }
.badge.mismatch { background: var(--red-soft); color: var(--red); }
.badge.muted { background: #f0f2f6; color: #6c7789; }
.badge.offline { background: #eef2f7; color: #4d5d72; }

.chips { display: flex; gap: 7px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; border: 1px solid var(--line); background: #fff; color: #526078; padding: 7px 12px; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap; }
.chip.active { background: var(--navy); border-color: var(--navy); color: #fff; }

.request-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 13px; box-shadow: 0 3px 14px rgba(10,29,54,.03); }
.request-card + .request-card { margin-top: 9px; }
.request-select-wrap { position: relative; margin-top: 9px; }
.request-check { display: flex; align-items: center; gap: 5px; width: fit-content; margin: 0 0 5px 2px; color: #65738a; font-size: 10.5px; user-select: none; }
.request-check input { width: 16px; height: 16px; accent-color: var(--navy); }
.request-select-wrap.selected .request-card { border-color: #9dc0e3; background: #f8fbff; box-shadow: 0 0 0 2px rgba(31,95,158,.08); }
.request-card { -webkit-touch-callout: none; user-select: none; }
.reimburse-item { margin-top: 9px; }
.select-row { display: flex; align-items: center; gap: 6px; color: #526078; font-size: 11px; padding: 2px 2px 5px; }
.select-row input { width: 16px; height: 16px; accent-color: var(--navy); }
.expense-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 13px; }
.batch-bar { margin-top: 10px; border-color: #d8e5f3; background: #f8fbff; }
.summary-card { margin-bottom: 12px; }
.summary-card .form-row { gap: 8px; }
.summary-card .field { margin-bottom: 0; }
.summary-card .field input[type="date"] { font-size: 13px; }
.summary-group { margin-top: 13px; }
.summary-heading { font-size: 14px; font-weight: 780; color: var(--navy); margin-bottom: 5px; }
.summary-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 3px 0 3px 14px; color: #526078; font-size: 12.5px; }
.summary-row strong { color: var(--navy); font-variant-numeric: tabular-nums; }
.summary-total { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); margin-top: 13px; padding-top: 11px; color: var(--navy); font-size: 16px; font-weight: 780; }
.summary-total strong { font-size: 20px; }
.batch-receive-list { display: grid; gap: 9px; }
.batch-receive-item { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 11px; }
.batch-receive-item .form-row { margin-top: 8px; }
.perm-grid { display: grid; gap: 7px; }
.perm-row { display: flex; align-items: center; gap: 7px; color: #526078; font-size: 12px; padding: 7px 9px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.perm-row input { width: 17px; height: 17px; accent-color: var(--navy); }
.activity-feed { display: grid; gap: 0; }
.activity-log-row { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f0f3f7; }
.activity-log-row:last-child { border-bottom: 0; padding-bottom: 0; }
.activity-log-row:first-child { padding-top: 0; }
.activity-log-time { width: 42px; flex: 0 0 auto; color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; padding-top: 2px; }
.activity-log-main { min-width: 0; flex: 1; font-size: 12px; }
.activity-log-detail { color: #526078; margin-top: 3px; line-height: 1.45; }
.activity-log-meta { color: var(--muted); font-size: 10px; margin-top: 3px; }
.request-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.request-store { font-size: 11px; color: var(--blue); font-weight: 700; }
.request-no { font-size: 10.5px; color: #9aa5b5; margin-top: 2px; }
.request-main { min-width: 0; }
.request-items { color: #526078; font-size: 12px; margin-top: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.request-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.request-total { font-weight: 780; color: var(--navy); font-size: 15px; }
.request-meta { color: var(--muted); font-size: 10.5px; }
.tag-line { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 7px; }

.empty { text-align: center; padding: 36px 16px; color: var(--muted); font-size: 13px; }
.empty svg { width: 34px; height: 34px; color: #b8c3d2; margin-bottom: 7px; }

.fab { position: fixed; right: 18px; bottom: calc(84px + var(--safe-bottom)); z-index: 30; width: 54px; height: 54px; border-radius: 50%; border: 0; background: var(--navy); color: #fff; display: grid; place-items: center; box-shadow: 0 12px 28px rgba(10,29,54,.32); }
.fab svg { width: 24px; height: 24px; }

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: rgba(255,255,255,.94); backdrop-filter: blur(18px);
  border-top: 1px solid rgba(231,235,241,.9);
  padding: 7px 8px calc(7px + var(--safe-bottom));
}
.bottom-nav-inner { width: min(100%, 680px); margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); }
.nav-item { border: 0; background: transparent; color: #8b95a5; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 5px 2px; font-size: 10px; font-weight: 650; }
.nav-item svg { width: 21px; height: 21px; }
.nav-item.active { color: var(--navy); }
.nav-item.active svg { stroke-width: 2.2; }

.list { display: grid; gap: 0; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid #f0f3f7; }
.list-row:last-child { border-bottom: 0; padding-bottom: 0; }
.list-row:first-child { padding-top: 0; }
.list-icon { width: 36px; height: 36px; border-radius: 11px; background: var(--blue-soft); color: var(--navy); display: grid; place-items: center; flex: 0 0 auto; }
.list-icon svg { width: 18px; height: 18px; }
.list-main { min-width: 0; flex: 1; }
.list-title { font-weight: 680; color: var(--ink); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-sub { color: var(--muted); font-size: 11.5px; margin-top: 1px; }

.install-banner { display: flex; gap: 10px; align-items: center; background: var(--navy); color: #fff; border-radius: var(--radius); padding: 12px 13px; margin-top: 12px; }
.install-banner .card-title, .install-banner .card-sub, .install-banner .muted { color: #fff; }
.install-banner .card-sub { color: rgba(255, 255, 255, .7); }
.install-banner .list-icon { background: rgba(255,255,255,.12); color: #fff; }
.install-banner .list-sub { color: rgba(255,255,255,.64); }
.install-banner .btn { background: #fff; color: var(--navy); min-height: 34px; padding: 0 11px; font-size: 12px; }

.auth-screen { min-height: 100vh; background: radial-gradient(90% 60% at 90% 0%, #1b497b 0%, transparent 55%), linear-gradient(160deg, #07172b, #0a1d36 55%, #12335a); color: #fff; display: flex; align-items: center; justify-content: center; padding: calc(24px + var(--safe-top)) 18px calc(24px + var(--safe-bottom)); }
.auth-wrap { width: min(100%, 420px); }
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; }
.auth-brand img { width: 48px; height: 48px; border-radius: 50%; }
.auth-brand-name { font-weight: 780; letter-spacing: .06em; font-size: 18px; }
.auth-brand-sub { color: rgba(255,255,255,.58); font-size: 11px; margin-top: 2px; }
.auth-title { font-size: 27px; line-height: 1.24; font-weight: 780; margin: 0 0 6px; letter-spacing: -.02em; }
.auth-title em { font-style: normal; color: var(--gold); }
.auth-desc { color: rgba(255,255,255,.6); font-size: 12.5px; margin-bottom: 18px; }
.auth-card { background: #fff; color: var(--ink); border-radius: 22px; padding: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.28); }
.auth-card .card-title { font-size: 16px; }
.auth-card .card-sub { margin-bottom: 14px; }
.auth-foot { text-align: center; color: rgba(255,255,255,.45); font-size: 10.5px; margin-top: 16px; }
.user-pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 10px 0 14px; }
.user-pick button { border: 1px solid var(--line); background: #fff; border-radius: 13px; padding: 10px; display: flex; align-items: center; gap: 8px; text-align: left; }
.user-pick button.active { border-color: var(--navy); background: #f4f8fd; }
.user-pick .avatar { width: 30px; height: 30px; font-size: 12px; }
.user-pick-name { font-weight: 700; font-size: 12.5px; }
.user-pick-role { font-size: 10px; color: var(--muted); }

.field { display: grid; gap: 5px; margin-bottom: 11px; }
.field label { font-size: 11.5px; color: #5f6b7d; font-weight: 650; }
.field input, .field select, .field textarea {
  width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box;
  border: 1px solid #dfe5ee; background: #fbfcfe; color: var(--ink);
  border-radius: 12px; padding: 10px 11px; outline: none; font-size: 16px;
}
.field input[type="date"] {
  font-size: 14px; padding: 9px 8px; min-width: 0; width: 100%;
  -webkit-appearance: none; appearance: none;
}
.form-row, .form-row-3 { min-width: 0; }
.form-row .field, .form-row-3 .field { min-width: 0; }
.field textarea { min-height: 76px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); background: #fff; box-shadow: 0 0 0 3px rgba(31,95,158,.1); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.form-note { color: var(--muted); font-size: 11px; line-height: 1.5; }
.sheet-note { color: var(--muted); font-size: 11.5px; line-height: 1.7; text-align: center; text-indent: 2em; margin: 16px 0 2px; }
.sheet-note strong { color: #526078; }
.form-error { background: var(--red-soft); color: var(--red); border-radius: 10px; padding: 8px 10px; font-size: 12px; margin-top: 8px; }
.pin-wrap { position: relative; }
.pin-wrap input { letter-spacing: .35em; padding-right: 42px; }
.pin-eye { position: absolute; right: 7px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); width: 32px; height: 32px; display: grid; place-items: center; }
.pin-eye svg { width: 17px; height: 17px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(7,23,43,.54); backdrop-filter: blur(4px); display: flex; align-items: flex-end; justify-content: center; animation: fadein .16s ease; }
.sheet { width: min(100%, 620px); max-height: 92vh; background: var(--bg); border-radius: 22px 22px 0 0; overflow: hidden; display: flex; flex-direction: column; animation: slideup .22s ease; padding-bottom: var(--safe-bottom); }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); }
.sheet-head h3 { margin: 0; font-size: 16px; color: var(--navy); flex: 1; }
.sheet-close { border: 0; background: #eef2f7; color: #536176; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; }
.sheet-body { padding: 14px 16px 22px; overflow-y: auto; }
.sheet-foot { display: flex; gap: 8px; padding: 10px 16px calc(12px + var(--safe-bottom)); background: #fff; border-top: 1px solid var(--line); }
.sheet-foot .btn { flex: 1; }
@keyframes slideup { from { transform: translateY(20px); opacity: .7; } }
@keyframes fadein { from { opacity: 0; } }

.detail-hero { background: var(--navy); color: #fff; border-radius: 18px; padding: 15px; }
.detail-hero .request-store { color: var(--gold); }
.detail-hero .request-no { color: rgba(255,255,255,.55); }
.detail-hero .request-total { color: #fff; font-size: 26px; }
.detail-hero .muted { color: rgba(255,255,255,.6); }
.detail-rows { display: grid; gap: 0; margin-top: 10px; }
.detail-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid #f0f3f7; font-size: 12.5px; }
.detail-row:last-child { border-bottom: 0; }
.detail-row span:first-child { color: var(--muted); }
.detail-row span:last-child { text-align: right; font-weight: 650; }

.field-error { color: var(--red); font-size: 10.5px; line-height: 1.35; margin-top: 3px; min-height: 0; }
.field-error:empty { display: none; }
.input-invalid { border-color: var(--red) !important; background: #fff8f8 !important; }
.order-lines { display: grid; gap: 10px; }
.order-line { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 11px; }
.order-line-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.order-line-title { font-size: 12px; font-weight: 720; color: var(--navy); }
.order-line .field { margin-bottom: 8px; }
.order-line .field:last-child { margin-bottom: 0; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; align-items: start; }
.form-row-3 .field { min-width: 0; }
.form-row-3 .field label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.form-row-3 .field input { width: 100%; min-width: 0; }
.order-line input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
.order-line input[type="number"]::-webkit-outer-spin-button,
.order-line input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.choice-grid { display: grid; gap: 10px; }
.choice-card { width: 100%; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 16px; padding: 15px; display: flex; align-items: center; gap: 12px; }
.choice-card:active { background: #f6f9fd; }
.choice-icon { width: 44px; height: 44px; border-radius: 13px; background: var(--blue-soft); color: var(--navy); display: grid; place-items: center; flex: 0 0 auto; }
.choice-icon svg { width: 21px; height: 21px; }
.choice-title { font-weight: 750; color: var(--navy); font-size: 15px; }
.choice-sub { color: var(--muted); font-size: 11.5px; margin-top: 2px; line-height: 1.4; }
.chart { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 82px 1fr 48px; align-items: center; gap: 7px; font-size: 11px; }
.bar-label { color: #526078; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 8px; background: #edf1f6; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #1f5f9e, #6fa5d2); }
.bar-value { text-align: right; color: var(--navy); font-weight: 700; font-variant-numeric: tabular-nums; }
.insight-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin-top: 10px; }
.donut-layout { display: grid; grid-template-columns: 142px 1fr; gap: 12px; align-items: center; margin-top: 8px; }
.donut { position: relative; width: 142px; height: 142px; }
.donut svg { width: 100%; height: 100%; display: block; }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.donut-total { font-size: 18px; font-weight: 780; color: var(--navy); line-height: 1.1; }
.donut-caption { font-size: 10px; color: var(--muted); margin-top: 3px; }
.legend { display: grid; gap: 6px; max-height: 190px; overflow-y: auto; padding-right: 2px; }
.legend-row { display: grid; grid-template-columns: 8px minmax(0, 1fr) 38px; align-items: center; gap: 5px; font-size: 10.5px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.legend-name { color: #526078; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legend-pct { color: var(--navy); font-weight: 720; text-align: right; font-variant-numeric: tabular-nums; }
.legend-value { grid-column: 2 / 4; color: var(--muted); font-size: 9.5px; margin-top: -3px; }
.metric-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; background: #f4f7fb; }
.metric-toggle button { border: 0; background: transparent; color: #66748a; font-size: 10.5px; font-weight: 650; padding: 5px 9px; border-radius: 999px; }
.metric-toggle button.active { background: var(--navy); color: #fff; }
@media (max-width: 380px) {
  .donut-layout { grid-template-columns: 118px 1fr; }
  .donut { width: 118px; height: 118px; }
}
.insight-box { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.insight-label { color: var(--muted); font-size: 11px; }
.insight-value { color: var(--navy); font-weight: 780; font-size: 19px; margin-top: 3px; }

.line-table { border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: #fff; }
.line-head, .line-row { display: grid; grid-template-columns: 1.4fr .7fr .7fr 1fr; gap: 6px; align-items: center; padding: 8px 9px; font-size: 11px; }
.line-head { background: #f5f7fa; color: var(--muted); font-weight: 650; }
.line-row { border-top: 1px solid #f0f3f7; }
.line-row .field { margin: 0; min-width: 0; }
.line-row input { width: 100%; border: 1px solid #e1e7f0; border-radius: 8px; padding: 7px 6px; font-size: 14px; background: #fbfcfe; }
.line-row .field-error { font-size: 9.5px; margin-top: 2px; }
.line-edit { display: grid; grid-template-columns: 1.4fr .7fr .7fr 28px; gap: 6px; align-items: center; padding: 7px 0; border-bottom: 1px solid #f0f3f7; }
.line-edit:last-child { border-bottom: 0; }
.line-edit input { min-width: 0; border: 1px solid #e1e7f0; border-radius: 9px; padding: 8px 7px; font-size: 16px; background: #fbfcfe; }
.line-remove { border: 0; background: var(--red-soft); color: var(--red); width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; }
.line-remove svg { width: 14px; height: 14px; }
.add-line { border: 1px dashed #c9d6e5; background: #f8fbff; color: var(--blue); border-radius: 10px; padding: 8px; width: 100%; font-size: 12px; font-weight: 650; margin-top: 7px; }

.sig-wrap { background: #fff; border: 1px dashed #c9d6e5; border-radius: 12px; overflow: hidden; position: relative; }
.sig-canvas { display: block; width: 100%; height: 150px; touch-action: none; }
.sig-hint { position: absolute; inset: 0; display: grid; place-items: center; color: #b2bdcb; font-size: 12px; pointer-events: none; }
.sig-actions { display: flex; justify-content: flex-end; margin-top: 5px; }
.photo-preview { display: block; margin-top: 7px; max-height: 180px; border-radius: 10px; object-fit: cover; }

.conflict-box { background: var(--amber-soft); border: 1px solid #f0dfb9; color: #76531a; border-radius: 12px; padding: 10px; font-size: 12px; margin-bottom: 10px; }
.toast { position: fixed; left: 50%; bottom: calc(94px + var(--safe-bottom)); transform: translate(-50%, 14px); z-index: 200; background: #10233e; color: #fff; border-radius: 12px; padding: 10px 14px; font-size: 12.5px; box-shadow: 0 12px 30px rgba(0,0,0,.2); opacity: 0; pointer-events: none; transition: .2s ease; max-width: 86vw; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #8f3030; }

/* Netlify injects a fixed 197x64 badge iframe at the bottom-right.
   When it is present, lift fixed controls above it. */
html.netlify-badge-space .app-shell { padding-bottom: calc(148px + var(--safe-bottom)); }
html.netlify-badge-space .bottom-nav { bottom: 64px; }
html.netlify-badge-space .fab { bottom: calc(148px + var(--safe-bottom)); }
html.netlify-badge-space .toast { bottom: calc(158px + var(--safe-bottom)); }
html.netlify-badge-space .sheet-foot { padding-bottom: calc(76px + var(--safe-bottom)); }
html.netlify-badge-space .auth-screen { padding-bottom: calc(88px + var(--safe-bottom)); }

@media (min-width: 720px) {
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .page { padding: 18px 22px 30px; }
  .topbar { padding-left: 22px; padding-right: 22px; }
  .fab { right: calc(50% - 390px); }
  .auth-screen { padding-top: 36px; }
}

/* -------------------------------------------------------------------------- */
/* iOS liquid glass                                                            */
/* -------------------------------------------------------------------------- */

:root {
  --glass: rgba(255, 255, 255, .42);
  --glass-strong: rgba(255, 255, 255, .68);
  --glass-border: rgba(255, 255, 255, .82);
  --glass-shadow: 0 10px 32px rgba(18, 44, 75, .10), inset 0 1px 0 rgba(255, 255, 255, .9), inset 0 -1px 0 rgba(255, 255, 255, .28);
}

body {
  background:
    radial-gradient(circle at 14% 10%, rgba(88, 158, 242, .30), transparent 34%),
    radial-gradient(circle at 94% 2%, rgba(182, 132, 255, .24), transparent 32%),
    radial-gradient(circle at 52% 104%, rgba(34, 196, 160, .22), transparent 38%),
    radial-gradient(ellipse 80% 58% at 12% -8%, rgba(190, 218, 255, .92), transparent 62%),
    linear-gradient(180deg, #f5f8fd 0%, #eaf1f8 100%);
  background-attachment: fixed;
}

.topbar {
  background: rgba(248, 251, 255, .60);
  -webkit-backdrop-filter: blur(24px) saturate(1.7);
  backdrop-filter: blur(24px) saturate(1.7);
  border-bottom: 1px solid rgba(255, 255, 255, .78);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .62), 0 8px 30px rgba(18, 44, 75, .05);
}

.bottom-nav {
  background: rgba(255, 255, 255, .62);
  -webkit-backdrop-filter: blur(28px) saturate(1.8);
  backdrop-filter: blur(28px) saturate(1.8);
  border-top: 1px solid rgba(255, 255, 255, .9);
  box-shadow: 0 -8px 28px rgba(18, 44, 75, .06), inset 0 1px 0 rgba(255, 255, 255, .75);
}
.nav-item { border-radius: 14px; }
.nav-item.active {
  background: linear-gradient(145deg, rgba(255, 255, 255, .74), rgba(222, 236, 250, .48));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), 0 4px 14px rgba(31, 95, 158, .10);
}

.card, .stat, .request-card, .expense-card, .batch-receive-item, .choice-card,
.insight-box, .user-pick button, .perm-row, .line-table, .summary-card, .batch-bar {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .64) 0%, rgba(255, 255, 255, .30) 46%, rgba(255, 255, 255, .50) 100%),
    var(--glass);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(24px) saturate(1.7);
  backdrop-filter: blur(24px) saturate(1.7);
  box-shadow: var(--glass-shadow);
}
.request-card, .choice-card, .user-pick button { color: var(--ink); }
.request-select-wrap.selected .request-card {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .82), rgba(219, 237, 255, .66)),
    rgba(219, 237, 255, .55);
  border-color: rgba(120, 178, 235, .72);
  box-shadow: 0 0 0 2px rgba(31, 95, 158, .10), var(--glass-shadow);
}
.batch-bar {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .82), rgba(226, 241, 255, .6)),
    rgba(226, 241, 255, .55);
  border-color: rgba(162, 202, 240, .66);
}
.card-title, .stat-value, .page-title, .summary-total, .summary-row strong { text-shadow: 0 1px 0 rgba(255, 255, 255, .35); }

.btn {
  border: 1px solid rgba(255, 255, 255, .55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .75), 0 3px 10px rgba(18, 44, 75, .06);
}
.btn-primary, .btn-blue {
  border-color: rgba(255, 255, 255, .20);
  background: linear-gradient(145deg, #173e69, #0a1d36 62%, #12335a);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 6px 16px rgba(10, 29, 54, .22);
}
.btn-ghost {
  background: rgba(255, 255, 255, .55);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-color: var(--glass-border);
}
.icon-btn, .avatar {
  background: rgba(255, 255, 255, .62);
  -webkit-backdrop-filter: blur(14px) saturate(1.5);
  backdrop-filter: blur(14px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: 0 4px 14px rgba(18, 44, 75, .08), inset 0 1px 0 rgba(255, 255, 255, .9);
}
.chip {
  background: rgba(255, 255, 255, .54);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-color: rgba(255, 255, 255, .82);
}
.chip.active {
  background: linear-gradient(145deg, #183f6b, #0a1d36);
  border-color: rgba(255, 255, 255, .18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 4px 12px rgba(10, 29, 54, .16);
}
.field input, .field select, .field textarea {
  background: rgba(255, 255, 255, .54);
  border-color: rgba(255, 255, 255, .86);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 2px rgba(18, 44, 75, .04), 0 1px 0 rgba(255, 255, 255, .8);
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: rgba(54, 124, 191, .72);
  box-shadow: 0 0 0 3px rgba(31, 95, 158, .10), inset 0 1px 2px rgba(18, 44, 75, .04);
}
.field input[type="date"] { color: var(--navy); font-weight: 600; }

.sheet {
  background:
    linear-gradient(160deg, rgba(250, 253, 255, .92), rgba(235, 243, 252, .84) 58%, rgba(248, 252, 255, .88));
  -webkit-backdrop-filter: blur(34px) saturate(1.7);
  backdrop-filter: blur(34px) saturate(1.7);
  border: 1px solid rgba(255, 255, 255, .92);
  border-bottom: 0;
  box-shadow: 0 -18px 60px rgba(8, 28, 52, .22), inset 0 1px 0 rgba(255, 255, 255, .95);
}
.sheet-head {
  background: rgba(255, 255, 255, .48);
  border-bottom-color: rgba(255, 255, 255, .72);
}
.sheet-foot {
  background: rgba(255, 255, 255, .45);
  border-top-color: rgba(255, 255, 255, .78);
}
.modal-backdrop {
  background: rgba(8, 23, 42, .42);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
}
.sheet-close {
  background: rgba(255, 255, 255, .62);
  border: 1px solid rgba(255, 255, 255, .9);
}
.line-table { overflow: hidden; }
.line-head { background: rgba(244, 248, 253, .7); }
.line-row { border-top-color: rgba(255, 255, 255, .7); }
.line-row input, .line-edit input {
  background: rgba(255, 255, 255, .58);
  border-color: rgba(255, 255, 255, .86);
}
.bar-track { background: rgba(216, 228, 240, .58); box-shadow: inset 0 1px 2px rgba(31, 95, 158, .06); }
.bar-fill { background: linear-gradient(90deg, #1b568f, #71b7f0 55%, #a8dcff); box-shadow: 0 0 10px rgba(80, 165, 235, .35); }
.user-pick button.active { border-color: rgba(31, 95, 158, .62); background: rgba(226, 240, 255, .72); }
.metric-toggle { background: rgba(255, 255, 255, .5); border-color: rgba(255, 255, 255, .8); }
.user-pick button, .metric-toggle button { -webkit-tap-highlight-color: transparent; }

.auth-card {
  background:
    linear-gradient(150deg, rgba(255, 255, 255, .94), rgba(240, 247, 255, .78)),
    rgba(255, 255, 255, .72);
  -webkit-backdrop-filter: blur(30px) saturate(1.5);
  backdrop-filter: blur(30px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, .86);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .9);
}
.hero {
  box-shadow: 0 14px 38px rgba(8, 28, 52, .22), inset 0 1px 0 rgba(255, 255, 255, .14);
}
.fab {
  background: linear-gradient(145deg, #1b4675, #0a1d36 70%);
  border: 1px solid rgba(255, 255, 255, .18);
  box-shadow: 0 10px 26px rgba(10, 29, 54, .28), inset 0 1px 0 rgba(255, 255, 255, .24);
}
.toast {
  background: rgba(12, 31, 56, .82);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: 0 14px 36px rgba(0, 0, 0, .24), inset 0 1px 0 rgba(255, 255, 255, .16);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card, .stat, .request-card, .expense-card, .batch-receive-item, .choice-card,
  .insight-box, .user-pick button, .perm-row, .line-table, .summary-card, .batch-bar,
  .sheet, .topbar, .bottom-nav, .auth-card, .field input, .field select, .field textarea {
    background-color: rgba(255, 255, 255, .93);
  }
}

/* Tap ripple */
.tap-ripple {
  position: fixed;
  z-index: 9999;
  width: 170px;
  height: 170px;
  margin: -85px 0 0 -85px;
  border-radius: 50%;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, .48);
  background: radial-gradient(circle, rgba(255, 255, 255, .92) 0%, rgba(156, 205, 248, .48) 36%, rgba(55, 126, 195, .26) 58%, transparent 72%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .42), 0 0 26px rgba(90, 168, 235, .4);
  animation: jhg-ripple .68s cubic-bezier(.2, .7, .3, 1) forwards;
  will-change: transform, opacity;
}
@keyframes jhg-ripple {
  0% { transform: scale(.18); opacity: .72; }
  65% { opacity: .28; }
  100% { transform: scale(1.55); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .tap-ripple { display: none; }
  .btn, .icon-btn, .chip, .nav-item, .choice-card, .request-card { transition: none; }
}

/* Workbench: attendance, shifts, schedule, stats */
.work-tabs { display: flex; gap: 7px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.work-tabs::-webkit-scrollbar { display: none; }
.attendance-hero { margin-bottom: 12px; }
.attendance-clock { font-size: 27px; font-weight: 780; color: var(--navy); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.attendance-times { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.attendance-times > div { background: rgba(255,255,255,.45); border: 1px solid rgba(255,255,255,.7); border-radius: 12px; padding: 9px; min-width: 0; }
.attendance-times span { display: block; color: var(--muted); font-size: 10.5px; }
.attendance-times strong { display: block; color: var(--navy); font-size: 16px; margin-top: 2px; }
.attendance-times small { display: block; color: #7a8799; font-size: 9px; line-height: 1.35; margin-top: 3px; overflow-wrap: anywhere; }
.schedule-card { padding: 5px 8px; }
.schedule-item { display: flex; align-items: flex-start; gap: 9px; width: 100%; text-align: left; border: 0; border-bottom: 1px solid rgba(231,235,241,.7); background: transparent; padding: 11px 4px; color: var(--ink); }
.schedule-item:last-child { border-bottom: 0; }
.schedule-box { width: 20px; height: 20px; border-radius: 7px; border: 1.5px solid #b8c8da; flex: 0 0 auto; display: grid; place-items: center; color: #fff; background: rgba(255,255,255,.5); }
.schedule-box svg { width: 13px; height: 13px; }
.schedule-text { flex: 1; font-size: 12.5px; line-height: 1.5; }
.schedule-by { flex: 0 0 auto; color: var(--green); font-size: 9.5px; background: var(--green-soft); border-radius: 999px; padding: 2px 6px; }
.schedule-item.done .schedule-text { text-decoration: line-through; color: #8d99a9; }
.schedule-item.done .schedule-box { background: var(--green); border-color: var(--green); }
.work-stats-list { display: grid; gap: 11px; }
.work-stat-row { display: grid; gap: 5px; }
.work-stat-row .bar-track { height: 10px; }
.work-stat-shifts { color: var(--muted); font-size: 10px; }
.work-stat-row > .between span { color: var(--navy); font-size: 11px; font-weight: 650; }
.attendance-rule-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 2px 0 12px; }
.attendance-rule-row > span { display: flex; flex-direction: column; gap: 2px; padding: 8px 9px; border-radius: 11px; background: rgba(255,255,255,.42); border: 1px solid rgba(255,255,255,.68); color: var(--muted); font-size: 10.5px; }
.attendance-rule-row strong { color: var(--navy); font-size: 13px; font-variant-numeric: tabular-nums; }
.work-summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 11px; }
.work-summary-grid > div { min-width: 0; padding: 9px; border-radius: 12px; background: rgba(255,255,255,.42); border: 1px solid rgba(255,255,255,.68); }
.work-summary-grid span { display: block; color: var(--muted); font-size: 10px; }
.work-summary-grid strong { display: block; color: var(--navy); font-size: 14px; margin-top: 2px; }
.work-summary-grid small { display: block; color: #7a8799; font-size: 8.5px; line-height: 1.35; margin-top: 3px; }
.leave-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin-bottom: 12px; }
.leave-card { padding: 12px; border-radius: 15px; background: linear-gradient(135deg, rgba(255,255,255,.68), rgba(255,255,255,.36)); border: 1px solid rgba(255,255,255,.72); box-shadow: var(--shadow); }
.leave-card span { display: block; color: var(--muted); font-size: 10.5px; }
.leave-card strong { display: block; color: var(--navy); font-size: 25px; line-height: 1.15; margin-top: 3px; font-variant-numeric: tabular-nums; }
.leave-card strong small { font-size: 11px; font-weight: 600; }
.leave-card em { display: block; color: #7a8799; font-size: 9.5px; font-style: normal; margin-top: 4px; }
.collective-people { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.collective-people > span { display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px; border-radius: 999px; background: rgba(23,48,79,.055); color: var(--navy); font-size: 10px; }
.collective-people > span.me { background: var(--blue-soft); color: var(--blue); }
.collective-people small { color: var(--muted); font-size: 9px; }
.task-rate-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding: 9px 10px; border-radius: 11px; background: rgba(255,255,255,.4); border: 1px solid rgba(255,255,255,.65); color: var(--muted); font-size: 11px; }
.task-rate-line strong { color: var(--navy); font-size: 15px; }
.task-meta { display: block; color: #8692a3; font-size: 9.5px; margin-top: 3px; font-weight: 500; }
.task-progress { flex: 0 0 auto; max-width: 88px; color: var(--muted); font-size: 9.5px; text-align: right; line-height: 1.45; }
.task-progress em { display: block; color: var(--green); font-style: normal; }
.schedule-item.disabled { opacity: .56; }
.task-edit-row { display: grid; gap: 7px; padding: 10px; margin-bottom: 8px; border-radius: 13px; background: rgba(255,255,255,.45); border: 1px solid rgba(255,255,255,.72); }
.task-edit-main input { width: 100%; height: 38px; border: 1px solid rgba(23,48,79,.1); border-radius: 9px; background: rgba(255,255,255,.72); padding: 0 10px; font-size: 12.5px; color: var(--navy); }
.task-edit-meta { display: grid; grid-template-columns: 1.15fr 1fr .8fr 30px; gap: 5px; align-items: center; }
.task-edit-meta select { min-width: 0; height: 32px; border: 1px solid rgba(23,48,79,.1); border-radius: 8px; background: rgba(255,255,255,.72); padding: 0 5px; font-size: 10.5px; color: var(--navy); }
.task-edit-meta .icon-btn { width: 30px; height: 30px; background: rgba(255,255,255,.55); }
.work-stat-metrics { display: flex; flex-wrap: wrap; gap: 5px; }
.work-stat-metrics span { padding: 3px 7px; border-radius: 999px; background: rgba(23,48,79,.055); color: var(--navy); font-size: 9.5px; }
.work-admin-links { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 9px; }
.work-admin-links .link-btn { white-space: nowrap; padding: 5px 8px; border-radius: 8px; background: rgba(23,48,79,.05); }
.shift-form-row { grid-template-columns: 1.18fr 1fr 1fr !important; }
.shift-form-row #shift-date { font-size: 12px; padding-left: 8px; padding-right: 4px; }
.shift-form-row select { font-size: 11px; padding-left: 6px; padding-right: 2px; }
@media (max-width: 380px) {
  .attendance-times { grid-template-columns: repeat(2, 1fr); }
  .attendance-times > div:last-child { grid-column: 1 / -1; }
  .work-summary-grid { grid-template-columns: repeat(2, 1fr); }
  .task-edit-meta { grid-template-columns: 1fr 1fr 30px; }
  .task-edit-meta select[data-task-grade] { grid-column: 1 / 3; }
}
