:root {
    --navy: #1f3864;
    --blue: #2e75b6;
    --blue-soft: #e8f0fa;
    --bg: #f4f6fa;
    --card: #ffffff;
    --text: #1a1f29;
    --muted: #64708a;
    --line: #dde3ee;
    --ok: #1e7f4f;
    --ok-soft: #e3f5ec;
    --warn: #9a6200;
    --warn-soft: #fdf1dc;
    --bad: #a8281f;
    --bad-soft: #fbe7e5;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(20, 35, 70, .06), 0 8px 24px rgba(20, 35, 70, .05);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

@view-transition {
    navigation: auto;
}

::view-transition-old(root) {
    animation: page-leave .22s cubic-bezier(.22, .61, .36, 1) both;
}

::view-transition-new(root) {
    animation: page-enter .32s cubic-bezier(.22, .61, .36, 1) both;
}

@keyframes page-enter {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes page-leave {
    to { opacity: 0; transform: translateY(-4px); }
}

@media (prefers-reduced-motion: no-preference) {
    main.wrap { animation: page-enter .32s cubic-bezier(.22, .61, .36, 1) both; }
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: 26px; line-height: 1.2; margin: 0 0 4px; letter-spacing: -.2px; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0 0 6px; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; }
.hidden { display: none !important; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

/* ---------------------------------------------------------------- topbar */
.topbar {
    background: #fff;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 40;
}

.topbar-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 18px;
}

.brand {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    white-space: nowrap;
}
.brand:hover { text-decoration: none; }

.brand-logo {
    display: block;
    width: auto;
    height: 38px;
}

.nav {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 14px;
}
.nav a { color: var(--muted); padding: 4px 0; }
.nav a:hover { color: var(--navy); text-decoration: none; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.langswitch { font-size: 13px; color: var(--muted); }
.langswitch a { color: var(--muted); padding: 2px; }
.langswitch a.active { color: var(--navy); font-weight: 700; }

.avatar {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--blue-soft);
    color: var(--navy);
    font-weight: 700;
    font-size: 14px;
}
.avatar:hover { text-decoration: none; }

/* ---------------------------------------------------------------- layout */
.wrap { max-width: 1120px; margin: 0 auto; padding: 24px 20px 56px; }

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.back { font-size: 13px; color: var(--muted); }

.foot {
    max-width: 1120px;
    margin: 0 auto;
    padding: 18px 20px 40px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
    color: var(--muted);
}

/* ---------------------------------------------------------------- cards */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 18px;
}

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stats-grid { margin-bottom: 18px; }

.stat {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
}
.stat strong { display: block; font-size: 26px; color: var(--navy); line-height: 1.2; }
.stat span { font-size: 12.5px; }

.task h3 { margin-top: 8px; }
.task-top { display: flex; justify-content: space-between; align-items: center; }

/* ---------------------------------------------------------------- forms */
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }

.field { display: flex; flex-direction: column; gap: 5px; font-size: 13.5px; }
.field > span { color: var(--muted); font-weight: 600; }

.field-inline { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); }

input, select, textarea {
    font: inherit;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 9px 11px;
    width: 100%;
    min-width: 0;
}
input:focus, select:focus, textarea:focus {
    outline: 2px solid var(--blue-soft);
    border-color: var(--blue);
}
.password-input-wrap {
    position: relative;
    display: block;
    width: 100%;
}
.password-input-wrap input { padding-right: 44px; }
.password-toggle {
    position: absolute;
    top: 50%;
    right: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 6px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}
.password-toggle:hover { color: var(--navy); background: #f1f4f9; }
.password-toggle:focus-visible { outline: 2px solid var(--blue); }
.password-toggle svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
textarea { resize: vertical; }
input[disabled] { background: #f5f7fb; color: var(--muted); }

.check { display: flex; align-items: flex-start; gap: 8px; margin-top: 8px; font-size: 13.5px; }
.check input { width: auto; margin-top: 2px; }

.code-input {
    font-size: 26px;
    letter-spacing: 8px;
    text-align: center;
    font-weight: 700;
}

.filters {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

/* ---------------------------------------------------------------- buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--navy);
    border-radius: 9px;
    padding: 9px 14px;
    font: inherit;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { border-color: var(--blue); text-decoration: none; }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover { background: #16294b; }
.btn-ghost { background: transparent; }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-sm { padding: 6px 10px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }

/* ---------------------------------------------------------------- tables */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}
.table th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--muted);
    font-weight: 700;
    border-bottom: 1px solid #cdd6e6;
}
.table tbody tr:hover { background: #fafbfe; }
.table-compact th, .table-compact td { padding: 7px 6px; font-size: 13.5px; }
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}
.pagination-actions { display: flex; align-items: center; gap: 10px; }
.pagination-summary, .pagination-current { color: var(--muted); font-size: 13px; }

