*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #1f2937 0, #020617 55%, #000 100%);
    color: #e5e7eb;
}

a {
    color: #38bdf8;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.app-shell {
    min-height: 100vh;
}

/* ===== Shell: sidebar + content (╨░╨▓╤В╨╛╤А╨╕╨╖╨╛╨▓╨░╨╜╨╜╤Л╨╣ ╨┐╨╛╨╗╤М╨╖╨╛╨▓╨░╤В╨╡╨╗╤М) ===== */
.app-shell--sidebar {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: 260px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: rgba(15, 23, 42, 0.96);
    border-right: 1px solid rgba(148, 163, 184, 0.18);
    position: sticky;
    top: 0;
    align-self: flex-start;
    min-height: 100vh;
    z-index: 20;
    transition: width 180ms ease;
}

html[data-sidebar-collapsed="true"] .app-sidebar {
    width: 64px;
    overflow: visible;
    z-index: 3000;
}

.sidebar-top {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.65rem 0.55rem 0.55rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.sidebar-collapse-toggle {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.125rem;
    height: 2.125rem;
    padding: 0;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 0.5rem;
    background: rgba(30, 41, 59, 0.72);
    color: #e2e8f0;
    cursor: pointer;
    box-shadow: none;
    transition:
        background-color 120ms ease,
        border-color 120ms ease,
        color 120ms ease,
        transform 80ms ease;
}

.sidebar-collapse-toggle:hover {
    background: rgba(51, 65, 85, 0.95);
    border-color: rgba(148, 163, 184, 0.5);
    color: #ffffff;
    box-shadow: none;
}

.sidebar-collapse-toggle:active {
    transform: scale(0.94);
    background: rgba(15, 23, 42, 0.95);
}

.sidebar-collapse-toggle:focus {
    outline: none;
}

.sidebar-collapse-toggle:focus-visible {
    outline: 2px solid #38bdf8;
    outline-offset: 2px;
    box-shadow: none;
}

.sidebar-collapse-icon {
    width: 1.05rem;
    height: 1.05rem;
    flex-shrink: 0;
}

.sidebar-collapse-icon--collapsed {
    display: none;
}

html[data-sidebar-collapsed="true"] .sidebar-collapse-icon--expanded {
    display: none;
}

html[data-sidebar-collapsed="true"] .sidebar-collapse-icon--collapsed {
    display: block;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex: 1 1 auto;
    min-width: 0;
    padding: 0.15rem 0.25rem;
    text-decoration: none;
    color: #e5e7eb;
}

.sidebar-brand:hover {
    text-decoration: none;
    color: #ffffff;
}

.sidebar-brand img {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 0.45rem;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.35);
}

.sidebar-brand-text {
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.88rem;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.env-badge {
    display: inline-block;
    padding: 0.12rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1;
    vertical-align: middle;
    text-transform: lowercase;
}

.env-badge--dev {
    color: #fef3c7;
    background: #b45309;
    box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.35);
    text-transform: uppercase;
}

.app-logo .env-badge,
.sidebar-brand-text .env-badge {
    flex-shrink: 0;
}

.sidebar-nav {
    flex: 1;
    padding: 0.65rem 0.55rem 1rem;
    overflow-y: auto;
}

.sidebar-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-nav-item {
    margin: 0.12rem 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    padding: 0.62rem 0.85rem;
    border-radius: 0.55rem;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.92rem;
    line-height: 1.25;
    transition: background-color 120ms ease, color 120ms ease;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    text-decoration: none;
    background: rgba(148, 163, 184, 0.12);
    color: #f8fafc;
}

.sidebar-link.is-active {
    background: rgba(56, 189, 248, 0.14);
    color: #f8fafc;
    border-left-color: #38bdf8;
    padding-left: calc(0.85rem - 3px);
}

.sidebar-icon {
    flex: 0 0 auto;
    width: 1.25rem;
    height: 1.25rem;
    opacity: 0.92;
}

.sidebar-icon svg {
    display: block;
    width: 100%;
    height: 100%;
}

.sidebar-label {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 140ms ease;
}

html[data-sidebar-collapsed="true"] .sidebar-brand-text,
html[data-sidebar-collapsed="true"] .sidebar-label,
html[data-sidebar-collapsed="true"] .sidebar-group-chevron,
html[data-sidebar-collapsed="true"] .sidebar-badge {
    display: none;
}

html[data-sidebar-collapsed="true"] .sidebar-top {
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.35rem 0.45rem;
}

html[data-sidebar-collapsed="true"] .sidebar-brand {
    justify-content: center;
    padding: 0;
}

html[data-sidebar-collapsed="true"] .sidebar-nav {
    padding-left: 0.35rem;
    padding-right: 0.35rem;
    overflow: visible;
}

html[data-sidebar-collapsed="true"] .sidebar-nav-list {
    overflow: visible;
}

html[data-sidebar-collapsed="true"] .sidebar-link,
html[data-sidebar-collapsed="true"] .sidebar-group-toggle {
    justify-content: center;
    gap: 0;
    padding-left: 0.55rem;
    padding-right: 0.55rem;
}

html[data-sidebar-collapsed="true"] .sidebar-link.is-active {
    border-left-color: transparent;
    padding-left: 0.55rem;
}

html[data-sidebar-collapsed="true"] .sidebar-group.is-open {
    border: none;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}

html[data-sidebar-collapsed="true"] .sidebar-group.is-open > .sidebar-group-toggle {
    background: transparent;
    border-radius: 0.55rem;
    box-shadow: none;
}

html[data-sidebar-collapsed="true"] .sidebar-group.is-open.is-active > .sidebar-group-toggle {
    background: rgba(56, 189, 248, 0.14);
    box-shadow: none;
    border-left: none;
}

html[data-sidebar-collapsed="true"] .sidebar-group {
    position: relative;
}

html[data-sidebar-collapsed="true"] .sidebar-group.is-flyout-open > .sidebar-group-toggle {
    background: rgba(148, 163, 184, 0.12);
    color: #f8fafc;
}

html[data-sidebar-collapsed="true"] .sidebar-group.is-flyout-open.is-active > .sidebar-group-toggle {
    background: rgba(56, 189, 248, 0.14);
}

html[data-sidebar-collapsed="true"] .sidebar-group .sidebar-subnav {
    display: none;
}

html[data-sidebar-collapsed="true"] .sidebar-group.is-flyout-open .sidebar-subnav {
    display: block;
    position: fixed;
    min-width: 220px;
    margin: 0;
    padding: 0.35rem;
    border-radius: 0.65rem;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.98);
    box-shadow: 0 12px 32px rgba(2, 6, 23, 0.45);
    z-index: 4000;
}

html[data-sidebar-collapsed="true"] .sidebar-group.is-flyout-open .sidebar-subnav::before {
    content: "";
    position: absolute;
    left: -14px;
    top: 0;
    width: 14px;
    height: 100%;
}

html[data-sidebar-collapsed="true"] .sidebar-group.is-flyout-open .sidebar-subnav .sidebar-link {
    justify-content: flex-start;
    gap: 0.65rem;
    padding-left: 0.65rem;
    border-left: 3px solid transparent;
}

html[data-sidebar-collapsed="true"] .sidebar-group.is-flyout-open .sidebar-subnav .sidebar-link.is-active {
    border-left-color: #38bdf8;
    padding-left: calc(0.65rem - 3px);
}

html[data-sidebar-collapsed="true"] .sidebar-group.is-flyout-open .sidebar-subnav .sidebar-label {
    display: inline;
}

html[data-sidebar-collapsed="true"] .sidebar-link[data-tooltip] {
    position: relative;
}

html[data-sidebar-collapsed="true"] .sidebar-link[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    z-index: 45;
    padding: 0.35rem 0.55rem;
    border-radius: 0.45rem;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: #f8fafc;
    font-size: 0.82rem;
    line-height: 1.2;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 8px 20px rgba(2, 6, 23, 0.35);
}

html[data-sidebar-collapsed="true"] .sidebar-group-toggle[data-tooltip]:hover::after {
    display: none;
}

html[data-sidebar-collapsed="true"] .sidebar-subnav .sidebar-link[data-tooltip]:hover::after {
    display: none;
    content: none;
}

html[data-sidebar-collapsed="true"] .sidebar-link .sidebar-badge--dot:not([hidden]) {
    display: block;
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    width: 0.45rem;
    height: 0.45rem;
    min-width: 0;
    padding: 0;
    margin: 0;
    border-radius: 999px;
    font-size: 0;
    line-height: 0;
}

/* ╨Ч╨░╨│╨╛╤В╨╛╨▓╨║╨░ ╨┐╨╛╨┤ ╨│╤А╤Г╨┐╨┐╤Л ╤Б ╨┐╨╛╨┤╨╝╨╡╨╜╤О (╨║╨░╨║ ╨╜╨░ iDistribution) */
.sidebar-group-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.62rem 0.85rem;
    border: none;
    border-radius: 0.55rem;
    background: transparent;
    color: #cbd5e1;
    font-size: 0.92rem;
    text-align: left;
    cursor: pointer;
    margin-top: 0;
    box-shadow: none;
    position: relative;
}

.sidebar-group-toggle:hover {
    background: rgba(148, 163, 184, 0.12);
    color: #f8fafc;
    transform: none;
    filter: none;
    box-shadow: none;
}

.sidebar-group-chevron {
    margin-left: auto;
    opacity: 0.55;
    font-size: 0.75rem;
    transition: transform 140ms ease;
}

.sidebar-group.is-open .sidebar-group-chevron {
    transform: rotate(180deg);
}

.sidebar-group.is-open {
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 0.65rem;
    background: rgba(15, 23, 42, 0.42);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    overflow: hidden;
}

.sidebar-group.is-open > .sidebar-group-toggle {
    border-radius: 0;
    background: rgba(148, 163, 184, 0.1);
}

.sidebar-group.is-open > .sidebar-group-toggle:hover {
    background: rgba(148, 163, 184, 0.16);
}

.sidebar-subnav {
    list-style: none;
    margin: 0;
    padding: 0.2rem 0.35rem 0.4rem;
}

.sidebar-group.is-open .sidebar-subnav {
    border-top: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(2, 6, 23, 0.22);
}

.sidebar-group:not(.is-open) .sidebar-subnav {
    display: none;
}

.sidebar-group.is-active > .sidebar-group-toggle {
    color: #f8fafc;
    background: rgba(56, 189, 248, 0.14);
}

.sidebar-group.is-open.is-active > .sidebar-group-toggle {
    background: rgba(56, 189, 248, 0.16);
    border-left: 3px solid #38bdf8;
    padding-left: calc(0.85rem - 3px);
}

.sidebar-subnav .sidebar-link {
    padding: 0.48rem 0.65rem;
    font-size: 0.86rem;
    gap: 0.65rem;
}

.sidebar-subnav .sidebar-icon {
    width: 1.1rem;
    height: 1.1rem;
    opacity: 0.88;
}

.app-workspace {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1.25rem;
    background: rgba(15, 23, 42, 0.55);
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 2500;
}

.app-toolbar-spacer {
    flex: 1;
}

.btn-toolbar-logout {
    margin-top: 0;
    padding: 0.4rem 1rem;
    font-size: 0.82rem;
    background: rgba(55, 65, 81, 0.85);
    box-shadow: none;
}

.btn-toolbar-logout:hover {
    box-shadow: none;
    filter: brightness(1.12);
}

