:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1f2933;
  background: #eef2f5;
  font-synthesis: none;
  --blue: #173b59;
  --blue-2: #235779;
  --anthracite: #34414c;
  --card: #ffffff;
  --line: #d8e0e6;
  --muted: #65727d;
  --green: #18864b;
  --red: #bf2d25;
  --shadow: 0 12px 30px rgba(31, 41, 51, .08);
  --radius: 18px;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: #eef2f5; }
button { font: inherit; }
.app-shell { min-height: 100dvh; }
.topbar { position: fixed; inset: 0 0 auto 0; height: 68px; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; background: linear-gradient(135deg, var(--blue), var(--blue-2)); color: white; box-shadow: 0 4px 20px rgba(23,59,89,.18); }
.brand, .topbar-actions { display: flex; align-items: center; gap: 12px; font-weight: 750; }
.brand-mark { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: rgba(255,255,255,.16); font-size: 13px; }
.env-pill, .micro-label { border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.env-pill { padding: 6px 9px; background: rgba(255,255,255,.16); }
.icon-button { width: 40px; height: 40px; border: 0; border-radius: 12px; background: rgba(255,255,255,.12); color: white; font-size: 22px; }
.sidebar { position: fixed; top: 68px; left: 0; bottom: 0; width: 268px; padding: 22px 16px; background: #22303b; }
.nav-list { display: grid; gap: 8px; }
.nav-item { border: 0; border-radius: 12px; padding: 14px 16px; text-align: left; color: #dce4e9; background: transparent; font-weight: 650; }
.nav-item.is-active { background: #fff; color: var(--blue); }
.main { margin-left: 268px; padding: 96px 28px 44px; max-width: 1500px; }
.page-heading { display: flex; gap: 24px; align-items: flex-end; justify-content: space-between; margin-bottom: 24px; }
.eyebrow { margin: 0 0 6px; color: var(--blue-2); font-size: 12px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(28px, 4vw, 42px); line-height: 1.05; }
h2 { margin-bottom: 0; font-size: 19px; }
h3 { margin-bottom: 12px; text-transform: capitalize; font-size: 15px; }
.muted { color: var(--muted); max-width: 760px; }
.compact { margin: 4px 0 0; font-size: 13px; }
.heading-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.button { min-height: 48px; border-radius: 13px; padding: 0 18px; border: 1px solid transparent; font-weight: 800; cursor: pointer; }
.button-primary { background: var(--blue); color: white; }
.button-secondary { background: white; color: var(--blue); border-color: #bfd0dc; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.card { background: var(--card); border: 1px solid rgba(23,59,89,.08); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.id-line { color: var(--muted); font: 700 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; }
.status-dot { display: inline-block; width: 8px; height: 8px; margin-left: 5px; border-radius: 999px; background: #2f72d6; vertical-align: 1px; }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 10px; }
.day-card { min-height: 158px; border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: #f9fbfc; }
.shift-card { display: grid; gap: 3px; margin-top: 8px; padding: 10px; border-left: 4px solid var(--blue-2); border-radius: 10px; background: white; box-shadow: 0 3px 10px rgba(31,41,51,.05); }
.shift-card span { color: var(--muted); font-size: 12px; }
.absence-chip { margin-bottom: 8px; padding: 7px 9px; border-radius: 9px; background: #f4e7ad; font-size: 12px; font-weight: 750; }
.empty-slot { color: #8a969f; font-size: 13px; }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.diagnostic-list { display: grid; grid-template-columns: 1fr auto; gap: 9px 18px; margin: 0; }
.diagnostic-list dt { color: var(--muted); }
.diagnostic-list dd { margin: 0; font-weight: 800; }
.process-list { display: grid; gap: 8px; }
.process-row { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; background: #fff; text-align: left; }
.process-row span:first-child { display: grid; gap: 3px; }
.process-row small { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.process-state { color: var(--blue-2); font-size: 12px; font-weight: 850; }
.mobile-nav { display: none; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 40; max-width: min(360px, calc(100vw - 32px)); padding: 13px 16px; border-radius: 13px; background: #1f2933; color: white; box-shadow: var(--shadow); font-weight: 700; }

@media (max-width: 980px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding: 88px 16px 92px; }
  .page-heading { align-items: stretch; flex-direction: column; }
  .heading-actions .button { flex: 1; }
  .week-grid { grid-template-columns: 1fr; }
  .day-card { min-height: 0; display: grid; grid-template-columns: 86px 1fr; gap: 8px 10px; align-items: start; }
  .day-card h3 { grid-row: 1 / span 5; margin: 3px 0 0; }
  .shift-card, .absence-chip, .empty-slot { grid-column: 2; margin: 0; }
  .two-column { grid-template-columns: 1fr; }
  .mobile-nav { position: fixed; display: grid; grid-template-columns: repeat(4,1fr); inset: auto 0 0; z-index: 30; padding: 7px max(8px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); background: #fff; border-top: 1px solid var(--line); }
  .mobile-nav button { min-height: 48px; border: 0; background: transparent; color: var(--muted); font-weight: 750; }
  .mobile-nav button.is-active { color: var(--blue); }
  .toast { right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); }
}

@media (max-width: 560px) {
  .topbar { height: 62px; padding: 0 14px; }
  .brand span:last-child { display: none; }
  .main { padding-top: 80px; }
  .card { padding: 15px; border-radius: 15px; }
  .card-header { align-items: flex-start; }
  .id-line { max-width: 47%; overflow-wrap: anywhere; text-align: right; }
  .heading-actions { position: sticky; top: 70px; z-index: 10; padding: 8px; margin: -4px -8px 0; border-radius: 14px; background: rgba(238,242,245,.94); backdrop-filter: blur(9px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

.login-view { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: linear-gradient(145deg, #173b59, #235779 58%, #34414c); }
.login-view[hidden], .app-shell[hidden] { display: none !important; }
.login-card { width: min(460px, 100%); padding: 30px; border-radius: 22px; background: #fff; box-shadow: 0 22px 60px rgba(0,0,0,.22); }
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; color: var(--blue); }
.login-brand div { display: grid; gap: 2px; }
.login-brand strong { font-size: 17px; }
.login-brand span:last-child { color: var(--muted); font-size: 12px; font-weight: 750; }
.brand-mark.large { width: 50px; height: 50px; border-radius: 14px; background: var(--blue); color: #fff; }
.login-form { display: grid; gap: 14px; margin-top: 22px; }
.login-form label { display: grid; gap: 7px; color: var(--anthracite); font-size: 13px; font-weight: 800; }
.login-form input { width: 100%; min-height: 50px; padding: 0 14px; border: 1px solid #bdcad3; border-radius: 12px; background: #fbfcfd; color: #1f2933; font: inherit; }
.login-form input:focus { outline: 3px solid rgba(35,87,121,.16); border-color: var(--blue-2); }
.login-status { margin: 16px 0 0; min-height: 21px; color: var(--muted); font-size: 13px; font-weight: 700; }
.actor-pill { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 6px 9px; border-radius: 999px; background: rgba(255,255,255,.12); font-size: 11px; font-weight: 800; }
.logout-button { font-size: 18px; cursor: pointer; }
.three-column { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; }
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.data-chip { padding: 8px 10px; border-radius: 999px; background: #edf3f7; color: var(--blue); font-size: 12px; font-weight: 800; }
.acceptance-card, .next-card { margin-top: 18px; }
.status-text, .live-badge { padding: 7px 10px; border-radius: 999px; font-size: 12px; font-weight: 850; }
.live-badge { background: #e6f4ec; color: var(--green); }
.status-text { background: #eef3f6; color: var(--blue-2); }
.acceptance-list { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.acceptance-list li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line); }
.acceptance-list li span { color: var(--muted); font-size: 12px; font-weight: 750; text-align: right; }
.acceptance-ok strong::before { content: '✓ '; color: var(--green); }
.acceptance-fail strong::before { content: '× '; color: var(--red); }

@media (max-width: 1100px) {
  .three-column { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .login-view { padding: 14px; }
  .login-card { padding: 22px 18px; border-radius: 18px; }
  .actor-pill { max-width: 115px; }
  .acceptance-list li { align-items: flex-start; flex-direction: column; gap: 4px; }
  .acceptance-list li span { text-align: left; }
}
