/* =====================================================
   盘古外勤 · 管理后台 CSS
   Clean rewrite — no legacy conflicts, no !important hacks
   ===================================================== */

/* ── VARIABLES ────────────────────────────────────── */
:root {
    --accent:       #7c6ef7;
    --accent2:      #a78bfa;
    --success:      #34d399;
    --warning:      #fbbf24;
    --danger:       #f87171;
    --info:         #60a5fa;

    --bg-body:      linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    --bg-glass:     rgba(255,255,255,0.07);
    --bg-card:      rgba(255,255,255,0.07);
    --bg-hover:     rgba(255,255,255,0.12);

    --border:       rgba(255,255,255,0.14);
    --border-light: rgba(255,255,255,0.07);

    --text:         #f1f5f9;
    --text-muted:   rgba(241,245,249,0.60);

    --shadow:       0 8px 32px rgba(0,0,0,0.32);
    --shadow-lg:    0 16px 48px rgba(0,0,0,0.45);

    --radius:    14px;
    --radius-sm: 8px;
    --radius-xs: 5px;

    --blur:  blur(16px);
    --blur2: blur(10px);

    --nav-h: 48px;
    --sidebar-w: 220px;
}

/* ── RESET ────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ── BASE ─────────────────────────────────────────── */
html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
                 'Microsoft YaHei', sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--bg-body);
    background-attachment: fixed;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ── SCROLLBAR ────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.32); }

/* ── PAGE WRAPPERS ────────────────────────────────── */
#app { min-height: 100vh; }
.page { min-height: 100vh; }

.main-page-col {
    display: flex !important;
    flex-direction: row !important;
    min-height: 100vh;
    width: 100%;
}

/* ── LOGIN PAGE ───────────────────────────────────── */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-body);
    background-attachment: fixed;
    position: relative;
    overflow: hidden;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(124,110,247,0.25) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(167,139,250,0.2)  0%, transparent 50%),
        radial-gradient(circle at 50% 100%,rgba(96,165,250,0.15)  0%, transparent 60%);
    animation: bgPulse 12s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes bgPulse {
    from { opacity: 0.7; transform: scale(1); }
    to   { opacity: 1;   transform: scale(1.05); }
}

.login-container {
    width: 100%;
    max-width: 420px;
    margin: 20px;
    padding: 48px 40px;
    background: var(--bg-glass);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.1);
    position: relative;
    z-index: 1;
    animation: slideUp 0.6s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

.login-header {
    text-align: center;
    margin-bottom: 36px;
}

.login-header h1 {
    font-size: 30px;
    font-weight: 700;
    background: linear-gradient(135deg, #a78bfa, #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

.login-form { margin-bottom: 24px; }

.login-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

.login-footer p { font-size: 12px; color: rgba(255,255,255,0.25); }

.login-error {
    background: rgba(248,113,113,0.14);
    border: 1px solid rgba(248,113,113,0.35);
    color: #fca5a5;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 16px;
}

/* ── FORM GROUPS ──────────────────────────────────── */
.form-group { margin-bottom: 20px; }

.form-group label {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
    color: rgba(255,255,255,0.80);
    font-size: 13px;
    font-weight: 500;
}

.form-group label svg { color: var(--accent2); flex-shrink: 0; }

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.08);
    color: var(--text);
    font-size: 13px;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: rgba(255,255,255,0.30); }

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255,255,255,0.12);
    box-shadow: 0 0 0 3px rgba(124,110,247,0.20);
}

