:root {
  color-scheme: light;
  --bg: #f5f5f4;
  --surface: #fff;
  --ink: #1d1b1b;
  --quiet: #656063;
  --line: #e8e5e5;
  --red: #c91b2b;
  --red-dark: #a71322;
  --dark: #171616;
  --green: #086549;
  --green-soft: #e6f4eb;
  --amber: #805009;
  --amber-soft: #fff0d6;
  --radius: 16px;
  --shadow: 0 2px 6px #220a0a06;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
  color: var(--ink);
  background: var(--bg);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 290px; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:disabled { opacity: .46; cursor: default; }
:focus-visible { outline: 3px solid #e04a59; outline-offset: 3px; }
svg { flex-shrink: 0; vertical-align: middle; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2.1rem, 3.8vw, 3rem); font-weight: 850; letter-spacing: -.055em; line-height: 1.06; }
h2 { font-size: 1.15rem; font-weight: 800; letter-spacing: -.026em; line-height: 1.25; }
small { font-size: .825rem; line-height: 1.45; }
.layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100dvh; padding: 27px 15px 20px; background: var(--dark); color: #eee; display: flex; flex-direction: column; }
.brand { display: inline-flex; gap: 10px; align-items: center; min-width: 0; }
.brand img { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; background: #d11c13; }
.brand strong { display: block; font-size: 1.135rem; font-weight: 850; letter-spacing: -.043em; line-height: 1.12; }
.brand small { color: #aaa4a4; display: block; margin-top: 3px; font-size: .77rem; }
.sidebar .brand { margin: 0 5px 35px; }
.sidebar nav { display: grid; gap: 6px; }
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 13px; border-radius: 9px; color: #c4bfc0; font-size: .925rem; font-weight: 650; }
.nav-link:hover { background: #ffffff10; color: white; }
.nav-link.selected { background: #c91b2b; color: white; font-weight: 780; }
.side-footer { margin-top: auto; padding: 15px 6px 5px; border-top: 1px solid #ffffff1b; color: #b6b0b0; }
.side-footer div { display: flex; align-items: center; gap: 8px; padding: 5px; font-size: .8125rem; }
.body { min-width: 0; }
.topbar { background: white; min-height: 71px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 32px; }
.breadcrumb { display: flex; align-items: center; gap: 9px; color: var(--quiet); font-size: .925rem; }
.breadcrumb b { color: var(--ink); }
.header-actions { display: flex; gap: 16px; align-items:center; }
.languages { display: flex; align-items: center; padding: 3px; border: 1px solid #e9e4e4; border-radius: 9px; background: #f5f3f3; }
.languages button { background: transparent; border: 0; color: #575153; font-size: .8rem; font-weight: 800; min-width: 38px; min-height: 34px; border-radius: 6px; }
.languages button[aria-pressed=true] { background: white; color: var(--red-dark); box-shadow: 0 1px 3px #00000014; }
.profile-button { padding: 0; min-height: 44px; display: flex; align-items: center; gap: 9px; border: 0; background: transparent; text-align: left; }
.avatar { width: 39px; height: 39px; flex: 0 0 39px; border-radius: 50%; display: grid; place-items: center; color: #a31524; background: #fdebed; font-size: .82rem; font-weight: 850; }
.profile-button b, .profile-button small, .profile-card b, .profile-card small { display: block; }
.profile-button b { font-size: .875rem; }
.profile-button small, .profile-card small { color: var(--quiet); }
.mobile-brand, .bottom-nav { display: none; }
.main { max-width: 1390px; margin: 0 auto; padding: 30px 32px 48px; }
.hero { position: relative; overflow: hidden; min-height: 233px; display: flex; align-items: stretch; background-color: #1b1819; background-image: linear-gradient(90deg, #1a1718 2%, #1a1718 32%, #1a1718e0 47%, #1a171831 75%, #22141646 100%), url('/hero.webp'); background-size: 100% 100%, min(58%, 610px) auto; background-position: center, right 49%; background-repeat: no-repeat; border-radius: 18px; color: white; isolation: isolate; box-shadow: var(--shadow); }
.hero::before { content: ''; position: absolute; z-index: -1; inset: 18% auto 18% 0; width: 4px; background: #ec3040; border-radius: 0 4px 4px 0; }
.hero-content { padding: 30px 32px; min-width: 0; }
.hero h1 { margin: 12px 0 7px; font-size: clamp(2.5rem, 4vw, 4rem); line-height: .99; overflow-wrap: anywhere; }
.hero-content > p { line-height: 1.5; color: #ded8d9; margin-bottom: 19px; }
.hero-location, .hero-date { display: inline-flex; gap: 7px; align-items: center; font-size: .875rem; font-weight: 700; }
.hero-location { color: #ffb6bc; }
.hero-date { border: 1px solid #ffffff2a; background: #ffffff12; color: #f2eeee; padding: 7px 10px; border-radius: 7px; }
.section-title { margin: 24px 0 12px; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.section-title span { display: inline-flex; align-items: center; gap: 6px; color: var(--quiet); font-size: .8375rem; }
.metrics { display:grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.metric, .panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.metric { display: flex; flex-direction: column; align-items:flex-start; min-width: 0; padding: 16px 17px 15px; }
.metric:hover { border-color: #d9b2b6; }
.metric-top { display: flex; gap: 9px; align-items: center; font-size: .925rem; }
.metric-icon { display: inline-grid; place-items: center; width: 39px; height: 39px; flex: 0 0 39px; border-radius: 10px; }
.metric-icon.red, .pill.bad { color: #a81525; background: #fde9ec; }
.metric-icon.amber { color: var(--amber); background: var(--amber-soft); }
.metric-icon.green, .pill.good { color: var(--green); background: var(--green-soft); }
.metric-icon.soft { color: #6b585a; background: #f5efef; }
.metric > strong { display: block; font-size: 1.95rem; font-weight: 850; margin: 10px 0 1px; letter-spacing: -.055em; }
.metric-caption { color: var(--quiet); font-size: .875rem; }
progress { display: block; height: 5px; margin-top: 13px; width: 100%; background: #eee9e9; border: 0; border-radius: 99px; overflow: hidden; color: var(--red); }
progress::-webkit-progress-bar { background: #eee9e9; }
progress::-webkit-progress-value { background: var(--red); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--red); border-radius: 99px; }
.dashboard-panels { display: grid; grid-template-columns: 1.45fr 1fr; gap: 14px; margin-top: 16px; align-items: start; }
.main > .panel + .panel { margin-top: 14px; }
.panel-head { min-height: 61px; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 17px; border-bottom: 1px solid var(--line); }
.panel-head h2 { display: flex; align-items: center; gap: 9px; overflow-wrap: anywhere; }
.panel-note { padding: 13px 17px; color: var(--quiet); font-size: .925rem; line-height: 1.5; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 23px 16px 26px; min-height: 131px; text-align:center; }
.empty-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: #f5f2f2; color: #6b585a; margin-bottom: 2px; }
.empty strong { font-size: .925rem; }
.empty p { color: var(--quiet); font-size: .85rem; line-height: 1.4; max-width: 22rem; }
.button, .icon-button { min-height: 43px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 8px; white-space: nowrap; padding: 0 12px; font-size: .875rem; font-weight: 760; }
.button.primary { color: white; background: var(--red); }
.button.primary:hover { background: var(--red-dark); }
.button.secondary, .icon-button { background: white; border-color: #e4dfe0; color: var(--ink); }
.button.secondary:hover, .icon-button:hover { background: #f7f3f3; }
.button.danger { background: #fff1f3; border-color: #f8d3d9; color: #a31524; }
.icon-button { padding: 0; width: 43px; flex: 0 0 43px; }
.pill { display: inline-flex; align-items: center; width: max-content; min-height: 24px; padding: 3px 8px; border-radius: 99px; color: #615859; background: #f1eeee; white-space: nowrap; font-size: .76rem; font-weight: 750; line-height: 1.1; }
.rows > * + * { border-top: 1px solid var(--line); }
.record { display:flex; align-items:center; gap: 11px; padding: 12px 17px; min-height: 66px; }
.record-name { flex: 1 1 130px; min-width: 0; display: grid; gap: 3px; overflow-wrap: anywhere; }
.record-name b, .attention-row b { font-size: .95rem; }
.record-name small, .attention-row small { display: block; color: var(--quiet); }
.record-history { padding-top: 3px; }
.row-actions { display: flex; justify-content: flex-end; align-items: center; gap: 7px; flex-wrap: wrap; }
.shift-icon { color: #a31524; }
.shift-time { font-variant-numeric: tabular-nums; white-space: nowrap; font-size: .9rem; }
.overnight { color: var(--red); }
.attention-row { display: flex; align-items: center; gap: 10px; padding: 11px 17px; }
.attention-row:hover { background: #fff6f6; }
.text-link { min-height: 44px; display: inline-flex; align-items: center; color: var(--red-dark); font-size: .875rem; font-weight: 750; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; margin-bottom: 22px; }
.page-header p { color: var(--quiet); line-height: 1.5; margin-top: 6px; }
.page-actions:empty { display: none; }
.date-controls { display: flex; gap: 7px; align-items: center; }
.date-controls b { font-size: .925rem; min-width: 128px; text-align: center; }
.date-controls input { height: 43px; border: 1px solid var(--line); background: white; color: var(--ink); padding: 0 8px; border-radius: 8px; min-width: 0; }
.week-strip { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 6px; padding: 12px; }
.day-tile { min-width: 0; border: 1px solid var(--line); background: #faf8f8; padding: 7px 1px; display: grid; justify-items: center; align-content: center; gap: 3px; min-height: 77px; border-radius: 9px; color: var(--quiet); }
.day-tile b { color: var(--ink); font-size: 1.125rem; }
.day-tile span { font-size: .8rem; }
.day-tile small { font-size: .75rem; }
.day-tile.current { color: white; background: var(--red); border-color: var(--red); }
.day-tile.current b { color: white; }
.check-count { display: inline-flex; gap: 5px; align-items:center; color: var(--green); font-size: .85rem; }
.search { display: flex; align-items: center; border-radius: 8px; gap: 6px; background: #f7f5f5; border: 1px solid var(--line); padding: 0 9px; color: var(--quiet); }
.search input { background: transparent; border: 0; min-width: 0; width: min(185px,24vw); min-height: 43px; color: var(--ink); }
.tabs { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 15px; }
.tabs button { border: 1px solid var(--line); background: white; color: var(--quiet); min-height: 43px; padding: 0 12px; border-radius: 8px; font-size: .875rem; font-weight: 700; }
.tabs .chosen { background: var(--dark); border-color: var(--dark); color: white; }
.profile-card { display: flex; gap: 10px; align-items: center; }
.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.hours p, .preserve-lines { white-space: pre-wrap; overflow-wrap: anywhere; }
.hours p { color: var(--quiet); margin-top: 5px; }
.media-open { flex: 1; display: flex; align-items: center; gap: 9px; padding: 0; border: 0; background: transparent; min-height: 44px; text-align: left; color: var(--ink); }
.media-preview img, .media-preview video { display: block; max-width: 100%; max-height: 65dvh; margin: 0 auto; }
.media-preview { padding: 12px; background: #171616; }
dialog { width: min(100% - 24px, 530px); max-height: 91dvh; margin: auto; padding: 0; color: var(--ink); border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 22px 70px #10090a50; }
dialog::backdrop { background: #15111290; }
.dialog-head { padding: 12px 18px; display: flex; align-items:center; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { overflow-wrap: anywhere; }
.dialog-form, .settings-form { display: grid; gap: 13px; padding: 16px 18px 19px; }
.field-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 9px; }
.field { display: grid; gap: 5px; min-width: 0; }
.field span, .toggle span { font-size: .9rem; font-weight: 720; }
.field input, .field select, .field textarea { padding: 10px 9px; width: 100%; min-width: 0; min-height: 44px; border: 1px solid #ded8d9; border-radius: 8px; background: #fff; color: var(--ink); }
.field input:read-only:not([type=file]) { background: #f3f0f0; }
.field select { cursor: pointer; }
.field textarea { resize: vertical; }
.toggle { display: flex; min-height: 38px; align-items: center; gap: 9px; cursor: pointer; }
.toggle input { width: 20px; height: 20px; margin: 0; accent-color: var(--red); }
.form-hint { color: var(--quiet); font-size: .85rem; line-height: 1.45; overflow-wrap: anywhere; }
.form-error { color: var(--red-dark); font-weight: 700; font-size: .875rem; }
.form-error:empty { display:none; }
.form-footer { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; }
.form-footer p { margin-right: auto; }
.history > div { background: #f7f5f5; padding: 9px; border-radius: 8px; }
.history small { margin-left: 7px; color: var(--quiet); }
.history p { margin-top: 4px; overflow-wrap: anywhere; }
.install-instructions img { border-radius: 15px; }
.install-instructions p { line-height: 1.5; }
.toast { display: none; }
.toast.shown { display: block; position: fixed; z-index: 3; right: 15px; bottom: 20px; max-width: min(90vw,375px); border-radius: 9px; background: #174736; color: white; font-size: .9rem; font-weight: 700; padding: 13px 16px; box-shadow: 0 3px 14px #0003; }
.toast.error { background: #991b28; }
.boot { min-height: 100dvh; max-width: 440px; margin: auto; padding: 22px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 15px; }
.boot small { color: var(--quiet); }
.boot-logo { font-size: 2.5rem; line-height: .81; font-weight: 950; font-style: italic; letter-spacing: -.05em; }
.boot-logo span { color: var(--red); }
.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; }

@media (max-width: 980px) {
  .layout { grid-template-columns: 180px minmax(0,1fr); }
  .main { padding-inline: 20px; }
  .topbar { padding-inline: 20px; }
  .sidebar { padding-inline: 11px; }
  .record { flex-wrap: wrap; }
}
@media (max-width: 720px) {
  .layout { display: block; }
  .sidebar, .breadcrumb, .profile-button > span:not(.avatar) { display:none; }
  .mobile-brand { display:block; min-width: 0; }
  .topbar { min-height: 64px; padding: max(8px,env(safe-area-inset-top)) 12px 7px; }
  .brand { gap: 7px; }
  .brand img { width: 42px; height: 42px; border-radius: 9px; }
  .brand strong { font-size: 1rem; }
  .brand small { color: var(--quiet); margin-top: 2px; font-size: .71rem; }
  .header-actions { gap: 9px; }
  .languages button { min-width: 33px; min-height: 35px; }
  .main { padding: 14px 12px calc(88px + env(safe-area-inset-bottom)); }
  .bottom-nav { display: flex; justify-content: stretch; position: fixed; z-index: 2; background: #fff; border-top: 1px solid var(--line); inset: auto 0 0; padding: 3px max(3px,env(safe-area-inset-right)) env(safe-area-inset-bottom) max(3px,env(safe-area-inset-left)); }
  .bottom-nav .nav-link { min-height: 54px; flex: 1 1 0; min-width: 0; gap: 3px; padding: 4px 0 3px; flex-direction: column; justify-content: center; border-radius: 7px; color: #595356; font-size: clamp(.61rem,2.55vw,.78rem); font-weight: 700; }
  .bottom-nav .nav-link.selected { background: #fcebed; color: #a31524; }
  .hero { border-radius: 13px; min-height: 194px; background-size: 100% 100%, 83% auto; background-image: linear-gradient(90deg,#1a1718 1%,#1a1718f4 26%,#1a1718a9 55%,#1a171840 100%),url('/hero.webp'); }
  .hero-content { padding: 19px 15px 17px; }
  .hero h1 { margin: 9px 0 6px; font-size: clamp(2.05rem,9vw,3rem); }
  .hero-content > p { margin: 5px 0 13px; font-size: .9rem; max-width: 16rem; }
  .hero-date, .hero-location { font-size: .8rem; }
  .section-title { margin: 17px 0 9px; }
  .section-title span { font-size: .72rem; }
  .metric { padding: 9px 7px 10px; border-radius: 11px; }
  .metrics { gap: 5px; }
  .metric-top { display: grid; gap: 5px; font-size: .79rem; }
  .metric-icon { width: 34px; height: 34px; flex-basis: 34px; }
  .metric > strong { font-size: 1.43rem; margin-top: 6px; }
  .metric-caption { font-size: .73rem; line-height: 1.25; }
  progress { margin-top: 8px; }
  .dashboard-panels { grid-template-columns: minmax(0,1fr); gap: 9px; margin-top: 11px; }
  .panel { border-radius: 12px; }
  .panel-head { padding: 8px 10px; min-height: 51px; gap: 5px; }
  .panel-head h2 { font-size: 1.04rem; }
  .empty { min-height: 112px; padding: 15px 9px 16px; }
  .record { gap: 7px; padding: 9px 10px; }
  .row-actions { gap: 5px; }
  .check-record .row-actions, .shift .row-actions { flex: 1 1 100%; }
  .button, .icon-button { min-height: 44px; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 9px; margin-bottom: 13px; }
  .page-header h1 { font-size: 2rem; }
  .page-header p { font-size: .925rem; }
  .page-actions { display: flex; }
  .week-strip { padding: 7px; gap: 4px; }
  .day-tile { min-height: 68px; }
  .date-controls { gap: 4px; }
  .date-controls .icon-button { width: 37px; flex-basis: 37px; }
  .check-count { font-size: .74rem; }
  .tabs { gap: 4px; }
  .tabs button { padding: 0 8px; font-size: .79rem; }
  dialog { margin: auto auto 0; max-height: 88dvh; width: 100%; border-radius: 17px 17px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .toast.shown { bottom: calc(64px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }

.lock-bar { min-height: 68px; display:flex; justify-content:space-between; align-items:center; gap:16px; padding: 10px clamp(14px,4vw,36px); color:white; background:var(--dark); }
.lock-bar .brand small { color:#bdb7b7; }
.lock-main { min-height:calc(100dvh - 68px); display:grid; align-items:center; justify-items:center; padding:20px 14px; }
.lock-panel { width:min(100%,480px); padding:clamp(20px,5vw,36px); display:grid; justify-items:start; gap:14px; }
.lock-panel h1 { font-size:clamp(1.75rem,5vw,2.25rem); }
.lock-panel p { color:var(--quiet); line-height:1.55; }
.lock-panel .lock-name { color:var(--ink); font-weight:750; }
.lock-actions { display:flex; flex-wrap:wrap; gap:8px; width:100%; }
.lock-actions .primary { flex-grow:1; }
.security-actions { justify-content:flex-start; }
.recovery-code { display:block; user-select:all; font-size:1.04rem; line-height:1.45; color:var(--ink); padding:12px; background:#f6f1f1; border-radius:8px; overflow-wrap:anywhere; }

.review-form { display:grid; width:100%; gap:12px; }
.review-slot { display:grid; gap:9px; border:1px solid var(--line); padding:12px; border-radius:12px; }
