:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-synthesis: none;
  color-scheme: light;
  --navy: #031d43;
  --navy-deep: #02162f;
  --orange: #ff6b0b;
  --blue: #126df1;
  --page: #f7faff;
  --surface: #fff;
  --soft: #edf3fb;
  --text: #071d49;
  --muted: #53647e;
  --line: #dbe5f1;
  --primary: #126df1;
  --link: #125cce;
  --blue-soft: #eaf2ff;
  --blue-text: #165ab7;
  --accent-soft: #fff0e5;
  --accent-text: #924400;
  --success-soft: #e8f7ef;
  --success-text: #16733c;
  --danger-soft: #fff0ee;
  --danger-text: #a8322d;
  --auth-bg: radial-gradient(circle at 90% 5%, #e4efff 0, transparent 46%), #f7faff;
  --shadow: 0 6px 24px rgba(3, 29, 67, .06);
  --overlay: rgba(2, 15, 35, .65);
  color: var(--text);
  background: var(--page);
}
:root[data-ct-theme="dark"] {
  color-scheme: dark;
  --page: #02162f;
  --surface: #09284f;
  --soft: #10345f;
  --text: #edf4ff;
  --muted: #a9bad1;
  --line: #29496d;
  --primary: #1764d4;
  --link: #92bdff;
  --blue-soft: #103b6c;
  --blue-text: #a8caff;
  --accent-soft: #493019;
  --accent-text: #ffd0a4;
  --success-soft: #113d31;
  --success-text: #8ee6b6;
  --danger-soft: #482a36;
  --danger-text: #ffb5ae;
  --auth-bg: radial-gradient(circle at 90% 5%, #0a315e 0, transparent 46%), #02162f;
  --shadow: 0 8px 28px rgba(0, 0, 0, .17);
  --overlay: rgba(0, 7, 20, .75);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--text); font-size: 14px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .52; cursor: wait; }
