:root {
  color-scheme: light;
  --canvas: #f7f6f8;
  --paper: #fff;
  --ink: #25212b;
  --muted: #6d6573;
  --subtle: #837988;
  --line: #e9e5eb;
  --accent: #21665f;
  --accent-ink: color-mix(in srgb, var(--accent) 38%, #171b20);
  --accent-action: color-mix(in srgb, var(--accent) 38%, #20272e);
  --accent-dark: color-mix(in srgb, var(--accent) 25%, #20262c);
  --accent-light: color-mix(in srgb, var(--accent) 36%, white);
  --accent-soft: color-mix(in srgb, var(--accent) 9%, white);
  --accent-line: color-mix(in srgb, var(--accent) 22%, #e9edf0);
  --accent-halo: color-mix(in srgb, var(--accent) 35%, transparent);
  --green: #19674c;
  --green-bg: #eaf7ef;
  --amber: #865616;
  --amber-bg: #fff3df;
  --red: #a42c4a;
  --red-bg: #fcecf0;
  --blue: #295880;
  --blue-bg: #eaf3fc;
  --rail: #23272b;
  --radius: 15px;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .58; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px;
}
svg { display: block; }
.icon { width: 18px; height: 18px; flex: none; stroke-width: 1.65; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.upper { letter-spacing: .13em; text-transform: uppercase; font-weight: 750; font-size: 10px; }
.nowrap { white-space: nowrap; }
.stack { display: grid; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; width: fit-content; padding: 4px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; white-space: nowrap; color: #635769; background: #f1eef3; }
.pill.green { background: var(--green-bg); color: var(--green); }
.pill.red { background: var(--red-bg); color: var(--red); }
.pill.amber { background: var(--amber-bg); color: var(--amber); }
.pill.blue { background: var(--blue-bg); color: var(--blue); }
.pill.pink { background: var(--accent-soft); color: var(--accent-ink); }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.btn { border: 1px solid var(--line); border-radius: 9px; min-height: 37px; padding: 8px 12px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; color: var(--ink); background: #fff;
  font-size: 12px; font-weight: 700; text-align: center; }
.btn:hover { background: #f6f2f7; text-decoration: none; }
.btn.primary { background: var(--accent-action); border-color: var(--accent-action); color: white; }
.btn.primary:hover { background: var(--accent-ink); }
.btn.dark { background: var(--rail); border-color: var(--rail); color: #fff; }
.btn.danger { color: var(--red); border-color: #f2d6dd; }
.btn.compact { min-height: 31px; padding: 5px 9px; font-size: 11px; }
.btn.icon-only { min-width: 36px; padding: 8px; }
button.link { border: none; padding: 0; background: transparent; color: var(--accent-ink); font-weight: 700; text-align: left; }
button.link:hover { text-decoration: underline; }
.app-shell { display: grid; grid-template-columns: 232px minmax(0,1fr); min-height: 100vh; }
.sidebar { display: flex; flex-direction: column; gap: 14px; background: var(--rail); color: #f6f2f6; position: sticky;
  inset-block-start: 0; height: 100vh; padding: 20px 13px 14px; z-index: 10; overflow-y: auto; scrollbar-color: #5b5260 transparent; }
.brand { display: flex; align-items: center; gap: 10px; padding: 5px 9px 10px; }
.brand img { width: 40px; height: 40px; object-fit: contain; border-radius: 10px; }
.brand strong { font-size: 16px; letter-spacing: -.03em; display: block; line-height: 1.15; }
.brand small { color: #b6aaba; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.nav-label { color: #b0a5b3; padding: 10px 10px 5px; }
.nav-link { background: transparent; color: #e5dce7; border: 1px solid transparent; display: flex; gap: 10px;
  align-items: center; width: 100%; text-align: left; min-height: 36px; padding: 7px 9px; border-radius: 8px; font-size: 12px; }
.nav-link .icon { width: 16px; height: 16px; opacity: .82; }
.nav-link:hover { background: #37313c; }
.nav-link.active { background: var(--accent-dark); border-color: var(--accent); color: #fff; font-weight: 720; }
.rail-footer { margin-top: auto; border-top: 1px solid #45404a; padding: 13px 4px 0; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 10px;
  color: var(--accent-ink); background: var(--accent-soft); font-size: 12px; font-weight: 800; }
.sidebar .avatar { background: var(--accent-action); color: #fff; }
.rail-footer .icon-only { background: #332e38; border-color: #514554; color: #e9d8eb; }
.workspace { min-width: 0; }
.topbar { padding: 11px clamp(16px,3vw,40px); min-height: 61px; background: var(--paper); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.topbar .demo { color: #765c2d; background: #fff4df; }
.top-title { font-weight: 700; font-size: 13px; }
.hamburger { display: none; }
.content { width: 100%; max-width: 1630px; margin: 0 auto; padding: 28px clamp(16px,3vw,40px) 50px; }
.head { margin-bottom: 22px; }
h1,h2,h3,p { margin: 0; }
h1 { font-size: clamp(24px,3vw,35px); font-weight: 780; line-height: 1.12; letter-spacing: -.045em; }
h2 { font-size: 18px; letter-spacing: -.025em; }
h3 { font-size: 14px; line-height: 1.3; }
.head p { color: var(--muted); margin-top: 7px; }
.eyebrow { color: var(--accent-ink); margin-bottom: 7px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.panel-head { margin-bottom: 13px; }
.panel-head p { margin-top: 3px; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(2,minmax(0,1fr)); }
.grid.three { grid-template-columns: repeat(3,minmax(0,1fr)); }
.grid.four { grid-template-columns: repeat(4,minmax(0,1fr)); }
.kpi { padding: 15px 17px; }
.kpi .label { color: var(--muted); font-weight: 620; font-size: 12px; }
.kpi strong { display: block; margin: 4px 0 1px; font-size: clamp(18px,2.2vw,26px); letter-spacing: -.045em; white-space: nowrap; }
.kpi .kpi-icon { color: var(--accent-ink); background: var(--accent-soft); padding: 7px; border-radius: 9px; }
.kpi .kpi-icon .icon { width: 16px; height: 16px; }
.dash-main { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(0,1fr); gap: 15px; }
.hero { padding: 23px; background: var(--accent-dark); color: #fff; border-color: var(--accent-dark); position: relative; isolation: isolate; overflow: hidden; }
.hero::after { content: ''; position: absolute; z-index: -1; inset: -80px -45px auto auto; width: 280px; height: 280px;
  border: 26px solid var(--accent-halo); border-radius: 37% 54% 52% 34%; transform: rotate(28deg); box-shadow: 0 0 0 23px color-mix(in srgb, var(--accent) 18%, transparent),0 0 0 46px color-mix(in srgb, var(--accent) 10%, transparent); }
.hero .upper { color: var(--accent-light); }
.hero .muted { color: #e4eaeb; }
.hero .hero-value { font-weight: 790; font-size: clamp(36px,5vw,62px); letter-spacing: -.075em; line-height: 1.05; margin: 10px 0 7px; }
.hero .hero-stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-top: 17px; }
.hero .hero-stats strong { display: block; font-size: 15px; margin-top: 2px; }
.progress { height: 8px; border-radius: 8px; overflow: hidden; background: var(--accent-soft); }
.progress i { display: block; width: var(--progress,0%); max-width: 100%; min-width: 0; height: 100%; border-radius: 8px; background: var(--accent); }
.hero .progress { background: #ffffff32; margin: 12px 0 0; }
.hero .progress i { background: var(--accent-light); }
.hero select { border-color: var(--accent); background: var(--accent-action); color: #fff; min-height: 34px; width: auto; }
.note { padding: 11px 13px; border-radius: 9px; border: 1px solid var(--accent-line); color: var(--accent-ink); background: var(--accent-soft); font-size: 12px; }
.note.warn { color: #755223; background: #fff8ec; border-color: #f2e4c9; }
.note.error { background: var(--red-bg); color: var(--red); border-color: #f1d4de; }
.list-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list-line:last-child { border-bottom: 0; }
.list-line b { font-size: 13px; }
.section-title { margin: 2px 0 12px; }
.order-card { overflow: hidden; padding: 0; }
.order-card .card-img { width: 100%; height: 118px; object-fit: cover; display: block; background: #e8dde8; }
.order-card .body { padding: 14px; }
.order-card h3 { margin: 7px 0 4px; }
.order-card .bottom { border-top: 1px solid var(--line); padding: 10px 14px; }
.scroll-table { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 12px; }
th { padding: 10px 11px; background: #f8f6f9; color: #655c6a; text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .055em; }
td { padding: 11px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.green-text { color: var(--green); }
.red-text { color: var(--red); }
.tabs { display: flex; gap: 3px; overflow-x: auto; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tab { border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted);
  padding: 9px 12px; font-weight: 670; white-space: nowrap; font-size: 12px; }
.tab.active { color: var(--accent-ink); border-bottom-color: var(--accent-ink); }
input, select, textarea { border: 1px solid #dcd5df; border-radius: 8px; padding: 8px 10px; min-height: 37px;
  width: 100%; color: var(--ink); background: #fff; }
input[type=checkbox] { width: auto; min-height: 0; accent-color: var(--accent-ink); }
input[type=range] { padding: 0; }
textarea { min-height: 75px; resize: vertical; }
input::placeholder,textarea::placeholder { color: #8c8190; }
label.field { display: grid; gap: 5px; font-weight: 680; font-size: 12px; min-width: 0; }
label.check { display: flex; align-items: center; gap: 8px; padding: 4px 0; color: var(--muted); font-size: 12px; }
.filter { width: auto; max-width: 100%; }
.filter-search { width: min(100%,275px); }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; }
.full { grid-column: 1/-1; }
.empty { color: var(--muted); padding: 19px 6px; text-align: center; }
.empty strong { display: block; color: var(--ink); margin-bottom: 3px; }
.plan-wrap { display: grid; grid-template-columns: minmax(0,1fr) 225px; gap: 15px; align-items: start; }
.plan-wrap.general { grid-template-columns: 1fr; }
.calendar { display: grid; grid-template-columns: repeat(7,minmax(118px,1fr)); gap: 7px; overflow-x: auto; padding-bottom: 8px; }
.day { background: #f0edf2; min-height: 216px; border: 1px solid #e8e1e9; border-radius: 11px; padding: 7px; min-width: 0; }
.day.today { border-color: var(--accent-line); background: var(--accent-soft); }
.day.drop-ready { outline: 2px dashed var(--accent); outline-offset: -2px; }
.day-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 7px; color: #635769; }
.day-head strong { font-size: 16px; color: var(--ink); }
.card-task { border: 1px solid #e6dfe8; border-left: 3px solid var(--accent-line); background: #fff; padding: 8px;
  margin-bottom: 6px; border-radius: 8px; display: grid; gap: 5px; word-break: break-word; }
.card-task.done { border-left-color: #499477; background: #f5fbf7; }
.card-task.missed { border-left-color: #bd5170; background: #fff7f8; }
.card-task.doing { border-left-color: #4a83b4; }
.card-task.blocked { border-left-color: #cf9e49; }
.card-task h3 { font-size: 12px; }
.card-task .task-action { padding: 0; border: 0; background: transparent; text-align: left; color: var(--ink); font-weight: 720; line-height: 1.26; }
.card-task .task-action:hover { text-decoration: underline; }
.card-task .pill { font-size: 9px; padding: 3px 6px; white-space: normal; }
.card-task .icon { width: 13px; height: 13px; }
.card-task .label { color: #6e5270; font-size: 10px; font-weight: 750; }
.card-task .row { gap: 5px; }
.capacity-list { display: grid; gap: 12px; }
.capacity-list .progress { height: 5px; margin-top: 4px; }
.capacity-list .over i { background: var(--red); }
.capacity-list .cap-row strong { font-size: 12px; }
.capacity-list .cap-row small { font-size: 10px; }
.backlog { display: grid; grid-template-columns: repeat(auto-fit,minmax(172px,1fr)); gap: 8px; }
.backlog .card-task { margin: 0; }
.my-task { border-left: 3px solid var(--accent-line); display: grid; gap: 9px; }
.my-task.done { border-left-color: #439775; }
.my-task.blocked { border-left-color: #c79439; }
.my-task h3 { font-size: 16px; }
.clock { font-variant-numeric: tabular-nums; font-size: 19px; font-weight: 760; color: var(--accent-ink); }
.doc-preview { width: 100%; max-height: 224px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.timeline { display: grid; gap: 12px; border-left: 2px solid #e9d9e6; padding-left: 14px; margin-left: 4px; }
.timeline .timeline-item { position: relative; }
.timeline .timeline-item::before { content: ''; position: absolute; left: -20px; top: 6px; width: 9px; height: 9px; background: #9c6591; border-radius: 50%; }
.catalog-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }
.catalog-card { background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 11px; display: grid; gap: 5px; }
.footer-note { margin-top: 22px; color: var(--subtle); font-size: 11px; }
.dialog { padding: 0; }
dialog { border: 1px solid #e6dbe6; border-radius: 17px; background: #fff; color: var(--ink); width: min(94vw,565px);
  max-height: 92vh; padding: 0; box-shadow: 0 22px 75px #2a1b3252; }
dialog.wide { width: min(94vw,780px); }
dialog::backdrop { background: #211a2a78; }
.modal-head { padding: 15px 17px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 16px 17px; display: grid; gap: 12px; }
.modal-foot { border-top: 1px solid var(--line); padding: 12px 17px; display: flex; gap: 9px; justify-content: flex-end; }
.modal-body .small { font-weight: 450; }
#toast { position: fixed; z-index: 40; right: 18px; bottom: 18px; max-width: min(460px,calc(100vw - 36px));
  color: white; background: #382d3b; border-radius: 10px; padding: 11px 15px; box-shadow: 0 10px 25px #392b4440;
  font-size: 13px; visibility: hidden; }
#toast.visible { visibility: visible; }
#toast.error { background: #8b2846; }
.loading { display: grid; place-content: center; justify-items: center; gap: 12px; min-height: 100vh; color: var(--muted); }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1fr minmax(370px, .95fr); }
.login-brand { background: var(--accent-dark); color: #fff; display: grid; place-content: center; padding: clamp(26px,6vw,84px); position: relative; isolation: isolate; overflow: hidden; }
.login-brand::after { content: ''; position: absolute; z-index: -1; width: 420px; height: 420px; bottom: -190px; right: -110px;
  border: 34px solid var(--accent-halo); border-radius: 38%; transform: rotate(31deg); box-shadow: 0 0 0 36px color-mix(in srgb, var(--accent) 18%, transparent),0 0 0 72px color-mix(in srgb, var(--accent) 10%, transparent); }
.login-brand img { width: 64px; height: 64px; margin-bottom: 17px; }
.login-brand h1 { font-size: clamp(34px,6vw,63px); max-width: 530px; }
.login-brand p { color: #e4eaeb; margin-top: 15px; max-width: 360px; }
.login-area { display: grid; place-items: center; padding: 25px; }
.login-card { width: min(100%,432px); }
.demo-roles { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
.allocation-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) 110px auto; gap: 6px; align-items: center; margin: 7px 0; }
.hidden { display: none !important; }
@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 195px minmax(0,1fr); }
  .plan-wrap { grid-template-columns: 1fr; }
  .capacity-list { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 800px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; position: fixed; inset: 0 auto 0 0; width: 242px; height: 100dvh; box-shadow: 0 0 0 100vmax #20182466; }
  .sidebar.open { display: flex; }
  .hamburger { display: inline-flex; }
  .content { padding-top: 21px; }
  .dash-main { grid-template-columns: 1fr; }
  .grid.four { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .grid.three { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .catalog-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { place-content: start; padding: 24px; }
  .login-brand img { width: 42px; height: 42px; margin-bottom: 9px; }
  .login-brand h1 { font-size: 32px; }
  .login-brand p { margin-top: 8px; font-size: 13px; }
}
@media (max-width: 510px) {
  .grid.two, .grid.three, .form-grid, .catalog-grid { grid-template-columns: 1fr; }
  .hero .hero-stats { gap: 7px; }
  .hero .hero-stats strong { font-size: 12px; }
  .capacity-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .calendar { grid-template-columns: repeat(7,minmax(135px,1fr)); }
  .allocation-row { grid-template-columns: 1fr 1fr; }
  .topbar { min-height: 52px; }
  .topbar .small { display: none; }
  .panel { padding: 13px; }
  .order-card { padding: 0; }
  .btn { min-height: 41px; }
}

.finance-list { gap: 8px; }
.finance-filters { gap: 12px; }
.finance-group { padding: 0; }
.finance-group summary {
  display: grid;
  grid-template-columns: 15px minmax(0,1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  cursor: pointer;
  list-style: none;
  border-radius: inherit;
}
.finance-group summary::-webkit-details-marker { display: none; }
.finance-group summary::before {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
}
.finance-group[open] summary::before { transform: rotate(45deg); }
.finance-group summary:hover { background: var(--accent-soft); }
.finance-title { display: grid; gap: 4px; min-width: 0; }
.finance-total { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.finance-group-body { border-top: 1px solid var(--line); }
.finance-actions, .finance-inner { padding: 12px 16px; }
.finance-actions { display: flex; justify-content: flex-end; }
.manual-payroll summary { cursor: pointer; font-weight: 600; }
@media (max-width: 580px) {
  .finance-filters { align-items: flex-start; }
  .finance-group summary { grid-template-columns: 11px minmax(0,1fr) auto; gap: 8px; padding: 12px; }
}

.finance-nested { padding: 10px 16px 14px; background: var(--canvas); }
.payroll-period + .payroll-period { border-top: 1px solid var(--line); }
.payroll-period h3 { padding: 10px 16px 0; }
.agenda-empty { padding: 11px 16px 11px 43px; }
.login-kicker { color: var(--accent-light); }
.theme-picker { width: 70px; padding: 4px; cursor: pointer; }
.theme-hex { width: 115px; font-variant-numeric: tabular-nums; }
#theme-form { align-items: flex-end; gap: 12px; }
#theme-form .btn { min-height: 36px; }
.payroll-preview-parts { display: grid; grid-template-columns: repeat(auto-fit,minmax(130px,1fr)); gap: 6px 12px; }
.payroll-preview-parts span { display: flex; justify-content: space-between; gap: 6px; }

.setup-steps { display: flex; flex-wrap: wrap; gap: 8px; }
.setup-steps [aria-current=step] { opacity: 1; }
.cash-check-form { align-items: flex-end; }
.cash-check-form .btn { min-height: 36px; }
