:root {
  --bg: #f4f5f8;
  --panel: #ffffff;
  --line: #cfd4dc;
  --text: #15171a;
  --muted: #69707b;
  --accent: #0b63d8;
  --accentText: #ffffff;
  --empty: #ebe9fb;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.screen { min-height: 100vh; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.login-screen { display: grid; place-items: center; padding: 24px; }
.login-box { width: min(100%, 390px); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 24px; }
.brand { color: var(--accent); font-weight: 700; letter-spacing: .02em; }
h1 { font-size: 24px; margin: 8px 0; }
label { display: block; margin-top: 16px; font-size: 14px; }
input { display: block; width: 100%; margin-top: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.primary, .secondary, .period-nav button, .tab { border: 1px solid var(--line); border-radius: 11px; background: var(--panel); padding: 10px 12px; }
.primary { width: 100%; margin-top: 18px; background: var(--accent); border-color: var(--accent); color: var(--accentText); font-weight: 600; }
.error { color: #b00020; font-size: 14px; }
.topbar { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); padding: max(10px, env(safe-area-inset-top)) 8px 10px; backdrop-filter: blur(8px); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tab.active { background: var(--accent); color: var(--accentText); border-color: var(--accent); font-weight: 600; }
.period-nav { display: grid; grid-template-columns: 46px 1fr 46px; gap: 8px; align-items: center; margin-top: 9px; }
.period-title { text-align: center; font-weight: 600; background: transparent !important; border: 0 !important; }
.loading { padding: 20px; text-align: center; }
.week-grid { display: grid; grid-template-columns: 34px repeat(7, minmax(0, 1fr)); border-top: 1px solid #222; border-left: 1px solid #222; background: var(--empty); }
.week-grid > * { min-width: 0; border-right: 1px solid #222; border-bottom: 1px solid #222; }
.week-corner, .week-time, .week-day-head { background: #f1f0ff; }
.week-day-head { border: 0; border-right: 1px solid #222; border-bottom: 1px solid #222; padding: 5px 1px; text-align: center; line-height: 1.15; font-size: 9px; color: var(--text); }
.week-day-head strong { display: block; font-size: 11px; }
.week-day-head.weekend { color: #d20b0b; }
.week-time { display: flex; align-items: center; justify-content: center; font-size: 8px; font-weight: 600; min-height: 50px; }
.week-cell { min-height: 50px; display: flex; overflow: hidden; background: var(--empty); }
.week-order { flex: 1 1 0; min-width: 0; border: 0; border-right: 1px solid rgba(0,0,0,.3); padding: 2px; text-align: left; overflow: hidden; color: #111; }
.week-order:last-child { border-right: 0; }
.week-order .car { display: block; font-size: 8px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.week-order .line { display: block; font-size: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; margin-bottom: 9px; }
.day-caption { text-align: center; display: grid; }
.day-rows { padding: 8px; touch-action: pan-y; }
.day-row { display: grid; grid-template-columns: 58px 1fr; margin-bottom: 6px; border: 1px solid #222; border-radius: 9px; overflow: hidden; background: var(--panel); }
.day-time { display: flex; align-items: center; justify-content: center; font-weight: 650; border-right: 1px solid #222; }
.day-orders { min-height: 66px; background: var(--empty); }
.day-order { display: block; width: 100%; border: 0; border-bottom: 1px solid rgba(0,0,0,.35); padding: 8px 10px; text-align: left; color: #111; min-height: 66px; }
.day-order:last-child { border-bottom: 0; }
.day-order strong, .day-order span { display: block; }
.day-order span { font-size: 13px; margin-top: 2px; }
.order-head { display: flex; align-items: center; gap: 12px; }
.order-body { padding: 12px; max-width: 720px; margin: 0 auto; }
.status-band { padding: 14px; border: 1px solid rgba(0,0,0,.35); border-radius: 12px; font-weight: 700; margin-bottom: 14px; }
.detail-section { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 12px; }
.detail-section h2 { font-size: 15px; margin: 0 0 8px; }
.detail-row { display: grid; grid-template-columns: minmax(110px, .8fr) 1.2fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid #eceef1; }
.detail-row:last-child { border-bottom: 0; }
.detail-row .label { color: var(--muted); font-size: 13px; }
.service-row { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid #eceef1; }
.service-row:last-child { border-bottom: 0; }
.total { display: flex; justify-content: space-between; font-weight: 800; font-size: 18px; padding-top: 12px; }
.readonly { text-align: center; color: var(--muted); font-size: 12px; margin: 18px 0 30px; }
@media (min-width: 760px) {
  .week-grid { grid-template-columns: 48px repeat(7, minmax(0, 1fr)); }
  .week-time, .week-cell { min-height: 62px; }
  .week-day-head { font-size: 12px; }
  .week-day-head strong { font-size: 14px; }
  .week-order .car { font-size: 11px; }
  .week-order .line { font-size: 10px; }
}
