/* Logistika admin — "Dispetcher" uslubi */
:root {
    --rail: #04342C;
    --rail-hover: #0A4A3E;
    --rail-active: #0F6E56;
    --rail-icon: #9FE1CB;
    --primary: #0F6E56;
    --primary-hover: #085041;
    --primary-soft: #E1F5EE;
    --primary-text: #085041;
    --bg: #F1F3F2;
    --card: #FFFFFF;
    --text: #1F2A27;
    --muted: #5F6B67;
    --faint: #8A9590;
    --border: #E2E6E4;
    --border-strong: #CBD2CF;
    --danger: #C53030;  --danger-soft: #FCEBEB;
    --warning: #854F0B; --warning-soft: #FAEEDA;
    --success: #27500A; --success-soft: #EAF3DE;
    --info: #0C447C;    --info-soft: #E6F1FB;
    --violet: #3C3489;  --violet-soft: #EEEDFE;
    --radius: 10px;
    --rail-w: 64px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 14px; line-height: 1.5;
    color: var(--text); background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 600; }
.ti { font-size: 18px; vertical-align: -3px; }

/* ---------- Karkas ---------- */
.app { display: flex; min-height: 100vh; }
.rail {
    position: fixed; inset: 0 auto 0 0; width: var(--rail-w);
    background: var(--rail); display: flex; flex-direction: column; align-items: center;
    padding: 14px 0; z-index: 20;
}
.rail-logo {
    width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
    color: #fff; background: var(--rail-active); margin-bottom: 22px;
}
.rail-logo .ti { font-size: 22px; vertical-align: 0; }
.rail-nav { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.rail-bottom { margin-top: auto; }
.rail-form { margin: 0; }
.rail-link {
    position: relative; width: 42px; height: 42px; border-radius: 10px;
    display: grid; place-items: center; color: var(--rail-icon);
    background: transparent; border: 0; cursor: pointer; transition: background .15s, color .15s;
}
.rail-link .ti { font-size: 21px; vertical-align: 0; }
.rail-link:hover { background: var(--rail-hover); color: #fff; }
.rail-link.active { background: var(--rail-active); color: #fff; }
.rail-link::after {           /* tooltip */
    content: attr(data-tip); position: absolute; left: 52px; top: 50%; transform: translateY(-50%);
    background: #1F2A27; color: #fff; font-size: 12px; white-space: nowrap;
    padding: 5px 9px; border-radius: 6px; pointer-events: none; opacity: 0; transition: opacity .12s;
}
.rail-link:hover::after { opacity: 1; }

.main { flex: 1; margin-left: var(--rail-w); min-width: 0; display: flex; flex-direction: column; }
.topbar {
    height: 60px; display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px; background: var(--card); border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 10;
}
.page-title { font-size: 18px; }
.topbar-right { display: flex; align-items: center; gap: 18px; }
.clock { color: var(--muted); font-variant-numeric: tabular-nums; }
.me { display: flex; align-items: center; gap: 10px; color: var(--text); }
.me-text { display: flex; flex-direction: column; line-height: 1.2; }
.me-text b { font-weight: 500; }
.me-text small { color: var(--faint); font-size: 12px; }
.avatar {
    width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
    background: var(--primary-soft); color: var(--primary-text); font-weight: 600; font-size: 13px;
}
.content { padding: 24px; max-width: 1280px; width: 100%; }

/* ---------- Kartalar ---------- */
.grid { display: grid; gap: 16px; }
.grid-stats { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 20px; }
.grid-2 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.card {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
}
.card-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.card-head h2 { font-size: 15px; }
.card-body { padding: 18px; }

.stat { padding: 16px 18px; display: flex; gap: 14px; align-items: center; }
.stat-icon {
    width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0;
}
.stat-icon .ti { font-size: 22px; vertical-align: 0; }
.stat-label { color: var(--muted); font-size: 13px; }
.stat-value { font-size: 22px; font-weight: 600; line-height: 1.2; }
.stat-sub { color: var(--faint); font-size: 12px; }

.tone-teal  { background: var(--primary-soft); color: var(--primary-text); }
.tone-amber { background: var(--warning-soft); color: var(--warning); }
.tone-green { background: var(--success-soft); color: var(--success); }
.tone-red   { background: var(--danger-soft);  color: var(--danger); }
.tone-gray  { background: #EEF0EF; color: #444C49; }
.tone-blue  { background: var(--info-soft); color: var(--info); }
.tone-purple{ background: var(--violet-soft); color: var(--violet); }

/* ---------- Ro'yxat / jadval ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 12px; align-items: center; padding: 11px 18px; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.list .dot { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; }
.list .dot .ti { font-size: 16px; vertical-align: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .meta { color: var(--faint); font-size: 12px; white-space: nowrap; }
.list .sub { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.empty { text-align: center; padding: 36px 20px; color: var(--muted); }
.empty .ti { font-size: 36px; color: var(--border-strong); display: block; margin-bottom: 8px; }
.empty b { color: var(--text); font-weight: 500; display: block; margin-bottom: 4px; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 500; }

.badge {
    display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px;
    font-size: 12px; font-weight: 500;
}

/* ---------- Formalar ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 500; margin-bottom: 6px; }
.field .hint { color: var(--faint); font-size: 12px; margin-top: 4px; }
.input {
    width: 100%; height: 40px; padding: 0 12px; font: inherit; color: var(--text);
    background: #fff; border: 1px solid var(--border-strong); border-radius: 8px; outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15,110,86,.15); }
.input-wrap { position: relative; }
.input-wrap .input { padding-left: 38px; }
.input-wrap > .ti { position: absolute; left: 12px; top: 11px; color: var(--faint); }
.input-wrap .toggle-pass {
    position: absolute; right: 6px; top: 5px; width: 30px; height: 30px; border: 0; background: none;
    color: var(--faint); cursor: pointer; border-radius: 6px;
}
.input-wrap .toggle-pass:hover { color: var(--text); background: var(--bg); }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 40px; padding: 0 16px; font: inherit; font-weight: 500; border-radius: 8px;
    border: 1px solid var(--border-strong); background: #fff; color: var(--text); cursor: pointer;
    transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--bg); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-block { width: 100%; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }

/* Switch (yoqish/o'chirish) */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span {
    position: absolute; inset: 0; background: var(--border-strong); border-radius: 999px;
    cursor: pointer; transition: background .15s;
}
.switch span::before {
    content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px;
    background: #fff; border-radius: 50%; transition: transform .15s;
}
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::before { transform: translateX(18px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px rgba(15,110,86,.25); }

/* ---------- Xabarlar ---------- */
.alert {
    display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 8px;
    margin-bottom: 16px; border: 1px solid transparent; transition: opacity .3s;
}
.alert span { flex: 1; }
.alert-success { background: var(--success-soft); color: var(--success); border-color: #C0DD97; }
.alert-error   { background: var(--danger-soft);  color: var(--danger);  border-color: #F7C1C1; }
.alert-info    { background: var(--primary-soft); color: var(--primary-text); border-color: #9FE1CB; }
.alert-warning { background: var(--warning-soft); color: var(--warning); border-color: #FAC775; }
.alert-close { background: none; border: 0; font-size: 20px; line-height: 1; color: inherit; cursor: pointer; opacity: .6; }
.alert-close:hover { opacity: 1; }

/* ---------- Kirish sahifasi ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side {
    background: var(--rail); color: #CFEFE3; padding: 48px; display: flex; flex-direction: column;
    justify-content: space-between;
}
.auth-brand { display: flex; align-items: center; gap: 12px; color: #fff; font-size: 18px; font-weight: 600; }
.auth-brand .rail-logo { margin: 0; }
.auth-side h2 { color: #fff; font-size: 30px; line-height: 1.25; max-width: 420px; margin-bottom: 14px; }
.auth-side p { max-width: 420px; margin: 0; color: #9FE1CB; }
.auth-points { display: flex; gap: 22px; flex-wrap: wrap; color: #9FE1CB; font-size: 13px; }
.auth-form { display: grid; place-items: center; padding: 32px; background: var(--bg); }
.auth-box { width: 100%; max-width: 380px; }
.auth-box h1 { font-size: 24px; margin-bottom: 6px; }
.auth-box .lead { color: var(--muted); margin: 0 0 24px; }
.auth-foot { text-align: center; color: var(--faint); font-size: 12px; margin-top: 24px; }

/* ---------- Funksiyalar ---------- */
.feature-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.feature-row:last-child { border-bottom: 0; }
.feature-row .grow { flex: 1; min-width: 0; }
.feature-row code { font-size: 12px; color: var(--faint); }

/* ---------- Jadval va asboblar paneli ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.toolbar .grow { flex: 1; min-width: 200px; }
.select { width: auto; min-width: 150px; padding-right: 30px; appearance: none; cursor: pointer;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235F6B67' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; }
.field .select { width: 100%; }
.input.date { width: auto; }
.input:disabled { background: var(--bg); color: var(--muted); cursor: not-allowed; }
.input.is-invalid { border-color: var(--danger); }
.hint.error { color: var(--danger); }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); padding: 10px 18px;
    background: #F8FAF9; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 11px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #FAFBFA; }
.table .sub, .sub { color: var(--muted); font-size: 12px; }
.sub-inline { color: var(--faint); font-size: 12px; }
.row-muted td { color: var(--faint); }
.row-muted .person-name { color: var(--muted); }
.nowrap { white-space: nowrap; }
.wrap { min-width: 220px; word-break: break-word; }
.t-right, .table .t-right { text-align: right; }
.inline { display: inline; margin: 0; }

.person { display: flex; align-items: center; gap: 10px; }
.person-name { color: var(--text); font-weight: 500; }
.person-name:hover { color: var(--primary); }
.avatar { position: relative; flex-shrink: 0; }
.avatar.is-online::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px;
    border-radius: 50%; background: #3B9B3B; border: 2px solid #fff; }
.dot-live { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }

.icon-btn { width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 8px; border: 0;
    background: transparent; color: var(--muted); cursor: pointer; vertical-align: middle; }
.icon-btn:hover { background: var(--bg); color: var(--text); }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }
.icon-btn .ti { vertical-align: 0; }

.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.tab { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; color: var(--muted); font-weight: 500;
    border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.pager { display: flex; gap: 6px; align-items: center; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--border); }
.pager-info { margin-right: auto; color: var(--muted); font-size: 13px; }

/* ---------- Forma ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.form-section { font-weight: 600; font-size: 13px; color: var(--muted); text-transform: none; margin: 6px 0 12px;
    padding-top: 14px; border-top: 1px solid var(--border); }
.form-actions { display: flex; gap: 10px; margin-top: 4px; }
.check-row { display: flex !important; align-items: center; gap: 10px; height: 40px; font-weight: 400 !important; cursor: pointer; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); margin-bottom: 14px; }
.back-link:hover { color: var(--primary); }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; }
.grid-2 { align-items: start; }
.empty.small { padding: 22px 18px; }

/* ---------- Buyurtmalar va dispetcher ---------- */
a.card.stat { color: var(--text); transition: border-color .15s; }
a.card.stat:hover { border-color: var(--border-strong); }
.stat-alert { border-color: #F09595; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head .back-link, .page-head .tabs { margin-bottom: 0; }
.head-actions { display: flex; align-items: center; gap: 10px; }
.tabs-scroll { overflow-x: auto; flex: 1; min-width: 0; scrollbar-width: none; }
.tabs-scroll .tab { white-space: nowrap; }
.tab-alert { color: var(--danger); }
.table tbody tr.clickable { cursor: pointer; }
.row-alert td { background: #FFF8F6; }
.row-alert td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.late { color: var(--danger); font-size: 12px; margin-top: 4px; }
.route { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-weight: 500; }
.route .ti { color: var(--faint); font-size: 14px; vertical-align: 0; }
.route-big { display: flex; flex-direction: column; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 16px; position: relative; }
.route-big > div { display: flex; gap: 12px; align-items: flex-start; }
.route-big small, .facts small { display: block; color: var(--faint); font-size: 12px; }
.route-big b { font-size: 16px; font-weight: 500; }
.pin { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 13px; flex-shrink: 0; }
.pin-a { background: var(--info-soft); color: var(--info); }
.pin-b { background: var(--success-soft); color: var(--success); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px 18px; }
.facts b { font-weight: 500; }
.facts .price { font-size: 17px; color: var(--primary-text); }
.card-alert { border-color: #F09595; }
.card-alert .card-head { background: var(--danger-soft); color: var(--danger); border-radius: var(--radius) var(--radius) 0 0; }
.m0 { margin: 0 0 6px; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #A32D2D; border-color: #A32D2D; }
.btn-danger-outline { color: var(--danger); border-color: #F09595; }
.btn-danger-outline:hover { background: var(--danger-soft); }
.btn-lg { height: 48px; font-size: 15px; }
.split-forms { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; border-top: 1px solid var(--border); }
.card > .split-forms:first-child { border-top: 0; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.form-label { font-weight: 600; font-size: 13px; color: var(--muted); }
.check-inline { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; cursor: pointer; }
.more { margin-top: 14px; }
.more summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.tel { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; font-weight: 500; }
.tel .ti { font-size: 15px; vertical-align: 0; }
.note-box { margin-top: 12px; padding: 10px 12px; background: #FFFBEF; border: 1px solid #FAE3B0; border-radius: 8px; color: #633806; font-size: 13px; }
.opt { color: var(--faint); font-weight: 400; }
.textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.input-suffix { position: relative; }
.input-suffix span { position: absolute; right: 12px; top: 10px; color: var(--faint); }
.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice, .field label.choice { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--border-strong); border-radius: 8px; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.choice input { margin-top: 3px; accent-color: var(--primary); }
.choice b { display: block; font-weight: 500; }
.choice small { color: var(--muted); }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg label { cursor: pointer; }
.seg input { display: none; }
.seg span { display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; border: 1px solid var(--border-strong); border-radius: 999px; font-size: 13px; color: var(--muted); }
.seg input:checked + span { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-text); }
.timeline { list-style: none; margin: 0; padding: 0 18px 8px; border-top: 1px solid var(--border); }
.timeline li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; position: relative; }
.timeline li + li::before { content: ""; position: absolute; left: 15px; top: -10px; height: 20px; width: 1px; background: var(--border-strong); }
.timeline .dot { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; }
.timeline .dot .ti { font-size: 16px; vertical-align: 0; }
.timeline .grow { flex: 1; min-width: 0; }
.timeline .meta { color: var(--faint); font-size: 12px; white-space: nowrap; }
.client-info { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; background: #F8FAF9; font-size: 13px; }
.client-info .ci-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.client-info .ci-order { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--border); }
.profile-bar { display: flex; align-items: center; gap: 14px; padding: 16px 18px; margin-bottom: 16px; }
.profile-bar .grow { flex: 1; min-width: 0; }
.profile-bar b { font-weight: 600; font-size: 16px; }
.avatar-lg { width: 48px; height: 48px; font-size: 16px; }
.btn-logout { color: var(--muted); }
.btn-logout:hover { color: var(--danger); border-color: #F09595; background: var(--danger-soft); }
.list li .tel { font-size: 13px; }

/* ---------- Xarita ---------- */
.content-full, .content.content-full { padding: 0; max-width: none; }
.map-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); height: calc(100vh - 60px); }
.map-side { display: flex; flex-direction: column; background: var(--card); border-right: 1px solid var(--border); min-height: 0; }
.map-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--border); }
.map-tab { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 8px; border: 0; background: none;
    font: inherit; font-weight: 500; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.map-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.map-filters { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.map-filters .select { width: 100%; height: 36px; }
.map-list { overflow-y: auto; flex: 1; min-height: 0; }
.map-item { display: block; width: 100%; text-align: left; padding: 11px 14px; border: 0; border-bottom: 1px solid var(--border);
    background: none; font: inherit; color: var(--text); cursor: pointer; }
.map-item:hover { background: #F8FAF9; }
.map-item.active { background: var(--primary-soft); }
.map-item.is-late { box-shadow: inset 3px 0 0 var(--danger); }
.mi-top { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.mi-top .badge:last-child, .mi-price { margin-left: auto; }
.mi-price { font-weight: 600; font-size: 13px; color: var(--primary-text); }
.mi-route { font-weight: 500; }
.mi-route .ti { font-size: 13px; color: var(--faint); vertical-align: -1px; }
.mi-near { font-size: 12px; color: var(--success); margin-top: 3px; }
.mi-near.none { color: var(--warning); }
.mi-warn { font-size: 12px; color: var(--warning); margin-top: 3px; }
.sub.stale { color: var(--warning); }
.map-detail { border-bottom: 1px solid var(--border); padding: 12px 14px; max-height: 58%; overflow-y: auto; background: #FBFCFB; }
.map-detail .list li { padding: 8px 0; }
.md-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.md-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.md-row span:first-child { color: var(--muted); }
.map-detail .btn-block { margin: 10px 0 4px; }
.md-title { font-weight: 600; font-size: 12px; color: var(--muted); margin-top: 12px; }
.md-empty { padding: 6px 0; }
.map-foot { padding: 10px 14px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.warn-line { color: var(--warning); }
.map-wrap { position: relative; min-width: 0; }
.map { position: absolute; inset: 0; background: #E9EDEB; }
.map-legend { position: absolute; left: 12px; bottom: 22px; z-index: 500; display: flex; flex-wrap: wrap; gap: 6px 12px;
    background: rgba(255,255,255,.94); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font-size: 12px; color: var(--muted); }
.map-legend span { display: inline-flex; align-items: center; gap: 5px; }
.lg { width: 12px; height: 12px; border-radius: 50%; display: inline-block; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.lg-order { background: #185FA5; border-radius: 3px; }
.lg-partial { background: #534AB7; border-radius: 3px; }
.lg-late { background: #C53030; border-radius: 3px; }
.lg-free { background: #3B9B3B; }
.lg-busy { background: #BA7517; }
.lg-stale { background: #B4B2A9; }

/* Belgilar */
.lg-icon { background: none; border: 0; }
.mk { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: #fff; border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.mk .ti { font-size: 17px; vertical-align: 0; }
.mk-order { background: #185FA5; border-radius: 9px; }
.mk-order.mk-partial { background: #534AB7; }
.mk-late { background: #C53030; animation: pulse 1.6s infinite; }
.mk-active { background: #854F0B; border-radius: 9px; }
.mk-free { background: #3B9B3B; }
.mk-busy { background: #BA7517; }
.mk-offline { background: #888780; }
.mk-stale { opacity: .55; filter: grayscale(.6); }
.mk-dim { opacity: .5; }
.mk.pin-a, .mk.pin-b { width: 28px; height: 28px; font-weight: 700; font-size: 13px; }
.mk.pin-a { background: #185FA5; color: #fff; }
.mk.pin-b { background: #3B6D11; color: #fff; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(197,48,48,.5); } 50% { box-shadow: 0 0 0 8px rgba(197,48,48,0); } }

/* Formadagi xarita */
.picker { border: 1px solid var(--border-strong); border-radius: 10px; overflow: hidden; margin-bottom: 16px; }
.picker-bar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #F8FAF9; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.seg-btn { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border: 1px solid var(--border-strong);
    border-radius: 999px; background: #fff; font: inherit; font-size: 13px; cursor: pointer; color: var(--muted); }
.seg-btn .pin { width: 22px; height: 22px; font-size: 11px; }
.seg-btn.active { border-color: var(--primary); color: var(--primary-text); background: var(--primary-soft); }
.picker-map { height: 320px; background: #E9EDEB; }
.picker-sm { height: 240px; }
.picker-info { padding: 8px 12px; font-size: 13px; border-top: 1px solid var(--border); background: #fff; }
.picker-info:empty { display: none; }
.input-btn { display: flex; gap: 6px; }
.input-btn > .input-wrap, .input-btn > .input { flex: 1; min-width: 0; }
.input-btn .btn { padding: 0 12px; flex-shrink: 0; }
.field { position: relative; }
.geo-results { position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; z-index: 1000; background: #fff;
    border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); max-height: 260px; overflow-y: auto; }
.geo-item { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 12px; font: inherit; font-size: 13px; cursor: pointer;
    border-bottom: 1px solid var(--border); color: var(--text); }
.geo-item:hover { background: var(--primary-soft); }
.geo-item .ti { color: var(--primary); }
.geo-msg { padding: 10px 12px; font-size: 13px; color: var(--muted); }
.geo-msg.error { color: var(--danger); }
.spin { display: inline-block; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.order-map { height: 260px; border-top: 1px solid var(--border); background: #E9EDEB; }
.map-caption { padding: 9px 18px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--border); }
.map-caption.warn { color: var(--warning); background: var(--warning-soft); }
.leaflet-container { font-family: inherit; }
.leaflet-container a.tel { color: var(--primary); }

.version-line { color: var(--muted); font-size: 13px; margin-bottom: 12px; }

/* ---------- Telegram ---------- */
.tg-feed { display: flex; flex-direction: column; }
.tg-item { padding: 14px 18px; border-bottom: 1px solid var(--border); }
.tg-item.tg-called { background: #F7FBF9; }
.tg-item.tg-ignored, .tg-item.tg-order, .tg-item.tg-driver { opacity: .75; }
.tg-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.tg-chat { font-weight: 500; font-size: 13px; color: var(--muted); }
.tg-chat .ti { font-size: 15px; }
.tg-time { margin-left: auto; }
.tg-facts { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin-bottom: 8px; }
.tg-route { font-weight: 600; font-size: 15px; display: inline-flex; align-items: center; gap: 6px; margin-right: 4px; }
.tg-route .ti { color: var(--faint); font-size: 15px; vertical-align: 0; }
.chip-s { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; background: #EEF0EF; font-size: 12px; color: #444C49; }
.chip-s .ti { font-size: 14px; vertical-align: 0; }
.chip-money { background: var(--primary-soft); color: var(--primary-text); font-weight: 500; }
.tg-text { white-space: normal; word-break: break-word; font-size: 14px; line-height: 1.55; color: #2C3532; background: #F8FAF9; border-radius: 8px; padding: 10px 12px; }
.tg-text.is-long { max-height: 7.8em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.tg-more { border: 0; background: none; color: var(--primary); font: inherit; font-size: 13px; cursor: pointer; padding: 4px 0 0; }
.tg-contacts { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 10px; font-size: 13px; }
.tg-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.tg-actions .grow { flex: 1; }
.tg-menu { position: relative; }
.tg-menu summary { list-style: none; }
.tg-menu summary::-webkit-details-marker { display: none; }
.tg-pop { position: absolute; right: 0; top: 38px; z-index: 20; width: 260px; background: #fff; border: 1px solid var(--border-strong);
    border-radius: 10px; padding: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.tg-pop .btn { justify-content: flex-start; }
.tg-source { background: #fff; border: 1px solid #B5D4F4; border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; }
.tg-source .tg-text { max-height: 12em; overflow: auto; }
.tg-acc { padding: 14px 18px; border-bottom: 1px solid var(--border); }
.tg-acc:last-child { border-bottom: 0; }
.tg-acc .avatar .ti { font-size: 18px; vertical-align: 0; color: #229ED9; }
.tg-inline-form { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.tg-inline-form .input { flex: 1; min-width: 160px; }
.tg-acc-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tg-howto ol { padding-left: 18px; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }
.tg-howto code { background: #EEF0EF; padding: 1px 6px; border-radius: 4px; font-size: 12px; }

/* ---------- Moslashuvchan ---------- */
@media (max-width: 900px) {
    .grid-2 { grid-template-columns: 1fr; }
    .auth { grid-template-columns: 1fr; }
    .auth-side { display: none; }
}
@media (max-width: 640px) {
    :root { --rail-w: 0px; }
    .rail {
        inset: auto 0 0 0; width: 100%; height: 60px; flex-direction: row; justify-content: space-around;
        padding: 0 8px;
    }
    .rail-logo { display: none; }
    .rail-nav, .rail-bottom { flex-direction: row; margin: 0; }
    .rail-nav:first-of-type { overflow-x: auto; flex: 1; scrollbar-width: none; }
    .rail-bottom .rail-form { display: none; }
    .btn-logout span { display: none; }
    .choice-row { grid-template-columns: 1fr; }
    .page-head .btn-primary { width: 100%; }
    .map-layout { grid-template-columns: 1fr; grid-template-rows: 55vh auto; height: auto; }
    .map-side { order: 2; border-right: 0; }
    .map-wrap { order: 1; height: 55vh; }
    .map-list { max-height: none; }
    .table-orders thead { display: none; }
    .table-orders, .table-orders tbody, .table-orders tr, .table-orders td { display: block; width: 100%; }
    .table-orders tr { border-bottom: 1px solid var(--border); padding: 10px 0; }
    .table-orders td { border: 0 !important; padding: 3px 14px !important; }
    .table-orders td.wrap { min-width: 0; }
    .table-orders .row-alert td:first-child { box-shadow: none; }
    .table-orders tr.row-alert { box-shadow: inset 3px 0 0 var(--danger); background: #FFF8F6; }
    .rail-link::after { display: none; }
    .main { padding-bottom: 60px; }
    .topbar { padding: 0 16px; }
    .me-text, .clock { display: none; }
    .content { padding: 16px; }
    .grid-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .toolbar .select, .toolbar .date { flex: 1; min-width: 130px; }
    .toolbar .btn-primary { width: 100%; }
    .table th, .table td { padding: 10px 12px; }
    .stat { flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; }
}

/* ---------- Telegram: AI tahlil ---------- */
.tg-ai { margin-top: 10px; border: 1px solid #DCD6F7; background: #FAF9FF; border-radius: 8px; padding: 10px 12px; }
.tg-ai.is-skip { background: #F8FAF9; border-color: var(--border); padding: 6px 12px; }
.tg-ai-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.tg-ai-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: #5B4BC4; background: #EEEBFD; border-radius: 6px; padding: 2px 7px; }
.tg-ai-tag .ti { font-size: 14px; }
.tg-ai-facts { margin: 8px 0 0; }
.tg-match-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); margin: 10px 0 4px; }
.tg-match { list-style: none; margin: 0; padding: 0; }
.tg-match li { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; padding: 6px 0; border-top: 1px dashed #E2DEF7; font-size: 13px; }
.tg-match li:first-child { border-top: 0; }
.tg-match .grow { flex: 1; }
.tg-match-name { font-weight: 500; }
.tg-match-none { margin-top: 8px; display: flex; align-items: center; gap: 6px; }
.tg-ai-wait { margin-top: 8px; display: flex; align-items: center; gap: 6px; font-size: 12px; }
.tg-ai-bar { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: space-between; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--border); background: #FAF9FF; font-size: 13px; }
.tg-ai-bar .ti { color: #5B4BC4; }
.tg-actions form.inline { display: inline-flex; }
