/* ═══════════════════════════════════════════════════════════════
   B1 SalesHub - Modern Backoffice Design System
   ═══════════════════════════════════════════════════════════════ */

/* --- Design Tokens --- */
:root {
    /* Brand Colors */
    --primary: #1a56db;
    --primary-hover: #1346c2;
    --primary-light: rgba(26, 86, 219, 0.08);
    --primary-glow: rgba(26, 86, 219, 0.14);

    /* Semantic Colors */
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.08);
    --warning: #d97706;
    --warning-light: rgba(217, 119, 6, 0.08);
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.08);
    --info: #1a56db;
    --info-light: rgba(26, 86, 219, 0.08);

    /* Neutrals */
    --bg: #f3f4f6;
    --bg-secondary: #f8fafc;
    --bg-card: #ffffff;
    --bg-hover: rgba(0, 0, 0, 0.03);
    --surface: #ffffff;
    --surface-hover: #f9fafb;
    --border: #e5e7eb;
    --border-light: #f3f4f6;

    /* Text */
    --text: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;

    /* Sidebar */
    --sidebar-bg: #ffffff;
    --sidebar-text: #4b5563;
    --sidebar-text-active: #1a56db;
    --sidebar-hover: #f3f4f6;
    --sidebar-active-bg: rgba(26, 86, 219, 0.08);
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;

    /* Layout */
    --topbar-height: 64px;
    --radius: 8px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);

    /* Transitions */
    --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Distribution planning / truck loading desk */
.dist-shell {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 1680px;
    margin: 0 auto;
    padding-bottom: 2rem;
}

.dist-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.dist-page-header h2 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 900;
    color: var(--text);
}

.dist-page-header p {
    margin: 0.2rem 0 0;
    color: var(--text-muted);
    font-size: 0.84rem;
    font-weight: 600;
}

.dist-header-actions,
.dist-action-stack {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.dist-action-stack {
    flex-wrap: nowrap;
}

.dist-action-stack .btn {
    min-height: 32px;
    padding: 0.35rem 0.55rem;
}

.dist-flow {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) auto minmax(150px, 1fr) auto minmax(150px, 1fr) auto minmax(150px, 1fr);
    gap: 0.55rem;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    padding: 0.85rem;
}

.dist-flow > .fa-arrow-right {
    color: var(--text-muted);
    font-size: 0.8rem;
    justify-self: center;
}

.dist-flow-step {
    appearance: none;
    min-height: 46px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.65rem 0.8rem;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.dist-flow-step i {
    color: var(--primary);
}

.dist-flow-step strong {
    margin-left: auto;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.07);
    color: var(--text);
    min-width: 28px;
    padding: 0.15rem 0.45rem;
    text-align: center;
    font-size: 0.72rem;
}