/* ===== Guest shell (╤Б╤В╤А╨░╨╜╨╕╤Ж╨░ ╨▓╤Е╨╛╨┤╨░) ===== */
.app-shell--guest {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-guest-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: rgba(15, 23, 42, 0.9);
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.app-main--guest {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    max-width: 480px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    width: 100%;
}

/* Legacy header (╨╜╨╡ ╨╕╤Б╨┐╨╛╨╗╤М╨╖╤Г╨╡╤В╤Б╤П ╨▓ sidebar-layout, ╨╛╤Б╤В╨░╨▓╨╗╨╡╨╜╨╛ ╨┤╨╗╤П ╤Б╨╛╨▓╨╝╨╡╤Б╤В╨╕╨╝╨╛╤Б╤В╨╕) */
.app-header {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.app-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.app-nav {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    flex-shrink: 0;
}

.theme-toggle {
    margin-top: 0;
    padding: 0.35rem 0.65rem;
    min-width: 2.25rem;
    font-size: 1.05rem;
    line-height: 1;
    background: rgba(55, 65, 81, 0.65);
    box-shadow: none;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 999px;
}

.theme-toggle:hover {
    transform: none;
    filter: brightness(1.12);
    box-shadow: none;
}

.theme-toggle:active {
    transform: none;
    box-shadow: none;
}

.app-header-inner.wide-layout,
.app-main.wide-layout {
    max-width: none;
    width: 100%;
}

.app-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 0.95rem;
    color: #e5e7eb;
}

.app-logo img {
    width: 2rem;
    height: 2rem;
    border-radius: 0.45rem;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.35);
}

.app-nav a {
    margin-left: 1rem;
    font-size: 0.9rem;
    color: #cbd5f5;
}

.app-nav a:hover {
    color: #ffffff;
}

.logout-form {
    margin-left: 0;
}

.app-main {
    flex: 1;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 1.25rem 1.25rem 2rem;
}

.app-main:not(.wide-layout) .card {
    max-width: 1100px;
    margin: 0 auto;
}

.card {
    background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.98));
    border-radius: 1rem;
    padding: 1.5rem 1.75rem 2rem;
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.shadow {
    box-shadow:
        0 18px 45px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(15, 23, 42, 0.9);
}

h1 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
}

form .form-row {
    display: flex;
    gap: 1rem;
}

label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
}

input {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(55, 65, 81, 0.9);
    background: rgba(15, 23, 42, 0.8);
    color: #e5e7eb;
}

input:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.65);
}

button {
    border: none;
    border-radius: 999px;
    padding: 0.45rem 1.2rem;
    margin-top: 0.6rem;
    background: linear-gradient(to right, #38bdf8, #6366f1);
    color: white;
    font-size: 0.85rem;
    cursor: pointer;
    box-shadow: 0 12px 25px rgba(59, 130, 246, 0.45);
    transition: transform 0.08s ease-out, box-shadow 0.08s ease-out, filter 0.08s;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 35px rgba(59, 130, 246, 0.6);
    filter: brightness(1.05);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 10px 18px rgba(59, 130, 246, 0.4);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0;
    font-size: 0.85rem;
}

th,
td {
    padding: 0.55rem 0.75rem;
    text-align: left;
    vertical-align: middle;
}

th {
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    border-bottom: 1px solid rgba(55, 65, 81, 0.9);
    white-space: nowrap;
    background: rgba(15, 23, 42, 0.95);
    position: sticky;
    top: 0;
    z-index: 1;
}

tbody tr {
    border-bottom: 1px solid rgba(31, 41, 55, 0.9);
}

tbody tr:nth-child(2n) {
    background: rgba(15, 23, 42, 0.8);
}

tbody tr:hover {
    background: linear-gradient(to right, rgba(15, 23, 42, 0.95), rgba(30, 64, 175, 0.4));
}

/* ===== Data tables: wrapper + columns ===== */
.table-wrap {
    margin: 0 0 0.5rem;
    border: 1px solid rgba(55, 65, 81, 0.7);
    border-radius: 0.6rem;
    overflow-x: auto;
    overflow-y: visible;
    max-height: 70vh;
    overflow-y: auto;
    background: rgba(15, 23, 42, 0.55);
}

.data-table {
    min-width: 1180px;
}

.data-table .mono,
.data-table td.mono {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 0.78rem;
    color: #e2e8f0;
}

.cell-name {
    font-weight: 500;
}

/* ╨и╨╕╤А╨╕╨╜╨░ ╨┐╨╛ ╤Б╨░╨╝╨╛╨╝╤Г ╨┤╨╗╨╕╨╜╨╜╨╛╨╝╤Г ╨╜╨░╨╖╨▓╨░╨╜╨╕╤О ╨▓ ╤В╨░╨▒╨╗╨╕╤Ж╨╡ */
.data-table .col-product-name {
    width: 1%;
    white-space: nowrap;
    padding-right: 1.25rem;
}

.toolbar-check {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    color: var(--text-muted, #94a3b8);
    white-space: nowrap;
    user-select: none;
    cursor: pointer;
}

.toolbar-check input {
    margin: 0;
    accent-color: #38bdf8;
}

.cell-nowrap {
    white-space: nowrap;
}

.col-id {
    width: 120px;
}

.col-coords {
    width: 180px;
    white-space: nowrap;
}

.col-num {
    text-align: right;
    width: 110px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.data-table th .th-sort {
    color: inherit;
    text-decoration: none;
    display: inline-block;
    padding: 2px 4px;
    border-radius: 4px;
}

.data-table th .th-sort:hover {
    background: rgba(56, 189, 248, 0.12);
    color: #e2e8f0;
}

.col-actions {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}

.weekly-route-table {
    min-width: 0;
    width: 100%;
}

.weekly-route-table .col-actions {
    width: 7.5rem;
}

.row-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.3rem;
}

.row-action-btn {
    margin-top: 0;
    min-width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border-radius: 0.4rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(248, 250, 252, 0.04);
    box-shadow: none;
    transform: none;
    font-size: 0.9rem;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.row-action-btn:hover {
    transform: none;
    box-shadow: none;
    filter: none;
    background: rgba(148, 163, 184, 0.14);
    border-color: rgba(148, 163, 184, 0.5);
    color: #e2e8f0;
}

.row-action-btn-danger {
    color: #f87171;
}

.row-action-btn-danger:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(248, 113, 113, 0.45);
    color: #fca5a5;
}

.btn-sm {
    padding: 0.25rem 0.55rem;
    font-size: 0.85rem;
}

.btn-icon {
    min-width: 2rem;
    padding: 0.2rem 0.45rem;
    font-size: 1rem;
    line-height: 1.2;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.5);
    color: inherit;
    cursor: pointer;
}

.btn-icon:hover {
    background: rgba(56, 189, 248, 0.15);
}

.btn-danger-text {
    color: #f87171;
}

.weekday-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0.75rem 0 1rem;
}

.weekday-tab {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    min-width: 3.25rem;
    padding: 0.45rem 0.65rem;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.45);
    color: inherit;
    text-decoration: none;
    font-size: 0.9rem;
}

.weekday-tab:hover {
    border-color: rgba(56, 189, 248, 0.5);
    background: rgba(56, 189, 248, 0.08);
}

.weekday-tab.is-active {
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.18);
    font-weight: 600;
}

.weekday-tab-count {
    font-size: 0.75rem;
    opacity: 0.75;
}

.weekday-tab.has-issues {
    border-color: rgba(251, 191, 36, 0.55);
}

.weekday-tab-issue {
    margin-top: 0.15rem;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    color: #fbbf24;
}

.weekday-tab-delivery {
    margin-top: 0.12rem;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
    color: #7dd3fc;
}
.weekday-tab-delivery--77 { color: #7dd3fc; }
.weekday-tab-delivery--83 { color: #86efac; }

.visit-route-delivery-offset {
    margin: 0 0 1rem;
    padding: 0.85rem 1rem;
    border-radius: 0.65rem;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(15, 23, 42, 0.35);
}

.visit-route-subsection-title {
    margin: 0 0 0.35rem;
    font-size: 1rem;
}

.visit-route-delivery-hint {
    margin: 0 0 0.75rem;
    font-size: 0.88rem;
}

.visit-route-delivery-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem 1rem;
}

.visit-route-delivery-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 16rem;
}

.visit-route-delivery-field select {
    min-height: 2.4rem;
}

.visit-route-health-banner {
    margin: 0.75rem 0 1rem;
}

.visit-route-list-issue {
    margin-left: 0.5rem;
    vertical-align: middle;
}

.visit-route-list-agents {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.15rem 0.35rem;
    font-size: 0.92rem;
    color: var(--text-muted, #94a3b8);
    min-width: 0;
}

.visit-route-list-agents-sep {
    opacity: 0.55;
}

.visit-route-list-agent-link {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dotted rgba(148, 163, 184, 0.55);
}

.visit-route-list-agent-link:hover {
    color: var(--link-color, #93c5fd);
    border-bottom-color: currentColor;
}

.data-table tr.route-item-issue td {
    background: rgba(251, 191, 36, 0.08);
}

.route-item-issue-cell {
    max-width: 22rem;
}

.route-item-issue-badge {
    display: inline-block;
    white-space: normal;
    line-height: 1.35;
    text-align: left;
}

.weekly-agent-list {
    list-style: none;
    margin: 0 0 0.5rem;
    padding: 0;
    border: 1px solid rgba(55, 65, 81, 0.7);
    border-radius: 0.6rem;
    background: rgba(15, 23, 42, 0.55);
    overflow: hidden;
}

.weekly-agent-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid rgba(55, 65, 81, 0.45);
}

.weekly-agent-row:last-child {
    border-bottom: none;
}

.weekly-agent-main {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    min-width: 0;
    flex: 1 1 auto;
}

.weekly-agent-name {
    font-weight: 500;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.weekly-agent-count {
    flex-shrink: 0;
    font-size: 0.82rem;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.weekly-agent-configure {
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .weekly-agent-row {
        padding: 0.6rem 0.65rem;
        gap: 0.5rem;
    }

    .weekly-agent-count {
        font-size: 0.78rem;
    }
}

.col-when {
    width: 160px;
}

.text-danger {
    color: #f87171;
    margin-top: 0.5rem;
}

.logs-summary {
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
    color: #cbd5e1;
}

.logs-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 0.75rem;
}

.logs-filter-label {
    font-size: 0.9rem;
    color: #fbbf24;
}

.api-logs-table .api-log-preview {
    max-width: 28rem;
    white-space: normal;
    word-break: break-word;
    font-size: 0.82rem;
}

.data-table tr.api-log-row-issue td {
    background: rgba(251, 191, 36, 0.08);
}

.data-table tr.api-log-row-issue td:last-child {
    color: #fde68a;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    margin: 0 0 1rem;
    font-size: 0.85rem;
}

.pagination-link,
.pagination-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    padding: 0.35rem 0.55rem;
    border-radius: 0.45rem;
    border: 1px solid rgba(55, 65, 81, 0.85);
    background: rgba(15, 23, 42, 0.65);
    color: #e5e7eb;
}

.pagination-num:hover {
    border-color: rgba(56, 189, 248, 0.65);
    background: rgba(30, 58, 138, 0.35);
}

.pagination-link.is-disabled,
.pagination-link.is-disabled:hover {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
    border-color: rgba(55, 65, 81, 0.5);
}

.pagination-current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    padding: 0.35rem 0.55rem;
    border-radius: 0.45rem;
    border: 1px solid rgba(56, 189, 248, 0.55);
    background: rgba(30, 64, 175, 0.45);
    font-weight: 600;
    color: #f8fafc;
}

.pagination-gap {
    padding: 0 0.15rem;
    color: #6b7280;
    user-select: none;
}

.pagination-footer {
    margin-top: 1rem;
}

/* ===== Toolbar / search ===== */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.85rem;
    padding: 0.65rem 0.85rem;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(55, 65, 81, 0.6);
    border-radius: 0.7rem;
}

.toolbar-spacer {
    flex: 1;
}

.toolbar-actions {
    margin-top: -0.35rem;
}

.toolbar-inline-form,
.inline-form {
    margin: 0;
    display: inline-flex;
}

.search-input {
    flex: 1 1 320px;
    max-width: 520px;
    margin: 0;
}

.toolbar-label {
    font-size: 0.85rem;
    color: #94a3b8;
    white-space: nowrap;
}

.toolbar-select {
    flex: 0 1 260px;
    max-width: 320px;
    min-width: 180px;
    margin: 0;
}

.col-thumb {
    width: 56px;
    text-align: center;
    vertical-align: middle;
}

.product-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 0.4rem;
    box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.25);
    background: rgba(15, 23, 42, 0.9);
}

.product-photo-block {
    min-width: 0;
}

.product-photo-block input[type="file"] {
    max-width: 100%;
    font-size: 0.85rem;
}