.form-group select option { background: #1e1b4b; color: var(--text); }

select option { background: #1e1b4b; color: var(--text); }

/* ── BUTTONS ──────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.18s cubic-bezier(0.34,1.56,0.64,1);
    line-height: 1;
    text-decoration: none;
}

.btn:active { transform: scale(0.95); }

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(124,110,247,0.4);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(124,110,247,0.55); transform: translateY(-1px); }

.btn-secondary {
    background: rgba(255,255,255,0.10);
    color: var(--text);
    border-color: var(--border);
}
.btn-secondary:hover { background: rgba(255,255,255,0.17); }

.btn-success {
    background: linear-gradient(135deg, #059669, var(--success));
    color: #fff;
}
.btn-success:hover { box-shadow: 0 4px 14px rgba(52,211,153,0.4); transform: translateY(-1px); }

.btn-danger {
    background: linear-gradient(135deg, #dc2626, var(--danger));
    color: #fff;
}
.btn-danger:hover { box-shadow: 0 4px 14px rgba(248,113,113,0.4); transform: translateY(-1px); }

.btn-warning {
    background: linear-gradient(135deg, #d97706, var(--warning));
    color: #1a1a1a;
}
.btn-warning:hover { box-shadow: 0 4px 14px rgba(251,191,36,0.35); transform: translateY(-1px); }

.btn-sm { padding: 5px 11px; font-size: 12px; }

.btn-login {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
    color: #fff;
    box-shadow: 0 6px 20px rgba(124,110,247,0.4);
}
.btn-login:hover { box-shadow: 0 8px 28px rgba(124,110,247,0.55); transform: translateY(-2px); }

/* ── LEFT SIDEBAR ─────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    height: 100vh;
    position: sticky;
    top: 0;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: rgba(8,6,28,0.82);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border-right: 1px solid var(--border-light);
    overflow: hidden;
    z-index: 100;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 16px 14px 13px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}
.sidebar-brand .brand-icon { font-size: 20px; }
.sidebar-brand .brand-name {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.sidebar-nav {
    flex: 1;
    padding: 6px 8px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.10) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border-radius: 2px; }

.sidebar-section {
    font-size: 10px;
    font-weight: 700;
    color: rgba(148,163,184,0.55);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 6px 4px;
    user-select: none;
}

.nav-divider {
    height: 1px;
    background: var(--border-light);
    margin: 5px 2px;
}

/* Tab buttons — vertical sidebar */
.tab-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0;
    padding: 8px 14px;
    background: transparent;
    border: none;
    border-left: 2px solid transparent;
    border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    text-align: left;
    margin-bottom: 1px;
    box-sizing: border-box;
}

.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

.tab-btn:hover {
    background: var(--bg-hover);
    color: #fff;
    border-left-color: rgba(124,110,247,0.4);
}

.tab-btn.active {
    background: linear-gradient(90deg, rgba(124,110,247,0.22), rgba(167,139,250,0.10));
    color: #fff;
    border-left-color: var(--accent);
    font-weight: 600;
}

.tab-btn:active { opacity: 0.8; }

.sidebar-footer {
    flex-shrink: 0;
    padding: 10px 10px 12px;
    border-top: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-user {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 2px 2px;
}
.sidebar-user-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-user-role {
    font-size: 11px;
    color: var(--accent2);
    background: rgba(124,110,247,0.18);
    border: 1px solid rgba(124,110,247,0.28);
    border-radius: 10px;
    padding: 2px 8px;
    display: inline-block;
    width: fit-content;
    white-space: nowrap;
}

.btn-logout {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 10px;
    border: 1px solid rgba(248,113,113,0.35);
    border-radius: var(--radius-sm);
    background: rgba(248,113,113,0.10);
    color: #fca5a5;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
    box-sizing: border-box;
}
.btn-logout:hover { background: rgba(248,113,113,0.25); border-color: rgba(248,113,113,0.6); color: #fff; }

/* ── CONTENT AREA ─────────────────────────────────── */
.main-area {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow: hidden;
}

.content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
    min-height: 0;
    box-sizing: border-box;
}

.tab-content { display: none !important; }
.tab-content.active { display: block !important; }

/* ── GLASS CARDS ──────────────────────────────────── */
.glass-card,
.stat-card,
.chart-card,
.card,
.config-list,
.pagination-wrapper {
    background: var(--bg-card);
    backdrop-filter: var(--blur2);
    -webkit-backdrop-filter: var(--blur2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* ── STATS ────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.stat-card {
    padding: 22px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.2s;
}
.stat-card:hover { transform: translateY(-4px) scale(1.02); box-shadow: var(--shadow-lg); }

.stat-icon {
    font-size: 32px;
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    flex-shrink: 0;
}

.stat-info { flex: 1; }
.stat-value { font-size: 26px; font-weight: 700; color: #fff; margin-bottom: 4px; }
.stat-label { font-size: 13px; color: var(--text-muted); }

/* ── CHARTS ───────────────────────────────────────── */
.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(440px, 1fr));
    gap: 18px;
}

.chart-card { padding: 22px; }
.chart-card h3 { margin-bottom: 18px; color: var(--text); font-size: 15px; font-weight: 600; }

/* ── SECTION HEADER ───────────────────────────────── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-light);
}

.section-title h3 {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 3px;
}

.section-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

.section-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.section-filters label {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.section-filters select,
.section-filters input[type="date"] {
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.07);
    color: var(--text);
    font-size: 13px;
    transition: border-color 0.2s, background 0.2s;
}
.section-filters select:focus,
.section-filters input[type="date"]:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255,255,255,0.12);
}
.section-filters select option { background: #302b63; }

/* ── TABLE SCROLL WRAPPER ─────────────────────────── */
.table-scroll-wrap {
    overflow-x: auto;
    border-radius: var(--radius);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.12) transparent;
}
.table-scroll-wrap::-webkit-scrollbar { height: 4px; }
.table-scroll-wrap::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 2px; }
.table-scroll-wrap .data-table { border-radius: 0; border: none; min-width: 640px; }

/* ── TOOLBAR ──────────────────────────────────────── */
.toolbar {
    margin-bottom: 16px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.toolbar select,
.toolbar input[type="date"],
.toolbar input[type="text"],
.toolbar input[type="number"] {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.07);
    color: var(--text);
    font-size: 13px;
    transition: border-color 0.2s, background 0.2s;
}
.toolbar select:focus,
.toolbar input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255,255,255,0.12);
}
.toolbar select option { background: #302b63; }
.toolbar input::placeholder { color: rgba(255,255,255,0.30); }

/* ── DATA TABLE ───────────────────────────────────── */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--bg-card);
    backdrop-filter: var(--blur2);
    -webkit-backdrop-filter: var(--blur2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.data-table th {
    background: rgba(255,255,255,0.06);
    padding: 12px 14px;
    text-align: left;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255,255,255,0.10);
    white-space: nowrap;
}