.dist-flow-step:hover {
    border-color: rgba(26, 86, 219, 0.28);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.dist-flow-step.active {
    background: var(--primary-light);
    border-color: rgba(26, 86, 219, 0.24);
    color: var(--primary);
}

.dist-flow-step.active strong {
    background: #fff;
    color: var(--primary);
}

.dist-readonly-field {
    min-height: 42px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    background: #f8fafc;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.85rem;
    font-size: 0.86rem;
    font-weight: 700;
}

.dist-readonly-field i {
    color: var(--primary);
}

.dist-click-row {
    cursor: pointer;
}

.dist-click-row:hover {
    background: #f8fafc;
}

.dist-click-row.expanded {
    background: var(--primary-light);
}

.dist-transfer-detail-row > td {
    background: #f8fafc;
    padding: 0 !important;
}

.dist-transfer-detail {
    border-top: 1px solid var(--border);
    padding: 1rem;
}

.dist-transfer-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.dist-transfer-detail-grid > div,
.dist-detail-note {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    padding: 0.75rem;
}

.dist-detail-label {
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.dist-detail-value {
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 900;
    margin-top: 0.2rem;
}

.dist-detail-note {
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 0.85rem;
}

.dist-transfer-detail-columns {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
    gap: 0.85rem;
}

.dist-transfer-detail-columns--single {
    grid-template-columns: minmax(0, 1fr);
}

.dist-transfer-detail-columns > div {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.dist-transfer-detail-columns h4 {
    margin: 0;
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
    font-weight: 900;
}

.dist-detail-card {
    min-width: 0;
}

.dist-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 0.85rem;
}

.dist-metric {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    padding: 0.95rem 1rem;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 0.78rem;
    align-items: center;
    min-height: 86px;
}

.dist-metric-icon {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dist-metric-label {
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dist-metric-value {
    color: var(--text);
    font-size: 1.32rem;
    font-weight: 900;
    line-height: 1.1;
    margin-top: 0.22rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dist-metric-sub {
    color: var(--text-secondary);
    font-size: 0.74rem;
    font-weight: 650;
    margin-top: 0.2rem;
}

.dist-filter-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    padding: 0.85rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    align-items: end;
}

.dist-filter-card--truck {
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
}

.dist-filter-section {
    display: contents;
}

.dist-filter-card .form-group {
    margin: 0;
}

.dist-filter-card label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.dist-filter-card input,
.dist-filter-card select {
    width: 100%;
    min-height: 38px;
}

.dist-two-col {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(460px, 0.9fr);
    gap: 1rem;
    align-items: start;
}

.dist-two-col > .card {
    min-width: 0;
}

.dist-two-col--truck {
    grid-template-columns: minmax(760px, 1.15fr) minmax(620px, 0.85fr);
}

.dist-table {
    table-layout: fixed;
}

.dist-table th,
.dist-table td {
    padding-left: 0.72rem;
    padding-right: 0.72rem;
    vertical-align: top;
}

.dist-table--orders {
    min-width: 940px;
}

.dist-table--orders th:nth-child(1),
.dist-table--orders td:nth-child(1) { width: 110px; }
.dist-table--orders th:nth-child(2),
.dist-table--orders td:nth-child(2) { width: 190px; }
.dist-table--orders th:nth-child(3),
.dist-table--orders td:nth-child(3) { width: 92px; }
.dist-table--orders th:nth-child(4),
.dist-table--orders td:nth-child(4) { width: 68px; }
.dist-table--orders th:nth-child(5),
.dist-table--orders td:nth-child(5) { width: 116px; }
.dist-table--orders th:nth-child(6),
.dist-table--orders td:nth-child(6) { width: 102px; }
.dist-table--orders th:nth-child(8),
.dist-table--orders td:nth-child(8) { width: 122px; }

.dist-table--transfers {
    min-width: 820px;
}

.dist-table--transfers th:nth-child(1),
.dist-table--transfers td:nth-child(1) { width: 130px; }
.dist-table--transfers th:nth-child(2),
.dist-table--transfers td:nth-child(2) { width: 170px; }
.dist-table--transfers th:nth-child(3),
.dist-table--transfers td:nth-child(3),
.dist-table--transfers th:nth-child(4),
.dist-table--transfers td:nth-child(4) { width: 72px; }
.dist-table--transfers th:nth-child(5),
.dist-table--transfers td:nth-child(5) { width: 76px; }
.dist-table--transfers th:nth-child(6),
.dist-table--transfers td:nth-child(6) { width: 100px; }
.dist-table--transfers th:nth-child(7),
.dist-table--transfers td:nth-child(7) { width: 100px; }
.dist-table--transfers th:nth-child(8),
.dist-table--transfers td:nth-child(8) { width: 82px; }

.dist-strong {
    font-weight: 900;
    color: var(--text);
}

.dist-line-preview {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    font-size: 0.74rem;
    color: var(--text-secondary);
    max-width: 260px;
}

.dist-empty {
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 700;
}

@media (max-width: 1180px) {
    .dist-flow {
        grid-template-columns: 1fr;
    }

    .dist-flow > .fa-arrow-right {
        transform: rotate(90deg);
    }

    .dist-filter-card,
    .dist-two-col {
        grid-template-columns: 1fr;
    }

    .dist-transfer-detail-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1520px) {
    .dist-two-col--truck {
        grid-template-columns: 1fr;
    }
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0; padding: 0; box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════════
   LOGIN
   ═══════════════════════════════════════════════════════════════ */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    position: relative;
    overflow: hidden;
}
.login-container::before {
    content: none;
}
.login-container::after {
    content: none;
}
.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 3rem;
    width: 400px;
    position: relative;
    z-index: 1;
    box-shadow: var(--shadow-lg);
}
.login-brand {
    text-align: center;
    margin-bottom: 2.5rem;
}
.login-logo {
    width: 56px; height: 56px;
    background: transparent;
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.4rem;
    color: white;
    box-shadow: none;
}
.brand-logo-img {
    width: 100%;
    height: 100%;
    display: block;
}
.login-brand h1 {
    color: var(--text);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.login-brand p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}
.login-card .form-group {
    margin-bottom: 1.25rem;
}
.login-card label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.login-card input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
    transition: var(--transition);
}
.login-card input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: var(--surface);
}
.login-card input::placeholder { color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════════════ */
#dashboard-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: width var(--transition-slow);
    overflow-x: hidden;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
}
.brand-icon {
    width: 36px; height: 36px;
    background: transparent;
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 0.95rem;
    flex-shrink: 0;
    box-shadow: none;
}
.brand-text {
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.sidebar-section-label {
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 1rem 1.25rem 0.45rem;
}

.sidebar-nav {
    list-style: none;
    padding: 0 0.75rem;
}
.sidebar-nav li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.58rem 0.85rem;
    margin-bottom: 2px;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
}
.sidebar-nav li i {
    width: 20px;
    text-align: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}
.sidebar-nav li:hover {
    background: var(--sidebar-hover);
    color: var(--text);
}
.sidebar-nav li.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-text-active);
    font-weight: 600;
}
.sidebar-nav li.active i { color: var(--primary); }

