:root {
  --bg: #f3f6f2;
  --surface: #ffffff;
  --surface-soft: #f7faf7;
  --ink: #17241e;
  --muted: #607069;
  --line: #dce5df;
  --brand: #176b4d;
  --brand-dark: #0f5039;
  --brand-soft: #e3f3eb;
  --accent: #d8a93a;
  --danger: #b63a35;
  --danger-soft: #fbe9e7;
  --warning: #8a5b00;
  --warning-soft: #fff4d8;
  --info: #245d86;
  --info-soft: #e8f2f8;
  --success: #176b4d;
  --shadow: 0 12px 32px rgba(30, 56, 43, .08);
  --radius: 18px;
  --sidebar: 272px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
:focus-visible { outline: 3px solid #4d94ff; outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; transform: translateY(-160%); background: var(--ink); color: white; padding: 12px 16px; border-radius: 10px; }
.skip-link:focus { transform: none; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: var(--sidebar); display: flex; flex-direction: column; padding: 24px 16px 16px; color: #eef7f2; background: linear-gradient(180deg, #12372a 0%, #0d2c21 100%); border-right: 1px solid rgba(255,255,255,.08); }
.brand { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 10px; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; color: #12372a; background: #f2c75f; font-weight: 900; font-size: 20px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 18px; letter-spacing: .04em; }
.brand small { margin-top: 1px; color: #b9cdc2; font-size: 12px; }
.side-nav { display: grid; gap: 4px; margin-top: 28px; overflow-y: auto; scrollbar-width: thin; }
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 10px 12px; color: #cfe0d7; border-radius: 12px; text-decoration: none; font-weight: 600; font-size: 14px; }
.nav-link:hover { background: rgba(255,255,255,.07); color: white; }
.nav-link.is-active { color: white; background: rgba(255,255,255,.13); box-shadow: inset 3px 0 #f2c75f; }
.nav-icon, [data-icon] { width: 20px; height: 20px; flex: 0 0 20px; display: inline-block; background: currentColor; -webkit-mask: var(--icon) center/contain no-repeat; mask: var(--icon) center/contain no-repeat; }
[data-icon="home"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 11.5 12 4l9 7.5V21h-6v-6H9v6H3z'/%3E%3C/svg%3E"); }
[data-icon="store"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 4h16l2 6a3 3 0 0 1-4.5 2.6A3 3 0 0 1 12 12a3 3 0 0 1-5.5.6A3 3 0 0 1 2 10zm1 10h14v7H5z'/%3E%3C/svg%3E"); }
[data-icon="users"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8m7-1a3 3 0 1 0 0-6 3 3 0 0 0 0 6M2 21v-3a5 5 0 0 1 5-5h4a5 5 0 0 1 5 5v3zm14-8h1a5 5 0 0 1 5 5v3h-4v-3a7 7 0 0 0-2-5'/%3E%3C/svg%3E"); }
[data-icon="calendar"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 2h2v3h10V2h2v3h2v17H3V5h2zm0 8v10h14V10z'/%3E%3C/svg%3E"); }
[data-icon="briefcase"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 4h6l2 3h4v14H3V7h4zm1 3h4l-1-1h-2z'/%3E%3C/svg%3E"); }
[data-icon="alert"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2 1 21h22zm-1 6h2v7h-2zm0 9h2v2h-2z'/%3E%3C/svg%3E"); }
[data-icon="check"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m9 16.2-4.2-4.2-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E"); }
[data-icon="calculator"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 2h14v20H5zm2 3v4h10V5zm0 7v2h2v-2zm4 0v2h2v-2zm4 0v2h2v-2zM7 17v2h2v-2zm4 0v2h2v-2zm4 0v2h2v-2z'/%3E%3C/svg%3E"); }
[data-icon="chart"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 21V3h2v16h16v2zm4-4v-5h3v5zm5 0V6h3v11zm5 0V9h3v8z'/%3E%3C/svg%3E"); }
[data-icon="inbox"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 3h16l2 11v7H2v-7zm2 2L4 14h5a3 3 0 0 0 6 0h5l-2-9z'/%3E%3C/svg%3E"); }
[data-icon="settings"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m19 13 .1-1-.1-1 2-1.5-2-3.4-2.4 1a8 8 0 0 0-1.7-1L14.6 3h-4l-.4 3a8 8 0 0 0-1.7 1l-2.4-1-2 3.4L6 11l-.1 1 .1 1-2 1.5 2 3.4 2.4-1a8 8 0 0 0 1.7 1l.4 3h4l.4-3a8 8 0 0 0 1.7-1l2.4 1 2-3.4zM12 15a3 3 0 1 1 0-6 3 3 0 0 1 0 6'/%3E%3C/svg%3E"); }
[data-icon="logout"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10 3H3v18h7v-2H5V5h5zm5 4-1.4 1.4 2.6 2.6H8v2h8.2l-2.6 2.6L15 17l5-5z'/%3E%3C/svg%3E"); }
[data-icon="menu"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z'/%3E%3C/svg%3E"); }
[data-icon="more"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='5' cy='12' r='2'/%3E%3Ccircle cx='12' cy='12' r='2'/%3E%3Ccircle cx='19' cy='12' r='2'/%3E%3C/svg%3E"); }
[data-icon="plus"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11 5h2v6h6v2h-6v6h-2v-6H5v-2h6z'/%3E%3C/svg%3E"); }
[data-icon="arrow"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m9 5 7 7-7 7-1.4-1.4 5.6-5.6-5.6-5.6z'/%3E%3C/svg%3E"); }
[data-icon="refresh"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M17.7 6.3A8 8 0 1 0 20 12h-2a6 6 0 1 1-1.8-4.2L13 11h8V3z'/%3E%3C/svg%3E"); }
[data-icon="search"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10 3a7 7 0 1 0 4.3 12.5L20 21l1-1-5.5-5.7A7 7 0 0 0 10 3m0 2a5 5 0 1 1 0 10 5 5 0 0 1 0-10'/%3E%3C/svg%3E"); }
[data-icon="back"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m20 11H7.8l5.6-5.6L12 4l-8 8 8 8 1.4-1.4L7.8 13H20z'/%3E%3C/svg%3E"); }
[data-icon="comment"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 3h18v15H8l-5 4zm2 2v12.2L7.2 16H19V5z'/%3E%3C/svg%3E"); }
[data-icon="lock"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10V7a5 5 0 0 1 10 0v3h2v12H5V10zm2 0h6V7a3 3 0 0 0-6 0z'/%3E%3C/svg%3E"); }

.sidebar-foot { margin-top: auto; display: grid; grid-template-columns: 42px 1fr 44px; align-items: center; gap: 10px; padding: 16px 6px 0; border-top: 1px solid rgba(255,255,255,.1); }
.avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #e1bb5d; color: #17372b; font-weight: 800; }
.identity { min-width: 0; }
.identity strong, .identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.identity strong { font-size: 13px; }
.identity small { color: #b9cdc2; font-size: 12px; }
.icon-button { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0; color: inherit; border: 0; border-radius: 12px; background: transparent; cursor: pointer; }
.icon-button:hover { background: rgba(255,255,255,.09); }
.workspace { min-height: 100vh; margin-left: var(--sidebar); }
.topbar { position: sticky; top: 0; z-index: 20; min-height: 68px; display: flex; align-items: center; gap: 16px; padding: 10px clamp(20px, 3vw, 40px); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.92); backdrop-filter: blur(16px); }
.topbar-title { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.topbar-title strong { font-size: 16px; }
.topbar-title span { color: var(--muted); font-size: 14px; }
.menu-button { display: none; }
.quick-action { margin-left: auto; }
.main-content { width: min(100%, 1504px); margin: 0 auto; padding: 32px clamp(20px, 3vw, 40px) 56px; }
.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 24px; }
.eyebrow { margin: 0 0 4px; color: var(--brand); font-weight: 800; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: clamp(28px, 3vw, 36px); line-height: 1.16; letter-spacing: -.025em; }
h2 { margin: 0; font-size: 20px; line-height: 1.25; }
h3 { margin: 0; font-size: 16px; }
.page-header p:not(.eyebrow), .panel-head p { margin: 6px 0 0; color: var(--muted); }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border: 1px solid transparent; border-radius: 12px; text-decoration: none; font-weight: 750; cursor: pointer; }
.button-primary { color: white; background: var(--brand); box-shadow: 0 8px 18px rgba(23,107,77,.18); }
.button-primary:hover { background: var(--brand-dark); }
.button-secondary { color: var(--ink); background: var(--surface); border-color: var(--line); }
.button-secondary:hover { border-color: #b9c9bf; background: var(--surface-soft); }
.text-link { color: var(--brand); font-weight: 750; text-decoration: none; }
.panel { padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel + .panel { margin-top: 20px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.attention-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; margin-bottom: 20px; }
.action-card { min-height: 104px; display: grid; grid-template-columns: 48px 1fr 20px; gap: 14px; align-items: center; padding: 18px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); text-decoration: none; }
.action-card:hover { transform: translateY(-1px); border-color: #b6c9bd; }
.action-card-accent { color: white; background: linear-gradient(135deg, var(--brand), #248061); border-color: transparent; }
.action-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; color: var(--brand); background: var(--brand-soft); }
.action-card-accent .action-icon { color: white; background: rgba(255,255,255,.16); }
.action-card strong, .action-card small { display: block; }
.action-card small { margin-top: 3px; color: var(--muted); font-size: 13px; }
.action-card-accent small { color: #d8ebe2; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.7fr) minmax(280px,.8fr); gap: 20px; }
.metrics { display: grid; gap: 10px; margin: 0; }
.metrics div { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.metrics div:last-child { border-bottom: 0; }
.metrics dt { color: var(--muted); }
.metrics dd { margin: 0; font-size: 22px; font-weight: 850; }
.state-box { min-height: 180px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 12px; padding: 24px; text-align: center; color: var(--muted); }
.state-box h2, .state-box p { margin: 0; }
.state-box p { max-width: 560px; }
.skeleton-line, .skeleton-card { position: relative; overflow: hidden; background: #e9efeb; border-radius: 10px; }
.skeleton-line::after, .skeleton-card::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.75), transparent); animation: shimmer 1.4s infinite; }
.skeleton-line { width: 100%; height: 18px; }
.skeleton-card { width: 100%; height: 82px; margin-bottom: 10px; }
.w-80 { width: 80%; }.w-70 { width: 70%; }.w-60 { width: 60%; }
@keyframes shimmer { to { transform: translateX(100%); } }
.empty-illustration { width: 48px; height: 48px; color: #799187; }
.notice { margin-bottom: 16px; padding: 14px 16px; border-radius: 12px; background: var(--info-soft); color: var(--info); border: 1px solid #bad5e5; }
.notice.is-error { background: var(--danger-soft); color: var(--danger); border-color: #efc5c1; }
.filter-bar { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 20px; }
.filter-bar label:not(.search-field), .form-grid > label, .period-picker > label { display: grid; gap: 6px; color: var(--muted); font-size: 14px; font-weight: 700; }
.search-field { min-height: 46px; display: flex; align-items: center; gap: 8px; flex: 1; padding: 0 13px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 12px; }
.search-field input { width: 100%; min-height: 44px; padding: 0; border: 0; outline: 0; background: transparent; color: var(--ink); }
select, input[type="date"], input[type="text"], input[type="password"], input[type="email"], textarea { width: 100%; min-height: 46px; padding: 10px 12px; color: var(--ink); background: white; border: 1px solid #becbc3; border-radius: 11px; }
textarea { min-height: 110px; resize: vertical; }
select:disabled { color: #89958f; background: #edf1ee; }
.responsive-list { display: grid; gap: 10px; }
.data-row { min-height: 72px; display: grid; grid-template-columns: minmax(180px,1.4fr) repeat(3,minmax(110px,.7fr)) auto; align-items: center; gap: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-decoration: none; }
.data-row:hover { border-color: #adc2b5; background: var(--surface-soft); }
.data-row-main strong, .data-row-main small, .data-cell strong, .data-cell small { display: block; }
.data-row small, .data-cell small { color: var(--muted); font-size: 13px; }
.status { display: inline-flex; align-items: center; gap: 6px; width: fit-content; min-height: 28px; padding: 4px 9px; border-radius: 999px; background: var(--info-soft); color: var(--info); font-size: 13px; font-weight: 800; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-warning { color: var(--warning); background: var(--warning-soft); }
.status-danger { color: var(--danger); background: var(--danger-soft); }
.status-success { color: var(--success); background: var(--brand-soft); }
.detail-layout { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(280px,.7fr); gap: 20px; margin-bottom: 20px; }
.task-summary { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.summary-field { padding: 12px 0; border-bottom: 1px solid var(--line); }
.summary-field span, .summary-field strong { display: block; }
.summary-field span { color: var(--muted); font-size: 13px; }
.timeline { display: grid; gap: 0; }
.timeline-item { position: relative; padding: 0 0 20px 28px; }
.timeline-item::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: -8px; width: 1px; background: var(--line); }
.timeline-item:last-child::before { display: none; }
.timeline-item::after { content: ""; position: absolute; left: 2px; top: 6px; width: 11px; height: 11px; border: 2px solid white; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.timeline-item p { margin: 3px 0 0; color: var(--muted); font-size: 14px; }
.comment-form { display: grid; gap: 10px; margin-top: 18px; }
.comment-form textarea { min-height: 92px; }
.attachment-list { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.attachment-list h3 { margin-bottom: 8px; }
.attachment-list p { margin: 5px 0; font-size: 14px; }
.period-picker { display: grid; grid-template-columns: minmax(180px,.7fr) minmax(240px,1fr) auto; align-items: end; gap: 16px; margin-bottom: 20px; }
.legend { min-height: 46px; display: flex; align-items: center; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 13px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }.legend-work { background: var(--brand); }.legend-absence { background: var(--danger); }.legend-attention { background: var(--accent); }
.timesheet-desktop { overflow: auto; max-width: 100%; }
.timesheet-table { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; }
.timesheet-table th, .timesheet-table td { min-width: 78px; padding: 10px; text-align: center; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.timesheet-table th { position: sticky; top: 0; z-index: 2; background: #edf4ef; font-size: 13px; }
.timesheet-table .employee { position: sticky; left: 0; z-index: 3; min-width: 210px; text-align: left; background: white; box-shadow: 1px 0 var(--line); }
.timesheet-mobile { display: none; gap: 12px; }
.employee-card { padding: 16px; border: 1px solid var(--line); border-radius: 14px; }
.employee-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.day-list { display: grid; gap: 8px; }
.day-row { min-height: 52px; display: grid; grid-template-columns: 72px 1fr auto; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.wizard { max-width: 900px; margin: 0 auto; }
.stepper { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; margin: 0 0 28px; padding: 0; list-style: none; counter-reset: steps; }
.stepper li { position: relative; padding-top: 12px; color: var(--muted); font-size: 13px; text-align: center; border-top: 4px solid var(--line); }
.stepper li.is-active { color: var(--brand); border-color: var(--brand); font-weight: 800; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
.span-2, fieldset { grid-column: 1 / -1; }
fieldset { margin: 0; padding: 0; border: 0; }
legend { margin-bottom: 8px; color: var(--muted); font-size: 14px; font-weight: 700; }
.choice-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.choice { position: relative; min-height: 96px; display: grid; grid-template-columns: 36px 1fr; align-content: center; gap: 2px 12px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand); }
.choice input { position: absolute; opacity: 0; }.choice [data-icon] { grid-row: span 2; align-self: center; width: 28px; height: 28px; color: var(--brand); }.choice strong, .choice small { display: block; }.choice small { color: var(--muted); }
.form-grid label > small { color: var(--muted); font-weight: 400; }
.field-error:not(:empty) { color: var(--danger); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 28px; }
.success-state { min-height: 420px; display: grid; place-items: center; align-content: center; gap: 14px; text-align: center; }
.success-state h2, .success-state p { margin: 0; }.success-state p { color: var(--muted); }.success-state > div { display: flex; gap: 10px; margin-top: 8px; }
.success-mark { display: grid; place-items: center; width: 70px; height: 70px; padding: 20px; color: white; background: var(--brand); border-radius: 50%; }
.bottom-nav, .drawer-backdrop { display: none; }
.muted { color: var(--muted); }

@media (min-width: 1600px) {
  .dashboard-grid { grid-template-columns: minmax(0,2fr) minmax(320px,.8fr); }
  .panel { padding: 28px; }
}

@media (max-width: 1023px) {
  .sidebar { transform: translateX(-105%); transition: transform .2s ease; box-shadow: 18px 0 48px rgba(7,25,17,.24); }
  .sidebar.is-open { transform: none; }
  .workspace { margin-left: 0; }
  .menu-button { display: inline-grid; }
  .drawer-backdrop { position: fixed; z-index: 25; inset: 0; display: block; background: rgba(7,25,17,.46); }
  .attention-grid { grid-template-columns: 1fr; }
  .action-card { min-height: 88px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .period-picker { grid-template-columns: 1fr 1fr; }
  .legend { grid-column: 1 / -1; }
  .data-row { grid-template-columns: minmax(160px,1.4fr) repeat(2,minmax(100px,.7fr)) auto; }
  .data-row .data-cell:nth-of-type(4) { display: none; }
}

@media (max-width: 599px) {
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .sidebar { width: min(88vw, 320px); padding-bottom: 24px; }
  .topbar { min-height: 60px; padding: 8px 14px; }
  .topbar-title span { display: none; }
  .topbar .quick-action span:last-child { display: none; }
  .topbar .quick-action { min-width: 44px; padding: 0; margin-left: auto; }
  .main-content { padding: 22px 14px 32px; }
  .page-header { align-items: flex-start; margin-bottom: 18px; }
  .page-header > :last-child:not(:first-child) { flex: 0 0 auto; }
  .page-header p:not(.eyebrow) { font-size: 14px; }
  h1 { font-size: 28px; }
  .panel { padding: 16px; border-radius: 15px; box-shadow: 0 6px 20px rgba(30,56,43,.06); }
  .attention-grid { gap: 10px; }
  .action-card { grid-template-columns: 44px 1fr 20px; padding: 14px; border-radius: 15px; }
  .action-icon { width: 44px; height: 44px; }
  .filter-bar { align-items: stretch; flex-direction: column; }
  .filter-bar > * { width: 100%; }
  .data-row { min-height: 0; display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 15px; }
  .data-row .data-cell { display: block !important; grid-column: 1; }
  .data-row .data-cell:empty { display: none !important; }
  .data-row .row-action { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .detail-layout, .task-summary { grid-template-columns: 1fr; }
  .period-picker { grid-template-columns: 1fr; }
  .legend { grid-column: auto; }
  .timesheet-desktop { display: none !important; }
  .timesheet-mobile { display: grid; }
  .form-grid, .choice-grid { grid-template-columns: 1fr; }
  .span-2, fieldset { grid-column: auto; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .button { width: 100%; }
  .success-state > div { flex-direction: column; width: 100%; }
  .bottom-nav { position: fixed; z-index: 22; inset: auto 0 0; min-height: calc(64px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(5,1fr); padding: 6px 4px env(safe-area-inset-bottom); background: rgba(255,255,255,.97); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(25,50,38,.08); }
  .bottom-nav a, .bottom-nav button { min-width: 0; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 4px 2px; color: var(--muted); border: 0; background: transparent; text-decoration: none; font-size: 10px; font-weight: 700; }
  .bottom-nav .nav-icon { width: 22px; height: 22px; }
  .bottom-nav .is-active { color: var(--brand); }
}

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

@media (forced-colors: active) {
  .status::before, .legend i { border: 1px solid CanvasText; }
  .nav-link.is-active { outline: 2px solid Highlight; }
}

.login-page { min-height: 100vh; background: #eef3ef; }
.login-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(420px,1.05fr) minmax(420px,.95fr); }
.login-story { display: flex; flex-direction: column; justify-content: space-between; padding: clamp(36px,6vw,88px); color: white; background: radial-gradient(circle at 15% 15%, rgba(242,199,95,.2), transparent 28%), linear-gradient(145deg,#12372a,#0a251b); }
.login-brand, .login-mobile-brand { display: flex; align-items: center; gap: 12px; }
.login-brand strong, .login-brand small { display: block; }
.login-brand strong { font-size: 20px; }
.login-brand small { color: #bdd2c7; }
.login-story .eyebrow { color: #f2c75f; }
.login-story h1 { margin: 8px 0 18px; font-size: clamp(40px,5vw,68px); max-width: 760px; }
.login-story > div > p:last-child { max-width: 650px; color: #c9ddd3; font-size: 18px; }
.login-security { display: flex; align-items: center; gap: 8px; color: #bdd2c7; font-size: 14px; }
.login-card { width: min(100% - 40px, 480px); margin: auto; padding: 42px; background: white; border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 24px 70px rgba(23,55,42,.13); }
.login-card h2 { margin: 4px 0 8px; font-size: 30px; }
.login-card > .muted { margin: 0 0 26px; }
.login-card form { display: grid; gap: 18px; }
.login-card form > label { display: grid; gap: 7px; color: var(--ink); font-size: 14px; font-weight: 750; }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 92px; }
.password-field button { position: absolute; right: 5px; top: 5px; min-height: 36px; padding: 0 10px; color: var(--brand); background: transparent; border: 0; border-radius: 8px; font-size: 13px; font-weight: 750; cursor: pointer; }
.login-submit { width: 100%; margin-top: 6px; }
.login-submit:disabled { opacity: .7; cursor: wait; }
.button-spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.4); border-top-color: white; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.login-error { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 20px; padding: 12px 14px; color: var(--danger); background: var(--danger-soft); border: 1px solid #efc5c1; border-radius: 11px; font-size: 14px; }
.login-help { margin: 22px 0 0; color: var(--muted); font-size: 13px; text-align: center; }
.login-mobile-brand { display: none; }

@media (max-width: 899px) {
  .login-layout { display: grid; grid-template-columns: 1fr; place-items: center; padding: 28px 0; background: radial-gradient(circle at top,rgba(23,107,77,.15),transparent 38%),#eef3ef; }
  .login-story { display: none; }
  .login-mobile-brand { display: flex; margin-bottom: 28px; }
  .login-card { padding: 32px; }
}
@media (max-width: 599px) {
  .login-page { padding-bottom: 0; }
  .login-layout { align-items: start; min-height: 100svh; padding: 24px 0; }
  .login-card { width: calc(100% - 28px); margin-top: 8px; padding: 26px 22px; border-radius: 18px; }
  .login-card h2 { font-size: 26px; }
}