.data-table td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
    color: var(--text);
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background 0.12s; }
.data-table tbody tr:hover { background: rgba(255,255,255,0.05); }

/* ── MODAL ────────────────────────────────────────── */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(4px);
    z-index: 500;
}
.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: rgba(20,17,50,0.94);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    padding: 28px;
    border-radius: var(--radius);
    max-width: 520px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 60px rgba(0,0,0,0.60);
    animation: modalIn 0.22s cubic-bezier(0.34,1.56,0.64,1);
    color: var(--text);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9) translateY(18px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.modal-header h3 { margin: 0; color: #fff; font-size: 16px; font-weight: 600; }

.close-btn {
    background: rgba(255,255,255,0.08);
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-muted);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}
.close-btn:hover { background: rgba(255,255,255,0.16); color: #fff; }

.modal-body { margin-bottom: 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; }

/* ── ALERTS ───────────────────────────────────────── */
.alert {
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.5;
}
.alert-success { background: rgba(52,211,153,0.12); color: #6ee7b7; border: 1px solid rgba(52,211,153,0.25); }
.alert-error   { background: rgba(248,113,113,0.12); color: #fca5a5; border: 1px solid rgba(248,113,113,0.25); }
.alert-warning { background: rgba(251,191,36,0.12);  color: #fde68a; border: 1px solid rgba(251,191,36,0.25); }
.alert-info    { background: rgba(96,165,250,0.12);  color: #93c5fd; border: 1px solid rgba(96,165,250,0.25); }

/* ── SYSTEM CONFIG ────────────────────────────────── */
.config-list { padding: 0; overflow: hidden; }

.config-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-light);
}
.config-item:last-child { border-bottom: none; }

.config-info { flex: 1; }
.config-label { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.config-desc  { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.config-action { margin-left: 20px; }

/* ── TOGGLE SWITCH ────────────────────────────────── */
.switch { position: relative; display: inline-block; width: 46px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.18);
    transition: 0.28s cubic-bezier(0.34,1.56,0.64,1);
    border-radius: 24px;
}
.slider::before {
    position: absolute;
    content: '';
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background: rgba(255,255,255,0.9);
    transition: 0.28s cubic-bezier(0.34,1.56,0.64,1);
    border-radius: 50%;
}
input:checked + .slider { background: var(--accent); border-color: var(--accent); }
input:checked + .slider::before { transform: translateX(22px); }

/* ── PAGINATION ───────────────────────────────────── */
.pagination-wrapper {
    margin-top: 16px;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.pagination-info { color: var(--text-muted); font-size: 13px; }

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 5px 11px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.05);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s;
    min-width: 34px;
    text-align: center;
}
.pagination-btn:hover:not(.disabled):not(.active) {
    background: rgba(124,110,247,0.20);
    border-color: var(--accent);
    color: var(--accent2);
    transform: translateY(-1px);
}
.pagination-btn.active {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border-color: transparent;
    color: #fff;
    font-weight: 700;
}
.pagination-btn.disabled { opacity: 0.4; cursor: not-allowed; }
.pagination-ellipsis { padding: 5px 8px; color: var(--text-muted); }

.pagination-jump {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--text-muted);
}
.pagination-jump input {
    padding: 4px 8px;
    width: 52px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.07);
    color: var(--text);
}
.pagination-jump input:focus { outline: none; border-color: var(--accent); }

@media (max-width: 768px) {
    .pagination-wrapper { flex-direction: column; align-items: stretch; }
    .pagination-controls { justify-content: center; }
    .pagination-jump { justify-content: center; }
}

/* ── DB MANAGER ───────────────────────────────────── */
.db-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 18px;
}
.db-panel-header {
    padding: 13px 20px;
    background: rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.db-panel-header h4 { font-size: 14px; font-weight: 600; color: var(--text); margin: 0; }
.db-panel-body { padding: 18px 20px; }

.db-table-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }

.db-table-chip {
    padding: 5px 14px;
    background: rgba(124,110,247,0.12);
    border: 1px solid rgba(124,110,247,0.25);
    border-radius: 20px;
    font-size: 12px;
    color: var(--accent2);
    cursor: pointer;
    transition: all 0.15s;
}
.db-table-chip:hover { background: rgba(124,110,247,0.25); transform: translateY(-1px); }
.db-table-chip.active {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border-color: transparent;
    color: #fff;
}

.db-query-box {
    width: 100%;
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-sm);
    color: #e2e8f0;
    font-size: 13px;
    font-family: 'Fira Code', 'Consolas', monospace;
    padding: 12px 14px;
    resize: vertical;
    min-height: 88px;
    transition: border-color 0.2s;
}
.db-query-box:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(124,110,247,0.15);
}