.sidebar-groups {
    padding-top: 0.25rem;
}

.sidebar-groups li {
    min-height: 44px;
    font-weight: 700;
}

.sidebar-footer {
    margin-top: auto;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}
.avatar {
    width: 34px; height: 34px;
    background: var(--primary);
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}
.user-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}
.user-meta span:first-child {
    color: var(--text);
    font-weight: 600;
    font-size: 0.82rem;
}
.user-role {
    color: var(--text-secondary);
    font-size: 0.7rem;
}

/* ═══════════════════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════════════════ */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    width: calc(100% - var(--sidebar-width));
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left var(--transition-slow);
}

.topbar {
    height: var(--topbar-height);
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 50;
    min-width: 0;
}
.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.topbar-left h1 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.sap-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.85rem;
    background: var(--success-light);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--success);
}
.sap-status.error { background: var(--danger-light); color: var(--danger); }
.status-dot {
    width: 8px; height: 8px;
    background: currentColor;
    border-radius: 50%;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.sidebar-toggle { display: none; }

.view-container {
    padding: 1.5rem 2rem 2rem;
    flex: 1;
    min-width: 0;
}

.group-tabs {
    padding: 1rem 2rem 0;
    background: var(--bg);
    position: sticky;
    top: var(--topbar-height);
    z-index: 40;
    min-width: 0;
}

.group-tabs-inner {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    overflow-x: auto;
    scrollbar-width: thin;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    padding: 0.45rem;
}

.group-tab {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    flex: 0 0 auto;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    padding: 0.45rem 0.75rem;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}

.group-tab:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.group-tab.active {
    background: var(--primary);
    color: #fff;
    box-shadow: var(--shadow);
}

.group-tab.active i {
    color: #fff;
}

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover { background: var(--primary-hover); box-shadow: var(--shadow-md); }
.btn-full { width: 100%; justify-content: center; padding: 0.75rem; }
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--surface-hover); color: var(--text); border-color: var(--text-muted); }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.78rem; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #b45309; }
.btn-icon {
    background: none;
    border: none;
    color: var(--sidebar-text);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-xs);
    font-size: 1rem;
    transition: var(--transition);
}
.btn-icon:hover { color: var(--sidebar-text-active); background: var(--sidebar-hover); }