.product-photo-preview-wrap {
    margin-top: 0.55rem;
}

.product-photo-preview-wrap[hidden] {
    display: none !important;
}

.product-photo-preview {
    display: block;
    max-height: 160px;
    max-width: 100%;
    border-radius: 0.45rem;
    margin-top: 0.35rem;
    box-shadow: 0 0 0 1px rgba(55, 65, 81, 0.6);
}

/* ╨Ю╨┤╨╜╨░ ╤Б╤В╤А╨╛╨║╨░: ╤З╨╡╨║╨▒╨╛╨║╤Б + ╤В╨╡╨║╤Б╤В, ╨▒╨╡╨╖ ┬л╨╗╨╡╤Б╤В╨╜╨╕╤Ж╤Л┬╗ ╨╕ ╨╛╨▒╤А╨╡╨╖╨║╨╕ ╨▓ ╤Г╨╖╨║╨╛╨╣ ╨║╨╛╨╗╨╛╨╜╨║╨╡ */
.product-remove-photo-row {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(55, 65, 81, 0.55);
    width: 100%;
    box-sizing: border-box;
}

.product-remove-photo-option {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.55rem;
    margin: 0;
    max-width: 100%;
    font-size: 0.87rem;
    font-weight: 400;
    color: #cbd5e1;
    cursor: pointer;
    line-height: 1.4;
}

.product-remove-photo-option input[type="checkbox"] {
    margin: 0.15rem 0 0;
    flex: 0 0 auto;
    width: 1rem;
    height: 1rem;
    accent-color: #94a3b8;
}

.product-remove-photo-option span {
    flex: 1 1 auto;
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.toolbar button,
.toolbar .btn-link {
    margin-top: 0;
}

.btn-link {
    color: #cbd5e1;
    text-decoration: underline;
    font-size: 0.85rem;
}

.btn-link:hover {
    color: #ffffff;
}

.btn-add {
    background: linear-gradient(to right, #22c55e, #16a34a);
    box-shadow: 0 12px 25px rgba(34, 197, 94, 0.35);
}

.btn-add:hover {
    box-shadow: 0 16px 35px rgba(34, 197, 94, 0.5);
}

.btn-secondary {
    background: rgba(55, 65, 81, 0.85);
    box-shadow: none;
}

.btn-secondary:hover {
    box-shadow: none;
    filter: brightness(1.15);
}

.btn-edit {
    margin-top: 0;
    padding: 0.3rem 0.85rem;
    font-size: 0.78rem;
    box-shadow: none;
}

.btn-edit:hover {
    box-shadow: none;
    transform: none;
    filter: brightness(1.15);
}

/* ===== Modal dialog ===== */
.app-modal {
    border: none;
    border-radius: 1rem;
    padding: 0;
    background: #0f172a;
    color: #e5e7eb;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
    max-width: 760px;
    width: 95vw;
}

.app-modal::backdrop {
    background: rgba(2, 6, 23, 0.65);
    backdrop-filter: blur(2px);
}

.app-modal-form {
    padding: 1.25rem 1.5rem 1.5rem;
}

.app-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(55, 65, 81, 0.6);
    padding-bottom: 0.65rem;
}

.app-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.app-modal-close {
    background: transparent;
    border: none;
    color: #cbd5e1;
    font-size: 1.5rem;
    line-height: 1;
    padding: 0.15rem 0.55rem;
    cursor: pointer;
    margin-top: 0;
    box-shadow: none;
    border-radius: 0.4rem;
}

.app-modal-close:hover {
    background: rgba(148, 163, 184, 0.18);
    color: #ffffff;
    transform: none;
    box-shadow: none;
}

.app-modal-meta {
    margin: 0 0 0.85rem;
    font-size: 0.8rem;
    color: #9ca3af;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.85rem;
}

.app-modal-meta .meta-label {
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.app-modal-meta code {
    background: rgba(15, 23, 42, 0.85);
    padding: 0.1rem 0.4rem;
    border-radius: 0.35rem;
    color: #e5e7eb;
    font-size: 0.85rem;
}

.app-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: 1.3rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(55, 65, 81, 0.6);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1rem;
}

.form-col-2 {
    grid-column: span 2;
}

.product-packaging-block {
    padding-top: 0.25rem;
    border-top: 1px solid var(--border-subtle, #e5e7eb);
}

.product-packaging-title {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    font-weight: 600;
}

.product-packaging-grid {
    margin-top: 0.5rem;
}

@media (max-width: 560px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-col-2 {
        grid-column: span 1;
    }
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.15rem 0.4rem;
    margin-top: 0.35rem;
    padding: 0.5rem;
    border: 1px solid rgba(55, 65, 81, 0.6);
    border-radius: 0.5rem;
    background: rgba(15, 23, 42, 0.45);
    max-height: 260px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* ===== Picker (╤Б╨┐╨╕╤Б╨╛╨║ ╤Б ╨┐╨╛╨╕╤Б╨║╨╛╨╝ ╨╕ ╨║╨╜╨╛╨┐╨║╨░╨╝╨╕ ┬л╨Т╤Б╨╡/╨Э╨╕╨║╤В╨╛┬╗) ===== */
.picker-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.picker-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
}

.picker-title {
    font-weight: 500;
    color: #e5e7eb;
    margin: 0;
}

.picker-counter {
    font-size: 0.78rem;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
}

.picker-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.picker-search {
    flex: 1 1 220px;
    min-width: 0;
    margin: 0;
    padding: 0.45rem 0.7rem;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(55, 65, 81, 0.7);
    border-radius: 0.45rem;
    color: #e5e7eb;
    font-size: 0.85rem;
}

.picker-search:focus {
    outline: none;
    border-color: rgba(56, 189, 248, 0.7);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.18);
}

.btn-mini {
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
    border-radius: 0.4rem;
    margin: 0;
    box-shadow: none;
    flex: 0 0 auto;
}

.btn-mini:hover {
    filter: brightness(1.15);
}

.picker-section .checkbox-grid {
    margin-top: 0;
}

.picker-section [data-picker-item][hidden] {
    display: none !important;
}

.picker-empty {
    margin: 0.4rem 0 0;
    font-size: 0.82rem;
    color: #94a3b8;
}

/* Store picker (weekly routes and similar large lists) */
.picker-root {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    min-width: 0;
}

.picker-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.picker-toolbar .picker-search {
    flex: 1 1 220px;
    min-width: 0;
    width: auto;
    margin: 0;
}

.picker-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.picker-hint {
    margin: 0;
    font-size: 0.78rem;
}

.picker-list {
    max-height: min(52vh, 420px);
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid rgba(55, 65, 81, 0.65);
    border-radius: 0.55rem;
    background: rgba(15, 23, 42, 0.35);
}

.picker-sentinel {
    height: 1px;
    margin-top: -1px;
    pointer-events: none;
}

.picker-status {
    margin: 0.35rem 0 0;
    font-size: 0.78rem;
    text-align: center;
}

.picker-root [data-picker-item][hidden] {
    display: none !important;
}

.picker-root label.picker-item {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin: 0;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid rgba(55, 65, 81, 0.32);
    font-weight: 400;
    font-size: inherit;
    text-transform: none;
    letter-spacing: normal;
    color: #e5e7eb;
    cursor: pointer;
    transition: background-color 120ms ease;
}

.picker-root label.picker-item:last-child {
    border-bottom: none;
}

.picker-root label.picker-item:hover {
    background: rgba(56, 189, 248, 0.08);
}

.picker-root label.picker-item:has(input:checked) {
    background: rgba(56, 189, 248, 0.14);
}

.picker-root label.picker-item input[type="checkbox"] {
    width: 1.05rem;
    height: 1.05rem;
    min-width: 1.05rem;
    margin: 0.12rem 0 0;
    flex: 0 0 auto;
    padding: 0;
    accent-color: #38bdf8;
}

.picker-item-text {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    line-height: 1.35;
}

.picker-item-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #f1f5f9;
    overflow-wrap: anywhere;
}

.picker-item-meta {
    font-size: 0.78rem;
    color: #94a3b8;
    overflow-wrap: anywhere;
}

.app-modal-store-picker {
    max-width: min(720px, 96vw);
}

.app-modal-store-picker .app-modal-header h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.3;
    padding-right: 0.5rem;
}

.app-modal-store-picker .app-modal-body {
    min-width: 0;
}

.visit-route-section-title {
    margin: 1.25rem 0 0.65rem;
    font-size: 1rem;
    font-weight: 600;
}

.visit-route-meta-card,
.visit-route-assignments {
    margin-bottom: 1rem;
}

.visit-route-meta-form label,
.visit-route-assign-form label {
    text-transform: none;
    letter-spacing: normal;
    font-size: 0.85rem;
    color: #94a3b8;
}

.visit-route-notes-field {
    width: 100%;
}

.visit-route-meta-form .visit-route-notes {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 4.5rem;
    padding: 0.55rem 0.65rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(55, 65, 81, 0.9);
    background: rgba(15, 23, 42, 0.8);
    color: #e5e7eb;
    font: inherit;
    line-height: 1.45;
    resize: none;
    overflow: hidden;
    field-sizing: content;
}

.visit-route-meta-form .visit-route-notes:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.65);
}

.visit-route-meta-actions {
    display: flex;
    align-items: flex-end;
}

.visit-route-meta-actions button {
    margin-top: 0;
}

.visit-route-assign-form {
    margin-top: 0.75rem;
    align-items: end;
}

.visit-route-danger-zone {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(55, 65, 81, 0.45);
}

.visit-route-danger-zone button {
    margin-top: 0;
}

@media (max-width: 560px) {
    .picker-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .picker-toolbar-actions {
        justify-content: space-between;
    }
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0;
    padding: 0.35rem 0.55rem;
    min-width: 0;
    border-radius: 0.4rem;
    font-weight: 400;
    font-size: 0.86rem;
    line-height: 1.25;
    color: #e5e7eb;
    cursor: pointer;
    transition: background-color 120ms ease;
}

.checkbox-item:hover {
    background: rgba(56, 189, 248, 0.10);
}

.checkbox-item input[type="checkbox"] {
    margin: 0;
    flex: 0 0 auto;
    width: 1rem;
    height: 1rem;
    accent-color: #38bdf8;
}

.checkbox-item span {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}

.checkbox-item-inline {
    margin-top: 0.35rem;
}

.field-hint {
    margin: 0.35rem 0 0;
    font-size: 0.82rem;
    color: #94a3b8;
    line-height: 1.4;
}

.badge {
    display: inline-block;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-ok {
    background: rgba(34, 197, 94, 0.15);
    color: #86efac;
}

.badge-muted {
    background: rgba(148, 163, 184, 0.15);
    color: #cbd5e1;
}

.badge-warn {
    background: rgba(251, 191, 36, 0.15);
    color: #fde68a;
}

.data-table tr.store-row--removed td {
    background: rgba(251, 191, 36, 0.04);
}

.data-table .store-link-cell--removed {
    color: #94a3b8;
}

.store-removed-badge {
    margin-left: 0.35rem;
    vertical-align: middle;
}

.store-debt-excluded-badge {
    margin-left: 0.35rem;
    font-size: 0.75rem;
    vertical-align: middle;
}

.store-modal-debts-readonly .store-modal-debts-grid {
    margin-top: 0.35rem;
}

.store-modal-debt-value {
    font-variant-numeric: tabular-nums;
    padding: 0.45rem 0;
}

.store-status-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.data-table .col-status {
    min-width: 6.5rem;
}

.stores-removed-summary {
    color: #fde68a;
}

.route-observation-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: end;
    margin-bottom: 1rem;
}

.route-observation-summary {
    margin-bottom: 1rem;
}

.route-observation-extra td {
    opacity: 0.92;
}

.visit-detail-section {
    margin-top: 1.5rem;
}

.visit-detail-section + .visit-detail-section {
    padding-top: 0.25rem;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.visit-order-block + .visit-order-block {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px dashed rgba(148, 163, 184, 0.35);
}

.visit-photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.85rem;
}

