:root {
  --espresso: #241a12;
  --bark: #5b4935;
  --oak: #8b5634;
  --oak-active: #6f4228;
  --linen: #f3efe7;
  --paper: #fffdf8;
  --sand: #dfd3c3;
  --ink: #211912;
  --muted: #756a5e;
  --olive: #4d644e;
  --olive-soft: #e4ece3;
  --danger: #9d5146;
  --danger-soft: #f3e4e1;
  --shadow-float: 0 12px 32px rgba(35, 24, 16, .16);
  --shadow-touch: 0 6px 18px rgba(35, 24, 16, .1);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--linen);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { background: var(--espresso); }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--linen); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }
svg { display: block; width: 22px; height: 22px; }

:focus-visible { outline: 3px solid rgba(139, 86, 52, .35); outline-offset: 2px; }

.login-screen {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  align-items: center;
  padding: max(28px, env(safe-area-inset-top)) 22px max(20px, env(safe-area-inset-bottom));
  background: var(--espresso);
  color: var(--paper);
}
.login-brand { align-self: end; display: flex; align-items: center; gap: 18px; width: min(100%, 430px); margin: 0 auto 34px; }
.brand-mark { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; border-radius: 10px; background: var(--oak); color: #fff; font-size: 19px; font-weight: 820; box-shadow: 0 5px 16px rgba(0,0,0,.18); }
.brand-mark-large { width: 66px; height: 66px; flex-basis: 66px; border-radius: 18px; font-size: 34px; }
.login-brand h1 { margin: 0; font-size: clamp(29px, 8vw, 42px); line-height: 1.08; letter-spacing: -.035em; }
.login-brand p { margin: 9px 0 0; color: #d9cbb9; font-size: 14px; }
.login-form { width: min(100%, 430px); margin: 0 auto; padding: 24px; border: 1px solid rgba(255,255,255,.12); border-radius: 22px; background: #302219; box-shadow: var(--shadow-float); }
.login-form label, .form-field { display: grid; gap: 8px; margin-bottom: 16px; color: #d9cbb9; font-size: 13px; font-weight: 700; }
.login-form input { color: var(--paper); background: #1c140e; border-color: #604a38; }
.login-form input::placeholder { color: #8f7e6c; }
.login-form .remember-login { grid-template-columns: 24px minmax(0, 1fr); align-items: center; gap: 10px; margin: -1px 0 15px; color: var(--paper); cursor: pointer; }
.login-form .remember-login input { width: 20px; height: 20px; min-height: 20px; margin: 0; padding: 0; border: 1px solid #80654e; border-radius: 6px; accent-color: var(--olive); cursor: pointer; }
.remember-login strong, .remember-login small { display: block; }
.remember-login strong { font-size: 13px; line-height: 1.35; }
.remember-login small { margin-top: 2px; color: #b8a795; font-size: 11px; font-weight: 500; line-height: 1.4; }
.login-button { width: 100%; margin-top: 4px; }
.login-hint { margin: 14px 0 0; color: #b8a795; font-size: 12px; text-align: center; }
.login-foot { align-self: end; margin: 28px 0 0; color: #8e7f70; font-size: 12px; text-align: center; }
.form-error { min-height: 18px; margin: -4px 0 6px; color: #f1aea4; font-size: 13px; }
.new-order-error { margin: 0; color: var(--danger); line-height: 1.45; }

input, select, textarea {
  width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid var(--sand); border-radius: 14px;
  background: var(--paper); color: var(--ink); font-size: 16px; outline: none;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { border-color: var(--oak); box-shadow: 0 0 0 3px rgba(139, 86, 52, .14); }
input:disabled, select:disabled, textarea:disabled { opacity: .62; cursor: not-allowed; }

.button {
  min-height: 48px; padding: 12px 18px; border: 1px solid var(--sand); border-radius: 14px; background: var(--paper);
  color: var(--ink); font-weight: 720; cursor: pointer; transition: transform .16s ease, background .16s ease, box-shadow .16s ease;
}
.button:hover { box-shadow: var(--shadow-touch); }
.button:active { transform: translateY(1px); box-shadow: none; }
.button.primary { border-color: var(--oak); background: var(--oak); color: #fff; }
.button.primary:hover { background: var(--oak-active); }
.button.danger { border-color: #d8b4ae; background: var(--danger-soft); color: #762f27; }
.button.quiet { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 8px 12px; background: transparent; box-shadow: none; }
.button.quiet svg { flex: 0 0 auto; }
.button:disabled { opacity: .48; cursor: not-allowed; box-shadow: none; }

.app-shell { min-height: 100dvh; padding-bottom: calc(78px + var(--safe-bottom)); }
.app-header {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; height: 64px;
  padding: max(8px, env(safe-area-inset-top)) 14px 8px; border-bottom: 1px solid rgba(255,255,255,.08); background: var(--espresso); color: var(--paper);
}
.brand-button { min-width: 0; min-height: 44px; display: flex; align-items: center; gap: 10px; padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; }
.brand-title { overflow: hidden; font-size: 16px; font-weight: 780; text-overflow: ellipsis; white-space: nowrap; }
.header-actions { display: flex; align-items: center; gap: 6px; }
.icon-button, .user-button { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 12px; background: transparent; color: inherit; cursor: pointer; }
.icon-button:hover, .user-button:hover { background: rgba(255,255,255,.08); }
.user-button { width: auto; grid-auto-flow: column; gap: 8px; padding: 0 8px; font-weight: 700; }
.user-avatar { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--oak); color: #fff; font-size: 12px; }
.sync-state { display: none; align-items: center; gap: 6px; color: #cbbcab; font-size: 11px; }
.sync-state i { width: 7px; height: 7px; border-radius: 50%; background: #d3a65c; }
.sync-state.online i { background: #88a788; }
.sync-state.offline i { background: #d27a6d; }

.app-main { width: min(100%, 760px); min-height: calc(100dvh - 142px); margin: 0 auto; padding: 24px 16px 46px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin: 0 0 22px; }
.page-head h1 { margin: 0; font-size: clamp(28px, 8vw, 42px); line-height: 1.08; letter-spacing: -.035em; }
.page-head p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.head-action { flex: 0 0 auto; }

.date-rail { display: grid; grid-template-columns: repeat(7, minmax(48px, 1fr)); gap: 5px; margin: 0 -4px 22px; overflow-x: auto; scrollbar-width: none; }
.date-rail::-webkit-scrollbar { display: none; }
.date-button { min-width: 48px; min-height: 64px; padding: 7px 4px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); cursor: pointer; }
.date-button strong, .date-button span { display: block; }
.date-button strong { color: var(--ink); font-size: 15px; }
.date-button span { margin-top: 4px; font-size: 11px; }
.date-button.active { background: var(--oak); color: #fff; box-shadow: var(--shadow-touch); }
.date-button.active strong { color: #fff; }

.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 28px 0 10px; }
.section-title h2 { margin: 0; font-size: 18px; line-height: 1.3; }
.section-title span, .section-title button { color: var(--muted); font-size: 12px; }
.text-button { min-height: 44px; display: inline-flex; align-items: center; padding: 4px 6px; border: 0; background: none; color: var(--oak) !important; font-weight: 700; cursor: pointer; }

.agenda { overflow: hidden; border: 1px solid var(--sand); border-radius: 18px; background: var(--paper); }
.agenda-row { width: 100%; display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 84px; padding: 14px 14px; border: 0; border-bottom: 1px solid var(--sand); background: transparent; text-align: left; cursor: pointer; }
.agenda-row:last-child { border-bottom: 0; }
.agenda-row:hover { background: #f8f3eb; }
.agenda-time { color: var(--oak); font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.agenda-main { min-width: 0; }
.agenda-main strong { display: block; overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.agenda-main span { display: block; overflow: hidden; margin-top: 5px; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.agenda-state { display: flex; align-items: center; gap: 5px; }

.status-chip { display: inline-flex; align-items: center; gap: 5px; min-height: 26px; padding: 4px 9px; border: 1px solid var(--sand); border-radius: 999px; background: #f6f1e9; color: var(--muted); font-size: 11px; font-weight: 720; white-space: nowrap; }
.status-chip.active { border-color: #c79672; background: #f1dfd1; color: #6f3d22; }
.status-chip.done { border-color: #c4d3c4; background: var(--olive-soft); color: #385239; }
.status-chip.danger { border-color: #d9b6b0; background: var(--danger-soft); color: #7c352c; }
.status-chip.review { border-color: var(--oak); background: #f2e5da; color: var(--oak-active); }
.status-chip.locked { border-color: var(--sand); background: var(--linen); color: var(--oak-active); }

.baton-wrap { margin: 30px -16px 0; padding: 0 16px 26px; background: var(--bark); color: #fff; }
.baton-label { display: flex; align-items: center; justify-content: center; height: 52px; margin: 0 -16px; background: var(--oak); font-size: 19px; font-weight: 780; letter-spacing: .04em; }
.baton-label::before, .baton-label::after { width: 44px; height: 1px; margin: 0 12px; background: rgba(255,255,255,.45); content: ""; }
.baton-surface { margin-top: 0; padding: 20px 18px; border-radius: 0 0 22px 22px; background: var(--paper); color: var(--ink); box-shadow: var(--shadow-float); }
.baton-head { display: flex; justify-content: space-between; gap: 14px; }
.baton-head h2 { margin: 0; font-size: 22px; }
.baton-head p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.baton-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 18px 0; overflow: hidden; border: 1px solid var(--sand); border-radius: 14px; background: var(--sand); }
.baton-meta div { min-width: 0; padding: 12px; background: #f9f5ef; }
.baton-meta span { display: block; color: var(--muted); font-size: 11px; }
.baton-meta strong { display: block; overflow: hidden; margin-top: 5px; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.current-action { margin-top: 18px; padding-top: 17px; border-top: 1px solid var(--sand); }
.current-action-label { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.current-action-label span { color: var(--muted); font-size: 12px; }
.current-action-label strong { color: var(--oak); font-size: 14px; }
.primary-action { width: 100%; min-height: 54px; font-size: 16px; }
.waiting-note { display: flex; gap: 10px; align-items: flex-start; padding: 13px; border-radius: 12px; background: var(--olive-soft); color: #365037; font-size: 13px; line-height: 1.45; }
.waiting-note svg { flex: 0 0 auto; }
.waiting-note.date-locked { border: 1px solid var(--sand); background: var(--linen); color: var(--oak-active); }

.staff-line { display: flex; gap: 8px; overflow-x: auto; margin: 15px -2px 0; padding: 2px; scrollbar-width: none; }
.staff-person { flex: 0 0 auto; display: flex; align-items: center; gap: 7px; padding: 6px 9px 6px 6px; border: 1px solid var(--sand); border-radius: 999px; background: #faf6ef; font-size: 12px; }
.mini-avatar { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--olive); color: #fff; font-size: 10px; font-weight: 800; }

.segmented { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 18px; padding: 3px; border: 1px solid var(--sand); border-radius: 14px; background: #e9e0d4; }
.segmented button { min-height: 44px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 700; cursor: pointer; }
.segmented button.active { background: var(--paper); color: var(--oak); box-shadow: 0 2px 8px rgba(35,24,16,.08); }

.work-mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 24px; }
.work-mode-button { min-width: 0; min-height: 88px; display: grid; align-content: center; gap: 6px; padding: 12px 14px; border: 1px solid var(--sand); border-radius: 14px; background: var(--paper); color: var(--muted); text-align: left; cursor: pointer; }
.work-mode-button strong { color: var(--ink); font-size: 16px; }
.work-mode-button span { min-height: 32px; font-size: 12px; line-height: 1.35; }
.work-mode-button.active { border-color: var(--oak); background: var(--oak); color: var(--paper); }
.work-mode-button.active strong { color: var(--paper); }
.work-section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 0 0 14px; }
.work-section-head h2 { margin: 0; font-size: 18px; }
.work-section-head p { max-width: 52ch; margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.work-section-head > span { flex: 0 0 auto; color: var(--muted); font-size: 12px; }
.management-filter { grid-template-columns: repeat(2, 1fr); }

.payroll-entry, .payroll-review-entry { width: 100%; display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 12px; align-items: center; margin: 0 0 20px; padding: 14px; border: 1px solid var(--sand); border-radius: 16px; background: var(--paper); color: var(--ink); text-align: left; cursor: pointer; }
.payroll-entry:hover, .payroll-review-entry:hover { border-color: #c7a78f; background: #fbf6ef; box-shadow: var(--shadow-touch); }
.payroll-entry-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 13px; background: var(--espresso); color: var(--paper); }
.payroll-entry strong, .payroll-review-entry strong { display: block; font-size: 15px; }
.payroll-entry small, .payroll-review-entry small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 500; line-height: 1.45; }
.payroll-entry-action { display: inline-flex; align-items: center; gap: 3px; color: var(--oak); font-size: 12px; font-weight: 750; white-space: nowrap; }
.payroll-entry-action svg, .payroll-review-entry > svg { width: 18px; height: 18px; }
.payroll-review-entry { margin-bottom: 14px; border-color: #c9aa91; background: #f6ece3; }
.payroll-review-entry .payroll-entry-icon { background: var(--oak); }

.page-back { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; margin: -10px 0 12px; padding: 4px 8px 4px 0; border: 0; background: transparent; color: var(--oak); font-size: 13px; font-weight: 720; cursor: pointer; }
.page-back svg { width: 18px; height: 18px; }
.payroll-page-head { align-items: center; }
.payroll-month-switch { display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; align-items: stretch; gap: 8px; margin: 0 0 18px; }
.payroll-month-switch > button { min-height: 52px; display: grid; place-items: center; border: 1px solid var(--sand); border-radius: 14px; background: var(--paper); color: var(--oak); cursor: pointer; }
.payroll-month-switch label { position: relative; min-width: 0; }
.payroll-month-switch label > span { position: absolute; z-index: 1; top: 7px; left: 14px; color: var(--muted); font-size: 9px; font-weight: 700; pointer-events: none; }
.payroll-month-switch input { height: 52px; padding-top: 21px; font-weight: 750; }

.payroll-book { display: grid; gap: 18px; }
.payroll-ticket { overflow: hidden; border-radius: 20px; background: var(--espresso); color: var(--paper); box-shadow: 0 8px 24px rgba(35,24,16,.14); }
.payroll-ticket > div { padding: 22px 20px 18px; }
.payroll-ticket > div > span { display: block; color: #d8c9b8; font-size: 12px; }
.payroll-ticket > div > strong { display: block; margin-top: 7px; font-size: clamp(32px, 10vw, 48px); line-height: 1; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.payroll-ticket > div > small { display: block; margin-top: 10px; color: #bba997; font-size: 10px; }
.payroll-ticket dl { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; border-top: 1px solid rgba(255,255,255,.12); background: #302219; }
.payroll-ticket dl > div { min-width: 0; padding: 13px 12px; border-right: 1px solid rgba(255,255,255,.1); }
.payroll-ticket dl > div:last-child { border-right: 0; }
.payroll-ticket dt { color: #baa997; font-size: 10px; }
.payroll-ticket dd { overflow: hidden; margin: 5px 0 0; font-size: 12px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.payroll-ticket-compact { margin-bottom: 18px; }
.payroll-ticket-compact > div { padding: 18px; }
.payroll-ticket-compact > div > strong { font-size: 34px; }

.payroll-review-note { display: grid; gap: 5px; margin: 0 0 18px; padding: 13px 14px; border: 1px solid #d4aaa3; border-radius: 14px; background: var(--danger-soft); color: #74352e; }
.payroll-review-note strong { font-size: 12px; }
.payroll-review-note span { font-size: 12px; line-height: 1.5; }
.payroll-sheet { overflow: hidden; border: 1px solid var(--sand); border-radius: 18px; background: var(--paper); }
.payroll-sheet-head { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--sand); }
.payroll-sheet-head h2 { margin: 0; font-size: 17px; }
.payroll-sheet-head p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.payroll-sheet-head .button { flex: 0 0 auto; }
.payroll-base-field { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; margin: 16px; padding: 0 14px; border: 1px solid var(--sand); border-radius: 14px; background: #faf6ef; color: var(--oak); font-size: 24px; font-weight: 780; }
.payroll-base-field input { min-width: 0; padding-right: 0; padding-left: 0; border: 0; background: transparent; box-shadow: none; font-size: 24px; font-weight: 780; }
.payroll-base-field em { color: var(--muted); font-size: 12px; font-style: normal; }
.payroll-inline-empty { padding: 24px 18px; color: var(--muted); font-size: 12px; line-height: 1.55; text-align: center; }

.payroll-work-list { padding: 0; }
.payroll-work-item { border-bottom: 1px solid var(--sand); }
.payroll-work-item:last-child { border-bottom: 0; }
.payroll-work-item summary { list-style: none; }
.payroll-work-item summary::-webkit-details-marker { display: none; }
.payroll-work-item label { display: grid; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 700; }
.payroll-work-item label small { font-weight: 500; }
.payroll-work-head { min-height: 68px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 16px; cursor: pointer; }
.payroll-work-head > span:first-child { min-width: 0; }
.payroll-work-head > span:first-child strong, .payroll-work-head > span:first-child small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.payroll-work-head > span:first-child strong { font-size: 14px; }
.payroll-work-head > span:first-child small { margin-top: 4px; color: var(--muted); font-size: 10px; font-weight: 550; }
.payroll-work-head > span:last-child { display: flex; align-items: center; gap: 7px; }
.payroll-work-head > span:last-child strong { font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.payroll-work-head svg { width: 18px; height: 18px; color: var(--muted); transition: transform .18s ease-out; }
.payroll-work-item[open] .payroll-work-head svg { transform: rotate(90deg); }
.payroll-work-item[open] .payroll-work-head { background: #faf6ef; }
.payroll-work-body { display: grid; gap: 13px; padding: 16px 16px 18px; border-top: 1px solid var(--sand); }
.payroll-work-delete { min-height: 44px; border: 1px solid #d4aaa3; border-radius: 14px; background: var(--paper); color: var(--danger); font-size: 12px; font-weight: 720; cursor: pointer; }
.payroll-field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.payroll-order-link select { font-size: 13px; }

.payroll-leave-balance { flex: 0 0 auto; padding: 6px 9px; border-radius: 999px; background: var(--olive-soft); color: #39533b; font-size: 10px; font-weight: 750; }
.payroll-leave-balance.over { background: var(--danger-soft); color: #74352e; }
.payroll-leave-facts { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; border-bottom: 1px solid var(--sand); background: #faf6ef; }
.payroll-leave-facts > div { padding: 13px 12px; border-right: 1px solid var(--sand); }
.payroll-leave-facts > div:last-child { border-right: 0; }
.payroll-leave-facts dt { color: var(--muted); font-size: 10px; }
.payroll-leave-facts dd { margin: 5px 0 0; font-size: 13px; font-weight: 760; }
.payroll-calendar-instruction { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 10px; }
.payroll-calendar-instruction strong { font-size: 13px; }
.payroll-calendar-instruction span { color: var(--muted); font-size: 10px; }
.payroll-calendar-head, .payroll-calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; padding: 0 13px; }
.payroll-calendar-head span { min-width: 0; padding: 6px 0; color: var(--muted); font-size: 10px; font-weight: 720; text-align: center; }
.payroll-calendar-head small { display: block; margin-top: 2px; color: var(--danger); font-size: 7px; }
.payroll-calendar { padding-bottom: 15px; }
.payroll-calendar-day { position: relative; min-width: 0; min-height: 44px; display: grid; place-items: center; padding: 4px 1px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--ink); cursor: pointer; }
.payroll-calendar-day span { font-size: 12px; font-weight: 680; }
.payroll-calendar-day small { position: absolute; right: 2px; bottom: 2px; color: var(--oak); font-size: 7px; font-weight: 800; }
.payroll-calendar-day.weekend { color: var(--danger); }
.payroll-calendar-day.has-leave { border-color: #c9aa91; background: #f1dfd1; color: var(--oak-active); }
.payroll-calendar-day.active { outline: 2px solid var(--oak); outline-offset: 0; }
.payroll-calendar-day:disabled { opacity: .72; cursor: default; }
.payroll-leave-picker { margin: 0 16px 16px; padding: 13px; border: 1px solid #c9aa91; border-radius: 14px; background: #f6ece3; }
.payroll-leave-picker > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.payroll-leave-picker > div:first-child strong { font-size: 13px; }
.payroll-leave-picker > div:first-child button { min-height: 40px; border: 0; background: transparent; color: var(--muted); font-size: 11px; cursor: pointer; }
.payroll-leave-picker > div:nth-child(2) { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.payroll-leave-picker > div:nth-child(2) button { min-height: 54px; display: grid; place-items: center; align-content: center; gap: 3px; border: 1px solid var(--sand); border-radius: 11px; background: var(--paper); cursor: pointer; }
.payroll-leave-picker > div:nth-child(2) button.active { border-color: var(--oak); background: var(--oak); color: var(--paper); }
.payroll-leave-picker > div:nth-child(2) strong { font-size: 12px; }
.payroll-leave-picker > div:nth-child(2) span { font-size: 9px; }
.payroll-leave-list { margin: 0; padding: 0 16px; list-style: none; border-top: 1px solid var(--sand); }
.payroll-leave-list li { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--sand); }
.payroll-leave-list li:last-child { border-bottom: 0; }
.payroll-leave-list strong, .payroll-leave-list small { display: block; }
.payroll-leave-list strong { font-size: 12px; }
.payroll-leave-list small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.payroll-leave-list button { min-height: 42px; border: 0; background: transparent; color: var(--danger); font-size: 11px; cursor: pointer; }
.payroll-rules { border-top: 1px solid var(--sand); }
.payroll-rules summary { min-height: 48px; display: flex; align-items: center; padding: 0 16px; color: var(--oak); font-size: 11px; font-weight: 720; cursor: pointer; }
.payroll-rules p { margin: 0; padding: 0 16px 16px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.payroll-submit-panel { margin-top: 18px; padding: 18px; border: 1px solid var(--sand); border-radius: 18px; background: var(--paper); }
.payroll-submit-panel > div:not(.waiting-note) { display: grid; gap: 5px; margin-bottom: 14px; }
.payroll-submit-panel > div > strong { font-size: 14px; }
.payroll-submit-panel > div > span { color: var(--muted); font-size: 11px; line-height: 1.45; }
.payroll-submit-panel > .button { width: 100%; }

.payroll-review-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; overflow: hidden; margin: 0 0 18px; border: 1px solid var(--sand); border-radius: 16px; background: var(--sand); }
.payroll-review-summary span { min-width: 0; padding: 13px 10px; background: var(--paper); color: var(--muted); font-size: 10px; text-align: center; }
.payroll-review-summary strong { display: block; margin-top: 5px; color: var(--ink); font-size: 20px; }
.payroll-review-ledger { overflow: hidden; border-top: 1px solid var(--sand); border-bottom: 1px solid var(--sand); background: var(--paper); }
.payroll-review-row { width: 100%; min-height: 82px; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto 18px; gap: 10px; align-items: center; padding: 12px 10px; border: 0; border-bottom: 1px solid var(--sand); background: transparent; text-align: left; cursor: pointer; }
.payroll-review-row:last-child { border-bottom: 0; }
.payroll-review-row:hover { background: #faf6ef; }
.payroll-review-row > span:nth-child(2) { min-width: 0; }
.payroll-review-row > span:nth-child(2) > strong { display: flex; align-items: baseline; gap: 7px; font-size: 14px; }
.payroll-review-row > span:nth-child(2) > strong small { color: var(--muted); font-size: 9px; font-weight: 600; }
.payroll-review-row em { display: block; overflow: hidden; margin-top: 5px; color: var(--muted); font-size: 10px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.payroll-review-row > span:nth-child(3) { display: grid; justify-items: end; gap: 5px; }
.payroll-review-row > span:nth-child(3) > strong { font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.payroll-review-row .status-chip { min-height: 22px; margin: 0; padding: 3px 7px; font-size: 9px; }
.payroll-review-person { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 11px; align-items: center; margin-bottom: 16px; }
.payroll-review-person .mini-avatar { width: 40px; height: 40px; }
.payroll-review-person h3 { margin: 0; font-size: 18px; }
.payroll-review-person p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.payroll-review-detail-list { display: grid; }
.payroll-review-detail-list > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--sand); }
.payroll-review-detail-list > div:last-child { border-bottom: 0; }
.payroll-review-detail-list span:first-child { min-width: 0; }
.payroll-review-detail-list strong, .payroll-review-detail-list small { display: block; }
.payroll-review-detail-list span:first-child strong { font-size: 12px; }
.payroll-review-detail-list small { overflow: hidden; margin-top: 4px; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.payroll-review-detail-list span:last-child { flex: 0 0 auto; color: var(--muted); font-size: 10px; text-align: right; }
.payroll-review-detail-list span:last-child strong { margin-top: 4px; color: var(--ink); font-size: 12px; }
.payroll-review-actions textarea { min-height: 86px; }
.payroll-drawer-note { color: var(--muted); font-size: 11px; line-height: 1.5; }

.ledger { overflow: hidden; border-top: 1px solid var(--sand); border-bottom: 1px solid var(--sand); background: var(--paper); }
.ledger-row { width: 100%; display: grid; grid-template-columns: 54px minmax(0, 1fr) 24px; gap: 12px; min-height: 90px; align-items: center; padding: 14px 12px 14px 0; border: 0; border-bottom: 1px solid var(--sand); background: transparent; text-align: left; cursor: pointer; }
.ledger-row:last-child { border-bottom: 0; }
.ledger-date { align-self: stretch; display: grid; place-items: center; border-right: 1px solid var(--sand); color: var(--muted); font-size: 11px; font-weight: 750; line-height: 1.35; text-align: center; }
.ledger-copy { min-width: 0; }
.ledger-copy strong { display: block; overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.ledger-copy span { display: block; overflow: hidden; margin-top: 5px; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.ledger-copy .status-chip { display: inline-flex; margin-top: 8px; }

.search-box { position: relative; margin-bottom: 18px; }
.search-box svg { position: absolute; left: 14px; top: 13px; color: var(--muted); pointer-events: none; }
.search-box input { padding-left: 44px; }

.detail-hero { margin: -24px -16px 0; padding: 28px 18px 24px; background: var(--espresso); color: var(--paper); }
.detail-back { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; margin: -10px 0 16px; padding: 0 6px 0 0; border: 0; background: transparent; color: #d7c8b8; cursor: pointer; }
.detail-hero h1 { margin: 0; font-size: 30px; letter-spacing: -.025em; }
.detail-hero p { margin: 8px 0 0; color: #cdbdac; font-size: 13px; }
.detail-hero .status-chip { margin-top: 16px; }
.detail-action { margin: 0 -16px 24px; padding: 20px 18px; background: var(--bark); }
.detail-action .baton-surface { border-radius: 18px; }

.info-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 20px 0 0; overflow: hidden; border: 1px solid var(--sand); border-radius: 16px; background: var(--sand); }
.info-strip > div { min-width: 0; padding: 14px; background: var(--paper); }
.info-strip span { display: block; color: var(--muted); font-size: 11px; }
.info-strip strong { display: block; overflow-wrap: anywhere; margin-top: 5px; font-size: 13px; line-height: 1.4; }

.panel { margin: 18px 0; border: 1px solid var(--sand); border-radius: 18px; background: var(--paper); overflow: hidden; }
.panel-head { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--sand); }
.panel-head h2 { margin: 0; font-size: 16px; }
.panel-body { padding: 16px; }
.staff-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; overflow: hidden; border: 1px solid var(--sand); border-radius: 14px; background: var(--sand); }
.staff-role { min-width: 0; padding: 12px 8px; background: #faf6ef; text-align: center; }
.staff-role span { color: var(--muted); font-size: 10px; }
.staff-role strong { display: block; overflow: hidden; margin-top: 6px; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.legacy-note { margin: 12px 0 0; color: var(--danger); font-size: 12px; line-height: 1.5; }

.product-reference-panel { overflow: visible; }
.product-reference-panel .panel-body { display: grid; gap: 12px; }
.product-photo { position: relative; display: block; overflow: hidden; border: 1px solid var(--sand); border-radius: 14px; background: var(--linen); color: var(--paper); text-decoration: none; }
.product-photo img { width: 100%; max-height: 420px; display: block; object-fit: contain; background: var(--linen); }
.product-photo span { position: absolute; right: 8px; bottom: 8px; min-height: 32px; display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 8px; background: rgba(36,26,18,.82); color: var(--paper); font-size: 11px; font-weight: 700; }
.product-photo-empty { min-height: 180px; display: grid; place-items: center; align-content: center; gap: 8px; padding: 24px; border: 1px dashed var(--sand); border-radius: 14px; background: var(--linen); text-align: center; }
.product-photo-empty svg { color: var(--oak); }
.product-photo-empty strong { font-size: 14px; }
.product-photo-empty span, .product-photo-meta { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.product-photo-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.product-photo-picker { position: relative; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); cursor: pointer; }
.product-photo-picker input { position: absolute; width: 1px; height: 1px; min-height: 0; opacity: 0; pointer-events: none; }

.timeline { position: relative; display: grid; gap: 0; }
.timeline::before { position: absolute; top: 22px; bottom: 22px; left: 15px; width: 1px; background: var(--sand); content: ""; }
.timeline-step { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; min-height: 62px; padding: 9px 0; }
.timeline-dot { position: relative; z-index: 1; width: 16px; height: 16px; margin: 4px 0 0 8px; border: 2px solid #b5ab9f; border-radius: 50%; background: var(--paper); }
.timeline-step.done .timeline-dot { border-color: var(--olive); background: var(--olive); box-shadow: inset 0 0 0 3px var(--paper); }
.timeline-step.current .timeline-dot { width: 22px; height: 22px; margin: 1px 0 0 5px; border: 4px solid #e8d1c1; background: var(--oak); box-shadow: 0 0 0 2px var(--oak); }
.timeline-copy strong { display: block; font-size: 14px; }
.timeline-copy span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.timeline-step.current .timeline-copy strong { color: var(--oak); font-size: 16px; }
.timeline-tools { display: flex; gap: 8px; margin-top: 7px; }
.timeline-tools button, .timeline-secondary button { min-height: 44px; padding: 7px 10px; border: 1px solid var(--sand); border-radius: 9px; background: var(--paper); color: var(--muted); font-size: 11px; cursor: pointer; }
.timeline-secondary { margin-top: 5px; }
.timeline-secondary summary { min-height: 44px; display: flex; align-items: center; width: fit-content; color: var(--muted); font-size: 11px; cursor: pointer; }
.timeline-secondary button { display: block; margin-bottom: 6px; }
.timeline-group { margin: 0 0 10px; border: 1px solid var(--sand); border-radius: 12px; background: #faf6ef; }
.timeline-group > summary { min-height: 48px; display: flex; align-items: center; padding: 0 13px; color: var(--oak); font-size: 12px; font-weight: 730; cursor: pointer; }
.timeline-group > .timeline { padding: 0 13px 8px; }

.activity-list { display: grid; }
.activity-item { display: grid; grid-template-columns: 8px minmax(0, 1fr); gap: 11px; padding: 12px 0; border-bottom: 1px solid var(--sand); }
.activity-item:last-child { border-bottom: 0; }
.activity-item i { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--olive); }
.activity-item strong { display: block; font-size: 13px; line-height: 1.45; }
.activity-item span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }

.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 28px 0 8px; padding: 16px; border: 1px solid var(--danger); border-radius: 16px; background: var(--danger-soft); }
.danger-zone div { min-width: 0; }
.danger-zone h2 { margin: 0; color: var(--danger); font-size: 16px; }
.danger-zone p { max-width: 50ch; margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.danger-zone .button { flex: 0 0 auto; }

.new-form { display: grid; gap: 18px; }
.form-section { overflow: hidden; border: 1px solid var(--sand); border-radius: 18px; background: var(--paper); }
.form-section > h2 { margin: 0; padding: 16px 18px; border-bottom: 1px solid var(--sand); font-size: 16px; }
.form-section-body { display: grid; gap: 15px; padding: 18px; }
.form-section label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.project-start { border-color: #c9aa91; }
.project-start > h2 { background: #f2e5da; color: var(--oak-active); }
.project-start select { border-color: #c9aa91; font-weight: 760; }
.project-start p { margin: -3px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.paste-box { min-height: 145px; }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.person-fields { display: grid; gap: 20px; }
.person-block + .person-block { padding-top: 18px; border-top: 1px solid var(--sand); }
.person-block h3 { margin: 0 0 12px; font-size: 15px; }
.package-preview { display: grid; gap: 7px; padding: 13px 14px; border: 1px solid #cdb59f; border-radius: 12px; background: #f6ece3; }
.package-preview strong { color: var(--oak-active); font-size: 14px; }
.package-preview span { color: var(--muted); font-size: 11px; line-height: 1.55; }
.form-disclosure { border-top: 1px solid var(--sand); border-bottom: 1px solid var(--sand); }
.form-disclosure > summary { min-height: 48px; display: flex; align-items: center; color: var(--oak); font-size: 13px; font-weight: 730; cursor: pointer; }
.form-disclosure-body { display: grid; gap: 14px; padding-bottom: 16px; }
.participant-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; overflow: hidden; border: 1px solid var(--sand); border-radius: 14px; background: var(--sand); }
.participant-card { min-width: 0; padding: 14px; background: #faf6ef; }
.participant-card span { color: var(--muted); font-size: 10px; }
.participant-card strong { display: block; overflow: hidden; margin-top: 6px; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.participant-card p { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }

.choice-group { display: grid; gap: 8px; }
.choice-group-title { color: var(--ink); font-size: 13px; font-weight: 760; }
.choice-help { color: var(--muted); font-size: 11px; line-height: 1.45; }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { min-height: 44px; display: inline-flex; align-items: center; padding: 8px 12px; border: 1px solid var(--sand); border-radius: 12px; background: #faf6ef; color: var(--ink); font-size: 13px; cursor: pointer; }
.choice input:checked + span { border-color: var(--oak); background: #ecd9ca; color: #673c25; font-weight: 760; }
.choice input:focus-visible + span { outline: 3px solid rgba(139,86,52,.3); }

.switch-row { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 8px 0; border-bottom: 1px solid var(--sand); }
.switch-row:last-child { border-bottom: 0; }
.switch-row strong { display: block; font-size: 14px; }
.switch-row span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.switch { position: relative; width: 48px; height: 44px; flex: 0 0 48px; }
.switch input { position: absolute; opacity: 0; }
.switch i { position: absolute; inset: 8px 0; border-radius: 999px; background: #c9c0b5; transition: background .2s ease; cursor: pointer; }
.switch i::after { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.2); content: ""; transition: transform .2s ease; }
.switch input:checked + i { background: var(--olive); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 3px solid rgba(139,86,52,.3); }

.bottom-nav { position: fixed; right: 0; bottom: 0; left: 0; z-index: 35; display: grid; grid-template-columns: repeat(5, 1fr); min-height: calc(70px + var(--safe-bottom)); padding: 5px 6px var(--safe-bottom); border-top: 1px solid var(--sand); background: rgba(255,253,248,.98); box-shadow: 0 -8px 26px rgba(35,24,16,.1); }
.nav-button { min-width: 0; display: grid; place-items: center; align-content: center; gap: 4px; min-height: 60px; padding: 4px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 700; cursor: pointer; }
.nav-button svg { width: 22px; height: 22px; }
.nav-button.active { background: #eddfd3; color: var(--oak-active); }
.desktop-rail { display: none; }

.drawer-shell { position: fixed; inset: 0; z-index: 80; display: flex; justify-content: flex-end; }
.drawer-backdrop { position: absolute; inset: 0; border: 0; background: rgba(28,20,14,.48); cursor: default; }
.drawer { position: relative; width: min(100%, 480px); height: 100%; overflow: auto; background: var(--linen); box-shadow: var(--shadow-float); animation: drawer-in .35s cubic-bezier(.16,1,.3,1); }
.drawer-head { position: sticky; top: 0; z-index: 1; min-height: 66px; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--sand); background: rgba(243,239,231,.98); }
.drawer-head h2 { margin: 0; font-size: 20px; }
.drawer-body { padding: 18px 16px calc(34px + var(--safe-bottom)); }
.drawer-body .panel { margin-top: 0; }

.empty-state { padding: 32px 20px; border: 1px dashed #cbbdae; border-radius: 18px; color: var(--muted); text-align: center; }
.empty-state svg { width: 32px; height: 32px; margin: 0 auto 12px; color: var(--oak); }
.empty-state strong { display: block; color: var(--ink); font-size: 15px; }
.empty-state p { margin: 7px auto 0; max-width: 34ch; font-size: 12px; line-height: 1.55; }
.empty-state .button { margin-top: 14px; }
.compact-empty { padding: 22px 18px; }
.list-more { width: 100%; margin-top: 12px; }
.order-month { margin: 0 0 22px; }
.order-month-head { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.order-month-head h2 { margin: 0; font-size: 16px; }
.order-month-head span { color: var(--muted); font-size: 12px; }

.stats-head { align-items: end; }
.stats-month { min-width: 138px; display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 700; }
.stats-month select { min-height: 44px; padding: 9px 12px; font-size: 13px; }
.stats-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; overflow: hidden; margin-bottom: 24px; border: 1px solid var(--sand); border-radius: 18px; background: var(--sand); }
.stats-strip > div { min-width: 0; padding: 16px 14px; background: var(--paper); }
.stats-strip span { display: block; color: var(--muted); font-size: 11px; }
.stats-strip strong { display: block; overflow: hidden; margin-top: 8px; font-size: 22px; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stats-strip small { font-size: 12px; font-weight: 650; }
.report-sheet { margin: 0 0 24px; overflow: hidden; border-top: 1px solid var(--sand); border-bottom: 1px solid var(--sand); background: var(--paper); }
.report-head { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--sand); }
.report-head h2 { margin: 0; font-size: 16px; }
.report-head span { color: var(--muted); font-size: 11px; }
.workflow-bar { height: 14px; display: flex; margin: 18px 14px 12px; overflow: hidden; border-radius: 999px; background: #ece4da; }
.workflow-bar i { display: block; min-width: 0; }
.workflow-bar .delivered, .workflow-legend i.delivered { background: var(--olive); }
.workflow-bar .active, .workflow-legend i.active { background: var(--oak); }
.workflow-bar .review, .workflow-legend i.review { background: var(--bark); }
.workflow-bar .assignment, .workflow-legend i.assignment { background: var(--danger); }
.workflow-legend { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 0 14px 18px; }
.workflow-legend span { display: grid; grid-template-columns: 8px 1fr; gap: 5px; align-items: center; color: var(--muted); font-size: 10px; }
.workflow-legend i { width: 8px; height: 8px; border-radius: 50%; }
.workflow-legend strong { grid-column: 2; color: var(--ink); font-size: 15px; }
.metric-list { padding: 4px 14px 10px; }
.metric-row { padding: 12px 0; border-bottom: 1px solid var(--sand); }
.metric-row:last-child { border-bottom: 0; }
.metric-row > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.metric-row strong { min-width: 0; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.metric-row span { flex: 0 0 auto; color: var(--muted); font-size: 11px; }
.metric-row > i, .staff-stat-row > div > i { height: 6px; display: block; overflow: hidden; margin-top: 8px; border-radius: 999px; background: #ece4da; }
.metric-row b, .staff-stat-row b { height: 100%; display: block; border-radius: inherit; background: var(--oak); }
.staff-stats { padding: 4px 14px 10px; }
.staff-stat-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 64px; border-bottom: 1px solid var(--sand); }
.staff-stat-row:last-child { border-bottom: 0; }
.staff-stat-row > div { min-width: 0; }
.staff-stat-row strong { display: flex; align-items: baseline; gap: 7px; font-size: 13px; }
.staff-stat-row strong small { color: var(--muted); font-size: 10px; font-weight: 600; }
.staff-stat-row > span:last-child { color: var(--ink); font-size: 13px; font-weight: 750; text-align: right; }
.staff-stat-row > span:last-child small { display: block; margin-top: 4px; color: var(--danger); font-size: 9px; font-weight: 650; }

.toast { position: fixed; left: 50%; bottom: calc(88px + var(--safe-bottom)); z-index: 120; max-width: calc(100vw - 32px); padding: 11px 15px; border-radius: 12px; background: var(--espresso); color: #fff; box-shadow: var(--shadow-float); font-size: 13px; line-height: 1.4; opacity: 0; pointer-events: none; transform: translate(-50%, 10px); transition: opacity .2s ease, transform .28s cubic-bezier(.16,1,.3,1); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.loading-state { display: grid; gap: 13px; padding-top: 30px; }
.loading-line { height: 22px; border-radius: 6px; background: #ded5ca; animation: loading-pulse 1.2s ease-in-out infinite alternate; }
.loading-line.short { width: 58%; }
.handoff-flash { animation: handoff-flash .7s cubic-bezier(.16,1,.3,1); }
.offline-banner { margin-bottom: 16px; padding: 11px 13px; border: 1px solid #d6b0a9; border-radius: 12px; background: var(--danger-soft); color: #73362e; font-size: 12px; line-height: 1.5; }

@keyframes drawer-in { from { transform: translateX(36px); opacity: .4; } to { transform: translateX(0); opacity: 1; } }
@keyframes loading-pulse { to { opacity: .45; } }
@keyframes handoff-flash { 0% { clip-path: inset(0 100% 0 0); } 100% { clip-path: inset(0); } }

@media (min-width: 560px) {
  .sync-state { display: flex; }
  .app-main { padding-right: 24px; padding-left: 24px; }
  .baton-wrap { margin-right: -24px; margin-left: -24px; padding-right: 24px; padding-left: 24px; }
  .baton-label { margin-right: -24px; margin-left: -24px; }
  .stats-strip { grid-template-columns: repeat(4, 1fr); }
  .management-filter { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 559px) {
  .danger-zone { align-items: stretch; flex-direction: column; }
  .danger-zone .button { width: 100%; }
  .payroll-entry-action { font-size: 0; }
  .payroll-sheet-head { align-items: flex-start; }
  .payroll-sheet-head .text-button { max-width: 130px; justify-content: flex-end; font-size: 10px; text-align: right; }
  .payroll-review-row { grid-template-columns: 30px minmax(0, 1fr) auto 16px; gap: 8px; padding-right: 7px; padding-left: 7px; }
  .payroll-review-row > span:nth-child(2) > strong { display: grid; gap: 2px; }
}

@media (min-width: 940px) {
  body { background: #ded5ca; }
  .app-shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); padding-bottom: 0; }
  .app-header, .bottom-nav { display: none; }
  .desktop-rail { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; padding: 24px 16px; background: var(--espresso); color: var(--paper); }
  .rail-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 24px; }
  .rail-brand strong { font-size: 17px; }
  .desktop-rail nav { display: grid; gap: 6px; }
  .desktop-rail .nav-button { grid-template-columns: 28px 1fr; place-items: center start; min-height: 50px; padding: 8px 12px; color: #cdbdac; font-size: 13px; }
  .desktop-rail .nav-button.active { background: var(--oak); color: #fff; }
  .rail-tools { display: grid; gap: 5px; margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.1); }
  .rail-tool { min-height: 48px; display: grid; grid-template-columns: 28px 1fr; align-items: center; padding: 8px 12px; border: 0; border-radius: 12px; background: transparent; color: #cdbdac; text-align: left; cursor: pointer; }
  .rail-tool:hover { background: rgba(255,255,255,.08); color: #fff; }
  .rail-status { margin-top: 12px; padding: 14px 10px 0; border-top: 1px solid rgba(255,255,255,.1); color: #a99785; font-size: 11px; line-height: 1.6; }
  .app-main { width: min(100%, 1040px); min-height: 100vh; padding: 42px 44px 70px; background: var(--linen); }
  .page-head h1 { font-size: 42px; }
  .today-layout { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(350px, .88fr); grid-template-areas: "dates baton" "agenda baton"; gap: 0 28px; align-items: start; }
  .today-dates { grid-area: dates; }
  .today-agenda { grid-area: agenda; }
  .today-layout .baton-wrap { position: sticky; top: 28px; margin: 0; padding: 0 0 20px; border-radius: 22px; overflow: hidden; }
  .today-layout .baton-wrap { grid-area: baton; }
  .today-layout .baton-label { margin: 0; }
  .today-layout .baton-surface { margin: 0 18px; }
  .detail-hero { margin: -42px -44px 0; padding: 42px 44px 30px; }
  .detail-action { margin-right: -44px; margin-left: -44px; padding-right: 44px; padding-left: 44px; }
  .form-grid-wide { grid-template-columns: repeat(3, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