/* ═══════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════════ */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
}
.card-header p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}
.card-body { padding: 1.5rem; }
.card-body.compact { padding: 1rem 1.5rem; }

/* --- KPI Stat Cards --- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.kpi-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    transition: var(--transition);
}
.kpi-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.kpi-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}
.kpi-value {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1;
}
.kpi-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
}
.kpi-icon {
    width: 42px; height: 42px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════════════════ */
.table-container {
    overflow-x: auto;
}

.item-master-table {
    table-layout: fixed;
    min-width: 980px;
}

.item-master-table th {
    padding: 0.7rem 0.9rem !important;
    font-size: 0.7rem !important;
}

.item-master-table th:first-child,
.item-master-table td:first-child {
    padding-left: 1.4rem !important;
}

.item-master-table th:last-child,
.item-master-table td:last-child {
    padding-right: 1.4rem !important;
}

.item-master-table td {
    padding: 0.7rem 0.9rem !important;
    vertical-align: middle;
}

.item-master-table img {
    width: 40px !important;
    height: 40px !important;
}

.item-master-table td > div {
    min-width: 0;
}

table {
    width: 100%;
    border-collapse: collapse;
}
thead th {
    background: var(--bg);
    padding: 0.7rem 1rem;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.85rem;
    color: var(--text);
    vertical-align: middle;
}
tbody tr { transition: var(--transition); }
tbody tr:hover { background: var(--surface-hover); }
tbody tr:last-child td { border-bottom: none; }

/* ═══════════════════════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════════════════════ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-info { background: var(--info-light); color: var(--info); }
.badge-default { background: #f1f5f9; color: var(--text-secondary); }

/* ═══════════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════════ */
.form-group {
    margin-bottom: 1rem;
}
.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}
input[type="text"],
input[type="password"],
input[type="email"],
input[type="date"],
input[type="number"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 0.6rem 0.85rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--text);
    transition: var(--transition);
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

/* ═══════════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.15s ease;
}
.modal-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    animation: slideUp 0.2s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════════════════════════ */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    background: var(--surface);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--primary);
    font-size: 0.85rem;
    font-weight: 500;
    animation: slideIn 0.25s ease;
    min-width: 280px;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast.info { border-left-color: var(--info); }

@keyframes slideIn {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

/* ═══════════════════════════════════════════════════════════════
   LOADER
   ═══════════════════════════════════════════════════════════════ */
.loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 3rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.loader::before {
    content: '';
    width: 20px; height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-msg {
    color: var(--danger);
    font-size: 0.82rem;
    margin-top: 0.75rem;
    text-align: center;
}

/* ═══════════════════════════════════════════════════════════════
   DASHBOARD SPECIFIC
   ═══════════════════════════════════════════════════════════════ */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.25rem;
}

.quick-action {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    background: none;
    width: 100%;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    text-align: left;
}
.quick-action:hover { background: var(--surface-hover); border-color: var(--primary); }
.quick-action i:first-child { width: 18px; text-align: center; }
.quick-action i:last-child { margin-left: auto; color: var(--text-muted); font-size: 0.7rem; }

.health-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border-light);
}
.health-row:last-child { border-bottom: none; }
.health-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.tx-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--border-light);
}
.tx-row:last-child { border-bottom: none; }
.tx-icon {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
}

/* ═══════════════════════════════════════════════════════════════
   ROLE MATRIX
   ═══════════════════════════════════════════════════════════════ */
.matrix-header {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.matrix-header i { color: var(--primary); font-size: 0.8rem; }
.matrix-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem 1rem;
}
.matrix-grid label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem 0;
}
.matrix-grid input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: var(--primary);
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; width: 100%; }
    .sidebar-toggle { display: flex; }
    .kpi-grid { grid-template-columns: 1fr; }
    .topbar { padding: 0 1rem; }
    .group-tabs { padding: 0.75rem 1rem 0; }
    .view-container { padding: 1rem; }
}

