:root {
    color-scheme: dark;
    --bg: #101216;
    --surface: #191c23;
    --surface-soft: #222630;
    --ink: #f7f8fb;
    --muted: #949aa8;
    --line: rgba(255, 255, 255, .09);
    --accent: #ffbf19;
    --accent-strong: #ffcf4d;
    --danger: #ff7777;
    --success: #77d59a;
    --shadow: 0 18px 48px rgba(0, 0, 0, .22);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); }
body {
    margin: 0;
    min-width: 320px;
    background: radial-gradient(circle at 80% -10%, rgba(255, 191, 25, .14), transparent 35%), var(--bg);
    color: var(--ink);
    font: 16px/1.4 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(255, 191, 25, .55); outline-offset: 2px; }

.app-shell { width: min(100%, 620px); min-height: 100vh; margin: 0 auto; padding: max(22px, env(safe-area-inset-top)) 18px max(28px, env(safe-area-inset-bottom)); }
.app-header, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.app-header { align-items: flex-start; margin-bottom: 26px; }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-mark, .profile-initial { display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; border-radius: 14px; background: var(--accent); color: #181a20; font-size: 22px; font-weight: 900; box-shadow: 0 8px 22px rgba(255, 191, 25, .2); }
.avatar-button { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink); font-weight: 800; }
h1, h2, h3, p { margin: 0; } h1 { max-width: 250px; font-size: clamp(25px, 7vw, 34px); line-height: 1.06; letter-spacing: -.045em; } h2 { font-size: 28px; line-height: 1.1; letter-spacing: -.04em; } h3 { font-size: 18px; letter-spacing: -.02em; }
.eyebrow { color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .16em; margin-bottom: 7px; }
.subtitle { max-width: 460px; margin-top: 8px; color: var(--muted); font-size: 14px; }
.notice { min-height: 0; margin: -9px 0 15px; color: var(--danger); font-size: 13px; font-weight: 700; }
.notice[data-kind="success"] { color: var(--success); }
.notice:empty { display: none; }

