:root {
  color-scheme: light;
  --page: #f5f7fb;
  --panel: #fff;
  --ink: #122541;
  --muted: #566984;
  --border: #dce5ef;
  --blue: #1857bb;
  --blue-deep: #12448f;
  --pale: #eaf2ff;
  --green: #116747;
  --red: #982744;
  --radius: 17px;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  background: var(--page);
  color: var(--ink);
  line-height: 1.48;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 290px; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: var(--blue); }
:focus-visible { outline: 3px solid #e1a43b; outline-offset: 3px; }
[hidden] { display: none !important; }
.shell { max-width: 1450px; margin: auto; min-height: 100dvh; display: grid; grid-template-columns: 228px minmax(0, 1fr); }
.rail { background: var(--panel); border-right: 1px solid var(--border); padding: 27px 19px; display: flex; flex-direction: column; gap: 30px; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); font-size: 19px; font-weight: 760; letter-spacing: -.06em; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 10px 10px 10px 3px; background: var(--ink); color: white; font-weight: 800; font-style: italic; letter-spacing: -.09em; }
.brand-light { color: var(--blue); }
.nav { display: grid; gap: 7px; }
.nav button { text-align: left; min-height: 44px; padding: 9px 13px; border: 0; border-radius: 11px; color: var(--muted); background: transparent; font-weight: 650; }
.nav button[aria-current="page"] { color: var(--blue-deep); background: var(--pale); }
.nav button:hover { color: var(--blue-deep); background: var(--pale); }
.account { display: grid; margin-top: auto; gap: 4px; padding: 13px 10px 0; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.account span { color: var(--muted); font-size: 13px; }
.main { min-width: 0; width: 100%; max-width: 1160px; margin-inline: auto; padding: 35px clamp(19px, 4vw, 56px) 55px; }
h1, h2, h3, p { margin: 0; overflow-wrap: anywhere; }
h1 { font-size: clamp(29px, 5vw, 43px); letter-spacing: -.061em; line-height: 1.12; }
h2 { font-size: 21px; letter-spacing: -.035em; line-height: 1.2; }
p, dd { color: var(--muted); }
small { color: var(--muted); }
.head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 25px; }
.head p { margin-top: 7px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn { min-height: 44px; border-radius: 11px; border: 1px solid var(--border); background: var(--panel); color: var(--ink); padding: 10px 15px; font-weight: 660; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: normal; }
.btn:hover { background: var(--pale); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: white; }
.btn.primary:hover { background: var(--blue-deep); }
.btn.danger { color: var(--red); }
.btn:disabled { opacity: .58; cursor: wait; }
.btn.back { padding: 5px 0; min-height: 40px; margin-bottom: 12px; border: none; background: transparent; color: var(--blue-deep); }
.filters { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 15px; align-items: center; }
.filter { display: flex; gap: 8px; align-items: center; border: 1px solid var(--border); padding: 8px 12px; min-height: 41px; border-radius: 10px; background: var(--panel); color: var(--muted); font-size: 13px; font-weight: 620; }
.filter b { font-size: 12px; font-variant-numeric: tabular-nums; }
.filter[aria-pressed="true"] { border-color: #9abbea; background: var(--pale); color: var(--blue-deep); }
.switch { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; color: var(--muted); font-size: 14px; cursor: pointer; }
.switch input { width: 16px; height: 16px; accent-color: var(--blue); }
.list { display: grid; gap: 9px; }
.row { display: grid; align-items: center; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; width: 100%; border: 1px solid var(--border); border-radius: 13px; padding: 14px 16px; background: var(--panel); text-align: left; color: var(--ink); }
button.row:hover { border-color: #a7bee1; box-shadow: 0 3px 12px #19458a0b; }
.row-title { display: block; font-size: 16px; font-weight: 750; overflow-wrap: anywhere; }
.row-meta { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.badge { display: inline-flex; align-items: center; max-width: 145px; align-self: start; padding: 5px 10px; border-radius: 999px; background: #e9f2ff; color: #184a8d; font-weight: 700; font-size: 12px; text-align: center; white-space: normal; }
.badge.working { background: #fff0d6; color: #744a13; }
.badge.driver { background: #ede8fd; color: #533787; }
.badge.done { background: #e1f4eb; color: var(--green); }
.badge.refused { background: #fae7ec; color: var(--red); }
.block { border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; background: var(--panel); }
.block h2 { margin-bottom: 15px; }
.detail-grid { display: grid; align-items: start; grid-template-columns: minmax(220px, .75fr) minmax(0, 1.25fr); gap: 15px; }
.info { display: grid; gap: 13px; margin: 0; }
.info div { display: grid; gap: 2px; }
.info dt { color: var(--muted); font-size: 13px; }
.info dd { margin: 0; color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; align-items: start; }
.form .wide { grid-column: 1 / -1; }
.field { display: grid; min-width: 0; gap: 5px; font-size: 13px; color: var(--muted); font-weight: 635; }
.field input, .field select { min-width: 0; max-width: 100%; width: 100%; appearance: auto; min-height: 44px; padding: 8px 10px; border-radius: 9px; border: 1px solid #c9d6e5; background: #fff; color: var(--ink); font-size: 16px; }
.field select:focus, .field input:focus { border-color: var(--blue); }
.form-end { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 3px; align-items: center; }
.sep { border: none; border-top: 1px solid var(--border); margin: 19px 0; }
.note { border: 1px solid #d6e5ff; background: #edf4ff; color: #294d7d; padding: 10px 12px; border-radius: 10px; font-size: 14px; margin-bottom: 13px; }
.form-error { background: #fbeef1; color: var(--red); padding: 9px 11px; border-radius: 9px; font-size: 14px; }
.empty { padding: 33px 17px; color: var(--muted); border: 1px dashed #cbd9ea; border-radius: var(--radius); text-align: center; }
.empty h2, .empty h1 { margin-bottom: 9px; color: var(--ink); }
.auth { margin-top: 35px; }
.auth a { display: inline-flex; margin-top: 16px; }
.more { margin-top: 14px; }
.summary { font: inherit; white-space: pre-wrap; margin: 0 0 17px; }
.toast { z-index: 4; position: fixed; right: 21px; bottom: max(19px, env(safe-area-inset-bottom)); max-width: min(91vw, 380px); background: var(--ink); color: white; border-radius: 12px; padding: 12px 15px; box-shadow: 0 5px 25px #0e233830; }
.toast.error { background: #81273a; }
@media (max-width: 760px) {
  .shell { display: block; }
  .rail { display: grid; grid-template-columns: 1fr auto; gap: 11px; padding: 13px 16px 8px; border-right: 0; border-bottom: 1px solid var(--border); }
  .brand { font-size: 17px; }
  .brand-mark { width: 29px; height: 29px; }
  .nav { grid-column: 1 / -1; grid-row: 2; display: flex; flex-wrap: wrap; gap: 4px; }
  .nav button { min-height: 38px; font-size: 13px; padding: 6px 11px; }
  .account { grid-column: 2; grid-row: 1; padding: 0; border: 0; align-self: center; text-align: right; gap: 0; max-width: 126px; }
  .account strong { display: none; }
  .main { padding: 23px 15px calc(29px + env(safe-area-inset-bottom)); }
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .head { align-items: center; flex-wrap: wrap; margin-bottom: 17px; }
  .block { padding: 15px; }
  .badge { max-width: 94px; }
  .row { padding: 12px; }
}
@media (max-width: 420px) {
  .form { grid-template-columns: minmax(0, 1fr); }
  .form-end .btn { flex: 1; }
}
@media (prefers-reduced-motion: no-preference) {
  .block, .list { animation: appear .2s ease-out; }
  @keyframes appear { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
}