/* ═══════════════════════════════════════════════════════════════
   PREMIUM UTILITIES
   ═══════════════════════════════════════════════════════════════ */
.glass-panel {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.hover-lift {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease;
}
.hover-lift:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.slide-in-right {
    animation: slideInRight 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.1) forwards;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.slide-in-up {
    animation: slideInUp 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideInUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.fade-in-scale {
    animation: fadeInScale 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.05) forwards;
}

@keyframes fadeInScale {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.seg-control {
    display: flex;
    background: rgba(15, 23, 42, 0.04);
    border-radius: 12px;
    padding: 4px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.03);
}
.seg-btn {
    flex: 1;
    text-align: center;
    padding: 0.65rem 1rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.seg-btn:hover:not(.active) {
    color: var(--text);
    background: rgba(255,255,255,0.4);
}
.seg-btn.active {
    background: #ffffff;
    color: var(--primary);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0,0,0,0.04);
}
.progress-bar-fill {
    animation: progressFill 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    width: 0;
}
@keyframes progressFill {
    from { width: 0; }
}

   MAP FULLSCREEN & MODERN UI
   ═══════════════════════════════════════════════════════════════ */
.map-fullscreen-container {
    position: fixed !important;
    top: 0; left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 99999 !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    background: #f8fafc !important; /* Light aesthetic background */
}
.map-fullscreen-container #routeGeoMap {
    height: 100vh !important;
    min-height: 100vh !important;
    border-radius: 0 !important;
}
.map-header-overlay {
    position: absolute;
    top: 0; left: 0; right: 0;
    padding: 1rem 1.5rem;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.92);
    pointer-events: none;
}
.map-header-overlay h3 { color: var(--text) !important; text-shadow: none !important; }
.map-header-overlay p { color: var(--text-secondary) !important; }
.map-header-overlay > * { pointer-events: auto; }

/* Modern Float Panels */
.float-panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    gap: 0.75rem;
}
.btn-round {
    width: 44px; height: 44px;
    border-radius: 22px;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border: none; cursor: pointer; transition: var(--transition);
}
.btn-round:hover { transform: scale(1.05); }

/* Sleek Pill Card */
.sleek-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
    margin-bottom: 0.75rem;
}
.sleek-card:hover { box-shadow: var(--shadow-md); }
.sleek-icon-box {
    width: 48px; height: 48px;
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
}

/* ═══════════════════════════════════════════════════════════════
   EXPLORER (Category Explorer)
   ═══════════════════════════════════════════════════════════════ */
.explorer-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
    min-height: 400px;
}
.explorer-col {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: 500px;
    overflow-y: auto;
}
.explorer-col-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
.explorer-col-header h4 {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
}
.cat-item {
    padding: 0.5rem 0.65rem;
    border-radius: var(--radius-xs);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 0.82rem;
    border: 1px solid transparent;
    transition: var(--transition);
}
.cat-item:hover { background: var(--surface-hover); }
.cat-item.active {
    border-color: var(--primary);
    background: var(--primary-light);
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════
   SYNC CONNECTIVITY VISUAL
   ═══════════════════════════════════════════════════════════════ */
.sync-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 2rem;
    background: var(--sidebar-bg);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}
.sync-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}
.sync-node-icon {
    width: 52px; height: 52px;
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem;
    color: #fff;
}
.sync-node-label {
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.sync-arrow {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--primary);
}
.sync-arrow span {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════
   UTILITY
   ═══════════════════════════════════════════════════════════════ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.25rem; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; gap: 0.5rem; }