.visit-photo-card {
    margin: 0;
    border-radius: 0.55rem;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.visit-photo-card img {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    background: rgba(148, 163, 184, 0.12);
}

.visit-photo-card figcaption {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.45rem 0.55rem;
    font-size: 0.72rem;
    color: #94a3b8;
}

.visit-photo-gps {
    font-size: 0.68rem;
}

.col-nowrap,
th.col-nowrap {
    white-space: nowrap;
}

.muted-note {
    color: #9ca3af;
    font-size: 0.85rem;
    margin: 0 0 0.85rem;
}

/* ===== Routes page ===== */
.routes-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
    margin: 0 0 0.85rem;
    padding: 0.65rem 0.85rem;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(55, 65, 81, 0.6);
    border-radius: 0.7rem;
}

.routes-filter-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 220px;
}

.routes-filter-field label {
    margin-bottom: 0;
}

.routes-agent-select {
    width: 100%;
    padding: 0.45rem 0.6rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(55, 65, 81, 0.9);
    background: rgba(15, 23, 42, 0.85);
    color: #e5e7eb;
    font-size: 0.9rem;
}

.routes-agent-select:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.65);
}

.routes-date-field .routes-date-input-wrap {
    display: flex;
    align-items: stretch;
    border: 1px solid rgba(55, 65, 81, 0.9);
    border-radius: 0.5rem;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.85);
    min-width: 200px;
}

.routes-date-field .routes-date-input-wrap:focus-within {
    border-color: #38bdf8;
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.4);
}

.routes-date-field input.routes-date-input,
.routes-date-field input.flatpickr-alt-input {
    flex: 1;
    border: none;
    padding: 0.45rem 0.65rem;
    font-size: 0.95rem;
    min-width: 0;
    outline: none;
    background: transparent;
    color: #e5e7eb;
    box-shadow: none !important;
    margin: 0;
    width: auto;
}

.routes-date-field button.routes-date-calendar-btn {
    border: none;
    border-left: 1px solid rgba(55, 65, 81, 0.9);
    background: rgba(30, 41, 55, 0.9);
    padding: 0 0.85rem;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    color: #e5e7eb;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
}

.routes-date-field button.routes-date-calendar-btn:hover {
    background: rgba(30, 58, 138, 0.5);
    transform: none;
    box-shadow: none;
}

.routes-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-left: auto;
    margin-top: 0;
}

.routes-filter-actions button {
    margin-top: 0;
}

.routes-grid {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.routes-sessions-card,
.routes-map-card {
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(55, 65, 81, 0.6);
    border-radius: 0.7rem;
    padding: 0.85rem 1rem 1rem;
    min-width: 0;
}

.routes-sessions-card {
    width: max-content;
    max-width: 100%;
}

.routes-sessions-card h3,
.routes-map-card h3 {
    margin: 0 0 0.6rem;
    font-size: 1rem;
}

.routes-sessions-scroll {
    max-height: 720px;
    overflow: auto;
    border: 1px solid rgba(55, 65, 81, 0.7);
    border-radius: 0.6rem;
}

.sessions-table {
    width: max-content;
    min-width: 0;
    table-layout: auto;
}

.sessions-table th:first-child,
.sessions-table td.session-agent {
    width: 1%;
}

.sessions-table td.session-agent {
    white-space: normal;
    line-height: 1.25;
    vertical-align: top;
}

.sessions-table .session-agent-line {
    display: block;
    white-space: nowrap;
}

.sessions-table td.route-session-start {
    white-space: normal !important;
    line-height: 1.25;
    vertical-align: top;
}

.sessions-table .session-start-date,
.sessions-table .session-start-time,
.sessions-table .session-start-ver {
    display: block !important;
    white-space: nowrap;
}

.sessions-table .session-start-ver {
    opacity: 0.75;
    font-size: 0.85em;
}

.sessions-table tr.route-session-row {
    cursor: pointer;
}

.sessions-table tr.route-session-row:hover td {
    background: rgba(148, 163, 184, 0.1);
}

.routes-map-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
}

.routes-map-header h3 {
    margin: 0;
}

.routes-map-wrap {
    position: relative;
    isolation: isolate;
    z-index: 0;
    overflow: hidden;
    border-radius: 0.6rem;
}

.routes-map-wrap .leaflet-pane {
    z-index: 1 !important;
}

.routes-map-wrap .leaflet-tile-pane {
    z-index: 1 !important;
}

.routes-map-wrap .leaflet-overlay-pane {
    z-index: 2 !important;
}

.routes-map-wrap .leaflet-shadow-pane {
    z-index: 3 !important;
}

.routes-map-wrap .leaflet-marker-pane {
    z-index: 4 !important;
}

.routes-map-wrap .leaflet-tooltip-pane {
    z-index: 5 !important;
}

.routes-map-wrap .leaflet-popup-pane {
    z-index: 6 !important;
}

.route-filters-overlay {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    z-index: 20;
    max-width: calc(100% - 1.3rem);
}

.route-filters-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 0.5rem;
    background: rgba(15, 23, 42, 0.92);
    color: #e2e8f0;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    list-style: none;
    box-shadow: 0 4px 14px rgba(2, 6, 23, 0.35);
    backdrop-filter: blur(6px);
}

.route-filters-toggle::-webkit-details-marker {
    display: none;
}

.route-filters-toggle::before {
    content: "тЦ╕";
    font-size: 0.7rem;
    color: #94a3b8;
    transition: transform 0.15s ease;
}

.route-filters-overlay[open] .route-filters-toggle::before {
    transform: rotate(90deg);
}

.route-filters-panel {
    margin-top: 0.45rem;
    width: min(21rem, calc(100vw - 2.5rem));
    padding: 0.55rem 0.65rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 0.55rem;
    background: rgba(15, 23, 42, 0.94);
    box-shadow: 0 8px 24px rgba(2, 6, 23, 0.45);
    backdrop-filter: blur(8px);
}

.route-filters-hint {
    margin: 0 0 0.45rem;
    padding: 0 0.15rem;
    color: #94a3b8;
    font-size: 0.75rem;
    line-height: 1.35;
}

.route-filters-list {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.route-filter-row {
    display: grid;
    grid-template-columns: 1.1rem 1fr auto;
    align-items: center;
    column-gap: 0.55rem;
    padding: 0.38rem 0.25rem;
    margin: 0;
    border-radius: 0.35rem;
    color: #cbd5e1;
    font-size: 0.82rem;
    line-height: 1.25;
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
}

.route-filter-row:hover {
    background: rgba(148, 163, 184, 0.08);
}

.route-filter-row--simple {
    grid-template-columns: 1.1rem 1fr;
}

.route-filter-check {
    margin: 0;
    width: 0.95rem;
    height: 0.95rem;
    accent-color: #38bdf8;
}

.route-filter-name {
    min-width: 0;
}

.route-filter-controls {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.3rem;
    white-space: nowrap;
}

.route-filter-unit {
    color: #94a3b8;
    font-size: 0.78rem;
}

.route-filter-num {
    width: 4.2rem;
    padding: 0.15rem 0.35rem;
    background: #0b1220;
    color: #e2e8f0;
    border: 1px solid rgba(148, 163, 184, 0.4);
    border-radius: 0.3rem;
    font-size: 0.8rem;
    text-align: right;
}

.routes-map {
    height: 760px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 0.6rem;
    background: #0b1220;
}

.map-info {
    margin: 0.65rem 0 0;
    color: #9ca3af;
    white-space: pre-wrap;
    font-size: 0.85rem;
}

.route-info-panel {
    margin-top: 0.75rem;
    padding: 0.85rem 0.95rem;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 0.65rem;
    background: rgba(15, 23, 42, 0.45);
}

.route-info-stats {
    display: grid;
    grid-template-columns: minmax(9rem, 1.1fr) minmax(6rem, 0.7fr) minmax(10rem, 1.2fr);
    gap: 0.65rem 1rem;
    margin-bottom: 0.85rem;
}

.route-info-stat {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.route-info-stat-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
}

.route-info-stat-value {
    font-size: 1.15rem;
    font-weight: 600;
    color: #e2e8f0;
    line-height: 1.2;
}

.route-info-stat-value--small {
    font-size: 0.82rem;
    font-weight: 500;
}

.route-info-stat--primary .route-info-stat-value {
    font-size: 1.45rem;
    color: #38bdf8;
}

.route-segment-picker {
    padding: 0.7rem 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 0.55rem;
    background: rgba(2, 6, 23, 0.35);
}

.route-segment-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.55rem;
}

.route-segment-picker-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: #cbd5e1;
}

.route-segment-reset {
    border: none;
    background: transparent;
    color: #38bdf8;
    font-size: 0.78rem;
    cursor: pointer;
    padding: 0.15rem 0.35rem;
    border-radius: 0.3rem;
}

.route-segment-reset:hover {
    background: rgba(56, 189, 248, 0.12);
}

.route-trim-editor {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.route-trim-labels {
    position: relative;
    height: 2.65rem;
    margin: 0.2rem 0 0;
    padding: 0 0.75rem;
}

.route-trim-handle-label {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    min-width: 5.5rem;
    padding: 0.2rem 0.45rem 0.25rem;
    border-radius: 0.4rem;
    font-size: 0.72rem;
    line-height: 1.15;
    white-space: nowrap;
    pointer-events: none;
    z-index: 3;
}

.route-trim-handle-label--start {
    background: rgba(16, 185, 129, 0.16);
    border: 1px solid rgba(52, 211, 153, 0.55);
    color: #a7f3d0;
}

.route-trim-handle-label--end {
    background: rgba(249, 115, 22, 0.16);
    border: 1px solid rgba(251, 146, 60, 0.55);
    color: #fed7aa;
}

.route-trim-handle-label.is-near.route-trim-handle-label--start {
    top: -0.15rem;
}

.route-trim-handle-label.is-near.route-trim-handle-label--end {
    top: 1.15rem;
}

.route-trim-handle-tag {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.9;
}

.route-dual-range {
    position: relative;
    height: 2.5rem;
    margin: 0.1rem 0 0;
    padding: 0 0.75rem;
}

.route-dual-range-rail {
    position: absolute;
    left: 0.75rem;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    height: 0.85rem;
    border-radius: 999px;
    background: #475569;
    pointer-events: none;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(2, 6, 23, 0.4);
    z-index: 1;
}

.route-dual-range-dim {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    background: rgba(2, 6, 23, 0.62);
    pointer-events: none;
    z-index: 3;
}

.route-dual-range-dim--right {
    right: auto;
}

.route-dual-range-fill {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #059669 0%, #0ea5e9 50%, #ea580c 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
    z-index: 2;
}

.route-trim-handle-markers {
    position: absolute;
    left: 0.75rem;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    height: 0;
    pointer-events: none;
    z-index: 8;
}

.route-trim-handle-marker {
    position: absolute;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    width: 0.78rem;
    height: 1.7rem;
    border-radius: 0.32rem;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(2, 6, 23, 0.55), 0 0 0 1px rgba(15, 23, 42, 0.4);
    pointer-events: auto;
    cursor: ew-resize;
    touch-action: none;
}

.route-trim-handle-marker--start {
    background: #10b981;
}

.route-trim-handle-marker--end {
    background: #f97316;
}

.route-range-thumb {
    position: absolute;
    left: 0.75rem;
    right: 0.75rem;
    width: auto;
    margin: 0;
    height: 2.5rem;
    opacity: 0;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
    z-index: 1;
}

.route-range-thumb::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 0;
    height: 0;
    border: none;
    background: transparent;
}

.route-range-thumb::-moz-range-thumb {
    width: 0;
    height: 0;
    border: none;
    background: transparent;
}

.route-range-thumb--start,
.route-range-thumb--end {
    z-index: 1;
}

.route-range-thumb::-webkit-slider-runnable-track,
.route-range-thumb::-moz-range-track {
    background: transparent;
    border: none;
}

.route-trim-bounds {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.72rem;
    color: #64748b;
    padding: 0 0.95rem;
    margin-top: 0.15rem;
}

.route-info-details {
    margin-top: 0.7rem;
    font-size: 0.8rem;
    color: #94a3b8;
}

.route-info-details summary {
    cursor: pointer;
    user-select: none;
    color: #cbd5e1;
}