.db-result-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255,255,255,0.10);
    overflow: hidden;
}
.db-result-table th {
    background: rgba(124,110,247,0.15);
    padding: 9px 12px;
    text-align: left;
    color: var(--accent2);
    font-weight: 600;
    border-bottom: 1px solid rgba(255,255,255,0.10);
    white-space: nowrap;
}
.db-result-table td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    color: var(--text);
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.db-result-table tr:last-child td { border-bottom: none; }
.db-result-table tbody tr:hover { background: rgba(255,255,255,0.04); }

.db-status-bar {
    padding: 7px 12px;
    background: rgba(0,0,0,0.22);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 10px;
    font-family: monospace;
}

/* ── TOAST NOTIFICATIONS ──────────────────────────── */
#toastContainer {
    position: fixed;
    top: 12px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    background: rgba(20,17,50,0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    min-width: 260px;
    max-width: 380px;
    pointer-events: all;
    animation: toastIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
    font-size: 13px;
    color: var(--text);
    line-height: 1.45;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px) scale(0.9); }
    to   { opacity: 1; transform: translateX(0)   scale(1);   }
}

.toast.removing {
    animation: toastOut 0.22s ease-in forwards;
}
@keyframes toastOut {
    to { opacity: 0; transform: translateX(40px) scale(0.9); }
}

.toast-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.toast-body { flex: 1; }
.toast-title { font-weight: 600; margin-bottom: 2px; }
.toast-msg   { color: var(--text-muted); font-size: 12px; }

.toast-success { border-left: 3px solid var(--success); }
.toast-success .toast-icon { color: var(--success); }

.toast-error { border-left: 3px solid var(--danger); }
.toast-error .toast-icon { color: var(--danger); }

.toast-warning { border-left: 3px solid var(--warning); }
.toast-warning .toast-icon { color: var(--warning); }

.toast-info { border-left: 3px solid var(--info); }
.toast-info .toast-icon { color: var(--info); }

/* ── CONFIRM DIALOG ───────────────────────────────── */
#confirmOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(4px);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

