:root {
    --bg: #f3f4f7;
    --panel: #ffffff;
    --panel-2: #f8f9fb;
    --line: #e6e8ee;
    --line-strong: #d3d7e0;
    --text: #12162a;
    --text-2: #3b4258;
    --muted: #737a8f;
    --ink: #0d1120;
    --ink-2: #171c30;
    --accent: #4f46e5;
    --accent-2: #6366f1;
    --accent-weak: #eef0ff;
    --accent-ring: rgba(79, 70, 229, .18);
    --ok: #12805c;
    --ok-weak: #e4f5ee;
    --warn: #a15c07;
    --warn-weak: #fdf3e1;
    --bad: #c2353a;
    --bad-weak: #fcebec;
    --r-sm: 8px;
    --r: 12px;
    --r-lg: 16px;
    --sh-1: 0 1px 2px rgba(16, 24, 40, .05);
    --sh-2: 0 1px 3px rgba(16, 24, 40, .06), 0 6px 16px -4px rgba(16, 24, 40, .08);
    --sh-3: 0 24px 64px -12px rgba(16, 24, 40, .28), 0 4px 12px rgba(16, 24, 40, .08);
    font-size: 14px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-feature-settings: "cv11", "ss01";
    -webkit-font-smoothing: antialiased;
    color: var(--text);
    background: var(--bg);
    display: flex;
    flex-direction: column;
    letter-spacing: -0.005em;
}
button, input, select { font: inherit; color: inherit; letter-spacing: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.02em; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 14px; }
a { color: var(--accent); text-decoration: none; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
.eyebrow { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

/* ---------- buttons & inputs ---------- */
button {
    cursor: pointer;
    border: 1px solid var(--line-strong);
    background: var(--panel);
    border-radius: var(--r-sm);
    padding: 8px 14px;
    line-height: 1.2;
    white-space: nowrap;
    font-weight: 500;
    box-shadow: var(--sh-1);
    transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
}
button:hover:not(:disabled) { border-color: #b9bfcc; background: #fbfbfd; }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: default; }
button.primary {
    background: linear-gradient(180deg, var(--accent-2), var(--accent));
    border-color: var(--accent); color: #fff; font-weight: 600;
    box-shadow: 0 1px 2px rgba(79, 70, 229, .3), inset 0 1px 0 rgba(255, 255, 255, .15);
}
button.primary:hover:not(:disabled) { background: linear-gradient(180deg, #7275f4, #5a52ea); border-color: var(--accent); }
button.danger { color: var(--bad); }
button.danger:hover:not(:disabled) { border-color: #e4a9ac; background: var(--bad-weak); }
button.danger-solid { background: var(--bad); border-color: var(--bad); color: #fff; font-weight: 600; }
button.ghost { border-color: transparent; background: transparent; box-shadow: none; }
button.ghost:hover:not(:disabled) { background: rgba(18, 22, 42, .05); border-color: transparent; }
button.big { padding: 11px 18px; font-size: 15px; border-radius: 10px; }
button.icon { padding: 5px 8px; }
button.link { border: 0; background: none; padding: 0; color: var(--accent); box-shadow: none; font-weight: 500; }
button.link:hover:not(:disabled) { text-decoration: underline; background: none; }

input[type=text], input[type=password], input[type=number], input[type=date], input[type=time], select {
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    padding: 8px 10px;
    background: #fff;
    min-width: 0;
    box-shadow: var(--sh-1);
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
button:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--accent-ring); }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
label.field > input, label.field > select { color: var(--text); font-weight: 400; font-size: 14px; }
label.check { display: flex; gap: 8px; align-items: center; cursor: pointer; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.grow { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- top bar ---------- */
.topbar {
    height: 56px; flex: none; display: flex; align-items: center; gap: 18px;
    padding: 0 14px 0 18px; background: var(--ink); color: #e8eaf3; z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 16px; letter-spacing: -0.02em; }
.logo {
    width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
    background: linear-gradient(135deg, #818cf8, #4f46e5 55%, #312e81);
    box-shadow: 0 4px 12px rgba(79, 70, 229, .45), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.logo svg { width: 18px; height: 18px; }
.crumbs { display: flex; gap: 8px; align-items: center; color: #8d93a9; min-width: 0; font-size: 13.5px; }
.crumbs a { color: #8d93a9; }
.crumbs a:hover { color: #fff; }
.crumbs b { color: #fff; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs .sep { opacity: .4; }
.topbar-right { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.topbar button.ghost { color: #c9cde0; }
.topbar button.ghost:hover:not(:disabled) { background: rgba(255, 255, 255, .08); color: #fff; }
.osrm {
    display: flex; gap: 7px; align-items: center; font-size: 12px; color: #9ea4ba; margin-right: 8px;
    padding: 5px 10px; border-radius: 20px; background: rgba(255, 255, 255, .05);
}
.osrm i { width: 7px; height: 7px; border-radius: 50%; background: #5d6378; }
.osrm.up i { background: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, .18); }
.osrm.down i { background: #f87171; box-shadow: 0 0 0 3px rgba(248, 113, 113, .2); }
.osrm.down span { color: #fca5a5; }
.user-btn {
    display: flex; gap: 8px; align-items: center; background: rgba(255, 255, 255, .06) !important;
    border: 1px solid rgba(255, 255, 255, .08) !important; color: #fff; border-radius: 22px; padding: 4px 12px 4px 4px; box-shadow: none;
}
.user-btn:hover { background: rgba(255, 255, 255, .12) !important; }
.user-btn .role { font-size: 11px; color: #a5b4fc; }
.avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; border-radius: 50%;
    color: #fff; font-size: 11px; font-weight: 700; flex: none;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
}
.menu {
    position: fixed; z-index: 3500; background: var(--panel); border-radius: var(--r); box-shadow: var(--sh-3);
    border: 1px solid var(--line); padding: 6px; min-width: 220px; display: flex; flex-direction: column;
}
.menu .menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu button { border: 0; box-shadow: none; background: none; text-align: left; padding: 9px 10px; border-radius: 6px; }
.menu button:hover { background: var(--panel-2); }

main { flex: 1; min-height: 0; display: flex; }

/* ---------- auth screen ---------- */
.auth { flex: 1; display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.auth-art {
    position: relative; overflow: hidden; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
    background: radial-gradient(1200px 600px at 20% 10%, #312e81 0%, transparent 60%),
                radial-gradient(900px 500px at 90% 90%, #1e3a8a 0%, transparent 55%), var(--ink);
}
.auth-art svg.lines { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .4; }
.auth-art .brand { font-size: 20px; position: relative; }
.auth-art .pitch { position: relative; max-width: 440px; }
.auth-art .pitch h1 { font-size: 34px; line-height: 1.15; letter-spacing: -0.03em; font-weight: 700; }
.auth-art .pitch p { color: #b8bdd6; font-size: 15px; line-height: 1.6; margin: 14px 0 0; }
.auth-art .foot { position: relative; color: #6f7592; font-size: 12px; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 32px 20px; background: var(--panel); }
.auth-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 18px; }
.auth-card h2 { font-size: 26px; letter-spacing: -0.03em; }
.auth-card .sub { color: var(--muted); margin-top: -10px; line-height: 1.5; }
.auth-card .err { color: var(--bad); font-size: 13px; min-height: 18px; margin-top: -6px; }
.auth-card button.primary { width: 100%; padding: 12px; font-size: 15px; border-radius: 10px; }

/* ---------- pages ---------- */
.page { flex: 1; overflow: auto; padding: 36px 20px 48px; }
.page-inner { max-width: 1040px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; }
.page-head h1 { font-size: 28px; letter-spacing: -0.03em; }
.page-head .lead { color: var(--muted); margin-top: 6px; max-width: 620px; line-height: 1.5; }
.empty {
    background: var(--panel); border: 1px dashed var(--line-strong); border-radius: var(--r-lg);
    padding: 56px 24px; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center;
}
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.card {
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
    padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 14px; cursor: pointer;
    box-shadow: var(--sh-1); transition: box-shadow .2s, transform .2s, border-color .2s;
}
.card:hover { box-shadow: var(--sh-2); transform: translateY(-2px); border-color: #d9dcf5; }
.card-top { display: flex; gap: 10px; align-items: flex-start; }
.card .title { font-weight: 600; font-size: 16px; letter-spacing: -0.015em; flex: 1; line-height: 1.3; }
.card .meta { color: var(--muted); font-size: 12px; display: flex; gap: 6px 12px; flex-wrap: wrap; align-items: center; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat { background: var(--panel-2); border-radius: 10px; padding: 9px 10px; }
.stat b { display: block; font-size: 17px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 11px; color: var(--muted); }
.progress { height: 6px; border-radius: 3px; background: #eceef3; overflow: hidden; display: flex; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); border-radius: 3px; transition: width .4s; }
.progress > i.ok { background: linear-gradient(90deg, #34d399, var(--ok)); }

/* tables (admin) */
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); overflow: hidden; }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 12px 16px; background: var(--panel-2); border-bottom: 1px solid var(--line); }
table.t td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr:hover td { background: #fafbfd; }
.who-cell { display: flex; gap: 10px; align-items: center; }
.who-cell .avatar { width: 32px; height: 32px; font-size: 13px; }
.who-cell b { display: block; font-weight: 600; }

/* ---------- project page ---------- */
.workspace { flex: 1; display: flex; min-height: 0; }
.side {
    width: 440px; flex: none; background: var(--panel); border-right: 1px solid var(--line);
    display: flex; flex-direction: column; min-height: 0; box-shadow: 4px 0 24px -12px rgba(16, 24, 40, .12); z-index: 2;
}
.side-head { padding: 18px 18px 14px; display: flex; flex-direction: column; gap: 12px; border-bottom: 1px solid var(--line); }
.title-row { display: flex; gap: 6px; align-items: center; }
.title-row h1 { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 20px; }
.viewers { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); min-height: 24px; flex-wrap: wrap; }
.viewers .who { display: inline-flex; gap: 5px; align-items: center; color: var(--text-2); background: var(--panel-2); border-radius: 20px; padding: 2px 9px 2px 2px; }
.viewers .who .avatar { width: 20px; height: 20px; font-size: 10px; }

.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: #eef0f4; padding: 4px; border-radius: 11px; }
.tab {
    border: 0; border-radius: 8px; background: none; box-shadow: none; padding: 8px 6px;
    color: var(--muted); display: flex; gap: 7px; align-items: center; justify-content: center; font-size: 13px;
}
.tab:hover:not(:disabled) { color: var(--text); background: rgba(255, 255, 255, .6); }
.tab.active { color: var(--text); background: #fff; box-shadow: var(--sh-2); font-weight: 600; }
.tab .num {
    width: 19px; height: 19px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; background: #dde0e8; color: var(--muted); font-weight: 600;
}
.tab.active .num { background: var(--accent); color: #fff; }
.tab .num.done { background: var(--ok); color: #fff; }

.side-body { flex: 1; overflow: auto; padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.box { border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 12px; background: var(--panel); box-shadow: var(--sh-1); }
.box.tint { background: linear-gradient(180deg, #fafbff, #f6f7fb); }
.hint { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.callout { border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.45; }
.callout.warn { background: var(--warn-weak); color: #74420a; }
.callout.bad { background: var(--bad-weak); color: #85232a; }
.callout.ok { background: var(--ok-weak); color: #0c5b41; }
.callout.info { background: var(--accent-weak); color: #3730a3; }
.stat-line { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); align-items: baseline; }
.stat-line b { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; color: var(--text); font-variant-numeric: tabular-nums; }

.list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--panel); }
.list-row {
    display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--line);
    cursor: pointer; min-height: 46px; transition: background .12s;
}
.list-row:first-child { border-top: 0; }
.list-row:hover { background: #f8f9fc; }
.list-row.sel { background: var(--accent-weak); box-shadow: inset 3px 0 0 var(--accent); }
.list-row .name { font-weight: 600; min-width: 84px; }
.list-row .info { flex: 1; font-size: 12px; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.list-head { padding: 8px 12px; background: var(--panel-2); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-top: 1px solid var(--line); }
.list-head:first-child { border-top: 0; }
.swatch { width: 12px; height: 12px; border-radius: 4px; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }

.chip {
    font-size: 11px; padding: 3px 8px; border-radius: 20px; white-space: nowrap; font-weight: 600;
    background: #eef0f4; color: var(--muted);
}
.chip.ok { background: var(--ok-weak); color: var(--ok); }
.chip.warn { background: var(--warn-weak); color: var(--warn); }
.chip.bad { background: var(--bad-weak); color: var(--bad); }
.chip.info { background: var(--accent-weak); color: var(--accent); }
.chip.dark { background: var(--ink-2); color: #c7d2fe; }

.time-edit { display: flex; gap: 4px; align-items: center; }
.time-edit input { padding: 6px 8px; font-size: 13px; }
.time-edit input[type=date] { width: 132px; }
.time-edit input[type=time] { width: 112px; }

.job {
    border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 10px; color: #e8eaf3;
    background: linear-gradient(135deg, #1e1b4b, var(--ink-2)); box-shadow: var(--sh-2);
}
.job .small { color: #a5adc8 !important; }
.job .progress { background: rgba(255, 255, 255, .12); height: 7px; }
.job button { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .15); box-shadow: none; }
.job button:hover:not(:disabled) { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .25); }

.back { align-self: flex-start; margin: -6px 0 -4px -8px; color: var(--muted); }
.kv { display: grid; grid-template-columns: 92px 1fr; gap: 10px 12px; font-size: 13px; margin: 0; align-items: baseline; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-variant-numeric: tabular-nums; }
.house-row { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-top: 1px solid var(--line); font-size: 13px; }
.house-row:first-child { border-top: 0; }
.house-row:hover { background: #f8f9fc; }
.house-row .n { color: var(--muted); width: 22px; text-align: right; flex: none; font-variant-numeric: tabular-nums; }
.house-row .addr { flex: 1; }

.activity { display: flex; flex-direction: column; gap: 14px; font-size: 13px; }
.activity .item { display: flex; gap: 10px; align-items: flex-start; }
.activity .when { color: var(--muted); font-size: 11.5px; margin-top: 2px; }

/* ---------- map ---------- */
.map-wrap { flex: 1; position: relative; min-width: 0; }
#map { position: absolute; inset: 0; background: #eef0f3; }
.map-banner {
    position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 900;
    background: var(--ink); color: #fff; border-radius: 24px; padding: 8px 8px 8px 18px;
    display: flex; gap: 12px; align-items: center; box-shadow: var(--sh-3); font-size: 13px;
}
.map-banner button { background: rgba(255, 255, 255, .14); border: 0; color: #fff; border-radius: 16px; box-shadow: none; }
.leaflet-container { font-family: inherit; }
/* calm, desaturated basemap so route colours carry the picture */
.muted-tiles { filter: grayscale(.85) contrast(.92) brightness(1.06); }
.leaflet-bar { border: 0 !important; box-shadow: var(--sh-2) !important; border-radius: 10px !important; overflow: hidden; }
.leaflet-bar a { border-bottom-color: var(--line) !important; color: var(--text) !important; }
.leaflet-popup-content-wrapper { border-radius: var(--r) !important; box-shadow: var(--sh-3) !important; }
.leaflet-popup-content { font-size: 13px; margin: 14px 16px; }
.leaflet-popup-content .pop { display: flex; flex-direction: column; gap: 10px; min-width: 240px; }
.leaflet-popup-content .pop b { font-size: 14px; }
.leaflet-tooltip { border-radius: 6px; border: 0; box-shadow: var(--sh-2); font-family: inherit; }
.start-pin { width: 28px; height: 36px; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .3)); }
.hover-tip {
    position: fixed; z-index: 2000; pointer-events: none; background: var(--ink); color: #fff;
    font-size: 12px; padding: 5px 9px; border-radius: 6px; white-space: nowrap; box-shadow: var(--sh-2); font-variant-numeric: tabular-nums;
}

/* ---------- modal ---------- */
.modal-backdrop {
    position: fixed; inset: 0; background: rgba(13, 17, 32, .5); backdrop-filter: blur(3px); z-index: 3000;
    display: flex; align-items: flex-start; justify-content: center; padding: 9vh 16px 16px; overflow: auto;
    animation: fade .15s ease-out;
}
.modal {
    background: var(--panel); border-radius: var(--r-lg); box-shadow: var(--sh-3); width: 100%; max-width: 480px;
    display: flex; flex-direction: column; max-height: 84vh; animation: pop .18s ease-out;
}
.modal.wide { max-width: 660px; }
.modal-head { padding: 20px 22px 0; display: flex; align-items: center; gap: 8px; }
.modal-head h2 { flex: 1; font-size: 18px; }
.modal-body { padding: 16px 22px; overflow: auto; display: flex; flex-direction: column; gap: 16px; }
.modal-foot { padding: 14px 22px 18px; display: flex; gap: 8px; justify-content: flex-end; align-items: center; border-top: 1px solid var(--line); background: var(--panel-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.modal-foot .err { color: var(--bad); font-size: 13px; margin-right: auto; }
.modal-foot .err:empty { display: none; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.drop {
    border: 1.5px dashed var(--line-strong); border-radius: var(--r); padding: 26px; text-align: center; background: var(--panel-2);
    cursor: pointer; color: var(--muted); display: flex; flex-direction: column; gap: 6px; align-items: center; transition: all .15s;
}
.drop.over, .drop:hover { border-color: var(--accent); background: var(--accent-weak); color: var(--text); }
.drop.has { border-style: solid; border-color: var(--ok); background: var(--ok-weak); color: var(--text); }
details.adv > summary { cursor: pointer; color: var(--accent); font-weight: 500; padding: 4px 0; }
.cfg-section { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.cfg-section h3 { font-size: 11px; color: var(--muted); margin-top: 10px; text-transform: uppercase; letter-spacing: .07em; }
.cfg-row { display: grid; grid-template-columns: 1fr 210px; gap: 8px; align-items: center; font-size: 13px; }
.cfg-row .vals { display: flex; gap: 4px; }
.cfg-row .vals input { width: 100%; padding: 6px 8px; }
.cfg-row .unit { color: var(--muted); font-size: 12px; align-self: center; white-space: nowrap; }

/* ---------- toasts ---------- */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 4000; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast {
    background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 10px; box-shadow: var(--sh-3);
    max-width: 420px; font-size: 13px; line-height: 1.45; animation: slide .2s ease-out; border-left: 3px solid var(--accent-2);
}
.toast.bad { border-left-color: #f87171; }
.toast.ok { border-left-color: #34d399; }
@keyframes slide { from { transform: translateY(10px); opacity: 0; } }

.spinner {
    width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
    display: inline-block; animation: spin .8s linear infinite; vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
    .auth { grid-template-columns: 1fr; }
    .auth-art { display: none; }
    .workspace { flex-direction: column; }
    .side { width: auto; height: 56%; border-right: 0; border-bottom: 1px solid var(--line); }
    .map-wrap { min-height: 44%; }
    .osrm span, .crumbs, .user-btn .uname { display: none; }
    .stats { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- settings: personal marker ---------- */
i.mine { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 7px; vertical-align: 1px; box-shadow: 0 0 0 3px var(--accent-ring); }

/* ---------- date & time pickers ---------- */
.dp-trigger {
    display: inline-flex; align-items: center; gap: 8px; text-align: left; font-weight: 400;
    padding: 8px 10px; min-width: 0; font-variant-numeric: tabular-nums; color: var(--text);
}
.dp-trigger .dp-ic { width: 16px; height: 16px; color: var(--muted); flex: none; display: inline-flex; }
.dp-trigger .dp-ic svg { width: 16px; height: 16px; }
.dp-trigger .dp-val { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dp-trigger .ph { color: #a3a9b8; }
.dp-trigger:hover .dp-ic, .dp-trigger.open .dp-ic { color: var(--accent); }
.dp-trigger.open { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
label.field > .dp-trigger { width: 100%; font-size: 14px; }
.time-edit .dp-trigger { padding: 6px 9px; font-size: 13px; gap: 6px; }
.time-edit .dp-trigger.date { width: 136px; }
.time-edit .dp-trigger.time { width: 104px; }
.time-edit .dp-trigger .dp-ic, .time-edit .dp-trigger .dp-ic svg { width: 14px; height: 14px; }

.dp-pop {
    position: fixed; z-index: 5000; background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
    box-shadow: var(--sh-3); padding: 12px; width: 280px; animation: pop .14s ease-out; user-select: none;
}
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dp-head b { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.dp-nav { width: 30px; height: 30px; padding: 0; display: grid; place-items: center; border-radius: 8px; box-shadow: none; border-color: transparent; background: transparent; }
.dp-nav:hover:not(:disabled) { background: var(--panel-2); border-color: transparent; }
.dp-nav svg { width: 16px; height: 16px; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-wd span { text-align: center; font-size: 11px; font-weight: 600; color: var(--muted); padding: 4px 0 6px; text-transform: uppercase; letter-spacing: .04em; }
.dp-days button {
    height: 34px; padding: 0; border: 0; box-shadow: none; background: none; border-radius: 9px;
    font-size: 13px; font-variant-numeric: tabular-nums; font-weight: 500;
}
.dp-days button:hover:not(:disabled) { background: var(--accent-weak); color: var(--accent); }
.dp-days button.we { color: #9a5b5f; }
.dp-days button.today { box-shadow: inset 0 0 0 1.5px var(--accent-ring); color: var(--accent); }
.dp-days button.sel, .dp-days button.sel:hover { background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: #fff; box-shadow: 0 2px 6px rgba(79, 70, 229, .35); }
.dp-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.dp-pop.tp { width: auto; }
.tp-cols { display: flex; gap: 6px; }
.tp-col { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tp-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.tp-list { height: 216px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding: 2px 4px; scrollbar-width: thin; }
.tp-list button {
    width: 52px; padding: 7px 0; border: 0; box-shadow: none; background: none; border-radius: 8px;
    font-variant-numeric: tabular-nums; font-size: 14px; font-weight: 500; flex: none;
}
.tp-list button:hover:not(:disabled) { background: var(--accent-weak); color: var(--accent); }
.tp-list button.sel, .tp-list button.sel:hover { background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: #fff; }
.tp-now { font-variant-numeric: tabular-nums; font-size: 15px !important; font-weight: 600; color: var(--text) !important; }
.dp-foot button.primary { padding: 7px 14px; }

/* segmented switch (admin: my / all projects) */
.seg { display: inline-flex; gap: 3px; padding: 3px; background: #e9ebf0; border-radius: 10px; }
.seg button { border: 0; box-shadow: none; background: none; padding: 6px 14px; border-radius: 8px; color: var(--muted); font-size: 13px; }
.seg button:hover:not(:disabled) { background: rgba(255, 255, 255, .6); color: var(--text); }
.seg button.active { background: #fff; color: var(--text); font-weight: 600; box-shadow: var(--sh-2); }