.role-switch { display: flex; gap: 5px; margin-bottom: 28px; padding: 5px; border: 1px solid var(--line); border-radius: 16px; background: rgba(25, 28, 35, .86); }
.role-tab { display: flex; align-items: center; justify-content: center; gap: 7px; flex: 1; min-height: 40px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 800; }
.role-tab.active { background: var(--accent); color: #17191e; box-shadow: 0 5px 14px rgba(255, 191, 25, .17); }
.view.active { animation: rise .22s ease-out; }
@keyframes rise { from { opacity: .2; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.hero-copy { margin-bottom: 18px; }

.route-card, .details-card, .order-card, .driver-status-card, .profile-card { border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(145deg, rgba(34, 38, 48, .98), rgba(25, 28, 35, .98)); box-shadow: var(--shadow); }
.route-card { padding: 20px 17px; }
.route-point { display: flex; align-items: flex-start; gap: 13px; }
.point-badge { display: grid; place-items: center; flex: 0 0 30px; width: 30px; height: 30px; border-radius: 10px; color: #17191e; font-size: 11px; font-weight: 900; }
.point-a { background: var(--accent); } .point-b { background: #dfe3ec; }
.route-stem { height: 22px; margin: 4px 0 4px 14px; border-left: 1px dashed #606674; }
.field-group { display: grid; gap: 7px; width: 100%; } .field-group + .field-group { margin-top: 16px; }
label { color: var(--muted); font-size: 11px; font-weight: 800; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; background: rgba(16, 18, 22, .55); color: var(--ink); padding: 12px 13px; transition: border-color .18s, background .18s, box-shadow .18s; }
input::placeholder, textarea::placeholder { color: #686e7b; } input:focus, select:focus, textarea:focus { border-color: var(--accent); background: rgba(16, 18, 22, .8); box-shadow: 0 0 0 3px rgba(255, 191, 25, .12); outline: 0; }
textarea { min-height: 66px; resize: vertical; }
.details-card { margin-top: 12px; padding: 17px; } .form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; } .form-grid .field-group { margin: 0; } .comment-field { margin-top: 15px !important; }

.primary-button, .danger-button, .secondary-button { width: 100%; min-height: 52px; border-radius: 15px; padding: 12px 15px; font-weight: 900; transition: transform .15s, opacity .15s, background .15s; }
.primary-button { display: flex; align-items: center; justify-content: space-between; border: 0; background: var(--accent); color: #17191e; box-shadow: 0 9px 20px rgba(255, 191, 25, .18); } .button-arrow { font-size: 22px; }
.primary-button:active, .danger-button:active, .secondary-button:active { transform: translateY(1px); } .primary-button:disabled, .danger-button:disabled { opacity: .5; cursor: wait; }
.browser-submit { margin-top: 16px; } .preview-hint { margin: 12px 8px; color: var(--muted); font-size: 12px; text-align: center; }

.client-active { margin: 17px 0; padding: 17px; border: 1px solid rgba(255, 191, 25, .28); border-radius: 22px; background: rgba(255, 191, 25, .06); }
.client-active .order-card { margin: 13px 0 10px; } .client-active .danger-button { border: 1px solid rgba(255, 119, 119, .3); background: transparent; color: var(--danger); } .link-button, .refresh-button { border: 0; background: transparent; color: var(--accent-strong); font-weight: 800; } .link-button { display: block; margin: 0 auto; padding: 8px; }

.order-list { display: grid; gap: 12px; margin-top: 13px; }
.order-card { padding: 16px; } .order-card-compact { cursor: pointer; } .order-card-compact:hover { border-color: rgba(255, 191, 25, .35); }
.order-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 15px; } .order-number { display: block; font-size: 13px; font-weight: 900; } .order-time { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.mini-route { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 9px; padding: 13px; border-radius: 14px; background: rgba(16, 18, 22, .52); font-size: 13px; font-weight: 800; } .mini-route span:last-child { text-align: right; } .mini-route b { color: var(--accent); }
.detail-grid { display: grid; gap: 8px; margin-top: 14px; } .detail-row { display: flex; justify-content: space-between; gap: 15px; padding-bottom: 8px; border-bottom: 1px solid var(--line); } .detail-row:last-child { border-bottom: 0; padding-bottom: 0; } .detail-label { color: var(--muted); font-size: 12px; } .detail-value { max-width: 66%; font-size: 12px; text-align: right; overflow-wrap: anywhere; }
.status-pill { flex-shrink: 0; padding: 6px 9px; border-radius: 999px; background: rgba(255, 191, 25, .14); color: var(--accent-strong); font-size: 10px; font-weight: 900; text-transform: uppercase; } .status-accepted { background: rgba(119, 213, 154, .14); color: var(--success); } .status-completed { background: rgba(174, 181, 199, .14); color: #c7ccd7; } .status-rejected_by_user, .status-rejected_by_admin { background: rgba(255, 119, 119, .14); color: var(--danger); }
.person-card { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 11px; border: 1px solid var(--line); border-radius: 13px; background: rgba(16, 18, 22, .4); } .person-icon { color: var(--success); font-size: 20px; } .person-name, .person-meta { display: block; } .person-name { font-size: 13px; } .person-meta { margin-top: 2px; color: var(--muted); font-size: 11px; } .card-actions { margin-top: 15px; } .card-actions .primary-button { justify-content: center; }

.driver-section { margin-top: 24px; } .live-dot { color: var(--success); font-size: 10px; font-weight: 900; letter-spacing: .1em; } .refresh-button { padding: 2px 4px; font-size: 23px; } .driver-status-card, .profile-card { margin-top: 14px; padding: 16px; } .driver-status-content, .profile-identity { display: flex; align-items: center; gap: 12px; } .online-dot { color: var(--success); } .offline-dot { color: var(--muted); } .status-message { color: var(--muted); font-size: 13px; font-weight: 700; }
.profile-identity { padding-bottom: 15px; margin-bottom: 15px; border-bottom: 1px solid var(--line); } .profile-initial { flex-basis: 48px; width: 48px; height: 48px; }
.empty-state { padding: 27px 15px; border: 1px dashed var(--line); border-radius: 16px; color: var(--muted); font-size: 13px; text-align: center; }
.section-heading { align-items: center; } .app-footer { margin-top: 30px; color: #6d7380; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-align: center; } .app-footer span { color: var(--accent); }
@media (max-width: 430px) { .app-shell { padding-inline: 14px; } .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .field-group:last-child { grid-column: 1 / -1; } .mini-route { grid-template-columns: 1fr; gap: 4px; } .mini-route span:last-child { text-align: left; } .mini-route b { display: none; } }