.gap-sm { gap: 0.5rem; }
.gap-md { gap: 1rem; }
.gap-lg { gap: 1.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.text-sm { font-size: 0.8rem; }
.text-xs { font-size: 0.72rem; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
code {
    background: #f1f5f9;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--info);
}

/* ── Premium Weekrooster UI ───────────────────────────────────────────── */

/* Salesperson Section Wrapper */
.wr-salesperson-section {
    background: #f8fafc;
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 3rem;
    border: 1px solid var(--border);
    box-shadow: inset 0 2px 8px rgba(0,0,0,.02);
}

/* Premium Profile Header */
.wr-profile-header {
    display: flex;
    gap: 1.5rem;
    align-items: stretch;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.wr-profile-avatar-card {
    background: var(--primary);
    display: flex;
    gap: 1.2rem;
    align-items: center;
    padding: 1.2rem 1.5rem;
    border-radius: var(--radius);
    color: white;
    box-shadow: 0 4px 15px rgba(0,0,0,.08);
    min-width: 320px;
}
.wr-profile-avatar-card img {
    height: 75px;
    width: 75px;
    border-radius: 12px;
    object-fit: cover;
    background: #fff;
    opacity: 0.9;
    padding: 2px;
}
.wr-profile-titles {
    display: flex;
    flex-direction: column;
}
.wr-profile-name {
    font-size: 1.45rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.5px;
}
.wr-profile-subtitle {
    font-size: 0.85rem;
    color: #94a3b8;
    margin: 4px 0 0 0;
    font-weight: 500;
}
.wr-profile-tag {
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.7rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 12px;
    width: fit-content;
    margin-top: 6px;
}

/* KPI Cards next to avatar */
.wr-kpi-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,.02);
    min-width: 150px;
}
.wr-kpi-title {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    text-transform: uppercase;
}
.wr-kpi-val {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: baseline;
    gap: 8px;
    letter-spacing: -1px;
}
.wr-kpi-sub {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: normal;
}

/* Day Columns Grid */
.wr-grid-scroll {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1rem;
    padding-bottom: 1.5rem;
}
.wr-grid-scroll::-webkit-scrollbar {
    height: 8px;
}
.wr-grid-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.wr-day-col {
    background: #f1f5f9;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 15px rgba(0,0,0,.015);
    overflow: hidden;
    min-width: 0; /* allows shrinking below content width */
}

.wr-day-header {
    background: transparent;
    padding: 1.25rem 1.25rem 0.5rem 1.25rem;
}
.wr-day-title {
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--text);
    margin: 0;
    letter-spacing: -0.3px;
}
.wr-day-date {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    margin: 3px 0 0 0;
}

.wr-day-droptarget {
    flex: 1;
    min-height: 200px;
    padding: 1rem 1.25rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.wr-day-droptarget.drag-over {
    background: var(--primary-light);
    box-shadow: inset 0 0 0 2px var(--primary);
    border-radius: var(--radius);
}

/* Empty Drop Zone Placeholder */
.wr-empty-drop {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    background: transparent;
    transition: all 0.2s;
    font-size: 1.5rem;
}

/* Premium Blok Card */
.wr-blok-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 4px 12px rgba(0,0,0,.03);
    cursor: grab;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}
.wr-blok-card:active {
    cursor: grabbing;
}
.wr-blok-card:hover {
    box-shadow: 0 10px 30px rgba(0,0,0,.08);
    transform: translateY(-3px);
    border-color: #cbd5e1;
}

.wr-blok-card.ghost {
    opacity: 0.4;
    transform: scale(0.95);
    box-shadow: none;
}

.wr-blok-badge {
    position: absolute;
    top: 1.25rem;
    left: 1.25rem;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.wr-blok-badge.ochtend {
    background: #e0f2fe;
    color: #0369a1;
}
.wr-blok-badge.middag {
    background: #dbeafe;
    color: #1d4ed8;
}

.wr-blok-drag {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    color: #cbd5e1;
    cursor: grab;
    font-size: 0.9rem;
}
.wr-blok-drag:active {
    cursor: grabbing;
}

.wr-blok-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin: 1.8rem 0 0.4rem 0;
}
.wr-blok-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