.route-info-meta {
    margin: 0.45rem 0 0;
    line-height: 1.45;
    white-space: pre-wrap;
}

@media (max-width: 900px) {
    .route-info-stats {
        grid-template-columns: 1fr 1fr;
    }

    .route-info-stat:last-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 1280px) {
    .routes-grid {
        grid-template-columns: auto minmax(0, 1fr);
    }
}

@media (max-width: 1024px) {
    .routes-grid {
        grid-template-columns: 1fr;
    }

    .routes-map {
        height: 520px;
    }

    .routes-filter-actions {
        margin-left: 0;
    }
}

/* ===== Leaflet tooltips/markers (page-specific) ===== */
.leaflet-tooltip.route-point-hover-tip {
    background: rgba(15, 23, 42, 0.95);
    color: #e2e8f0;
    border: 1px solid rgba(56, 189, 248, 0.55);
    border-radius: 0.4rem;
    padding: 0.35rem 0.6rem;
    font-size: 0.78rem;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    white-space: nowrap;
}

.leaflet-tooltip.route-point-hover-tip::before {
    border-bottom-color: rgba(15, 23, 42, 0.95);
}

.route-time-marker-wrap {
    background: none !important;
    border: none !important;
}

.route-time-marker-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.route-time-marker-stack .route-time-pin {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
    flex-shrink: 0;
}

.route-time-marker-stack .route-time-pin.start {
    background: #22c55e;
}

.route-time-marker-stack .route-time-pin.end {
    background: #ef4444;
}

.route-event-marker-wrap {
    background: none !important;
    border: none !important;
}

.route-event-marker-stack {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
}

.route-event-marker-stack .route-event-pin {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}

.route-event-marker-stack .route-event-pin.order {
    background: #16a34a;
}

.route-event-marker-stack .route-event-pin.photo {
    background: #ea580c;
}

.sessions-table tr.route-session-row.is-active td {
    background: rgba(14, 165, 233, 0.18);
    box-shadow: inset 3px 0 0 #38bdf8;
}

/* ===== Agent merge ===== */
.page-lead {
    max-width: 52rem;
    color: #94a3b8;
    line-height: 1.5;
    margin: 0 0 1.25rem;
}

.flash {
    padding: 0.65rem 0.85rem;
    border-radius: 0.5rem;
    margin: 0 0 1rem;
    max-width: 52rem;
    line-height: 1.5;
    font-weight: 500;
}

.flash-ok {
    background: rgba(34, 197, 94, 0.18);
    border: 1px solid rgba(74, 222, 128, 0.55);
    color: #ecfdf5;
}

.flash-error {
    background: rgba(239, 68, 68, 0.18);
    border: 1px solid rgba(248, 113, 113, 0.55);
    color: #fef2f2;
}

.flash-warn {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.45);
    color: #fffbeb;
}

/* ╨Я╤Г╤Б╤В╨╛╨╣ ╨▒╨╗╨╛╨║ asp-validation-summary ╨▒╨╡╨╖ ╨╛╤И╨╕╨▒╨╛╨║ */
.validation-summary-valid {
    display: none !important;
}

.merge-section {
    margin: 1.75rem 0;
}

.merge-section-head {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.merge-section-head h2 {
    margin: 0;
    font-size: 1.15rem;
}

.merge-section-meta {
    color: #64748b;
    font-size: 0.88rem;
}

.merge-empty,
.merge-hint,
.merge-back {
    color: #94a3b8;
}

.merge-suggestions-progress {
    margin: 0.75rem 0 1rem;
    max-width: 28rem;
}

.merge-suggestions-progress-track {
    height: 0.5rem;
    background: rgba(148, 163, 184, 0.25);
    border-radius: 999px;
    overflow: hidden;
}

.merge-suggestions-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    border-radius: 999px;
    transition: width 0.35s ease;
}

.merge-suggestions-progress-text {
    margin: 0.45rem 0 0;
    font-size: 0.88rem;
    color: #64748b;
}

.merge-agent-name {
    font-weight: 600;
}

.merge-agent-meta {
    font-size: 0.82rem;
    color: #94a3b8;
    margin-top: 0.15rem;
}

.merge-score {
    display: inline-block;
    min-width: 3rem;
    text-align: center;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
}

.merge-score-high {
    background: rgba(34, 197, 94, 0.18);
    color: #86efac;
}

.merge-score-mid {
    background: rgba(234, 179, 8, 0.18);
    color: #fde047;
}

.merge-score-low {
    background: rgba(148, 163, 184, 0.15);
    color: #cbd5e1;
}

.merge-back {
    margin-top: 2rem;
}

.merge-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: flex-end;
}

.app-modal-wide {
    width: min(640px, calc(100vw - 2rem));
    max-width: 640px;
    overflow-x: hidden;
}

.app-modal-wide .app-modal-form {
    overflow-x: hidden;
    min-width: 0;
}

/* Merge modal тАФ CSS variables (dark default) */
html[data-theme="dark"],
:root {
    --merge-lead-color: #cbd5e1;
    --merge-badge-bg: rgba(56, 189, 248, 0.22);
    --merge-badge-fg: #bae6fd;
    --merge-card-bg: rgba(30, 41, 59, 0.92);
    --merge-card-bg-secondary: rgba(30, 41, 59, 0.72);
    --merge-card-border: rgba(148, 163, 184, 0.35);
    --merge-card-primary-border: rgba(56, 189, 248, 0.65);
    --merge-label-color: #94a3b8;
    --merge-value-color: #e2e8f0;
    --merge-value-strong-color: #f8fafc;
    --merge-id-color: #e2e8f0;
    --merge-id-bg: rgba(15, 23, 42, 0.55);
    --merge-warning-bg: rgba(148, 163, 184, 0.1);
    --merge-warning-color: #cbd5e1;
    --merge-warning-border: rgba(148, 163, 184, 0.35);
    --merge-section-muted: #94a3b8;
    --merge-meta-label-color: #64748b;
}

.merge-modal-lead {
    margin: 0 0 1rem;
    color: var(--merge-lead-color);
    font-size: 0.95rem;
    line-height: 1.55;
}

.merge-modal-lead .merge-score-badge {
    display: inline-block;
    margin-right: 0.35rem;
    padding: 0.15rem 0.5rem;
    border-radius: 0.35rem;
    font-size: 0.82rem;
    font-weight: 700;
    vertical-align: middle;
    background: var(--merge-badge-bg);
    color: var(--merge-badge-fg);
}

.merge-suggestion-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin: -0.15rem 0 1rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.65rem;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(30, 41, 59, 0.35);
}

.merge-suggestion-pager-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(15, 23, 42, 0.55);
    color: #e2e8f0;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: none;
    margin: 0;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.merge-suggestion-pager-btn:hover:not(:disabled) {
    border-color: rgba(56, 189, 248, 0.55);
    background: rgba(56, 189, 248, 0.12);
    color: #f8fafc;
}

.merge-suggestion-pager-btn:disabled {
    opacity: 0.32;
    cursor: not-allowed;
}

.merge-suggestion-pager-btn svg {
    width: 1rem;
    height: 1rem;
    display: block;
}

.merge-suggestion-pager-label {
    min-width: 6.5rem;
    text-align: center;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--merge-section-muted);
    letter-spacing: 0.01em;
    user-select: none;
}

.merge-pick-grid-stacked {
    grid-template-columns: 1fr !important;
    gap: 0.85rem;
}

.merge-pick-details {
    margin: 0.65rem 0 0;
    display: grid;
    gap: 0.55rem;
}

.merge-pick-row {
    display: grid;
    grid-template-columns: 4.75rem minmax(0, 1fr);
    gap: 0.65rem;
    align-items: start;
}

.merge-pick-row dt {
    margin: 0;
    padding-top: 0.1rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--merge-label-color);
}

.merge-pick-row dd {
    margin: 0;
    font-size: 0.94rem;
    line-height: 1.55;
    color: var(--merge-value-color);
    word-break: break-word;
    overflow-wrap: anywhere;
}

.merge-pick-row-name dd {
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--merge-value-strong-color);
}

.merge-pick-row-id dd {
    display: inline-block;
    max-width: 100%;
    font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--merge-id-color);
    background: var(--merge-id-bg);
    padding: 0.25rem 0.5rem;
    border-radius: 0.35rem;
    word-break: break-all;
}

.merge-pick-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.merge-pick-card {
    display: block;
    cursor: pointer;
    position: relative;
    min-width: 0;
}

.merge-pick-card input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.merge-pick-body {
    display: block;
    padding: 0.95rem 1rem;
    border-radius: 0.6rem;
    border: 1px solid var(--merge-card-border);
    background: var(--merge-card-bg-secondary);
    transition: border-color 120ms ease, box-shadow 120ms ease;
    min-width: 0;
    overflow: hidden;
}

.merge-pick-card input:checked + .merge-pick-body {
    border-color: rgba(56, 189, 248, 0.65);
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.35);
}

.merge-pick-card-static {
    cursor: default;
}

.merge-pick-card-static .merge-pick-body:first-child {
    border-color: rgba(148, 163, 184, 0.25);
}

.merge-pick-grid-readonly .merge-pick-card-static:first-child .merge-pick-body {
    border-color: var(--merge-card-primary-border);
    background: var(--merge-card-bg);
    box-shadow: inset 3px 0 0 var(--merge-card-primary-border);
}

.merge-search-field {
    position: relative;
    min-width: 0;
}

.merge-search-results {
    position: absolute;
    z-index: 20;
    left: 0;
    right: 0;
    max-height: 14rem;
    overflow: auto;
    margin-top: 0.25rem;
    border-radius: 0.45rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: #0f172a;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.merge-search-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.55rem 0.65rem;
    border: 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.merge-search-item:hover,
.merge-search-item:focus-visible {
    background: rgba(56, 189, 248, 0.12);
}

.merge-search-item strong {
    display: block;
    font-weight: 600;
}

.merge-search-item span {
    display: block;
    font-size: 0.82rem;
    color: #94a3b8;
    margin-top: 0.15rem;
}

.merge-search-empty {
    padding: 0.65rem;
    font-size: 0.85rem;
    color: #94a3b8;
}

.merge-pick-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--merge-label-color);
    margin-bottom: 0.45rem;
}