#confirmBox {
    background: rgba(20,17,50,0.96);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 28px 22px;
    max-width: 380px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.22s cubic-bezier(0.34,1.56,0.64,1);
}
#confirmBox h4 { font-size: 15px; color: #fff; margin-bottom: 10px; }
#confirmBox p  { font-size: 13px; color: var(--text-muted); margin-bottom: 22px; line-height: 1.6; }
#confirmBox .confirm-btns { display: flex; justify-content: flex-end; gap: 10px; }

/* ── VISIT STATS MINI-CARDS ───────────────────────── */
.visit-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin: 18px 0;
}

.visit-stat-card {
    padding: 18px 20px;
}

.visit-stat-value {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 6px;
}

.visit-stat-label {
    font-size: 13px;
    color: var(--text-muted);
}

.accent-blue   { color: var(--info); }
.accent-green  { color: var(--success); }
.accent-yellow { color: var(--warning); }
.accent-cyan   { color: #22d3ee; }

/* ── INFO BOXES ──────────────────────────────────── */
.info-box {
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    font-size: 13px;
    line-height: 1.6;
}
.info-box-blue {
    background: rgba(96,165,250,0.10);
    border: 1px solid rgba(96,165,250,0.25);
    color: #93c5fd;
}
.info-box-yellow {
    background: rgba(251,191,36,0.10);
    border: 1px solid rgba(251,191,36,0.25);
    color: #fde68a;
}
.info-box ul { margin: 8px 0 0 20px; padding: 0; }
.info-box li { margin-bottom: 4px; }

/* ── FORM HELPERS ─────────────────────────────────── */
.form-select {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.07);
    color: var(--text);
    font-size: 13px;
    min-width: 140px;
}
.form-select:focus { outline: none; border-color: var(--accent); }
.form-select option { background: #302b63; }

.config-number-input {
    width: 100px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.07);
    color: var(--text);
    font-size: 13px;
}
.config-number-input:focus { outline: none; border-color: var(--accent); }

.input-suffix {
    margin-left: 8px;
    color: var(--text-muted);
    font-size: 13px;
}

/* ── TABLE SEARCH ─────────────────────────────────── */
.table-search-wrap {
    margin-top: 6px;
}
.table-search-input {
    width: 100%;
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    background: rgba(255,255,255,0.07);
    color: var(--text);
    font-size: 12px;
}
.table-search-input:focus { outline: none; border-color: var(--accent); }
.table-search-input::placeholder { color: rgba(255,255,255,0.30); }

/* ── LOCATIONS LAYOUT ─────────────────────────────── */
.locations-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.locations-map-wrap {
    width: 100%;
}
.locations-map {
    width: 100%;
    height: 520px;
    border-radius: var(--radius);
    overflow: hidden;
}
.locations-sidebar {
    width: 100%;
}

/* ── VISIT PATH MAP ───────────────────────────────── */
.visit-path-map {
    width: 100%;
    height: 600px;
    border-radius: var(--radius);
    overflow: hidden;
}

/* ── LOADING TEXT ──────────────────────────────────── */
.loading-text {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

/* ── PERMISSIONS CONTENT ─────────────────────────── */
.permissions-content {
    margin-top: 20px;
}

/* ── SECTION TITLE ─────────────────────────────────── */
.section-title {
    color: var(--text);
    font-size: 16px;
    font-weight: 600;
}

/* ── DB MANAGER HELPERS ───────────────────────────── */
.db-panel-actions {
    display: flex;
    gap: 8px;
}
.db-hint {
    color: var(--text-muted);
    font-size: 12px;
    margin-bottom: 12px;
}
.db-loading {
    color: var(--text-muted);
    font-size: 12px;
}
.db-query-wrap {
    margin-bottom: 10px;
}
.db-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

/* ── FORM GAP ────────────────────────────────────── */
.form-gap { margin-top: 30px; }

/* ── UTILITY CLASSES ─────────────────────────────── */
.loading-text {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 13px;
}

.toolbar-nested { margin-top: 12px; margin-bottom: 15px; }
.card-mb { margin-bottom: 20px; }
.card-title-divider {
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}
.card-title-success {
    margin-bottom: 15px;
    border-bottom: 2px solid var(--success);
    padding-bottom: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}
.card-body { margin-bottom: 20px; }
.text-mb { margin-bottom: 15px; }
.flex-inline {
    display: flex;
    align-items: center;
    gap: 10px;
}
.flex-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}
.info-list {
    margin: 10px 0 0 20px;
    padding: 0;
}
.info-list li { margin-bottom: 4px; }
.text-muted { color: var(--text-muted); font-size: 12px; }