/* ── Route-Grouped Layout (Weekrooster v3) ───────────────────── */
.wr-route-group {
    background: #f8fafc;
    border-radius: var(--radius);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    border: 1px solid #e2e8f0;
    cursor: grab;
    transition: all 0.2s;
}
.wr-route-group:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.wr-route-group:active {
    cursor: grabbing;
}

.wr-route-group-header {
    display: flex;
    flex-direction: column;
    padding: 8px 10px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

/* ── Swimlane Layout (legacy) ────────────────────────────────── */
.wr-swimlane {
    background: #fafbfc;
    border-radius: 10px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    border: 1px solid rgba(0,0,0,.04);
}

.wr-swimlane-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 10px;
    cursor: grab;
    border-radius: 8px;
    transition: all 0.15s;
}
.wr-swimlane-header:hover {
    filter: brightness(0.97);
}
.wr-swimlane-header:active {
    cursor: grabbing;
}

.wr-sp-avatar {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: .65rem;
    font-weight: 800;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}

/* Compact Route Card */
.wr-route-card {
    background: #ffffff;
    border: 1px solid #e8ecf0;
    border-radius: 10px;
    overflow: hidden;
    cursor: grab;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,.02);
}
.wr-route-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,.06);
    border-color: #cbd5e1;
    transform: translateY(-1px);
}
.wr-route-card.expanded {
    border-color: var(--swim-accent, var(--primary));
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
}
.wr-route-card.ghost {
    opacity: 0.35;
    transform: scale(0.95);
    box-shadow: none;
}
.wr-route-card:active {
    cursor: grabbing;
}

.wr-route-card-main {
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.15s;
}
.wr-route-card-main:hover {
    background: #fafbfc;
}

/* Expand area for customer list */
.wr-route-expand-area {
    border-top: 1px solid #f0f2f5;
    background: #fafbfc;
}

.wr-customer-list {
    padding: 4px 6px;
    max-height: 220px;
    overflow-y: auto;
}
.wr-customer-list::-webkit-scrollbar {
    width: 4px;
}
.wr-customer-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

.wr-customer-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 6px;
    border-radius: 6px;
    transition: background 0.12s;
}
.wr-customer-row:hover {
    background: rgba(0,0,0,.025);
}

.wr-customer-num {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background: #f1f5f9;
    color: #64748b;
    font-size: .62rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wr-freq-badge {
    font-size: .6rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #64748b;
    flex-shrink: 0;
}

.wr-expand-icon {
    transition: transform 0.2s ease !important;
}
/* -- Leaflet MarkerCluster custom styles ---------------------------------- */
.marker-cluster {
    border-radius: 50%;
    text-align: center;
}
.marker-cluster-small {
    background: rgba(14, 165, 233, 0.35);
    border: 2px solid rgba(14, 165, 233, 0.7);
}
.marker-cluster-small div {
    background: rgba(14, 165, 233, 0.9);
    border-radius: 50%;
    width: 24px; height: 24px; margin: 1px;
}
.marker-cluster-medium {
    background: rgba(139, 92, 246, 0.35);
    border: 2px solid rgba(139, 92, 246, 0.7);
}
.marker-cluster-medium div {
    background: rgba(139, 92, 246, 0.9);
    border-radius: 50%;
    width: 32px; height: 32px; margin: 2px;
}
.marker-cluster-large {
    background: rgba(245, 158, 11, 0.35);
    border: 2px solid rgba(245, 158, 11, 0.7);
}
.marker-cluster-large div {
    background: rgba(245, 158, 11, 0.9);
    border-radius: 50%;
    width: 40px; height: 40px; margin: 3px;
}

/* Override Leaflet popup for crisp dark-theme look */
.leaflet-popup-content-wrapper {
    border-radius: 10px !important;
    box-shadow: 0 4px 20px rgba(0,0,0,.15) !important;
    font-family: 'Inter', sans-serif !important;
}
.leaflet-popup-content {
    margin: 10px 14px !important;
    line-height: 1.5 !important;
}
.leaflet-popup-close-button {
    top: 6px !important;
    right: 8px !important;
    font-size: 16px !important;
}