.merge-pick-meta {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: #94a3b8;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.merge-agent-meta {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.82rem;
    color: #94a3b8;
    line-height: 1.45;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.merge-meta-label {
    color: var(--merge-meta-label-color);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-right: 0.2rem;
}

.merge-manual-grid {
    margin-bottom: 1rem;
}

.is-hidden {
    display: none !important;
}

.merge-manual-grid.is-hidden {
    display: none !important;
}

.merge-agent-select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.merge-warning {
    font-size: 0.9rem;
    color: var(--merge-warning-color);
    line-height: 1.55;
    margin: 0.85rem 0 0;
    padding: 0.7rem 0.85rem;
    border-radius: 0.45rem;
    background: var(--merge-warning-bg);
    border-left: 3px solid var(--merge-warning-border);
}

@media (max-width: 960px) {
    html[data-sidebar-collapsed="true"] .app-sidebar {
        width: 100%;
    }

    html[data-sidebar-collapsed="true"] .sidebar-brand-text,
    html[data-sidebar-collapsed="true"] .sidebar-label,
    html[data-sidebar-collapsed="true"] .sidebar-group-chevron,
    html[data-sidebar-collapsed="true"] .sidebar-badge {
        display: inline;
    }

    html[data-sidebar-collapsed="true"] .sidebar-top {
        flex-direction: row;
        align-items: center;
        padding: 0.65rem 0.55rem 0.55rem;
    }

    html[data-sidebar-collapsed="true"] .sidebar-link,
    html[data-sidebar-collapsed="true"] .sidebar-group-toggle {
        justify-content: flex-start;
        gap: 0.75rem;
    }

    html[data-sidebar-collapsed="true"] .sidebar-group .sidebar-subnav {
        display: none;
    }

    html[data-sidebar-collapsed="true"] .sidebar-group.is-open .sidebar-subnav {
        display: block;
        position: static;
        min-width: 0;
        border: none;
        box-shadow: none;
        background: transparent;
    }

    html[data-sidebar-collapsed="true"] .sidebar-link[data-tooltip]:hover::after,
    html[data-sidebar-collapsed="true"] .sidebar-group-toggle[data-tooltip]:hover::after {
        display: none;
    }

    html[data-sidebar-collapsed="true"] .sidebar-link .sidebar-badge--dot:not([hidden]) {
        display: inline;
        position: static;
        width: auto;
        height: auto;
        min-width: 1.25rem;
        padding: 0.1rem 0.45rem;
        font-size: 0.72rem;
        line-height: 1.2;
    }

    .app-shell--sidebar {
        flex-direction: column;
    }

    .app-sidebar {
        width: 100%;
        min-height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    }

    .sidebar-nav {
        padding-bottom: 0.5rem;
    }

    .sidebar-nav-list {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .sidebar-nav-item {
        margin: 0;
    }

    .sidebar-link {
        padding: 0.5rem 0.65rem;
        font-size: 0.82rem;
    }

    .sidebar-link.is-active {
        box-shadow: none;
        border: 1px solid rgba(56, 189, 248, 0.45);
    }

    .sidebar-group.is-open {
        width: 100%;
        border-radius: 0.55rem;
    }
}

/* ===== Photo reports ===== */
.photo-reports-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.photo-reports-header h1 {
    margin: 0 0 0.35rem;
}

.photo-reports-lead {
    margin: 0;
    max-width: 52rem;
}

.photo-reports-filter {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 0.85rem 1rem;
    border-radius: 0.65rem;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(8px);
    --filter-field-bg: rgba(15, 23, 42, 0.8);
    --filter-field-border: rgba(55, 65, 81, 0.9);
    --filter-field-fg: #e5e7eb;
    --filter-field-label: #94a3b8;
    --filter-check-fg: #cbd5e1;
    --filter-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M2.2 4.4 6 8.2l3.8-3.8' stroke='%2394a3b8' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
}

.photo-reports-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
    gap: 0.65rem 0.85rem;
    margin-bottom: 0.75rem;
}

.photo-reports-filter-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin: 0;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--filter-field-label);
}

.photo-reports-filter-field--grow {
    grid-column: span 2;
}

.photo-reports-filter-field--check {
    flex-direction: row;
    align-items: center;
    align-self: end;
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.88rem;
    color: var(--filter-check-fg);
    gap: 0.45rem;
    min-height: 2.15rem;
}

.photo-reports-filter-field--check input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    min-height: 0;
    margin: 0;
    padding: 0;
    flex: 0 0 1rem;
    accent-color: #38bdf8;
    cursor: pointer;
}

.photo-reports-filter-field input:not([type="checkbox"]),
.photo-reports-filter-field select {
    width: 100%;
    min-height: 2.15rem;
    padding: 0.4rem 0.65rem;
    border-radius: 0.5rem;
    border: 1px solid var(--filter-field-border);
    background-color: var(--filter-field-bg);
    color: var(--filter-field-fg);
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.92rem;
    box-sizing: border-box;
}

.photo-reports-filter-field input:not([type="checkbox"]):focus,
.photo-reports-filter-field select:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.65);
}

.photo-reports-filter-field select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: var(--filter-chevron);
    background-repeat: no-repeat;
    background-position: right 0.55rem center;
    background-size: 0.75rem;
    padding-right: 1.85rem;
}

.pay-type-filter option.pay-filter-group {
    font-weight: 600;
}

.pay-type-filter option.pay-filter-subgroup {
    font-weight: 600;
}

.pay-type-filter option.pay-filter-child,
.pay-type-filter option.pay-filter-subchild {
    font-weight: 400;
}

.photo-reports-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.photo-reports-filter-actions button,
.photo-reports-filter-actions .btn-secondary {
    margin-top: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 999px;
    padding: 0.45rem 1.2rem;
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.2;
    white-space: nowrap;
    transition: transform 0.08s ease-out, box-shadow 0.08s ease-out, filter 0.08s;
}

.photo-reports-filter-actions .btn-secondary {
    background: rgba(55, 65, 81, 0.85);
    color: #e5e7eb;
    box-shadow: none;
}

.photo-reports-filter-actions .btn-secondary:hover {
    filter: brightness(1.15);
    text-decoration: none;
    color: #ffffff;
    transform: translateY(-1px);
}

.photo-reports-filter-actions .btn-filter-reset {
    background: transparent;
    border: 1px solid var(--filter-field-border);
    color: var(--filter-check-fg);
    box-shadow: none;
}

.photo-reports-filter-actions .btn-filter-reset:hover {
    background: rgba(148, 163, 184, 0.12);
    filter: none;
    color: var(--filter-field-fg);
}

.photo-reports-filter-actions button[type="submit"] {
    background: linear-gradient(to right, #38bdf8, #6366f1);
    color: #ffffff;
    box-shadow: 0 12px 25px rgba(59, 130, 246, 0.45);
}

.photo-reports-filter-actions button[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 35px rgba(59, 130, 246, 0.6);
    filter: brightness(1.05);
}

.photo-reports-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.65rem;
}

.photo-reports-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.14);
    color: #e0f2fe;
    font-size: 0.82rem;
    text-decoration: none;
}

.photo-reports-chip:hover {
    background: rgba(56, 189, 248, 0.24);
    text-decoration: none;
}

.photo-reports-kpi {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.photo-reports-kpi-card {
    padding: 0.85rem 1rem;
    border-radius: 0.65rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(30, 41, 59, 0.55);
}

.photo-reports-kpi-value {
    display: block;
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.1;
    color: #f8fafc;
}

.photo-reports-kpi-label {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.82rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sales-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sales-header h1 {
    margin-bottom: 0.35rem;
}

.sales-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem 1rem;
}

.sales-lead {
    margin: 0;
    max-width: 52rem;
}

.sales-filter {
    margin: 0;
}

.sales-table-wrap {
    max-height: none;
}

.sales-list-table {
    min-width: 960px;
}

.sales-list-table tbody tr:hover {
    background: rgba(56, 189, 248, 0.06);
}

.sales-list-doc {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    max-width: 14rem;
}

.sales-list-channel {
    flex-shrink: 0;
}

.sales-list-order {
    white-space: nowrap;
}

.sales-list-row--variance {
    background: rgba(251, 191, 36, 0.06);
}

.sales-list-row--no-order {
    background: rgba(148, 163, 184, 0.04);
}

.sale-detail-page .order-detail-stat--warn {
    border-color: rgba(251, 191, 36, 0.45);
    background: rgba(251, 191, 36, 0.08);
}

.sale-detail-page .order-detail-stat--warn .order-detail-stat-value {
    color: #fde68a;
}

.sales-comparison-table .sales-comparison-row--delta {
    background: rgba(251, 191, 36, 0.06);
}

.orders-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.orders-header h1 {
    margin-bottom: 0.35rem;
}

.orders-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem 1rem;
}

.orders-lead {
    margin: 0;
    max-width: 52rem;
}

.orders-filter {
    margin: 0;
}

.orders-channel-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    max-width: 18rem;
}

.orders-channel-badges .badge {
    font-size: 0.75rem;
    white-space: nowrap;
}

.badge-info {
    background: rgba(56, 189, 248, 0.18);
    color: #7dd3fc;
}

/* тАФтАФтАФ Orders list & detail тАФтАФтАФ */
.orders-table-wrap,
.sales-table-wrap,
.order-detail-table-wrap {
    max-height: none;
}

.orders-list-table,
.sales-list-table,
.orders-detail-table {
    min-width: 960px;
}

.orders-list-table tbody tr:hover,
.sales-list-table tbody tr:hover,
.orders-detail-table tbody tr:hover {
    background: rgba(56, 189, 248, 0.06);
}

.orders-list-row--error {
    background: rgba(251, 191, 36, 0.06);
}

.orders-list-link {
    font-weight: 600;
    color: #7dd3fc;
    text-decoration: none;
}

.orders-list-link:hover {
    color: #bae6fd;
    text-decoration: underline;
}

.orders-list-number {
    white-space: nowrap;
}

.orders-list-badge {
    margin-left: 0.35rem;
    vertical-align: middle;
}

.orders-list-amount {
    font-weight: 600;
}

.orders-list-vavilon {
    white-space: nowrap;
}

.orders-vavilon-tags {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.3rem;
    max-width: none;
}

.page-kpi-item--warn {
    border-color: rgba(251, 191, 36, 0.45);
    background: rgba(251, 191, 36, 0.08);
}

.page-kpi-item--warn strong {
    color: #fde68a;
}

.page-kpi-item--accent {
    border-color: rgba(56, 189, 248, 0.45);
    background: rgba(56, 189, 248, 0.08);
}

.page-kpi-item--accent strong {
    color: #7dd3fc;
}

.order-channel-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    border: 1px solid transparent;
    white-space: nowrap;
}

.store-name-with-channels {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    min-width: 0;
}

.store-name-with-channels__name {
    min-width: 0;
}

.orders-list-store-cell {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
}

.orders-list-store-cell .store-name-with-channels {
    flex: 1 1 auto;
    min-width: 0;
}

.orders-list-filter-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    border: 1px solid rgba(56, 189, 248, 0.28);
    background: rgba(56, 189, 248, 0.1);
    color: #7dd3fc;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

@media (hover: hover) {
    .orders-list-filter-btn {
        opacity: 0;
        pointer-events: none;
    }

    .orders-list-table tbody tr:hover .orders-list-filter-btn,
    .orders-list-store-cell:focus-within .orders-list-filter-btn {
        opacity: 1;
        pointer-events: auto;
    }
}

.orders-list-filter-btn:hover {
    background: rgba(56, 189, 248, 0.22);
    border-color: rgba(56, 189, 248, 0.45);
    color: #bae6fd;
    text-decoration: none;
}

.store-channel-badges {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    flex-shrink: 0;
}

.store-channel-badge {
    display: block;
    width: 1.375rem;
    height: 1.375rem;
    border-radius: 5px;
    object-fit: cover;
}

.store-channel-badges--sm .store-channel-badge {
    width: 1.125rem;
    height: 1.125rem;
    border-radius: 4px;
}

.picker-item-name {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.order-channel-pill--vav {
    background: rgba(14, 165, 233, 0.14);
    color: #7dd3fc;
    border-color: rgba(14, 165, 233, 0.28);
}

.order-channel-pill--na {
    background: rgba(34, 197, 94, 0.14);
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.28);
}

.order-channel-pill--ok {
    box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.55);
}

.order-channel-pill--error {
    box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.65);
}

.order-channel-pill--pending {
    box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.65);
}

.order-option-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 0.45rem;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(148, 163, 184, 0.14);
    color: #e2e8f0;
    border: 1px solid rgba(148, 163, 184, 0.22);
}

.order-option-pill--sm {
    font-size: 0.72rem;
    padding: 0.12rem 0.45rem;
    white-space: nowrap;
}

.order-option-pill--pay {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.28);
    color: #bbf7d0;
}

.orders-pay-group {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.order-option-pill--cons {
    background: rgba(167, 139, 250, 0.16);
    border-color: rgba(167, 139, 250, 0.35);
    color: #ddd6fe;
}

.order-option-pill--cons-days {
    background: rgba(167, 139, 250, 0.08);
    border-color: rgba(167, 139, 250, 0.28);
    color: #c4b5fd;
    font-variant-numeric: tabular-nums;
}

.order-detail-page {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.order-detail-toolbar {
    margin-bottom: -0.25rem;
}

.order-detail-summary-main {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    min-width: 0;
}

.order-detail-summary--with-map {
    display: flex;
    align-items: stretch;
    gap: 0.85rem;
}

.order-detail-summary--with-map .order-detail-summary-main {
    flex: 1 1 auto;
    min-width: 0;
}

.order-detail-map-panel {
    position: relative;
    flex: 0 0 auto;
    align-self: stretch;
    width: clamp(16rem, 32vw, 26rem);
    min-height: 16rem;
    border-radius: 0.85rem;
    border: 1px solid rgba(148, 163, 184, 0.22);
    overflow: hidden;
    background: rgba(15, 23, 42, 0.55);
}

.order-detail-map {
    width: 100%;
    height: 100%;
    min-height: 16rem;
    z-index: 0;
}

.order-detail-map-caption {
    position: absolute;
    left: 0.45rem;
    bottom: 0.35rem;
    z-index: 400;
    margin: 0;
    padding: 0.15rem 0.4rem;
    border-radius: 0.35rem;
    background: rgba(15, 23, 42, 0.72);
    font-size: 0.72rem;
    pointer-events: none;
}

@media (max-width: 900px) {
    .order-detail-summary--with-map {
        flex-direction: column;
    }

    .order-detail-map-panel {
        width: 100%;
        aspect-ratio: 16 / 10;
        min-height: 14rem;
    }
}

.order-detail-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    padding: 1.25rem 1.35rem;
    border-radius: 0.85rem;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.75));
}