.card { padding: 20px; margin-bottom: 18px; }
.card h3 { margin-bottom: 10px; color: var(--text); font-size: 15px; font-weight: 600; }

.map-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 20px;
    border-radius: var(--radius);
    margin-bottom: 18px;
}

#syncResult { margin-top: 16px; }
#syncResultAlert { white-space: pre-line; word-break: break-word; }

.sync-form { padding: 0; }
.sync-form h3 { color: var(--text); margin-bottom: 16px; font-size: 15px; }

small { color: var(--text-muted); font-size: 12px; }

input[type="number"] {
    background: rgba(255,255,255,0.08);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
}

/* ── ATTENDANCE STATS ────────────────────────────── */
.att-legend {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 14px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
}
.att-legend-item { font-weight: 700; }

.att-stats-wrap {
    overflow-x: auto;
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.12) transparent;
}
.att-stats-wrap::-webkit-scrollbar { height: 5px; }
.att-stats-wrap::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 3px; }

.att-table {
    border-collapse: collapse;
    min-width: 100%;
    font-size: 12px;
    white-space: nowrap;
}
.att-table th, .att-table td {
    padding: 7px 5px;
    text-align: center;
    border-right: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}
.att-table thead th {
    background: rgba(255,255,255,0.06);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 11px;
    position: sticky;
    top: 0;
    z-index: 1;
}
.att-table tbody tr:hover { background: rgba(255,255,255,0.03); }

.att-name-col {
    min-width: 72px;
    max-width: 90px;
    text-align: left !important;
    padding-left: 12px !important;
    font-weight: 600;
    color: var(--text);
    position: sticky;
    left: 0;
    background: var(--bg-card);
    z-index: 2;
    border-right: 2px solid var(--border) !important;
}
thead .att-name-col { z-index: 3; background: rgba(30,27,75,0.96); }

.day-sun { color: var(--danger) !important; }