/* ---------------------------------------------------------------- pills */
.pill {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.5;
    white-space: nowrap;
}
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-bad { background: var(--bad-soft); color: var(--bad); }
.pill-info { background: var(--blue-soft); color: var(--navy); }
.pill-muted { background: #eef1f6; color: var(--muted); }

/* ---------------------------------------------------------------- flash */
.flash {
    border-radius: 10px;
    padding: 11px 14px;
    margin-bottom: 14px;
    font-size: 14px;
    border: 1px solid transparent;
}
.flash-ok { background: var(--ok-soft); color: var(--ok); border-color: #bfe6d1; }
.flash-warn { background: var(--warn-soft); color: var(--warn); border-color: #f0d9ac; }
.flash-error { background: var(--bad-soft); color: var(--bad); border-color: #f2c9c4; }
.flash-info { background: var(--blue-soft); color: var(--navy); border-color: #c9dcf3; }
.flash-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- auth */
.auth { max-width: 460px; margin: 32px auto; }
.auth-card { padding: 28px; }
.auth h1 { margin-bottom: 4px; }
.auth-links {
    display: flex;
    justify-content: space-between;
    margin-top: 18px;
    font-size: 13.5px;
}
.inline-form { margin-top: 12px; }

/* ---------------------------------------------------------------- map */
.map {
    height: 320px;
    border-radius: 10px;
    background: #e9eef6;
    border: 1px solid var(--line);
    width: 100%;
}
.map-tall { height: 380px; }
.map-xl { height: 560px; }
.map-unavailable {
    display: grid;
    place-items: center;
    padding: 24px;
    text-align: center;
    color: var(--muted);
    background: repeating-linear-gradient(135deg, #eef2f8, #eef2f8 12px, #e7edf6 12px, #e7edf6 24px);
}

.place-search { margin: 16px 0; }
.place-search > label { color: var(--muted); font-weight: 600; }
.place-search .row { flex-wrap: nowrap; align-items: stretch; }
.place-search .row input { flex: 1; }
.place-results {
    display: grid;
    gap: 6px;
    max-height: 220px;
    overflow-y: auto;
}
.place-result {
    display: grid;
    gap: 3px;
    width: 100%;
    padding: 10px 12px;
    text-align: left;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
}
.place-result:hover { border-color: var(--blue); background: var(--blue-soft); }
.place-result span { color: var(--muted); font-size: 12px; }
.google-place-fallback {
    display: grid;
    justify-items: start;
    gap: 10px;
    margin-top: 12px;
    padding: 14px;
    background: var(--blue-soft);
    border: 1px solid var(--line);
    border-radius: 9px;
}
.google-place-fallback h3,
.google-place-fallback p { margin: 0; }
.google-place-fallback .field { width: 100%; }
#google-place-status.bad { color: var(--bad); }
#google-place-status.ok { color: var(--ok); }

.picker-dialog {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    overflow-y: auto;
    padding: 20px;
    background: rgba(15, 25, 45, .55);
}
.picker-dialog.hidden { display: none; }
.picker-dialog-panel {
    width: min(520px, 100%);
    max-height: 100%;
    overflow-y: auto;
    padding: 20px;
    color: var(--text);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.picker-dialog-head, .picker-dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.picker-dialog-head h2 { margin: 0; }
.picker-dialog-actions { justify-content: flex-end; margin-top: 14px; }
.participant-list { display: grid; gap: 7px; max-height: 42vh; overflow-y: auto; margin-top: 12px; }
.participant-option {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
}
.participant-option > input { width: auto; margin: 0; accent-color: var(--navy); }
.participant-option > span { display: grid; gap: 2px; }
.participant-option small { color: var(--muted); }
body.dialog-open { overflow: hidden; }

.legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; color: var(--muted); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.dot-ok { background: var(--ok); }
.dot-warn { background: #d98b00; }
.dot-bad { background: var(--bad); }
.dot-muted { background: var(--muted); }

.geo-status {
    padding: 9px 12px;
    border-radius: 9px;
    background: var(--blue-soft);
    color: var(--navy);
    font-size: 13.5px;
    margin-bottom: 12px;
}
.geo-status.bad { background: var(--bad-soft); color: var(--bad); }

/* ---------------------------------------------------------------- misc */
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; margin: 0 0 16px; font-size: 14px; }
.kv dt { color: var(--muted); font-size: 13px; }
.kv dd { margin: 0; }

.channel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
}
.channel:last-of-type { border-bottom: 0; }

.review-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.review .kv { margin-top: 14px; }

.error-page { text-align: center; padding: 60px 20px; }
.error-code { font-size: 72px; font-weight: 800; color: var(--navy); line-height: 1; margin-bottom: 10px; }

@media (max-width: 900px) {
    .grid-main, .grid-2 { grid-template-columns: minmax(0, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .topbar-inner { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
    .brand-logo { height: 30px; }
    .nav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
    .wrap { padding: 18px 14px 40px; }
    h1 { font-size: 22px; }
    .table { display: block; overflow-x: auto; white-space: nowrap; }
    .kv { grid-template-columns: 1fr; gap: 2px; }
    .kv dt { margin-top: 8px; }
    .map { height: 260px; }
    .map-xl { height: 380px; }
}

/* ================================================================ app shell v2 */
/* ---------------------------------------------------------------- header */
.topbar {
    background: #fff;
    border-bottom: 1px solid #e5ebf4;
    position: sticky;
    top: 0;
    z-index: 40;
    box-shadow: 0 1px 2px rgba(20, 35, 70, .04);
}

.topbar-inner {
    max-width: 1260px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
    white-space: nowrap;
}
.brand:hover { text-decoration: none; }

.brand-icon {
    display: block;
    width: 42px;
    height: 42px;
    filter: drop-shadow(0 4px 8px rgba(31, 56, 100, .18));
}

.brand-divider {
    width: 1px;
    height: 30px;
    background: #e2e8f2;
}

.brand-word {
    display: block;
    width: auto;
    height: 38px;
}

.nav {
    display: flex;
    align-items: center;
    gap: 1px;
    flex-wrap: nowrap;
    min-width: 0;
}

.nav-toggle { display: none; }

.nav > a,
.nav-more > summary {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 10px;
    border-radius: 9px;
    color: #5b6983;
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}
.nav > a:hover,
.nav-more > summary:hover {
    background: #f2f7ff;
    color: var(--navy);
    text-decoration: none;
}
.nav > a.active,
.nav-more.active > summary {
    background: #e8f1ff;
    color: var(--navy);
}
.nav > a.active::after,
.nav-more.active > summary::after {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: -15px;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--navy);
}
.nav .icon { width: 17px; height: 17px; flex: 0 0 auto; }

.nav-more { position: relative; }
.nav-more > summary { list-style: none; }
.nav-more > summary::-webkit-details-marker { display: none; }
.nav-more[open] > summary {
    background: #f2f7ff;
    color: var(--navy);
}
.nav-caret { width: 13px; height: 13px; color: #8190a6; }

.nav-more-menu {
    position: absolute;
    left: 0;
    top: calc(100% + 10px);
    min-width: 216px;
    padding: 6px;
    border: 1px solid #e3e9f3;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 16px 40px rgba(20, 35, 70, .16);
    z-index: 50;
}
.nav-more-menu a {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 10px;
    border-radius: 8px;
    color: #4d5b73;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}
.nav-more-menu a:hover {
    background: #f2f7ff;
    color: var(--navy);
    text-decoration: none;
}
.nav-more-menu a.active { background: #e8f1ff; color: var(--navy); }
.nav-more-menu .icon { width: 17px; height: 17px; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.langswitch {
    display: inline-flex;
    align-items: center;
    padding: 3px;
    border: 1px solid #e5ebf4;
    border-radius: 999px;
    background: #f5f8fc;
    font-size: 11.5px;
    font-weight: 700;
}
.langswitch a {
    padding: 4px 8px;
    border-radius: 999px;
    color: #6b7894;
    line-height: 1;
}
.langswitch a:hover { color: var(--navy); text-decoration: none; }
.langswitch a.active {
    background: #fff;
    color: var(--navy);
    box-shadow: 0 1px 3px rgba(20, 35, 70, .12);
}

.topbar-sep { width: 1px; height: 24px; background: #e5ebf4; margin: 0 2px; }

.icon-btn {
    position: relative;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    color: #56647d;
}
.icon-btn:hover { background: #f2f7ff; color: var(--navy); text-decoration: none; }
.icon-btn .icon { width: 20px; height: 20px; }

.badge {
    position: absolute;
    top: 3px;
    right: 3px;
    display: grid;
    place-items: center;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #e23b32;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

.usermenu { position: relative; }
.usermenu > summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 8px 3px 3px;
    border-radius: 999px;
    cursor: pointer;
}
.usermenu > summary::-webkit-details-marker { display: none; }
.usermenu > summary:hover { background: #f2f7ff; }
.usermenu > summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.avatar {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--navy);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
}
.avatar:hover { text-decoration: none; }

.usermenu-name {
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 700;
    color: var(--navy);
}
.usermenu-caret { width: 14px; height: 14px; color: #7c899e; }

.usermenu-pop {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: 240px;
    padding: 6px;
    border: 1px solid #e3e9f3;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 16px 40px rgba(20, 35, 70, .16);
    z-index: 50;
}
.usermenu-head {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 9px 10px 11px;
    margin-bottom: 4px;
    border-bottom: 1px solid #eef2f8;
}
.usermenu-head strong { font-size: 13.5px; color: var(--navy); }
.usermenu-head span {
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.usermenu-pop a {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 10px;
    border-radius: 8px;
    color: #4d5b73;
    font-size: 13.5px;
    font-weight: 600;
}
.usermenu-pop a:hover { background: #f2f7ff; color: var(--navy); text-decoration: none; }
.usermenu-pop a.logout-link { color: #c62828; }
.usermenu-pop a.logout-link:hover { background: #fff1f0; color: #a61f1f; }
.usermenu-pop a .icon { width: 17px; height: 17px; }

/* ---------------------------------------------------------------- page banner */
.page-banner {
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid #e2ebf7;
    background: linear-gradient(100deg, #ffffff 0%, #f7fbff 38%, #e9f3ff 100%);
}
.page-banner::before {
    content: "";
    position: absolute;
    inset: 0 0 0 auto;
    width: 62%;
    background: url("banner-waves.svg") right center / cover no-repeat;
    pointer-events: none;
}
.page-banner-inner {
    position: relative;
    z-index: 1;
    max-width: 1120px;
    margin: 0 auto;
    padding: 22px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.page-banner-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: linear-gradient(145deg, #1f3864, #2e75b6);
    color: #fff;
    box-shadow: 0 8px 18px rgba(31, 56, 100, .25);
}
.page-banner-icon .icon { width: 21px; height: 21px; }
.page-banner-text { min-width: 0; }
.page-banner h1 {
    margin: 0;
    color: var(--navy);
    font-size: 26px;
    line-height: 1.15;
    letter-spacing: -.3px;
    overflow-wrap: break-word;
}
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 5px;
    color: #71809a;
    font-size: 12.5px;
    flex-wrap: wrap;
}
.breadcrumb a { color: #5b7fae; font-weight: 600; }
.breadcrumb a:hover { color: var(--navy); text-decoration: none; }
.crumb-sep { color: #a7b4c8; }

/* ---------------------------------------------------------------- page head */
.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.page-head > div {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    min-width: 0;
}
.page-head h1,
.page-head .back { display: none; }
.page-head .muted { margin: 0; font-size: 13.5px; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1250px) {
    .topbar-inner { flex-wrap: wrap; gap: 8px 14px; padding: 10px 16px; }
    .nav {
        order: 4;
        width: 100%;
        flex-wrap: wrap;
        gap: 2px;
        overflow: visible;
        padding-bottom: 0;
    }
    .nav > a,
    .nav-more > summary { height: 34px; padding: 0 9px; }
    .nav > a.active::after,
    .nav-more.active > summary::after {
        left: 9px;
        right: 9px;
        bottom: -2px;
    }
    .nav-more-menu { right: 0; left: auto; }
    .brand-word { height: 34px; }
    .brand-icon { width: 38px; height: 38px; }
}

@media (max-width: 640px) {
    .topbar-inner {
        position: relative;
        display: grid;
        grid-template-columns: minmax(0, 1fr) 38px auto;
        align-items: center;
        padding: 9px 14px;
        gap: 6px;
    }
    .brand { gap: 8px; }
    .brand-divider { display: none; }
    .brand-icon { width: 32px; height: 32px; }
    .brand-word { max-width: 118px; height: 28px; object-fit: contain; object-position: left center; }
    .topbar-right {
        grid-column: 3;
        grid-row: 1;
        min-width: 0;
        margin-left: 0;
        gap: 4px;
    }
    .nav-toggle {
        grid-column: 2;
        grid-row: 1;
        display: flex;
        flex: 0 0 auto;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        width: 38px;
        height: 38px;
        padding: 0;
        border: 1px solid #e5ebf4;
        border-radius: 10px;
        background: #fff;
        color: var(--navy);
        cursor: pointer;
    }
    .nav-toggle:hover { background: #f2f7ff; }
    .nav-toggle:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
    .nav-toggle span {
        display: block;
        width: 17px;
        height: 2px;
        border-radius: 2px;
        background: currentColor;
        transition: transform .18s ease, opacity .18s ease;
    }
    .nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(6px) rotate(45deg); }
    .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
    .nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-6px) rotate(-45deg); }
    .nav {
        position: absolute;
        top: calc(100% + 1px);
        left: 14px;
        right: 14px;
        width: auto;
        z-index: 41;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 3px;
        padding: 8px;
        border: 1px solid var(--line);
        border-radius: 0 0 12px 12px;
        background: #fff;
        box-shadow: 0 12px 24px rgba(20, 35, 70, .14);
        max-height: calc(100vh - 64px);
        overflow-y: auto;
        overscroll-behavior: contain;
    }
    .nav.is-open { display: flex; }
    .nav > a,
    .nav-more > summary {
        width: 100%;
        height: 42px;
        padding: 0 10px;
    }
    .nav > a.active::after,
    .nav-more.active > summary::after { display: none; }
    .topbar-sep,
    .usermenu-name,
    .usermenu-caret { display: none; }
    .usermenu > summary { padding: 2px; gap: 0; }
    .nav-more[open] { width: 100%; }
    .nav-more[open] .nav-more-menu {
        position: static;
        width: 100%;
        margin-top: 4px;
        padding: 4px;
        border: 0;
        background: #f5f9ff;
        box-shadow: none;
    }
    .langswitch { font-size: 11px; }
    .langswitch a { padding: 4px 5px; }
    .page-banner-inner { padding: 18px 14px; gap: 11px; }
    .page-banner-icon { width: 36px; height: 36px; }
    .page-banner-icon .icon { width: 18px; height: 18px; }
    .page-banner h1 { font-size: 21px; }
    .page-banner::before { width: 90%; opacity: .6; }
    .wrap { padding: 18px 14px 40px; }
    h1 { font-size: 22px; }
    .table { display: block; overflow-x: auto; white-space: nowrap; }
    .kv { grid-template-columns: 1fr; gap: 2px; }
    .kv dt { margin-top: 8px; }
    .map { height: 260px; }
    .map-xl { height: 380px; }
}

@media (max-width: 480px) {
    .topbar-inner { grid-template-columns: minmax(0, 1fr) 38px auto; padding-inline: 10px; }
    .brand-word { max-width: 104px; height: 24px; }
    .brand-icon { width: 30px; height: 30px; }
    .icon-btn { width: 34px; height: 34px; }
    .avatar { width: 32px; height: 32px; }
    .nav { left: 10px; right: 10px; }
}

@media (max-width: 350px) {
    .brand-word { display: none; }
    .topbar-inner { grid-template-columns: minmax(0, 1fr) 38px auto; gap: 4px; }
    .topbar-right { gap: 2px; }
    .langswitch a { padding-inline: 4px; }
}

@media print {
    .topbar,
    .page-banner,
    .foot { display: none !important; }
    .page-head h1 { display: block; }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }

}

/* ---------------------------------------------------------------- install app */
.pwa-install {
    position: relative;
    overflow: hidden;
    border-color: #d9e7fa;
    background:
        radial-gradient(120% 160% at 100% 0%, rgba(46, 117, 182, .15), transparent 55%),
        linear-gradient(120deg, #fbfdff 0%, #f1f8ff 55%, #e5f1ff 100%);
}
.pwa-install::after {
    content: "";
    position: absolute;
    right: -46px;
    bottom: -82px;
    width: 220px;
    height: 220px;
    border: 1px solid rgba(46, 117, 182, .18);
    border-radius: 50%;
    box-shadow: 0 0 0 30px rgba(46, 117, 182, .05), 0 0 0 60px rgba(46, 117, 182, .03);
    pointer-events: none;
}
.pwa-install-head {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}
.pwa-install-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    border-radius: 14px;
    background: linear-gradient(145deg, #1f3864, #2e75b6);
    color: #fff;
    box-shadow: 0 10px 22px rgba(31, 56, 100, .25);
}
.pwa-install-icon .icon { width: 23px; height: 23px; }
.pwa-install-copy { min-width: 0; }
.pwa-badge {
    display: inline-flex;
    align-items: center;
    margin-bottom: 6px;
    padding: 3px 8px;
    border: 1px solid #d4e5fa;
    border-radius: 999px;
    background: #fff;
    color: #2e75b6;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}
.pwa-install h2 { margin: 0 0 5px; color: var(--navy); font-size: 18px; }
.pwa-install .muted { margin: 0; max-width: 68ch; }
.pwa-chips {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0 16px 60px;
}
.pwa-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    border: 1px solid #dbe7f7;
    border-radius: 999px;
    background: rgba(255, 255, 255, .85);
    color: #3f5273;
    font-size: 12px;
    font-weight: 600;
}
.pwa-chip .icon { width: 14px; height: 14px; color: var(--blue); }
.pwa-actions {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-left: 60px;
}
.pwa-actions .btn { display: inline-flex; align-items: center; gap: 8px; }
.pwa-actions .btn .icon { width: 17px; height: 17px; }
.pwa-status { color: var(--muted); font-size: 12.5px; }
.pwa-help {
    position: relative;
    z-index: 1;
    margin: 14px 0 0 60px;
    padding: 12px 14px;
    border: 1px solid #e1eaf6;
    border-radius: 10px;
    background: #fff;
    color: #4d5b73;
    font-size: 13px;
}
.pwa-help p { margin: 0 0 6px; }
.pwa-help p:last-child { margin: 0; }
.pwa-note {
    position: relative;
    z-index: 1;
    margin: 12px 0 0 60px;
    color: var(--muted);
    font-size: 11.5px;
}
.pwa-install.is-installed {
    border-color: #cfe9da;
    background: linear-gradient(120deg, #fbfffd, #eefaf3);
}
.pwa-install.is-installed .pwa-actions .btn { opacity: .6; }
@media (max-width: 640px) {
    .pwa-chips,
    .pwa-actions,
    .pwa-help,
    .pwa-note { margin-left: 0; }
    .pwa-install-head { gap: 11px; }
}
@media (display-mode: standalone) {
    .pwa-install { display: none !important; }
}
@media print {
    .pwa-install { display: none !important; }
}

/* ---------------------------------------------------------------- reference UI polish
   Soft-edged surfaces and compact navy controls inspired by the supplied
   dashboard style. */
:root {
    --radius: 16px;
    --shadow: 0 10px 28px rgba(31, 56, 100, .08);
    --shadow-soft: 0 4px 14px rgba(31, 56, 100, .07);
}

body {
    background:
        radial-gradient(circle at 85% 18%, rgba(46, 117, 182, .055), transparent 25rem),
        linear-gradient(180deg, #f7f9fc 0, var(--bg) 18rem);
}

.topbar {
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, .94);
}

.topbar-inner {
    max-width: 1240px;
}

.nav > a,
.nav-more > summary {
    border-radius: 10px;
}

.nav > a.active,
.nav-more.active > summary {
    box-shadow: 0 4px 12px rgba(46, 117, 182, .08);
}

.wrap {
    max-width: 1240px;
    padding-top: 28px;
}

.page-banner-inner {
    max-width: 1240px;
}

.card {
    border-color: #e2e8f2;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.card.task {
    border: 1px solid #e7edf5;
    border-radius: 14px;
    box-shadow: var(--shadow-soft);
    transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.card.task:hover {
    border-color: #cadcf3;
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(31, 56, 100, .11);
}

.stat {
    border: 0;
    border-radius: 14px;
    background: linear-gradient(145deg, #fff, #f3f7fc);
    box-shadow: var(--shadow-soft);
}

.btn,
input,
select,
textarea {
    border-radius: 10px;
}

.btn {
    box-shadow: 0 3px 8px rgba(31, 56, 100, .05);
}

.btn-primary {
    background: linear-gradient(145deg, #263f70, #1f3864);
    border: 0;
    box-shadow: 0 7px 16px rgba(31, 56, 100, .16);
}

.btn-primary:hover {
    background: linear-gradient(145deg, #1f3864, #16294b);
    box-shadow: 0 9px 18px rgba(31, 56, 100, .20);
}

input,
select,
textarea {
    border-color: #dfe6f0;
    background: #fbfcfe;
}

input:focus,
select:focus,
textarea:focus {
    background: #fff;
    outline: 3px solid rgba(46, 117, 182, .12);
    border-color: #7fa9d2;
}

.table {
    border-radius: 10px;
}

.table th {
    border: 0;
    background: #f5f8fc;
}

.table th:first-child {
    border-radius: 8px 0 0 8px;
}

.table th:last-child {
    border-radius: 0 8px 8px 0;
}

.table td {
    border-bottom-color: #edf1f6;
}

.table tbody tr:last-child td {
    border-bottom: 0;
}

.pill {
    padding: 4px 10px;
    border: 1px solid transparent;
}

.pill-info,
.pill-ok {
    border-color: rgba(46, 117, 182, .10);
}

.page-banner {
    background:
        radial-gradient(circle at 78% 40%, rgba(46, 117, 182, .12), transparent 23rem),
        linear-gradient(100deg, #fff 0%, #f7fbff 55%, #edf5fd 100%);
}

.page-banner-icon,
.pwa-install-icon,
.avatar {
    background: linear-gradient(145deg, #315d99, #1f3864);
}

.icon-btn,
.usermenu > summary,
.langswitch,
.nav-toggle {
    transition: background .18s ease, border-color .18s ease, color .18s ease;
}

.flash,
.geo-status,
.google-place-fallback,
.picker-dialog-panel {
    border-radius: 12px;
}

.auth-card {
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(31, 56, 100, .12);
}

/* ---------------------------------------------------------------- auth page background
   Deep blue gradient shared by login, signup, verification, and password
   recovery pages. */
body.auth-page {
    min-height: 100vh;
    min-height: 100dvh;
    background:
        radial-gradient(ellipse 70% 70% at 18% 40%, rgba(52, 124, 199, .72) 0%, rgba(45, 112, 185, .38) 42%, transparent 72%),
        radial-gradient(ellipse 62% 58% at 78% 16%, rgba(79, 149, 219, .56) 0%, rgba(57, 119, 188, .28) 52%, transparent 78%),
        linear-gradient(135deg, #1f5f9d 0%, #2c73b4 38%, #276aa9 68%, #153b70 100%);
    background-attachment: fixed;
}

body.auth-page .topbar {
    background: rgba(255, 255, 255, .92);
}

body.auth-page .wrap {
    min-height: calc(100vh - 118px);
    min-height: calc(100dvh - 118px);
}

body.auth-page .auth-card {
    background: rgba(255, 255, 255, .96);
    border-color: rgba(255, 255, 255, .78);
    backdrop-filter: blur(10px);
}

@media (max-width: 640px) {
    body.auth-page {
        background:
            radial-gradient(ellipse 95% 58% at 18% 38%, rgba(52, 124, 199, .72) 0%, rgba(45, 112, 185, .38) 52%, transparent 78%),
            radial-gradient(ellipse 80% 48% at 82% 12%, rgba(79, 149, 219, .56) 0%, rgba(57, 119, 188, .28) 58%, transparent 82%),
            linear-gradient(145deg, #1f5f9d 0%, #2c73b4 42%, #276aa9 68%, #153b70 100%);
        background-attachment: scroll;
    }

    body.auth-page .wrap {
        width: 100%;
        min-height: calc(100dvh - 118px);
        padding: 18px 14px 28px;
    }

    body.auth-page .auth {
        width: 100%;
        max-width: 460px;
        margin: 8px auto 0;
    }

    body.auth-page .auth-card {
        padding: 20px;
    }

    body.auth-page .auth-links {
        align-items: center;
        gap: 10px;
    }
}

@media (max-width: 380px) {
    body.auth-page .wrap {
        padding-inline: 10px;
    }

    body.auth-page .auth-card {
        padding: 16px;
    }

    body.auth-page .auth-links {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* ---------------------------------------------------------------- usability */
.skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 100;
    padding: 10px 14px;
    transform: translateY(-160%);
    border-radius: 9px;
    background: var(--navy);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(20, 35, 70, .2);
}
.skip-link:focus { transform: translateY(0); color: #fff; text-decoration: none; }

:focus-visible {
    outline: 3px solid rgba(46, 117, 182, .72);
    outline-offset: 3px;
}

[id] { scroll-margin-top: 6rem; }

.network-status {
    padding: 10px 20px;
    border-bottom: 1px solid #f0d9ac;
    background: var(--warn-soft);
    color: #754900;
    text-align: center;
    font-size: 13px;
    font-weight: 650;
}
.network-status[hidden] { display: none; }

.offline-page {
    display: grid;
    min-height: min(72vh, 620px);
    place-items: center;
    padding: 32px 16px;
}
.offline-card {
    width: min(100%, 520px);
    padding: clamp(24px, 6vw, 42px);
    border: 1px solid #e2e8f2;
    border-radius: 20px;
    background: #fff;
    box-shadow: var(--shadow);
    text-align: center;
}
.offline-mark {
    display: grid;
    width: 58px;
    height: 58px;
    margin: 0 auto 18px;
    place-items: center;
    border-radius: 18px;
    background: var(--blue-soft);
    color: var(--navy);
}
.offline-mark img { width: 38px; height: 38px; }
.offline-card h1 { margin-bottom: 10px; color: var(--navy); font-size: clamp(23px, 5vw, 30px); }
.offline-card p { margin: 0 0 12px; }
.offline-card .btn { margin-top: 12px; }

@media (max-width: 640px) {
    .network-status { padding: 9px 14px; font-size: 12px; }
    input, select, textarea { font-size: 16px; }
}

.btn {
    transition: color .22s ease, background-color .22s ease, border-color .22s ease,
        box-shadow .22s ease, transform .22s cubic-bezier(.2, .75, .25, 1);
}
.btn:not(.btn-primary):not(.btn-danger):not(.btn-danger-soft):not(.btn-success-soft):not(.btn-soft) {
    border-color: #d7e4f5;
    background: #edf4ff;
}
.btn:not(.btn-primary):not(.btn-danger):not(.btn-danger-soft):not(.btn-success-soft):not(.btn-soft):hover {
    border-color: #b7cfee;
    background: #e2eeff;
}
.btn-ghost { background: #f2f5fa !important; border-color: #e1e7f0 !important; }
.btn-ghost:hover { background: #e8eef7 !important; border-color: #cbd6e5 !important; }
.btn-soft {
    border-color: #d6e5fa;
    background: #edf5ff;
    color: #254e80;
}
.btn-success-soft {
    border-color: #c7e9d7;
    background: #e8f7ef;
    color: #17653f;
}
.btn-success-soft:hover { border-color: #a4d8bb; background: #d8f1e4; }
.btn-danger-soft {
    border-color: #f0d2cf;
    background: #fff0ef;
    color: #922f29;
}
.btn-danger-soft:hover { border-color: #e7b6b1; background: #ffe4e1; }

.field > label {
    color: var(--muted);
    font-weight: 600;
}
.saved-location-controls {
    display: flex;
    align-items: stretch;
    gap: 8px;
}
.saved-location-controls select { flex: 1; }
.saved-location-confirm {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
    padding: 10px 12px;
    border: 1px solid #f0d2cf;
    border-radius: 10px;
    background: #fff7f6;
    color: #7d332e;
    font-size: 13px;
}
.saved-location-confirm .row { align-items: center; }

.participants-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}
.participants-summary-row p { margin: 0; }
.participants-confirmed-list {
    margin: 8px 0 0;
    padding: 10px 10px 10px 30px;
    border: 1px solid #dce8f7;
    border-radius: 10px;
    background: #f5f9ff;
    color: #40516b;
    font-size: 13px;
}
.participants-confirmed-list li + li { margin-top: 4px; }

.picker-dialog { z-index: 1200; }
.leaflet-top,
.leaflet-bottom { z-index: 600; }
.picker-dialog:not(.hidden) .picker-dialog-panel {
    animation: dialog-enter .24s cubic-bezier(.2, .75, .25, 1) both;
}
@keyframes dialog-enter {
    from { opacity: 0; transform: translateY(12px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.code-inputs {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 9px;
}
.code-digit {
    min-width: 0;
    min-height: 58px;
    padding: 8px 4px;
    border-color: #d7e4f5;
    background: #f7faff;
    text-align: center;
    font-size: 26px;
    font-weight: 750;
}
.field-error { color: var(--bad); }
@media (max-width: 420px) {
    .code-inputs { gap: 6px; }
    .code-digit { min-height: 52px; font-size: 23px; }
    .saved-location-controls { flex-wrap: wrap; }
    .saved-location-controls select { flex-basis: 100%; }
    .saved-location-confirm { align-items: flex-start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
    .picker-dialog:not(.hidden) .picker-dialog-panel { animation: none; }
}

/* ---------------------------------------------------------------- dashboard shell v3 */
.bottom-nav { display: none; }

.dashboard-welcome h1 { margin-bottom: 5px; }
.dashboard-welcome p { margin: 0; }

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.summary-card {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    min-height: 92px;
    padding: 16px;
    border: 1px solid #e2e8f2;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(31, 56, 100, .06);
    color: var(--text);
}
.summary-card:hover { border-color: #bdd1ea; text-decoration: none; transform: translateY(-1px); }
.summary-card span:last-child { display: grid; min-width: 0; }
.summary-card strong { font-size: 27px; line-height: 1; color: var(--navy); }
.summary-card small { margin-top: 7px; color: var(--muted); font-size: 12.5px; font-weight: 650; }
.summary-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    border-radius: 12px;
    background: #e8f1ff;
    color: var(--navy);
}
.summary-icon .icon { width: 21px; height: 21px; }
.summary-pending .summary-icon { background: #fff1d9; color: #9a6200; }
.summary-completed .summary-icon { background: #dff3e7; color: #1e7f4f; }
.summary-overdue .summary-icon { background: #fde8e6; color: #a8281f; }

.telegram-notice {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid #efdcb4;
    border-radius: 14px;
    background: #fff9ec;
}
.telegram-notice div { display: grid; gap: 2px; }
.telegram-notice strong { color: #6e500f; }
.telegram-notice div span { color: #7a6742; font-size: 13px; }
.telegram-notice-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #f4dfb3;
    color: #84601b;
}
.telegram-notice-icon .icon { width: 21px; height: 21px; }
.telegram-connected { border-color: #bfdfcb; background: #eff9f3; grid-template-columns: 42px minmax(0, 1fr); }
.telegram-connected strong { color: var(--ok); }
.telegram-connected div span { color: #4f7861; }
.telegram-connected .telegram-notice-icon { background: #d9eddf; color: var(--ok); }

.dashboard-section { margin-bottom: 18px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-heading h2 { margin: 0; }
.empty-state {
    display: grid;
    justify-items: center;
    gap: 8px;
    min-height: 140px;
    place-content: center;
    border: 1px dashed #d9e2ef;
    border-radius: 12px;
    background: #fafcff;
    color: var(--muted);
    text-align: center;
}
.empty-state > span {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #edf4fc;
    color: #6680a6;
}
.empty-state .icon { width: 21px; height: 21px; }
.empty-state p { margin: 0; }

@media (min-width: 1200px) {
    body:not(.auth-page) .topbar {
        position: fixed;
        inset: 0 auto 0 0;
        width: 232px;
        height: 100vh;
        border-right: 1px solid #e1e8f2;
        border-bottom: 0;
    }
    body:not(.auth-page) .topbar-inner {
        width: 232px;
        height: 100%;
        margin: 0;
        padding: 18px 14px 14px;
        flex-direction: column;
        align-items: stretch;
        gap: 18px;
    }
    body:not(.auth-page) .brand { justify-content: center; }
    body:not(.auth-page) .brand-word { width: 132px; height: 28px; }
    body:not(.auth-page) .nav {
        order: 0;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }
    body:not(.auth-page) .nav > a,
    body:not(.auth-page) .nav-more > summary {
        width: 100%;
        height: 44px;
        justify-content: flex-start;
        padding: 0 12px;
    }
    body:not(.auth-page) .nav > a.active::after,
    body:not(.auth-page) .nav-more.active > summary::after {
        left: auto;
        right: 6px;
        bottom: 11px;
        width: 3px;
        height: 22px;
    }
    body:not(.auth-page) .nav-more-menu { top: 2px; left: calc(100% + 8px); }
    body:not(.auth-page) .topbar-right {
        position: fixed;
        top: 10px;
        right: 20px;
        z-index: 45;
        width: auto;
        margin: 0;
        padding: 0;
        border: 0;
        justify-content: flex-end;
    }
    body:not(.auth-page) .usermenu { display: block; margin-left: 0; }
    body:not(.auth-page) .page-banner,
    body:not(.auth-page) .wrap,
    body:not(.auth-page) .foot { margin-left: 232px; width: calc(100% - 232px); }
    body:not(.auth-page) .page-banner-inner,
    body:not(.auth-page) .wrap,
    body:not(.auth-page) .foot { max-width: 1240px; }
}

@media (min-width: 768px) and (max-width: 1199px) {
    body:not(.auth-page) .topbar {
        position: fixed;
        inset: 0 auto 0 0;
        width: 82px;
        height: 100vh;
        border-right: 1px solid #e1e8f2;
        border-bottom: 0;
    }
    body:not(.auth-page) .topbar-inner {
        width: 82px;
        height: 100%;
        margin: 0;
        padding: 14px 8px;
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }
    body:not(.auth-page) .brand-divider,
    body:not(.auth-page) .brand-word,
    body:not(.auth-page) .nav span,
    body:not(.auth-page) .nav-caret,
    body:not(.auth-page) .usermenu-name,
    body:not(.auth-page) .usermenu-caret,
    body:not(.auth-page) .topbar-sep { display: none; }
    body:not(.auth-page) .brand-icon { width: 42px; height: 42px; }
    body:not(.auth-page) .nav {
        order: 0;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 5px;
    }
    body:not(.auth-page) .nav > a,
    body:not(.auth-page) .nav-more > summary {
        width: 48px;
        height: 44px;
        justify-content: center;
        padding: 0;
    }
    body:not(.auth-page) .nav .icon { width: 20px; height: 20px; }
    body:not(.auth-page) .nav-more-menu { left: 58px; top: 0; }
    body:not(.auth-page) .topbar-right {
        position: fixed;
        top: 10px;
        right: 12px;
        z-index: 45;
        width: auto;
        margin: 0;
        flex-direction: row;
    }
    body:not(.auth-page) .page-banner,
    body:not(.auth-page) .wrap,
    body:not(.auth-page) .foot { margin-left: 82px; width: calc(100% - 82px); }
}

@media (max-width: 767px) {
    body:not(.auth-page) .wrap { padding-bottom: 92px; }
    body:not(.auth-page) .foot { padding-bottom: 92px; }
    .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .summary-card { min-height: 82px; padding: 12px; }
    .summary-icon { width: 38px; height: 38px; }
    .summary-card strong { font-size: 24px; }
    .summary-card small { font-size: 11.5px; }
    .telegram-notice { grid-template-columns: 38px minmax(0, 1fr); padding: 12px; }
    .telegram-notice .btn { grid-column: 1 / -1; width: 100%; }
    .telegram-notice-icon { width: 38px; height: 38px; }
    .dashboard-section { padding: 16px; }
    .empty-state { min-height: 120px; }
    .bottom-nav {
        position: fixed;
        z-index: 80;
        left: 0;
        right: 0;
        bottom: 0;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        min-height: 68px;
        padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
        border-top: 1px solid #dde5f0;
        background: rgba(255, 255, 255, .96);
        backdrop-filter: blur(12px);
        box-shadow: 0 -8px 24px rgba(31, 56, 100, .08);
    }
    .bottom-nav a {
        display: grid;
        justify-items: center;
        align-content: center;
        gap: 3px;
        min-width: 0;
        border-radius: 10px;
        color: #69778f;
        font-size: 11.5px;
        font-weight: 700;
    }
    .bottom-nav a:hover { text-decoration: none; background: #f3f7fc; }
    .bottom-nav a.active { color: var(--navy); background: #edf4fd; }
    .bottom-nav .icon { width: 20px; height: 20px; }
}

@media (max-width: 420px) {
    .summary-card { gap: 8px; }
    .summary-icon { width: 34px; height: 34px; }
    .summary-card strong { font-size: 22px; }
}

/* ---------------------------------------------------------------- shared module refinement */
.page-head h1 { color: var(--navy); }
.filters {
    padding: 12px;
    border: 1px solid #e3e9f2;
    border-radius: 12px;
    background: #fafcff;
}
.field-inline > span { color: var(--muted); font-weight: 700; }
.stats-grid .stat {
    display: grid;
    gap: 5px;
    min-height: 88px;
    align-content: center;
}
.review { border-left: 4px solid #9ab9dc; }
.review .review-head { padding-bottom: 12px; border-bottom: 1px solid #edf1f6; }
.review .row { justify-content: flex-start; }
.review .btn-danger { box-shadow: 0 5px 12px rgba(168, 40, 31, .12); }
.channel { border-radius: 10px; }

@media (min-width: 768px) {
    body:not(.auth-page) .topbar-inner {
        overflow: visible;
    }

    body:not(.auth-page) .topbar-inner > .topbar-right {
        position: fixed;
        inset: 10px 20px auto auto;
        z-index: 70;
        width: auto;
        max-width: calc(100vw - 40px);
        margin: 0;
        padding: 0;
        border: 0;
        flex-direction: row;
    }

    body:not(.auth-page) .topbar-inner > .topbar-right + * {
        margin: 0;
    }
}

@media (max-width: 767px) {
    .page-head { margin-bottom: 14px; }
    .filters {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }
    .filters .field-inline,
    .filters .btn { width: 100%; }
    .filters .btn { margin: 0; }
    .grid.grid-2,
    .grid.grid-4,
    .stats-grid { grid-template-columns: 1fr; }
    .stats-grid { gap: 10px; }
    .stats-grid .stat { min-height: 76px; }
    .table {
        display: block;
        overflow-x: visible;
        white-space: normal;
    }
    .table thead { display: none; }
    .table tbody,
    .table tr,
    .table td { display: block; width: 100%; }
    .table tbody { display: grid; gap: 10px; }
    .table tr {
        padding: 12px;
        border: 1px solid #e3e9f2;
        border-radius: 12px;
        background: #fff;
    }
    .table td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 12px;
        padding: 5px 0;
        border: 0;
        text-align: right;
    }
    .table td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        color: var(--muted);
        font-size: 12px;
        font-weight: 700;
        text-align: left;
    }
    .table td:not([data-label]) { text-align: left; }
    .review { padding: 16px; }
    .review-head { flex-direction: column; }
    .review .kv { margin-bottom: 12px; }
    .review .row,
    .review .row .btn { width: 100%; }
    .channel { align-items: flex-start; }
    .channel .row { width: 100%; }
}