.order-detail-eyebrow {
    margin: 0 0 0.2rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
}

.order-detail-title {
    margin: 0 0 0.55rem;
    font-size: 1.85rem;
    line-height: 1.15;
}

.order-detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.55rem;
}

.order-detail-meta {
    margin: 0;
}

.order-detail-hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.order-detail-stat {
    min-width: 7.5rem;
    padding: 0.75rem 1rem;
    border-radius: 0.65rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.45);
}

.order-detail-stat-label {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
    margin-bottom: 0.2rem;
}

.order-detail-stat-value {
    font-size: 1.35rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #f8fafc;
}

.order-detail-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
}

.order-detail-grid--split {
    grid-template-columns: minmax(0, 2.4fr) minmax(13rem, 1fr);
}

.order-detail-card {
    padding: 1rem 1.1rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(30, 41, 59, 0.5);
}

.order-detail-card--participants {
    padding: 1.1rem 1.35rem;
}

.order-detail-card--compact {
    align-self: start;
}

.order-detail-card--wide {
    grid-column: 1 / -1;
}

.order-detail-card-title,
.order-detail-section-title {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: #e2e8f0;
}

.order-detail-dl {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.order-detail-dl-row {
    display: grid;
    grid-template-columns: minmax(6rem, 8rem) 1fr;
    gap: 0.5rem 0.75rem;
    align-items: baseline;
}

.order-detail-dl--participants .order-detail-dl-row--store {
    grid-template-columns: minmax(6.5rem, 8.5rem) minmax(0, 1fr);
    align-items: start;
}

.order-detail-dl--participants .order-detail-dl-row--store dt {
    padding-top: 0.12rem;
}

.order-detail-dl--participants .order-detail-store {
    gap: 0.35rem;
}

.order-detail-dl--participants .store-name-with-channels__name {
    font-size: 0.98rem;
    font-weight: 600;
    line-height: 1.35;
}

.order-detail-store-location {
    font-size: 0.84rem;
    line-height: 1.45;
}

@media (max-width: 860px) {
    .order-detail-grid--split {
        grid-template-columns: 1fr;
    }
}

.order-detail-dl dt {
    margin: 0;
    font-size: 0.78rem;
    color: #94a3b8;
}

.order-detail-dl dd {
    margin: 0;
    font-size: 0.92rem;
}

.order-detail-store {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.order-detail-comment {
    margin: 0;
    line-height: 1.55;
    white-space: pre-wrap;
}

.order-detail-empty {
    margin: 0;
}

.order-detail-section {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.order-detail-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
}

.order-detail-section-meta {
    font-size: 0.85rem;
}

.notification-preview {
    margin-top: 0.2rem;
    font-size: 0.82rem;
    line-height: 1.35;
    max-width: 28rem;
}

.order-export-error-text {
    margin-top: 0.35rem;
    max-width: 28rem;
    font-size: 0.82rem;
    line-height: 1.35;
    color: #b45309;
}

.text-error {
    color: #b45309;
}

.order-lines-total td {
    border-top: 2px solid rgba(148, 163, 184, 0.45);
    padding-top: 0.75rem;
    padding-bottom: 0.35rem;
    font-weight: 700;
    font-size: 0.95rem;
    color: #f1f5f9;
    background: rgba(15, 23, 42, 0.35);
}

.order-lines-total td:last-child {
    font-size: 1.15rem;
    color: #ffffff;
}

.import-sample-raw {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border-radius: 0.35rem;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(148, 163, 184, 0.25);
    font-size: 0.85rem;
    color: #fde68a;
    word-break: break-word;
}

.users-lead {
    margin: 0 0 1rem;
    max-width: 42rem;
}

.users-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.users-modal-login {
    margin: 0 0 0.85rem;
}

.btn-danger-text {
    color: #fca5a5;
}

.btn-danger-text:hover {
    color: #fecaca;
}

.page-kpi,
.sales-kpi {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    gap: 0.75rem;
    margin: 0;
}

.page-kpi-item,
.sales-kpi-item {
    padding: 0.85rem 1rem;
    border-radius: 0.65rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(30, 41, 59, 0.55);
}

.page-kpi-item strong,
.sales-kpi-item strong {
    display: block;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.1;
    color: #f8fafc;
}

.page-kpi-label,
.sales-kpi-label {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.82rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.text-warn {
    color: #fbbf24;
    font-weight: 600;
}

.photo-reports-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.photo-reports-view-tabs {
    display: inline-flex;
    gap: 0.25rem;
    padding: 0.2rem;
    border-radius: 0.55rem;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.photo-reports-view-tab {
    border: none;
    background: transparent;
    color: #94a3b8;
    padding: 0.45rem 0.85rem;
    border-radius: 0.45rem;
    font-size: 0.88rem;
    cursor: pointer;
    box-shadow: none;
    margin: 0;
}

.photo-reports-view-tab.is-active {
    background: rgba(56, 189, 248, 0.18);
    color: #f8fafc;
}

.photo-reports-period {
    font-size: 0.85rem;
    color: #94a3b8;
}

.photo-reports-panel {
    display: none;
}

.photo-reports-panel.is-active {
    display: block;
}

.photo-reports-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
    gap: 0.85rem;
}

.photo-report-card {
    display: flex;
    flex-direction: column;
    border-radius: 0.65rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(30, 41, 59, 0.45);
    overflow: hidden;
    cursor: pointer;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.photo-report-card:hover,
.photo-report-card:focus-visible {
    border-color: rgba(56, 189, 248, 0.45);
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.2);
    outline: none;
}

.photo-report-card-thumb {
    position: relative;
    aspect-ratio: 4 / 3;
    background: #0f172a;
}

.photo-report-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.photo-report-card-count {
    position: absolute;
    right: 0.5rem;
    bottom: 0.5rem;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.78);
    color: #f8fafc;
    font-size: 0.78rem;
    font-weight: 600;
}

.photo-report-card-body {
    padding: 0.7rem 0.8rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.photo-report-card-store {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.25;
}

.photo-report-card-meta {
    margin: 0;
    font-size: 0.84rem;
    color: #94a3b8;
}

.photo-report-card-date {
    margin: 0;
    font-size: 0.8rem;
    color: #64748b;
}

.photo-report-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.45rem;
}

.photo-report-link {
    color: #7dd3fc;
}

.photo-reports-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
    gap: 0.65rem;
}

.photo-reports-gallery-item {
    margin: 0;
    border-radius: 0.55rem;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: #0f172a;
    cursor: pointer;
}

.photo-reports-gallery-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}

.photo-reports-gallery-item figcaption {
    padding: 0.4rem 0.5rem;
    font-size: 0.72rem;
    line-height: 1.3;
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.photo-reports-gallery-store {
    font-weight: 600;
    color: #f1f5f9;
}

.photo-reports-carousel-layout {
    display: grid;
    grid-template-columns: minmax(12rem, 18rem) minmax(0, 1fr);
    gap: 0.85rem;
    min-height: 28rem;
}

.photo-reports-carousel-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: 36rem;
    overflow: auto;
    padding-right: 0.2rem;
}

.photo-reports-carousel-list-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    width: 100%;
    text-align: left;
    padding: 0.55rem 0.65rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(30, 41, 59, 0.45);
    color: #e2e8f0;
    cursor: pointer;
    box-shadow: none;
    margin: 0;
}

.photo-reports-carousel-list-item.is-active {
    border-color: rgba(56, 189, 248, 0.5);
    background: rgba(56, 189, 248, 0.12);
    box-shadow: inset 3px 0 0 #38bdf8;
}

.photo-reports-carousel-list-title {
    font-size: 0.88rem;
    font-weight: 600;
}

.photo-reports-carousel-list-meta {
    font-size: 0.75rem;
    color: #94a3b8;
}

.photo-reports-carousel-stage {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    min-width: 0;
}

.photo-reports-carousel-main {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.5rem;
    align-items: stretch;
    min-height: 18rem;
}

.photo-reports-carousel-image-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f172a;
    border-radius: 0.65rem;
    border: 1px solid rgba(148, 163, 184, 0.16);
    overflow: hidden;
    min-height: 16rem;
}

.photo-reports-carousel-image-wrap img {
    max-width: 100%;
    max-height: 28rem;
    object-fit: contain;
    display: block;
}

.photo-reports-carousel-nav {
    align-self: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(30, 41, 59, 0.8);
    color: #f8fafc;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: none;
    margin: 0;
    padding: 0;
}

.photo-reports-carousel-meta {
    padding: 0.75rem 0.85rem;
    border-radius: 0.55rem;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(30, 41, 59, 0.45);
}

.photo-reports-carousel-counter {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    font-weight: 700;
}

.photo-reports-carousel-details {
    margin: 0;
    display: grid;
    gap: 0.45rem;
}

.photo-reports-carousel-details dt {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
}

.photo-reports-carousel-details dd {
    margin: 0.1rem 0 0;
    font-size: 0.9rem;
}

.photo-reports-carousel-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.65rem;
    align-items: center;
}

.photo-reports-carousel-thumbs {
    display: flex;
    gap: 0.35rem;
    overflow-x: auto;
    padding-bottom: 0.2rem;
}

.photo-reports-carousel-thumb {
    flex: 0 0 auto;
    width: 4.5rem;
    height: 4.5rem;
    padding: 0;
    border-radius: 0.4rem;
    border: 2px solid transparent;
    overflow: hidden;
    cursor: pointer;
    background: #0f172a;
    box-shadow: none;
    margin: 0;
}

.photo-reports-carousel-thumb.is-active {
    border-color: #38bdf8;
}

.photo-reports-carousel-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.photo-reports-empty,
.photo-reports-truncate {
    margin: 0;
}

