:root {
    --green: #009843;
    --green-dark: #007a36;
    --green-soft: #e3f4ea;
    --ink: #13201a;
    --muted: #5e6b63;
    --bg: #f5f7f4;
    --line: #e4e9e5;
    --card: #ffffff;
    --warn: #e8a317;
    --warn-bg: #fff6e0;
    --danger: #e5484d;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Figtree, ui-sans-serif, system-ui, sans-serif;
    color: var(--ink);
    background: var(--bg);
}

a { color: inherit; }

button, input, select { font: inherit; }

.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }

.side {
    background: var(--ink);
    color: white;
    display: flex;
    flex-direction: column;
    padding: 18px 12px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.side-brand { display: flex; align-items: center; gap: 8px; padding: 0 8px 14px; }
.wordmark { font-weight: 800; font-size: 22px; letter-spacing: -0.04em; }
.admin-badge {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 3px 7px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.12);
}
.side-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8fa096;
    padding: 8px 10px 6px;
}
.ms { font-family: 'Material Symbols Rounded'; font-weight: normal; font-style: normal; font-size: 20px; line-height: 1; letter-spacing: normal; text-transform: none; white-space: nowrap; direction: ltr; -webkit-font-smoothing: antialiased; font-variation-settings: 'FILL' 1, 'wght' 500; }
.side-link {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 40px;
    padding: 0 10px;
    border-radius: 10px;
    text-decoration: none;
    color: #C9D4CD;
    font-weight: 600;
    font-size: 14px;
}
.side-link.active { background: rgba(0, 152, 67, 0.22); color: white; font-weight: 700; }
.side-link.soon { color: #6d7a72; cursor: default; }
.side-spacer { flex: 1; }
.side-user { display: flex; gap: 10px; align-items: center; padding: 12px 8px 0; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.side-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--green);
    display: grid;
    place-items: center;
    font-size: 13px;
    font-weight: 800;
}
.side-user strong { display: block; font-size: 14px; }
.side-logout { background: none; border: 0; color: #8fa096; padding: 0; cursor: pointer; font-weight: 600; }
.shell-main { min-width: 0; }
.live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--green-dark);
    background: var(--green-soft);
    border-radius: 999px;
    padding: 6px 10px;
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }

.topbar {
    display: flex;
    align-items: center;
    gap: 24px;
    height: 64px;
    padding: 0 28px;
    background: var(--card);
    border-bottom: 1px solid var(--line);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.mark {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--green);
    color: white;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 800;
}

.topbar nav { display: flex; gap: 8px; }

.topbar nav a {
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 999px;
    color: var(--muted);
    font-weight: 700;
}

.topbar nav a.active {
    background: var(--green-soft);
    color: var(--green-dark);
}

.spacer { flex: 1; }

.who { color: var(--muted); font-size: 14px; }

.linkish {
    background: none;
    border: 0;
    color: var(--muted);
    font-weight: 700;
    cursor: pointer;
}

.page { padding: 24px 28px 40px; }

.page-head, .row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

h1 { font-size: 28px; letter-spacing: -0.04em; margin: 0; }

.stats { display: flex; gap: 12px; margin: 20px 0; }

.stat {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px 16px;
    min-width: 140px;
}

.stat b { display: block; font-size: 22px; }
.stat span { color: var(--muted); font-size: 13px; }

.btn {
    border: 0;
    background: var(--green);
    color: white;
    border-radius: 14px;
    padding: 12px 16px;
    font-weight: 800;
    cursor: pointer;
}

.btn:hover { background: var(--green-dark); }

.btn.secondary {
    background: var(--green-soft);
    color: var(--green-dark);
}

.flash, .error-banner {
    border-radius: 14px;
    padding: 12px 14px;
    margin: 16px 0;
    font-weight: 650;
}

.flash { background: var(--green-soft); color: var(--green-dark); }
.error-banner, .field-error { background: #fdecec; color: var(--danger); }

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
}

th, td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 13px; font-weight: 700; }
tr:last-child td { border-bottom: 0; }