a { color: var(--link); }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #76aaff; outline-offset: 3px; }
#app { min-height: 100dvh; }
.top { background: linear-gradient(90deg, #021a3d, #031f46); color: #fff; padding: calc(env(safe-area-inset-top) + 17px) max(18px, calc((100vw - 980px)/2)); position: sticky; top: 0; z-index: 5; box-shadow: var(--shadow); border-bottom: 1px solid #274568; }
.toprow, .header-actions { display: flex; align-items: center; gap: 12px; }
.toprow { justify-content: space-between; }
.header-actions { gap: 10px; }
.brand { font-weight: 800; font-size: 25px; letter-spacing: -.8px; color: var(--text); line-height: 1.2; }
.top .brand { color: #fff; }
.brand em { color: var(--orange); font-style: normal; }
.brand small { display: block; color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: 1.6px; text-transform: uppercase; margin-top: 5px; }
.top .brand small { color: #b6c8e0; }
.avatar { border-radius: 100%; background: #113c6b; color: #fff; border: 1px solid #6887ad; width: 40px; height: 40px; font-weight: 700; flex: 0 0 40px; }
.theme-switch { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.theme-button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 36px; min-width: 36px; padding: 6px 9px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; }
.theme-button svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; flex: 0 0 16px; }
.theme-button.active { color: var(--navy); background: var(--orange); font-weight: 700; }
.top .theme-switch { background: #07264b; border-color: #597492; }
.top .theme-button { color: #d7e3f5; }
.top .theme-button.active { color: #071d49; }
.auth-toolbar { display: flex; justify-content: flex-end; margin-bottom: 26px; }
.content { max-width: 980px; margin: auto; padding: 23px 18px 110px; }
.eyebrow { color: var(--blue-text); letter-spacing: 1.5px; font-weight: 700; font-size: 10px; text-transform: uppercase; }
.pagehead { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 0 0 20px; }
.pagehead h1 { margin: 5px 0 0; font-size: 27px; line-height: 1.2; font-weight: 700; letter-spacing: -.6px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.summary .tile { background: var(--surface); border: 1px solid var(--line); padding: 18px; border-radius: 16px; box-shadow: var(--shadow); }
.tile strong { display: block; font-size: 30px; font-weight: 700; color: var(--text); }
.tile span { font-size: 12px; color: var(--muted); }
.tile:nth-child(2) { background: var(--blue-soft); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 17px; }
.toolbar input { flex: 2; min-width: 150px; }
.toolbar input[type=date] { flex: 1; }
.tabs { display: flex; gap: 7px; overflow: auto; padding-bottom: 6px; }
.tab { border: 1px solid var(--line); border-radius: 100px; background: var(--surface); color: var(--muted); padding: 10px 15px; white-space: nowrap; font-size: 13px; font-weight: 600; }
.tab.active { background: var(--navy); border-color: var(--navy); color: #fff; }
[data-ct-theme="dark"] .tab.active { background: var(--primary); border-color: var(--primary); }
.stack { display: grid; gap: 12px; }
.card { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 16px; padding: 19px; box-shadow: var(--shadow); overflow-wrap: anywhere; }
.card h2 { font-size: 17px; font-weight: 700; line-height: 1.35; margin: 7px 0; }
.card h3 { font-size: 15px; font-weight: 700; margin: 0 0 10px; }
.cardtop { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.badge { display: inline-flex; padding: 5px 9px; border-radius: 7px; background: var(--success-soft); color: var(--success-text); font-weight: 600; font-size: 11px; white-space: nowrap; }
.badge.amber { background: var(--accent-soft); color: var(--accent-text); }
.badge.blue { background: var(--blue-soft); color: var(--blue-text); }
.route { display: grid; grid-template-columns: 10px 1fr; gap: 0 11px; margin: 15px 0; color: var(--text); font-size: 13px; }
.route i { width: 9px; height: 9px; border-radius: 50%; background: var(--blue); margin-top: 5px; box-shadow: 0 0 0 4px var(--blue-soft); }
.route i:last-of-type { background: var(--orange); box-shadow: 0 0 0 4px var(--accent-soft); }
.route .dash { border-left: 1px dashed var(--line); margin-left: 4px; height: 15px; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 12px; }
.meta span { background: var(--soft); border-radius: 6px; padding: 6px 8px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 15px; }
.btn { border: 1px solid transparent; border-radius: 10px; padding: 11px 16px; font-size: 13px; font-weight: 600; background: var(--primary); color: #fff; min-height: 44px; line-height: 1.35; }
.btn.primary { background: var(--primary); }
.btn.gold { background: var(--orange); color: #071d49; font-weight: 700; }
.btn.ghost { background: var(--blue-soft); color: var(--blue-text); }
.btn.danger { background: var(--danger-soft); color: var(--danger-text); }
.btn.outline { background: var(--surface); color: var(--link); border-color: var(--line); }
.btn.wide { width: 100%; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--surface); color: var(--text); outline-color: var(--blue); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .85; }
label { display: block; font-size: 12px; color: var(--text); font-weight: 600; margin: 15px 0 7px; }
textarea { min-height: 85px; resize: vertical; }
.fieldpair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.empty { padding: 40px 18px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: 16px; }
.bottom { position: fixed; z-index: 6; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--line); display: flex; justify-content: space-around; box-shadow: var(--shadow); padding: 7px 4px calc(7px + env(safe-area-inset-bottom)); }
.nav { background: none; border: 0; color: var(--muted); min-width: 55px; padding: 7px 9px; font-size: 10px; font-weight: 600; border-radius: 10px; }
.nav .ico { display: block; font-size: 20px; line-height: 23px; margin-bottom: 2px; }
.nav.active { color: var(--accent-text); background: var(--accent-soft); font-weight: 700; }
.auth { min-height: 100dvh; background: var(--auth-bg); color: var(--text); display: grid; place-items: center; padding: 24px 18px; }
.authbox { width: min(100%, 440px); }
.auth .brand { font-size: 32px; }
.auth h1 { font-size: 30px; font-weight: 700; line-height: 1.2; letter-spacing: -.6px; margin: 30px 0 9px; }
.auth p { color: var(--muted); line-height: 1.6; }
.authcard { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 18px; padding: 23px; margin: 24px 0; box-shadow: var(--shadow); }
.authcard .btn { margin-top: 18px; }
.authcard p { color: var(--muted); font-size: 13px; }
.otp { display: flex; gap: 6px; }
.otp input { text-align: center; font-size: 25px; font-weight: 700; padding: 9px 1px; min-width: 0; }
.panelmask { position: fixed; inset: 0; z-index: 9; background: var(--overlay); display: flex; align-items: end; justify-content: center; }
.panel { width: 100%; max-width: 680px; max-height: 94dvh; overflow: auto; background: var(--page); color: var(--text); border-radius: 20px 20px 0 0; padding: 18px 18px calc(22px + env(safe-area-inset-bottom)); }
.panelhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; position: sticky; top: -18px; background: var(--page); padding: 5px 0 13px; z-index: 2; }
.panelhead h2 { font-size: 19px; font-weight: 700; margin: 0; }
.close { background: var(--danger-soft); color: var(--danger-text); border: 0; border-radius: 9px; width: 38px; height: 38px; flex: 0 0 38px; font-size: 22px; }
.point { border-left: 3px solid var(--blue); margin: 10px 0; padding: 13px; background: var(--surface); border-radius: 0 12px 12px 0; }
.point.done { border-color: var(--orange); }
.doc { display: flex; gap: 9px; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding: 12px 0; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: 85px; transform: translateX(-50%); background: var(--navy); color: #fff; border: 1px solid #567aa5; padding: 13px 18px; border-radius: 10px; max-width: min(90vw, 470px); box-shadow: var(--shadow); font-size: 13px; }
.busy { position: fixed; z-index: 30; inset: 0; background: var(--overlay); display: grid; place-items: center; }
.busy div { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 14px; padding: 18px 24px; font-weight: 600; }
.hint { background: var(--blue-soft); color: var(--blue-text); padding: 12px; border-radius: 10px; font-size: 12px; line-height: 1.55; }
.dangertext { color: var(--danger-text); }
@media(min-width:700px) {
  .grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
  .bottom { left: 50%; transform: translateX(-50%); width: 540px; max-width: 100%; border-radius: 16px 16px 0 0; border: 1px solid var(--line); }
  .panelmask { align-items: center; }
  .panel { border-radius: 20px; max-height: 90dvh; }
}
@media(max-width:520px) {
  .top .theme-label { display: none; }
  .top .theme-button { padding: 6px; }
  .brand { font-size: 23px; }
  .brand small { font-size: 9px; }
  .toprow { gap: 8px; }
  .header-actions { gap: 7px; }
}
@media(max-width:360px) {
  .fieldpair { grid-template-columns: 1fr; }
  .content { padding: 19px 13px 105px; }
  .top { padding-left: 13px; padding-right: 13px; }
  .card { padding: 16px; }
}
.back-login { margin-top: 9px; }
.badge.red { background: var(--danger-soft); color: var(--danger-text); }
.pending-route { display: grid; grid-template-columns: minmax(0,1fr) 24px minmax(0,1fr); gap: 10px; align-items: center; margin: 15px 0; font-size: 13px; }
.route-arrow { color: var(--orange); font-size: 22px; text-align: center; }
.pending-points { margin-top: 12px; }
.pending-points h3 { font-size: 12px; margin: 0 0 5px; }
.pending-points .small { margin-top: 4px; }
.pending-plans { margin-top: 12px; }
.allocation-progress { margin-top: 12px; padding: 10px 12px; border-radius: 9px; font-size: 12px; font-weight: 600; }
.allocation-progress.red { background: var(--danger-soft); color: var(--danger-text); }
.allocation-progress.amber { background: var(--accent-soft); color: var(--accent-text); }
.allocation-progress.green { background: var(--success-soft); color: var(--success-text); }

.push-banner { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%); z-index: 50; max-width: calc(100vw - 32px); box-shadow: var(--shadow); }

.report-body { white-space: pre-wrap; }

.confirm-mask { position:fixed; inset:0; background:rgba(0,0,0,.55); z-index:100; display:flex; align-items:center; justify-content:center; padding:16px; }
.confirm-mask .panel { width:min(80vw,520px); }
.profile-photo { width:88px; height:88px; border-radius:50%; overflow:hidden; display:grid; place-items:center; background:var(--accent-soft); font-size:28px; }
.profile-photo img { width:100%; height:100%; object-fit:cover; }
.irregularity { background:var(--danger-soft); border-radius:9px; padding:10px; }
.allocation-active { background:var(--accent-soft); }
.trip-card:nth-child(even) { background:var(--soft); }
.trip-card h2,.doc .small { overflow-wrap:anywhere; }
fieldset { border:0; margin:0; padding:0; min-width:0; }
button:disabled { opacity:.4; cursor:default; }
input[hidden] { display:none; }
.toolbar { flex-wrap:wrap; }