@media (max-width: 960px) {
    .photo-reports-kpi,
    .page-kpi,
    .sales-kpi {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .photo-reports-filter-field--grow {
        grid-column: auto;
    }

    .photo-reports-carousel-layout {
        grid-template-columns: 1fr;
    }

    .photo-reports-carousel-list {
        max-height: 10rem;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .photo-reports-carousel-list-item {
        min-width: 12rem;
    }
}

.sidebar-badge {
    margin-left: auto;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: #f97316;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.35);
}

.sidebar-badge[hidden] {
    display: none !important;
}

.sidebar-badge.is-pulse {
    animation: notification-badge-pulse 0.55s ease;
}

@keyframes notification-badge-pulse {
    0% {
        transform: scale(1);
    }

    40% {
        transform: scale(1.18);
    }

    100% {
        transform: scale(1);
    }
}

.notification-row.is-unread {
    background: rgba(56, 189, 248, 0.08);
}

.notification-status.is-new {
    color: #38bdf8;
    font-weight: 600;
}

.cell-actions {
    white-space: nowrap;
}

/* ===== Dashboard (╨│╨╗╨░╨▓╨╜╨░╤П) ===== */
.dashboard-page {
    padding: 0.25rem 0 1.5rem;
}

.dashboard-form {
    margin-bottom: 1.1rem;
}

.brand-switch {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    padding: 0.35rem;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 12px 40px rgba(2, 6, 23, 0.45);
    margin-bottom: 1.15rem;
    overflow: hidden;
}

.brand-switch__thumb {
    position: absolute;
    top: 0.35rem;
    bottom: 0.35rem;
    left: 0.35rem;
    width: calc(50% - 0.35rem);
    border-radius: 12px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 55%, #4338ca 100%);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.45);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 0;
}

.dashboard-page--natureagro .brand-switch__thumb {
    transform: translateX(100%);
    background: linear-gradient(135deg, #14b8a6 0%, #0d9488 55%, #0f766e 100%);
    box-shadow: 0 8px 24px rgba(20, 184, 166, 0.4);
}

.brand-switch__option {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    min-height: 4.25rem;
    padding: 0.85rem 1rem;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    font: inherit;
    transition: color 0.2s ease;
}

.brand-switch__option:hover {
    color: #e2e8f0;
}

.brand-switch__option.is-active {
    color: #ffffff;
}

.brand-switch__title {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.brand-switch__hint {
    font-size: 0.78rem;
    opacity: 0.88;
    font-weight: 500;
}

.dashboard-page--vavilon .dashboard-kpi {
    border-color: rgba(99, 102, 241, 0.28);
}

.dashboard-page--natureagro .dashboard-kpi {
    border-color: rgba(20, 184, 166, 0.28);
}

.dashboard-page--vavilon .dashboard-card {
    border-color: rgba(99, 102, 241, 0.12);
}

.dashboard-page--natureagro .dashboard-card {
    border-color: rgba(20, 184, 166, 0.12);
}

.dashboard-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    margin-bottom: 1.25rem;
}

.dashboard-title {
    margin: 0 0 0.35rem;
    font-size: 1.65rem;
    font-weight: 700;
}

.dashboard-subtitle {
    margin: 0;
}

.dashboard-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.65rem;
}

.dashboard-date-field {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    font-size: 0.88rem;
    text-transform: none;
    letter-spacing: 0;
    color: #94a3b8;
}

.dashboard-date-field input {
    width: auto;
    min-width: 8.75rem;
    min-height: 2.15rem;
    margin: 0;
    padding: 0.4rem 0.65rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(55, 65, 81, 0.9);
    background: rgba(15, 23, 42, 0.8);
    color: #e5e7eb;
    font-size: 0.92rem;
    box-sizing: border-box;
}

.dashboard-date-field input:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.65);
}

.dashboard-filter-btn {
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 999px;
    padding: 0.45rem 1.2rem;
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    line-height: 1.2;
    white-space: nowrap;
    background: linear-gradient(to right, #38bdf8, #6366f1);
    color: #ffffff;
    box-shadow: 0 12px 25px rgba(59, 130, 246, 0.45);
    transition: transform 0.08s ease-out, box-shadow 0.08s ease-out, filter 0.08s;
}

.dashboard-filter-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 35px rgba(59, 130, 246, 0.6);
    filter: brightness(1.05);
}

.dashboard-filter-btn--secondary {
    background: rgba(55, 65, 81, 0.85);
    color: #e5e7eb;
    box-shadow: none;
}

.dashboard-filter-btn--secondary:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
    box-shadow: none;
}

.dashboard-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.dashboard-kpi {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.88));
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 12px;
    padding: 1rem 1.1rem;
    min-height: 5.5rem;
}

.dashboard-kpi-label {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-bottom: 0.35rem;
}

.dashboard-kpi-value {
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.15;
    color: #f8fafc;
}

.dashboard-kpi-value--money {
    font-size: 1.35rem;
}

.dashboard-kpi-hint {
    margin-top: 0.25rem;
    font-size: 0.72rem;
    color: #64748b;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.dashboard-card {
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 12px;
    padding: 0.9rem 1rem 1rem;
}

.dashboard-card--wide {
    grid-column: 1 / -1;
}

.dashboard-card h2 {
    margin: 0 0 0.65rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #cbd5e1;
}

.dashboard-chart-wrap {
    position: relative;
    height: 220px;
}

.dashboard-chart-wrap--tall {
    height: 280px;
}

.dashboard-chart-wrap--products {
    height: 320px;
}

.dashboard-card--tall-chart {
    grid-row: span 1;
}

@media (min-width: 1100px) {
    .dashboard-page--natureagro .dashboard-card--tall-chart .dashboard-chart-wrap--products {
        height: 360px;
    }
}

.dashboard-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    font-size: 0.9rem;
}

@media (max-width: 1100px) {
    .dashboard-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .dashboard-kpis,
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-card--wide {
        grid-column: auto;
    }
}

/* --- Reports --- */
.reports-breadcrumb a {
    color: inherit;
    text-decoration: none;
}

.reports-breadcrumb a:hover {
    text-decoration: underline;
}

.reports-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin-top: 1.25rem;
}

.reports-hub-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.15rem 1.25rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.35);
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.reports-hub-card:hover {
    border-color: rgba(99, 102, 241, 0.45);
    background: rgba(30, 41, 59, 0.55);
}

.reports-hub-card-icon {
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    color: rgba(129, 140, 248, 0.95);
}

.reports-hub-card-icon svg {
    width: 100%;
    height: 100%;
}

.reports-hub-card-title {
    font-size: 1.05rem;
    font-weight: 600;
}

.reports-hub-card-desc {
    font-size: 0.88rem;
    color: rgba(148, 163, 184, 0.92);
    line-height: 1.45;
}

.reports-profit-total-row td {
    border-top: 2px solid rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.25);
}

.reports-managers-section {
    margin-top: 2rem;
    padding-top: 0.25rem;
}

.reports-managers-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.reports-managers-header h2 {
    margin: 0 0 0.35rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.reports-managers-lead {
    margin: 0;
    font-size: 0.88rem;
}

.reports-managers-count {
    flex-shrink: 0;
    min-width: 2.25rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.16);
    color: rgba(165, 180, 252, 0.98);
    font-size: 0.82rem;
    font-weight: 600;
    text-align: center;
}

.reports-managers-chart-card {
    margin-bottom: 1.15rem;
    padding: 1rem 1.15rem 1.1rem;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.42), rgba(15, 23, 42, 0.2));
    box-shadow: 0 10px 30px rgba(2, 6, 23, 0.14);
}

.reports-managers-chart-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.reports-managers-chart-head h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.reports-managers-chart-note {
    margin: 0;
    font-size: 0.82rem;
}

.reports-managers-chart-wrap {
    position: relative;
    width: 100%;
    max-width: 760px;
    height: 320px;
    margin: 0 auto;
}

@media (max-width: 720px) {
    .reports-managers-chart-wrap {
        height: 280px;
        max-width: 100%;
    }
}

.reports-managers-wrap {
    border-radius: 14px;
    overflow: auto;
    border: 1px solid rgba(148, 163, 184, 0.16);
    box-shadow: 0 10px 30px rgba(2, 6, 23, 0.18);
}

.reports-managers-table {
    width: 100%;
    border-collapse: collapse;
}

.reports-managers-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: rgba(30, 41, 59, 0.96);
    backdrop-filter: blur(6px);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(148, 163, 184, 0.95);
    white-space: nowrap;
}

.reports-managers-table .col-rank {
    width: 2.5rem;
    text-align: center;
}

.reports-managers-table .col-share {
    min-width: 9rem;
}

.reports-manager-row--top .reports-manager-name-text {
    font-weight: 600;
}

.reports-manager-row--top .reports-manager-revenue {
    color: rgba(167, 243, 208, 0.98);
}

.reports-manager-name {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 12rem;
}

.reports-manager-meta {
    font-size: 0.78rem;
}

.reports-manager-share {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 1.6rem;
    padding: 0.2rem 0;
}

.reports-manager-share-bar {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 0.55rem;
    max-width: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.55), rgba(56, 189, 248, 0.45));
    opacity: 0.85;
}

.reports-manager-share-label {
    position: relative;
    z-index: 1;
    padding-left: 0.15rem;
    font-size: 0.82rem;
    color: rgba(226, 232, 240, 0.92);
}

.reports-managers-total-row td {
    border-top: 2px solid rgba(148, 163, 184, 0.24);
    background: rgba(15, 23, 42, 0.42);
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
}

@media (max-width: 900px) {
    .reports-managers-table .col-share {
        min-width: 7rem;
    }
}

.debt-dynamics-chart-card {
    margin-top: 1.25rem;
}

.debt-dynamics-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.debt-dynamics-chart-header h2 {
    margin: 0;
    font-size: 1.05rem;
}

.debt-granularity-tabs {
    display: inline-flex;
    gap: 0.25rem;
    padding: 0.2rem;
    border-radius: 0.5rem;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.debt-gran-tab {
    border: none;
    background: transparent;
    color: rgba(148, 163, 184, 0.95);
    font-size: 0.82rem;
    padding: 0.35rem 0.65rem;
    border-radius: 0.35rem;
    cursor: pointer;
    margin-top: 0;
    box-shadow: none;
}

.debt-gran-tab:hover {
    transform: none;
    filter: none;
    box-shadow: none;
    color: #e2e8f0;
}

.debt-gran-tab.is-active {
    background: rgba(99, 102, 241, 0.85);
    color: #fff;
}

.debt-gran-tab.is-active:hover {
    color: #fff;
}

.debt-change--up {
    color: #f87171;
}

.debt-change--down {
    color: #4ade80;
}

.debt-dynamics-empty {
    border-left: 3px solid rgba(99, 102, 241, 0.55);
    padding-left: 0.75rem;
}

.debt-top-section {
    margin-top: 1.75rem;
}

.page-kpi-hint {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.75rem;
}

/* Динамика продаж */
.sales-change--up {
    color: #4ade80;
}

.sales-change--down {
    color: #f87171;
}

.sd-heatmap {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.sd-heatmap-cell {
    border-radius: 8px;
    padding: 0.65rem 0.5rem;
    text-align: center;
    background: rgba(34, 197, 94, var(--sd-heat, 0.08));
    border: 1px solid rgba(148, 163, 184, 0.18);
    min-height: 4.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.15rem;
}

.sd-heatmap-dow {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
}

.sd-heatmap-amount {
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    font-size: 0.95rem;
}

.sd-heatmap-share {
    font-size: 0.72rem;
    color: #94a3b8;
}

.sd-contrib-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    margin-top: 1rem;
}

@media (max-width: 900px) {
    .sd-contrib-grid {
        grid-template-columns: 1fr;
    }

    .sd-heatmap {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.sd-contrib-block h3 {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
}

.sd-contrib-block .data-table {
    margin: 0;
}

.sd-delta-pos {
    color: #4ade80;
}

.sd-delta-neg {
    color: #f87171;
}

.sd-compare-block {
    margin: 0.35rem 0 0.85rem;
    clear: both;
    width: 100%;
}

.sd-compare-check {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
    font-size: 0.9rem;
    color: #cbd5e1;
    margin: 0;
    width: auto;
}

.sd-compare-check input[type="checkbox"] {
    width: 1.05rem;
    height: 1.05rem;
    margin: 0;
    flex: 0 0 auto;
    accent-color: #6366f1;
}

.sd-compare-body {
    margin-top: 0.65rem;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.06);
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 0.85rem 1.25rem;
}

.sd-compare-body[hidden] {
    display: none !important;
}

.sd-compare-dates {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: end;
    gap: 0.65rem 0.85rem;
    flex: 0 0 auto;
    width: auto;
    max-width: 100%;
}

.sd-compare-dates .photo-reports-filter-field {
    flex: 0 0 11rem;
    width: 11rem;
    min-width: 0;
    max-width: 11rem;
}

.sd-compare-dates .photo-reports-filter-field input[type="date"] {
    width: 11rem;
    max-width: 100%;
}

@media (max-width: 560px) {
    .sd-compare-dates {
        flex-wrap: wrap;
    }

    .sd-compare-dates .photo-reports-filter-field {
        flex: 0 0 10.5rem;
        width: 10.5rem;
        max-width: 10.5rem;
    }
}

.sd-season-presets {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 12rem;
}

.sd-season-presets-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sd-season-presets-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.sd-season-btn {
    padding: 0.35rem 0.7rem;
    font-size: 0.82rem;
}

.sd-heatmap--compare {
    margin-top: 0.5rem;
}

.sd-heatmap-cell--b {
    background: rgba(167, 139, 250, var(--sd-heat, 0.08));
}

.sd-term {
    cursor: help;
    border-bottom: 1px dotted rgba(148, 163, 184, 0.55);
}

