:root {
  color-scheme: light;
  --ink: #16201b;
  --ink-soft: #52615a;
  --muted: #76847c;
  --line: #dfe6e1;
  --canvas: #f2f5f2;
  --surface: #fff;
  --green: #147640;
  --green-dark: #0b522c;
  --green-pale: #eaf4ed;
  --red: #a43232;
  --red-pale: #fff1ef;
  --amber: #8a5a00;
  --amber-pale: #fff6df;
  --shadow: 0 12px 32px rgba(17, 40, 27, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid rgba(20, 118, 64, .35); outline-offset: 2px; }
button:disabled { cursor: wait; opacity: .65; }
a { color: var(--green-dark); }
.app-shell { min-height: 100vh; }
.topbar { height: 76px; background: #111614; color: #fff; display:flex; align-items:center; justify-content:space-between; padding: 0 max(22px, calc((100vw - 1220px)/2)); gap: 20px; }
.brand { display:flex; align-items:center; min-width:0; gap: 14px; color: #fff; text-decoration:none; }
.brand-mark { width: 108px; height: 48px; border-radius: 6px; background: white; display:flex; align-items:center; justify-content:center; padding: 4px 9px; overflow:hidden; }
.brand-mark img { width:100%; height:auto; display:block; object-fit:contain; }
.brand-title { font-size: 14px; line-height:1.2; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:#e6eee8; }
.topbar-right { display:flex; align-items:center; gap:14px; }
.test-mode-tag { display:inline-flex; align-items:center; min-height:30px; padding:5px 9px; border-radius:999px; background:#ffe7ad; color:#513900; font-size:11px; font-weight:850; letter-spacing:.04em; white-space:nowrap; }
.user-badge { display:flex; flex-direction:column; align-items:flex-end; gap:2px; color:#f6fbf7; font-size:14px; }
.user-badge small { color:#a8b9ad; font-size:13px; }
.icon-button { border:1px solid #38433c; background:transparent; color:#fff; padding:10px 14px; border-radius:10px; min-height:42px; }
.icon-button:hover { background:#202923; }
.layout { max-width:1220px; margin:0 auto; padding:28px 22px 52px; display:grid; grid-template-columns:220px minmax(0,1fr); gap:26px; align-items:start; }
.side-nav { background:var(--surface); border:1px solid var(--line); border-radius:16px; box-shadow:var(--shadow); padding:12px; position:sticky; top:18px; }
.nav-label { margin:8px 10px 10px; color:var(--muted); font-weight:700; font-size:12px; letter-spacing:.11em; text-transform:uppercase; }
.nav-item { display:flex; align-items:center; gap:11px; width:100%; border:0; border-radius:10px; background:transparent; color:#34433a; min-height:47px; padding:10px 12px; text-align:left; font-weight:650; }
.nav-item:hover { background:#f1f5f1; }
.nav-item.active { color:var(--green-dark); background:var(--green-pale); }
.nav-icon { width:22px; text-align:center; font-size:18px; }
.mobile-nav { display:none; }
.main { min-width:0; }
.page-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:22px; }
.page-heading h1 { margin:0; font-size:clamp(25px, 3vw, 34px); line-height:1.15; letter-spacing:-.035em; }
.page-heading p { margin:8px 0 0; color:var(--ink-soft); font-size:15px; line-height:1.5; }
.eyebrow { display:block; margin-bottom:8px; color:var(--green); font-size:12px; font-weight:800; letter-spacing:.12em; text-transform:uppercase; }
.button { border:0; border-radius:10px; background:var(--green); color:white; padding:12px 17px; min-height:46px; font-weight:700; box-shadow:0 3px 0 var(--green-dark); transition:transform .12s ease, background .12s ease; }
.button:hover { background:#106536; transform:translateY(-1px); }
.button:active { transform:translateY(1px); box-shadow:none; }
.button.secondary { background:#eef3ef; color:var(--ink); box-shadow:inset 0 0 0 1px var(--line); }
.button.secondary:hover { background:#e5ece7; }
.button.danger { background:#a43232; box-shadow:0 3px 0 #742626; }
.button.small { min-height:38px; padding:8px 12px; font-size:14px; box-shadow:none; }
.button.full { width:100%; }
.text-button { border:0; background:transparent; color:var(--green-dark); padding:8px 3px; font-weight:700; text-decoration:underline; text-underline-offset:3px; }
.card { background:var(--surface); border:1px solid var(--line); border-radius:16px; box-shadow:var(--shadow); padding:22px; }
.card + .card { margin-top:16px; }
.card-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:16px; }
.card-head h2, .card h2 { margin:0; font-size:19px; letter-spacing:-.02em; }
.card-head p { margin:6px 0 0; color:var(--muted); font-size:14px; line-height:1.45; }
.welcome { padding:28px; border:0; color:white; background:linear-gradient(120deg,#111614 0%,#18241d 62%,#145e37 100%); position:relative; overflow:hidden; }
.welcome:after { content:""; position:absolute; right:-60px; top:-80px; width:240px; height:240px; border:1px solid rgba(255,255,255,.12); border-radius:50%; box-shadow:0 0 0 28px rgba(255,255,255,.035),0 0 0 56px rgba(255,255,255,.025); }
.welcome h1 { margin:0; max-width:650px; font-size:clamp(26px, 4vw, 40px); letter-spacing:-.04em; line-height:1.1; position:relative; z-index:1; }
.welcome p { max-width:590px; margin:12px 0 0; color:#d2ddd5; line-height:1.55; position:relative; z-index:1; }
.action-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin-top:16px; }
.action-card { min-height:168px; padding:24px; text-align:left; display:flex; flex-direction:column; justify-content:space-between; border:1px solid var(--line); border-radius:16px; background:white; box-shadow:var(--shadow); color:var(--ink); transition:transform .15s ease,border .15s ease; }
.action-card:hover { transform:translateY(-3px); border-color:#9ac3a7; }
.action-card .action-icon { display:grid; place-items:center; width:46px; height:46px; border-radius:12px; background:var(--green-pale); color:var(--green); font-size:23px; }
.action-card strong { display:block; margin-top:16px; font-size:20px; }
.action-card span:last-child { margin-top:5px; color:var(--muted); font-size:14px; line-height:1.4; }
.stat-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin:16px 0; }
.stat { padding:16px; border-radius:13px; background:#f4f7f4; border:1px solid #e6ece7; }
.stat strong { display:block; font-size:24px; letter-spacing:-.04em; }
.stat span { color:var(--muted); font-size:13px; }
.notice { padding:14px 16px; border-radius:12px; border:1px solid #efdcae; background:var(--amber-pale); color:#634300; line-height:1.45; }
.notice.red { border-color:#efd0cc; background:var(--red-pale); color:#772a24; }
.notice.green { border-color:#cee4d3; background:var(--green-pale); color:#17562f; }
.form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.field { min-width:0; display:flex; flex-direction:column; gap:7px; }
.field label, .field-label { font-weight:700; font-size:14px; color:#293830; }
.field .hint { color:var(--muted); font-size:13px; line-height:1.45; }
.field input, .field select, .field textarea, .control { width:100%; border:1px solid #cbd6ce; border-radius:9px; background:#fff; color:var(--ink); padding:11px 12px; min-height:46px; }
.field textarea { min-height:130px; line-height:1.5; resize:vertical; }
.field input[type="file"] { padding:9px; }
.field input::placeholder, .field textarea::placeholder { color:#8b9890; }
.form-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:20px; }
.section-spacer { height:16px; }
.inline-fields { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.period-card { border:1px solid var(--line); border-radius:12px; padding:16px; background:#fbfcfb; }
.period-card + .period-card { margin-top:12px; }
.period-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:12px; }
.period-head strong { font-size:15px; }
.period-head small { display:block; margin-top:3px; color:var(--muted); font-size:13px; }
.periods { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.periods .field input { text-align:right; }
.period-summary { display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; }
.period-chip { display:inline-flex; align-items:center; gap:7px; border:1px solid var(--line); border-radius:100px; background:white; padding:7px 10px; color:#405047; font-size:13px; }
.radio-row { display:flex; flex-wrap:wrap; gap:10px; }
.choice { display:flex; align-items:center; gap:9px; padding:11px 13px; border:1px solid var(--line); border-radius:10px; background:white; font-weight:650; }
.choice input { accent-color:var(--green); width:18px; height:18px; }
.row-actions { display:flex; align-items:center; justify-content:space-between; gap:10px; margin:12px 0; }
.material-row { display:grid; grid-template-columns:minmax(0,1fr) 130px 110px 42px; gap:9px; align-items:start; margin-bottom:10px; }
.material-row input { width:100%; min-height:44px; border:1px solid #cbd6ce; border-radius:9px; padding:10px; }
.remove-button { min-height:42px; border:1px solid #ead2cf; border-radius:9px; background:#fff7f6; color:#8d2b25; font-weight:700; }
.suggestions { position:relative; z-index:2; display:flex; flex-direction:column; gap:4px; margin-top:-7px; margin-bottom:7px; }
.suggestion { border:1px solid #cbd6ce; border-radius:8px; background:white; color:#34433a; text-align:left; padding:9px 11px; min-height:40px; }
.suggestion:hover { background:var(--green-pale); border-color:#9ac3a7; }
.table-wrap { width:100%; overflow:auto; border:1px solid var(--line); border-radius:12px; background:white; }
table { width:100%; border-collapse:collapse; min-width:620px; }
th, td { padding:12px 14px; border-bottom:1px solid #e8eeea; text-align:left; vertical-align:top; font-size:14px; }
th { position:sticky; top:0; background:#f5f8f5; color:#52615a; font-size:12px; letter-spacing:.06em; text-transform:uppercase; white-space:nowrap; }
tr:last-child td { border-bottom:0; }
td.numeric, th.numeric { text-align:right; font-variant-numeric:tabular-nums; }
.muted { color:var(--muted); }
.status { display:inline-flex; align-items:center; gap:7px; padding:5px 9px; border-radius:999px; background:#eef4ef; color:#285a39; font-size:12px; font-weight:700; }
.status.red { background:var(--red-pale); color:#8a3029; }
.status.amber { background:var(--amber-pale); color:#765000; }
.empty { text-align:center; padding:30px 15px; color:var(--muted); line-height:1.5; }
.filter-row { display:flex; align-items:end; flex-wrap:wrap; gap:11px; margin-bottom:16px; }
.filter-row .field { min-width:155px; flex:1; }
.filter-row .field.compact { max-width:205px; }
.employee-row { display:grid; grid-template-columns:1.1fr 1.2fr 1fr 130px 140px; align-items:center; gap:9px; padding:12px 0; border-bottom:1px solid #e8eeea; }
.employee-row:last-child { border-bottom:0; }
.employee-row strong { display:block; }
.employee-row small { display:block; margin-top:3px; color:var(--muted); }
.credential-box { margin-top:16px; border:1px solid #e8dcae; border-radius:12px; background:#fffaf0; padding:16px; }
.credential-box h3 { margin:0 0 8px; font-size:16px; }
.credential-box p { margin:0 0 10px; font-size:14px; line-height:1.5; color:#635126; }
.credentials { width:100%; border-collapse:collapse; }
.credentials td, .credentials th { border-bottom:1px solid #efe6c8; padding:8px; font-size:13px; }
.credentials th { position:static; background:transparent; }
.modal-backdrop { position:fixed; inset:0; z-index:20; display:grid; place-items:center; padding:18px; background:rgba(14,22,17,.65); }
.modal { width:min(760px,100%); max-height:min(90vh,850px); overflow:auto; padding:23px; border-radius:16px; background:white; box-shadow:0 24px 80px rgba(0,0,0,.25); }
.modal h2 { margin:0 0 5px; font-size:21px; }
.modal p { margin:0 0 17px; color:var(--muted); font-size:14px; line-height:1.5; }
.toast { position:fixed; z-index:30; left:50%; bottom:22px; transform:translate(-50%,20px); opacity:0; pointer-events:none; max-width:min(520px,calc(100vw - 28px)); padding:13px 17px; border-radius:11px; background:#17221a; color:white; box-shadow:0 12px 30px rgba(0,0,0,.2); transition:opacity .2s ease,transform .2s ease; font-size:14px; line-height:1.45; }
.toast.show { opacity:1; transform:translate(-50%,0); }
.toast.error { background:#8b3029; }
.login-screen { min-height:100vh; display:grid; place-items:center; padding:24px; background:radial-gradient(circle at 90% 5%,#dbeadf 0%,transparent 30%),linear-gradient(140deg,#f0f4f1,#e6ede8); }
.login-card { width:min(460px,100%); background:white; border:1px solid var(--line); border-radius:20px; box-shadow:0 24px 70px rgba(16,42,25,.13); overflow:hidden; }
.login-band { padding:24px; background:#111614; display:flex; align-items:center; gap:16px; color:white; }
.login-band .brand-mark { width:120px; }
.login-band p { margin:0; color:#dae4dc; font-size:14px; line-height:1.4; }
.test-notice { margin:14px 0 18px; font-size:14px; }
.login-body { padding:26px; }
.login-body h1 { margin:0 0 7px; font-size:25px; letter-spacing:-.035em; }
.login-body > p { margin:0 0 21px; color:var(--muted); line-height:1.5; font-size:15px; }
.login-body .field + .field { margin-top:14px; }
.login-body .button { margin-top:20px; }
.mic-button { display:inline-flex; align-items:center; gap:7px; border:1px solid #bad6c2; border-radius:9px; background:#f2f8f3; color:var(--green-dark); padding:9px 12px; font-weight:700; min-height:41px; }
.mic-button.listening { background:#fff1ef; color:#9e2727; border-color:#e4a8a4; }
.file-drop { border:1px dashed #aebeb2; background:#f8faf8; border-radius:12px; padding:18px; }
.fine-print { color:var(--muted); font-size:13px; line-height:1.5; }
.divider { height:1px; margin:18px 0; background:var(--line); }
.mobile-nav button { flex:1; }
.voice-live { color:var(--red); font-size:13px; font-weight:700; }

@media (max-width:900px) {
  .layout { grid-template-columns:minmax(0,1fr); max-width:760px; padding-top:20px; }
  .side-nav { display:none; }
  .mobile-nav { display:flex; position:fixed; z-index:10; left:0; right:0; bottom:0; overflow-x:auto; padding:8px max(8px,env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left)); gap:5px; background:#111614; border-top:1px solid #334038; scrollbar-width:none; }
  .mobile-nav::-webkit-scrollbar { display:none; }
  .mobile-nav .nav-item { color:#cad7ce; flex:0 0 80px; flex-direction:column; min-height:58px; padding:6px 4px; gap:3px; justify-content:center; font-size:12px; line-height:1.1; text-align:center; white-space:normal; }
  .mobile-nav .nav-item.active { color:#fff; background:#1c6d3d; }
  .mobile-nav .nav-icon { font-size:18px; line-height:1; }
  .layout { padding-bottom:calc(74px + env(safe-area-inset-bottom)); }
  .topbar { height:68px; padding:0 15px; }
  .brand-title { display:none; }
  .brand-mark { width:88px; height:42px; }
  .user-badge small { display:none; }
}
@media (max-width:620px) {
  .topbar { padding:0 12px; }
  .layout { padding:17px 13px calc(78px + env(safe-area-inset-bottom)); gap:17px; }
  .page-heading { flex-direction:column; align-items:stretch; margin-bottom:17px; }
  .page-heading .button { align-self:flex-start; }
  .card { padding:17px; border-radius:14px; }
  .welcome { padding:22px 19px; }
  .action-grid { grid-template-columns:1fr; gap:11px; margin-top:12px; }
  .action-card { min-height:142px; padding:18px; }
  .stat-grid { grid-template-columns:1fr 1fr; }
  .stat:last-child:nth-child(odd) { grid-column:span 2; }
  .form-grid { grid-template-columns:1fr; gap:14px; }
  .periods { grid-template-columns:1fr; }
  .periods .field input { text-align:left; }
  .inline-fields { grid-template-columns:1fr 1fr; }
  .material-row { grid-template-columns:minmax(0,1fr) 80px 72px 38px; gap:6px; }
  .material-row input { min-height:43px; padding:8px; font-size:14px; }
  .remove-button { min-height:42px; }
  .form-actions { flex-direction:column-reverse; }
  .form-actions .button { width:100%; }
  .filter-row { align-items:stretch; }
  .filter-row .field, .filter-row .field.compact { max-width:none; min-width:calc(50% - 6px); }
  .employee-row { grid-template-columns:1fr 1fr; align-items:start; }
  .employee-row > :last-child { grid-column:span 2; }
  .user-badge { font-size:13px; }
  .icon-button { padding:8px 10px; min-height:40px; }
  .login-screen { padding:15px; }
  .login-band { padding:18px; }
  .login-body { padding:22px 19px; }
}
.nav-count{display:inline-flex;align-items:center;justify-content:center;min-width:19px;height:19px;margin-left:5px;padding:0 5px;border-radius:999px;background:#b43228;color:#fff;font-size:11px;font-weight:800}
.current-work{display:flex;align-items:center;justify-content:space-between;gap:18px;border-left:4px solid var(--green,#317047)}
.current-work h2{margin:5px 0;font-size:20px}.current-work p{margin:0;color:var(--muted)}
.safety-alert{display:flex;align-items:center;gap:7px;flex-wrap:wrap}
.text-button{padding:0;border:0;background:none;color:inherit;text-decoration:underline;font:inherit;font-weight:800;cursor:pointer}
.safety-doc-list{display:grid;gap:10px;margin:18px 0}
.safety-doc{display:flex;align-items:center;gap:12px;padding:13px;border:1px solid var(--line);border-radius:12px;color:var(--ink);text-decoration:none;background:#fbfcfb}
.safety-doc:hover{border-color:var(--green,#317047);background:#f4f8f5}
.safety-doc>span:nth-child(2){display:grid;gap:4px;flex:1}.safety-doc small{color:var(--muted)}
.safety-ack-choice{display:flex;align-items:flex-start;gap:10px;padding:14px;border:1px solid var(--line);border-radius:12px;background:#f8faf8;font-weight:700}
.safety-ack-choice input{margin:3px 0 0;accent-color:var(--green,#317047);width:18px;height:18px;flex:0 0 auto}
.notification-card{border-left:4px solid #b43228}.notification-card.read{border-left-color:#317047;opacity:.82}.notification-card p{margin:7px 0;color:var(--muted)}
.notification-card h2{margin:5px 0;font-size:19px}
.menu-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.menu-grid .action-card{min-height:190px}
.process-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-top:16px}
.process-grid .empty{padding:20px 10px;border:1px dashed var(--line);border-radius:10px}
.order-preview h2{margin-bottom:12px}.order-preview p{line-height:1.5}
.check-field{display:flex;align-items:flex-start;gap:10px;grid-column:1/-1;padding:13px;border:1px solid var(--line);border-radius:10px;background:#f8faf8;font-weight:700}
.check-field input{margin:3px 0 0;accent-color:#237247;width:18px;height:18px;flex:0 0 auto}
.purchase-card{margin-top:14px;border-left:4px solid #d7dfd9}
.purchase-card.purchase-overdue{border-left-color:#b43228}
.purchase-card h2{margin:5px 0;font-size:20px}
.purchase-description{white-space:pre-wrap;line-height:1.5}
.purchase-meta{display:flex;flex-wrap:wrap;gap:8px 22px;color:var(--muted);margin:12px 0}
.purchase-action{margin-top:14px;padding-top:13px;border-top:1px solid var(--line)}
@media(max-width:900px){.menu-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:620px){
  .menu-grid,.process-grid{grid-template-columns:1fr}
  .menu-grid .action-card{min-height:82px;padding:12px 14px;flex-direction:row;justify-content:flex-start;align-items:center;gap:12px}
  .menu-grid .action-card .action-icon{flex:0 0 40px;width:40px;height:40px;font-size:20px}
  .menu-grid .action-card > span:last-child{margin:0}
  .menu-grid .action-card strong{margin:0;font-size:16px;line-height:1.25}
  .menu-grid .action-card span:last-child{margin-top:3px;font-size:12px;line-height:1.3}
  .home-history{display:none}
}