.one-clickable-row { cursor: pointer; }
.one-clickable-row:hover { background: #f7faf8; }

.pill {
    display: inline-flex;
    border-radius: 999px;
    padding: 4px 10px;
    background: var(--green-soft);
    color: var(--green-dark);
    font-size: 13px;
    font-weight: 800;
}

.pill.warn { background: var(--warn-bg); color: #8a5b00; }
.pill.muted { background: var(--bg); color: var(--muted); }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px;
    margin-top: 16px;
}

.grid-2 { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 16px; }

label { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }

input, select {
    width: 100%;
    border: 1px solid var(--line);
    background: white;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 12px;
}

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.timeline small { color: var(--muted); }

.login-body { display: grid; grid-template-columns: 1.1fr 0.9fr; min-height: 100vh; }
.login-hero {
    background: var(--green);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px;
    gap: 8px;
}
.login-hero h1 { color: white; font-size: 40px; }
.login-hero p { margin: 0; max-width: 360px; font-size: 16px; }
.login-wrap {
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card { width: min(420px, 100%); }

.hint { color: var(--muted); font-size: 14px; }

.note {
    background: var(--warn-bg);
    border-radius: 14px;
    padding: 12px 14px;
    margin-top: 12px;
}

.topbar { position: sticky; top: 0; z-index: 20; }
.search { position: relative; flex: 0 1 380px; }
.search .ms { position: absolute; left: 12px; top: 10px; color: var(--muted); }
.search input { height: 40px; border-radius: 10px; background: var(--bg); padding: 0 12px 0 40px; margin: 0; }
.zone { height: 40px; width: auto; border-radius: 10px; margin: 0; padding: 0 10px; font-weight: 700; }
.search-results { position: absolute; left: 24px; top: 56px; width: min(380px, calc(100% - 48px)); background: white; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(19,32,26,.14); padding: 6px; z-index: 30; }
.search-results a { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 8px; text-decoration: none; }
.search-results a:hover { background: var(--bg); }
.desk { display: flex; flex-direction: column; gap: 20px; }
.head-actions, .btn { display: inline-flex; align-items: center; gap: 6px; }
.btn.ghost { background: white; color: var(--ink); border: 1px solid var(--line); }
.btn.soon, .btn:disabled { background: #E4E9E5; color: #8A958E; cursor: default; }
.btn.danger { background: #FDF3F3; color: #B4232A; border-color: #F3C5C7; }
.btn.warn { background: #FFF0D1; color: #8A5A00; border-color: #F2D9A6; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi, .panel, .table-card { background: white; border: 1px solid var(--line); border-radius: 16px; }
.kpi { padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.kpi span, .kpi small, .panel-head span { color: var(--muted); font-size: 12px; font-weight: 600; }
.kpi b { font-size: 26px; }
.kpi b.bad { color: #B4232A; }
.kpi b.good { color: var(--green); }
.live-grid, .shift-layout, .support-layout, .tariff-layout { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.map-card { position: relative; flex: 2 1 520px; height: 540px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: #E8ECE5; }
.map-card svg { width: 100%; height: 100%; }
.zone-name { position: absolute; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.zone-name.centrum { left: 30%; top: 26%; color: var(--green-dark); }
.zone-name.nord { left: 40%; top: 5%; color: #2550A8; }
.zone-name.syd { left: 12%; top: 72%; color: #8A5A00; }
.map-dot { position: absolute; transform: translate(-50%, -50%); width: 28px; height: 28px; border-radius: 50%; border: 3px solid white; background: var(--ink); color: white; font-size: 9px; font-weight: 800; cursor: pointer; }
.legend { position: absolute; left: 12px; bottom: 12px; background: white; border-radius: 12px; padding: 10px 12px; display: flex; gap: 12px; flex-wrap: wrap; }
.legend.plain { position: static; margin-top: 10px; }
.legend i, .live-text i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.side-stack { flex: 1 1 320px; display: flex; flex-direction: column; gap: 16px; }
.panel { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.panel-head, .zone-row, .queue-row, .order-grid, .courier-grid, .pay-grid, .doc-line, .item-line, .time-line { display: flex; align-items: center; gap: 10px; }
.panel-head { justify-content: space-between; }
.alert { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 12px; }
.alert.warn { background: var(--warn-bg); }
.alert .ms { width: 34px; height: 34px; border-radius: 10px; background: var(--warn); color: white; display: grid; place-items: center; }
.alert small, .queue-row small, .order-grid small, .who-cell small { display: block; color: var(--muted); font-size: 12px; }
.alert button, .queue-row { border: 0; background: white; border-radius: 8px; font-weight: 700; cursor: pointer; }
.queue-row { width: 100%; text-align: left; padding: 8px; background: transparent; }
.queue-row b { width: 40px; text-align: center; }
.queue-row span, .order-grid span { flex: 1; min-width: 0; }
.queue-row em, .order-grid em, .drawer em { border-radius: 999px; padding: 3px 8px; font-style: normal; font-size: 12px; font-weight: 700; }
.zone-row { justify-content: space-between; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid #EEF1EE; }
.zone-row small { display: block; color: var(--muted); }
.segment { display: flex; background: #F1F4F1; border-radius: 10px; padding: 3px; }
.segment button { height: 30px; border: 0; border-radius: 8px; background: transparent; font-weight: 700; cursor: pointer; padding: 0 12px; }
.segment button.on { background: white; }
.segment button.on.level-1 { background: var(--warn); color: white; }
.segment button.on.level-2 { background: var(--danger); color: white; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters button { height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: white; font-weight: 700; cursor: pointer; }
.filters button.on { border-color: var(--green); background: var(--green-soft); color: var(--green-dark); }
.table-card { overflow: auto; }
.order-grid, .courier-grid, .pay-grid { width: 100%; border: 0; background: white; text-align: left; padding: 12px 16px; border-bottom: 1px solid #EEF1EE; cursor: pointer; font: inherit; color: inherit; }
.order-grid { display: grid; grid-template-columns: 80px minmax(180px, 2fr) 130px minmax(100px, 1fr) 60px 90px; }
.courier-grid { display: grid; grid-template-columns: minmax(200px, 2fr) 90px 120px 120px minmax(120px, 1fr); }
.pay-grid { display: grid; grid-template-columns: 2fr 80px 120px; cursor: default; }
.head { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; cursor: default; }
.pad { padding: 16px; }
.who-cell { display: flex; align-items: center; gap: 10px; }
.who-cell i, .who-cell i.big { width: 34px; height: 34px; border-radius: 50%; background: var(--green-soft); color: var(--green-dark); display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: 12px; }
.who-cell i.big { width: 64px; height: 64px; background: var(--green); color: white; font-size: 22px; }
.live-text { display: flex; align-items: center; gap: 6px; }
.kanban { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.kanban section { min-height: 220px; background: #EEF1EE; border-radius: 16px; padding: 12px; }
.empty-docs { min-height: 180px; align-items: center; justify-content: center; color: var(--muted); }
.shift-grid { display: grid; grid-template-columns: 120px repeat(7, minmax(0, 1fr)); gap: 6px; align-items: center; margin-bottom: 6px; }
.shift-grid .cell { height: 44px; border-radius: 10px; border: 2px solid #F3C5C7; background: #FDECEC; color: #B4232A; font-weight: 800; cursor: pointer; }
.shift-grid .cell.picked { outline: 2px solid var(--ink); }
.support-layout section { flex: 1; min-height: 240px; }
.sim-total { display: flex; justify-content: space-between; align-items: center; background: var(--ink); color: white; border-radius: 12px; padding: 12px 14px; }
.sim-total b { font-size: 26px; }
.check { display: flex; gap: 8px; align-items: center; }
.drawer-backdrop { position: fixed; inset: 0; background: rgba(19,32,26,.35); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100vw); background: white; z-index: 41; box-shadow: -10px 0 40px rgba(19,32,26,.18); display: flex; flex-direction: column; }
.drawer header, .modal-actions, .assign-row { display: flex; align-items: center; gap: 10px; }
.drawer header { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.drawer header button { margin-left: auto; width: 36px; height: 36px; border: 0; border-radius: 9px; background: var(--bg); cursor: pointer; }
.drawer-body { padding: 18px 20px; overflow: auto; display: flex; flex-direction: column; gap: 16px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kicker { display: block; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; margin-bottom: 6px; }
.two small, .assign-box small { color: var(--muted); }
.assign-box, .note { background: var(--bg); border-radius: 12px; padding: 14px; }
.item-line, .time-line { justify-content: space-between; padding: 4px 0; }
.time-line i { width: 10px; height: 10px; border-radius: 50%; background: var(--green); }
.modal { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(460px, 92vw); background: white; border-radius: 18px; z-index: 51; padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.modal textarea { min-height: 100px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; }
.profile-card h2 { margin: 0; }

@media (max-width: 800px) {
    .grid-2, .page-head, .stats, .shell, .login-body { display: block; }
    .side { position: static; height: auto; }
    .stat, .btn { margin-top: 8px; }
}