.att-cell { min-width: 30px; font-weight: 700; font-size: 12px; line-height: 1.2; }
.att-rest  { color: rgba(255,255,255,0.30); font-weight: 400; }
.att-absent{ color: var(--danger); background: rgba(248,113,113,0.10); }
.att-leave { color: #a78bfa; background: rgba(167,139,250,0.10); }
.att-ok    { color: var(--success); }
.att-low   { color: var(--warning); }
.att-rest-visits { color: #34d399; font-size: 11px; }
.att-full { color: #27ae60; font-weight: 700; }
.att-miss { color: #f1c40f; font-weight: 700; }

.att-summary-col { color: var(--info); font-weight: 800; border-left: 2px solid var(--border) !important; }
.att-absent-col  { color: var(--danger); font-weight: 700; }
.att-leave-col   { color: #a78bfa; font-weight: 700; }

.att-role-badge {
    display: block;
    font-size: 10px;
    font-weight: 500;
    margin-top: 2px;
    opacity: 0.7;
    letter-spacing: 0.2px;
}
.att-role-ss  { color: #f472b6; }
.att-role-cm  { color: #60a5fa; }
.att-role-bdm { color: #a78bfa; }
.att-role-bd  { color: #34d399; }
.att-role-admin { color: #fbbf24; }

.att-row-cm .att-name-col { color: #f6d860 !important; font-weight: 800; text-shadow: 0 0 8px rgba(246,216,96,0.4); }
.att-future { color: rgba(255,255,255,0.14) !important; font-weight: 400; }

/* ── Visit detail modal ─────────────────────────── */
.detail-section { margin-bottom: 18px; }
.detail-section-title { font-size: 13px; font-weight: 700; color: var(--primary-light); margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.detail-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; font-size: 13px; }
.detail-label { color: rgba(255,255,255,0.45); margin-right: 6px; font-size: 12px; }
.visit-photos-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.visit-photo-item { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.visit-photo-label { font-size: 11px; color: rgba(255,255,255,0.45); }
.visit-photo-thumb { width: 80px; height: 80px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); cursor: pointer; transition: transform .2s; }
.visit-photo-thumb:hover { transform: scale(1.05); }

/* ── VISIT STATS ─────────────────────────────────── */
.visit-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.visit-stat-card {
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.visit-stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.visit-stat-icon {
    font-size: 22px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    flex-shrink: 0;
}
.icon-bg-blue   { background: rgba(96,165,250,0.15);  border: 1px solid rgba(96,165,250,0.20); }
.icon-bg-green  { background: rgba(52,211,153,0.15);  border: 1px solid rgba(52,211,153,0.20); }
.icon-bg-yellow { background: rgba(251,191,36,0.15);  border: 1px solid rgba(251,191,36,0.20); }
.icon-bg-cyan   { background: rgba(34,211,238,0.15);  border: 1px solid rgba(34,211,238,0.20); }

.visit-stat-body { flex: 1; min-width: 0; }
.visit-stat-value {
    font-size: 26px;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 4px;
}
.visit-stat-label {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.accent-blue   { color: var(--info); }
.accent-green  { color: var(--success); }
.accent-yellow { color: var(--warning); }
.accent-cyan   { color: #22d3ee; }

/* Status badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.4;
}
.badge-success { background: rgba(52,211,153,0.14);  color: var(--success); border: 1px solid rgba(52,211,153,0.28); }
.badge-warning { background: rgba(251,191,36,0.14);  color: var(--warning); border: 1px solid rgba(251,191,36,0.28); }
.badge-danger  { background: rgba(248,113,113,0.14); color: var(--danger);  border: 1px solid rgba(248,113,113,0.28); }
.badge-info    { background: rgba(96,165,250,0.14);  color: var(--info);    border: 1px solid rgba(96,165,250,0.28); }

/* Person cell in visit table */
.person-cell { display: flex; flex-direction: column; gap: 2px; }
.person-name { font-weight: 600; color: var(--text); font-size: 13px; }
.person-phone { font-size: 11px; color: var(--text-muted); }

/* Store cell */
.store-cell { display: flex; flex-direction: column; gap: 2px; }
.store-name { font-weight: 600; color: var(--text); font-size: 13px; }
.store-addr { font-size: 11px; color: var(--text-muted); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Visit content cell */
.visit-content-text {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-muted);
    font-size: 12px;
    display: block;
}

/* Duration pill */
.duration-pill {
    display: inline-block;
    background: rgba(124,110,247,0.14);
    color: var(--accent2);
    border: 1px solid rgba(124,110,247,0.22);
    border-radius: 12px;
    padding: 2px 9px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

/* ── INLINE STYLE OVERRIDES ───────────────────────── */
/* JS-generated content uses hardcoded light colors — remap them */
[style*="background: white"],
[style*="background:#fff"],
[style*="background: #fff"],
[style*="background-color: white"],
[style*="background-color: #fff"],
[style*="background-color: #f8f9fa"],
[style*="background-color: #fafafa"] {
    background: var(--bg-card) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow) !important;
}

[style*="color: #333"],  [style*="color:#333"]  { color: var(--text) !important; }
[style*="color: #666"],  [style*="color:#666"]  { color: var(--text-muted) !important; }
[style*="color: #999"],  [style*="color:#999"]  { color: var(--text-muted) !important; }
[style*="color: black"]                         { color: var(--text) !important; }
[style*="border: 1px solid #ddd"]               { border-color: var(--border) !important; }
[style*="border-bottom: 1px solid #ddd"]        { border-bottom-color: var(--border) !important; }
[style*="background: #f5f5f5"],
[style*="background-color: #f5f5f5"]            { background: rgba(255,255,255,0.06) !important; color: var(--text) !important; }
[style*="background: #e3f2fd"]                  { background: rgba(96,165,250,0.15) !important; color: #93c5fd !important; }
[style*="color: #1976d2"]                       { color: #93c5fd !important; }

/* Status colours used inline in JS */
[style*="color: #28a745"] { color: var(--success) !important; }
[style*="color: #ffc107"] { color: var(--warning) !important; }
[style*="color: #dc3545"] { color: var(--danger)  !important; }
[style*="color: #007bff"] { color: var(--info)    !important; }
[style*="color: #17a2b8"] { color: #22d3ee        !important; }
[style*="color: #004085"] { color: #93c5fd        !important; }

/* Info/hint boxes with blue background */
[style*="background: #e7f3ff"],
[style*="background-color: #e7f3ff"] {
    background: rgba(96,165,250,0.10) !important;
    border-color: rgba(96,165,250,0.25) !important;
    color: #93c5fd !important;
    border-radius: var(--radius-sm) !important;
}
[style*="border: 1px solid #b3d9ff"],
[style*="border: 1px solid #ddd"] { border-color: var(--border) !important; }

/* ── VISIT ROUTES ─────────────────────────────────── */
.vr-layout {
    display: flex;
    gap: 16px;
    min-height: 600px;
    align-items: flex-start;
}
.vr-bd-panel {
    width: 220px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    max-height: calc(100vh - 160px);
}
.vr-panel-title {
    padding: 14px 16px 10px;
    font-weight: 700;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-light);
}
.vr-search {
    margin: 10px 12px;
    width: calc(100% - 24px);
    padding: 7px 12px;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 13px;
    box-sizing: border-box;
}
.vr-search:focus { outline: none; border-color: var(--accent); }
.vr-bd-list {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
}
.vr-bd-item {
    padding: 10px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    border-left: 3px solid transparent;
    transition: background 0.15s;
}
.vr-bd-item:hover { background: rgba(255,255,255,0.06); }
.vr-bd-item.active { background: rgba(124,110,247,0.12); border-left-color: var(--accent); }
.vr-bd-name { font-weight: 600; font-size: 13px; color: var(--text); }
.vr-bd-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.vr-plan-area {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.vr-plan-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    background: rgba(255,255,255,0.03);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}
.vr-empty-hint { color: var(--text-muted); font-size: 15px; }
.vr-plan-content { display: flex; flex-direction: column; gap: 16px; }

.vr-plan-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}
.vr-bd-title { font-size: 18px; font-weight: 700; color: var(--text); }
.vr-store-total { margin-left: 10px; font-size: 12px; color: var(--text-muted); }
.vr-plan-controls { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-muted); }

/* Grid */
.vr-grid-wrap { overflow-x: auto; }
.vr-grid {
    border-collapse: collapse;
    width: 100%;
    min-width: 720px;
}
.vr-grid thead th {
    padding: 10px 8px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    background: rgba(255,255,255,0.05);
    border-bottom: 2px solid var(--border);
}
.vr-week-th { width: 52px; }
.vr-week-label {
    width: 52px;
    text-align: center;
    font-weight: 700;
    font-size: 13px;
    color: var(--accent);
    vertical-align: top;
    padding-top: 14px;
    border-right: 2px solid var(--border);
    white-space: nowrap;
}
.vr-plan-cell {
    border: 1px solid var(--border-light);
    padding: 8px 6px;
    vertical-align: top;
    min-height: 80px;
    min-width: 110px;
    transition: background 0.12s;
}
.vr-plan-cell:hover { background: rgba(255,255,255,0.02); }

.vr-chip-wrap { display: flex; flex-wrap: wrap; gap: 4px; min-height: 22px; }
.vr-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px 2px 4px;
    border-radius: 12px;
    font-size: 11px;
    color: var(--text);
    max-width: 160px;
    overflow: hidden;
}
.vr-chip-num {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
}
.vr-chip-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.vr-chip-del {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    font-size: 14px;
    line-height: 1;
    flex-shrink: 0;
}
.vr-chip-del:hover { color: var(--danger); }

.vr-add-btn {
    margin-top: 6px;
    display: block;
    width: 100%;
    padding: 4px 0;
    background: rgba(255,255,255,0.04);
    border: 1px dashed var(--border);
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s;
}
.vr-add-btn:hover { background: rgba(124,110,247,0.10); border-color: var(--accent); color: var(--accent); }

/* Warnings */
.vr-warnings { min-height: 0; }
.vr-warning-box {
    background: rgba(251,191,36,0.08);
    border: 1px solid rgba(251,191,36,0.30);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    font-size: 12px;
    color: var(--warning);
}
.vr-warning-box ul { margin: 6px 0 0 18px; padding: 0; }
.vr-warning-box li { margin-bottom: 3px; }

/* Map */
.vr-map {
    width: 100%;
    height: 420px;
    border-radius: var(--radius);
    overflow: hidden;
}

/* Store selector modal items */
.vr-store-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.12s;
    font-size: 13px;
    border-radius: 0;
}
.vr-store-item:hover { background: rgba(255,255,255,0.05); }
.vr-store-item.selected { background: rgba(124,110,247,0.08); }
.vr-store-item input[type=checkbox] { cursor: pointer; flex-shrink: 0; }
.vr-store-item-name { font-weight: 600; flex-shrink: 0; }
.vr-store-item-addr { color: var(--text-muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
