:root {
    --bg-base: #090d16;
    --bg-surface: #111827;
    --bg-glass: rgba(17, 24, 39, 0.75);
    --bg-glass-hover: rgba(31, 41, 55, 0.85);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glass-bright: rgba(56, 189, 248, 0.3);
    
    --accent-cyan: #38bdf8;
    --accent-emerald: #34d399;
    --accent-violet: #a78bfa;
    --accent-amber: #fbbf24;
    --accent-blue: #3b82f6;
    --accent-rose: #f43f5e;

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;

    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.45);
    --shadow-glow: 0 0 25px rgba(56, 189, 248, 0.25);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme Variables */
[data-theme="light"] {
    --bg-base: #f1f5f9;
    --bg-surface: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.85);
    --bg-glass-hover: rgba(241, 245, 249, 0.95);
    --border-glass: rgba(0, 0, 0, 0.08);
    --border-glass-bright: rgba(37, 99, 235, 0.3);

    --accent-cyan: #0284c7;
    --accent-emerald: #059669;
    --accent-violet: #7c3aed;
    --accent-amber: #d97706;
    --accent-blue: #2563eb;
    --accent-rose: #e11d48;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;

    --shadow-glass: 0 8px 30px 0 rgba(15, 23, 42, 0.08);
    --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(at 0% 0%, rgba(56, 189, 248, 0.12) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(167, 139, 250, 0.12) 0px, transparent 50%),
        radial-gradient(at 50% 100%, rgba(52, 211, 153, 0.08) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.2);
}
::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-cyan);
}

.app-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Glassmorphism Card Utility */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
    transition: var(--transition);
}

.glass-card:hover {
    border-color: var(--border-glass-bright);
}

.glow-border {
    position: relative;
}
.glow-border::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: var(--radius-lg);
    padding: 1px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.3), rgba(167, 139, 250, 0.3));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
}

/* Executive Top Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
    gap: 20px;
    flex-wrap: wrap;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-box {
    position: relative;
    display: flex;
    align-items: center;
}

.logo-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(56, 189, 248, 0.35);
    transition: var(--transition);
}

.logo-icon:hover {
    transform: scale(1.05) rotate(-3deg);
}

.logo-live-pulse {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #10b981;
    border: 2px solid var(--bg-surface);
    box-shadow: 0 0 8px #10b981;
}

.header-titles {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.title-badge-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.brand-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 6px;
}

.brand-pro {
    font-size: 11px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 6px;
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    color: #ffffff;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.4);
}

.badge-group {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.status-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(16, 185, 129, 0.12);
    color: var(--accent-emerald);
    border: 1px solid rgba(16, 185, 129, 0.25);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.status-badge i {
    font-size: 6px;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.role-badge.director {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(167, 139, 250, 0.12);
    color: var(--accent-violet);
    border: 1px solid rgba(167, 139, 250, 0.25);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.brand-subtitle {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.brand-subtitle i {
    font-size: 11px;
    opacity: 0.7;
}

/* Header Actions Layout */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Action Buttons Bar */
.header-btn-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.btn-outline {
    height: 38px;
    padding: 0 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--border-glass-bright);
    transform: translateY(-1px);
}

.btn-icon-only {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-icon-only:hover {
    background: rgba(56, 189, 248, 0.12);
    color: var(--accent-cyan);
    border-color: rgba(56, 189, 248, 0.3);
    transform: rotate(90deg);
}

.btn-excel-download {
    height: 38px;
    padding: 0 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    color: #ffffff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
    transition: var(--transition);
    white-space: nowrap;
}

.btn-excel-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
    color: #ffffff;
}

/* Nav Tabs Bar */
.nav-tabs-bar {
    display: flex;
    gap: 8px;
    padding: 8px;
    border-radius: var(--radius-md);
}

.tab-btn {
    flex: 1;
    padding: 12px 18px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(59, 130, 246, 0.15));
    color: var(--accent-cyan);
    border-color: rgba(56, 189, 248, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Tabs Content Container */
.tab-content {
    display: none;
    flex-direction: column;
    gap: 20px;
}

.tab-content.active {
    display: flex;
    animation: fadeIn 0.4s ease-in-out;
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #fff;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border-color: var(--border-glass);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent-cyan), #0284c7);
    color: #ffffff;
    font-weight: 700;
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.4);
}

/* Dropzone */
.dropzone {
    border: 2px dashed rgba(56, 189, 248, 0.3);
    border-radius: var(--radius-lg);
    background: var(--bg-glass);
    padding: 36px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--accent-cyan);
    background: rgba(56, 189, 248, 0.08);
    transform: scale(1.003);
}

.upload-icon-pulse {
    font-size: 46px;
    color: var(--accent-cyan);
    margin-bottom: 12px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.dropzone-content h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
}

.dropzone-content p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.upload-spinner {
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.spinner-ring {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(56, 189, 248, 0.2);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* KPI Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.kpi-card {
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.kpi-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.kpi-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.card-cyan .kpi-icon { background: rgba(56, 189, 248, 0.15); color: var(--accent-cyan); }
.card-emerald .kpi-icon { background: rgba(52, 211, 153, 0.15); color: var(--accent-emerald); }
.card-violet .kpi-icon { background: rgba(167, 139, 250, 0.15); color: var(--accent-violet); }
.card-amber .kpi-icon { background: rgba(251, 191, 36, 0.15); color: var(--accent-amber); }

.kpi-value {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.kpi-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.kpi-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
}

.kpi-badge.positive {
    background: rgba(52, 211, 153, 0.15);
    color: var(--accent-emerald);
}

.kpi-subtext {
    color: var(--text-muted);
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(520px, 1fr));
    gap: 20px;
}

.chart-card {
    padding: 24px;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-wrap {
    flex-wrap: wrap;
}

.gap-12 {
    gap: 12px;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-badge {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 14px;
    background: rgba(56, 189, 248, 0.12);
    color: var(--accent-cyan);
}

.card-badge.green {
    background: rgba(52, 211, 153, 0.12);
    color: var(--accent-emerald);
}

.chart-wrapper {
    position: relative;
    height: 330px;
    width: 100%;
    margin-top: 16px;
}

/* Table Section */
.table-section {
    padding: 24px 28px;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.section-padding {
    padding: 28px;
}

.section-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* Business Sort Segment Control */
.sort-segment-control {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-glass);
    padding: 4px;
    border-radius: var(--radius-md);
    gap: 4px;
}

[data-theme="light"] .sort-segment-control {
    background: rgba(0, 0, 0, 0.05);
}

.sort-btn {
    padding: 8px 14px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.sort-btn:hover {
    color: var(--text-primary);
}

.sort-btn.active {
    background: var(--accent-cyan);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(56, 189, 248, 0.3);
}

.table-search-box {
    position: relative;
    width: 260px;
}

.table-search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.table-search-box input {
    width: 100%;
    padding: 9px 14px 9px 38px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: var(--transition);
}

.table-search-box input:focus {
    border-color: var(--accent-cyan);
    background: rgba(255, 255, 255, 0.08);
}

.table-responsive {
    overflow-x: auto;
    margin-top: 16px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th, .data-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-glass);
}

.data-table th {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 700;
    background: rgba(255, 255, 255, 0.02);
}

.sortable-th {
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
}

.sortable-th:hover {
    color: var(--accent-cyan);
}

.sortable-th.active {
    color: var(--accent-cyan);
}

.data-table td {
    font-size: 14px;
}

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

.badge-percent {
    background: rgba(56, 189, 248, 0.12);
    color: var(--accent-cyan);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}

/* Station Cards Grid (Tab 2) */
.station-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.station-card {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.st-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.st-name {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.st-metrics {
    display: flex;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.03);
    padding: 12px;
    border-radius: var(--radius-md);
}

.st-metric-item {
    display: flex;
    flex-direction: column;
}

.st-metric-label {
    font-size: 11px;
    color: var(--text-secondary);
}

.st-metric-value {
    font-size: 16px;
    font-weight: 800;
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-emerald));
    border-radius: 4px;
    transition: width 0.8s ease-in-out;
}

/* Settings Mapping Grid (Tab 4) */
.mapping-editor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.editor-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
}

.editor-card input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
}

[data-theme="light"] .editor-card input {
    background: rgba(255, 255, 255, 0.9);
}

.editor-card input:focus {
    border-color: var(--accent-cyan);
    outline: none;
}

.editor-card .email-field { flex: 1.2; }
.editor-card .station-field { flex: 1; }

/* Period Dropdown Capsule */
.period-select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.22);
    border-radius: 12px;
    padding: 0 14px;
    height: 38px;
    transition: var(--transition);
    cursor: pointer;
}

.period-select-wrapper:hover {
    background: rgba(56, 189, 248, 0.14);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.2);
}

.select-icon {
    color: var(--accent-cyan);
    font-size: 14px;
    margin-right: 8px;
}

.select-arrow {
    color: var(--text-muted);
    font-size: 10px;
    margin-left: 6px;
    pointer-events: none;
}

.period-select {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    outline: none;
    padding-right: 4px;
    appearance: none;
    -webkit-appearance: none;
}

.period-select option {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.comp-selectors-group {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.comp-select-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    padding: 8px 14px;
    border-radius: var(--radius-md);
}

.comp-select-item label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.kpi-badge.negative {
    background: rgba(244, 63, 94, 0.15);
    color: var(--accent-rose);
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 13px;
}

/* ==========================================================================
   Director Dashboard & Admin Center Premium Styles
   ========================================================================== */

/* Role Badges */
.role-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.3px;
}

.role-badge.director {
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.25), rgba(236, 72, 153, 0.25));
    color: #f472b6;
    border: 1px solid rgba(236, 72, 153, 0.4);
    box-shadow: 0 0 15px rgba(236, 72, 153, 0.2);
}

.role-badge.admin {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(59, 130, 246, 0.2));
    color: var(--accent-cyan);
    border: 1px solid rgba(56, 189, 248, 0.3);
}

/* Glow Cards & Executive Cards */
.glow-card {
    position: relative;
    border-color: rgba(167, 139, 250, 0.4) !important;
    box-shadow: 0 0 30px rgba(167, 139, 250, 0.15);
}

.kpi-progress-bar-wrapper {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.kpi-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-emerald));
    border-radius: 10px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Director AI Briefing Banner */
.director-ai-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-violet), var(--accent-rose));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
    box-shadow: 0 0 20px rgba(167, 139, 250, 0.4);
    flex-shrink: 0;
}

/* Target Status Badges */
.status-pill {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-pill.leading {
    background: rgba(52, 211, 153, 0.15);
    color: var(--accent-emerald);
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.status-pill.on_track {
    background: rgba(56, 189, 248, 0.15);
    color: var(--accent-cyan);
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.status-pill.lagging {
    background: rgba(244, 63, 94, 0.15);
    color: var(--accent-rose);
    border: 1px solid rgba(244, 63, 94, 0.3);
}

/* Target Plans Inputs in Admin Center */
.target-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: var(--transition);
}

.target-card:hover {
    border-color: var(--border-glass-bright);
    background: rgba(255, 255, 255, 0.06);
}

.target-card h4 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.target-inputs-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.input-group label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-weight: 600;
}

.input-control {
    width: 100%;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
}

.input-control:focus {
    border-color: var(--accent-cyan);
    outline: none;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

/* Fullscreen TV Presentation Mode */
body.tv-mode {
    background: #04070d;
}

body.tv-mode .top-header {
    background: rgba(11, 15, 25, 0.95);
}

body.tv-mode .upload-section {
    display: none !important;
}

body.tv-mode .nav-tabs-bar {
    border-color: rgba(56, 189, 248, 0.3);
}

/* Modal Styling */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(4, 7, 13, 0.8);
    backdrop-filter: blur(12px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.modal-card {
    width: 100%;
    max-width: 440px;
    padding: 28px;
    background: var(--bg-surface);
    border: 1px solid var(--border-glass-bright);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close-btn {
    background: transparent;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.modal-close-btn:hover {
    color: var(--accent-rose);
}

/* Executive Matrix Table Styles */
.director-matrix-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 4px;
    margin-top: 10px;
}

.director-matrix-table th {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
    padding: 14px 18px;
    border-bottom: 2px solid var(--border-glass);
}

.director-matrix-table td {
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--border-glass);
    border-bottom: 1px solid var(--border-glass);
    vertical-align: middle;
}

.director-matrix-table tr td:first-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
    border-left: 1px solid var(--border-glass);
}

.director-matrix-table tr td:last-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
    border-right: 1px solid var(--border-glass);
}

.director-matrix-table tbody tr:hover td {
    background: rgba(56, 189, 248, 0.07);
    border-color: rgba(56, 189, 248, 0.2);
}

/* Clickable Station Rows & Cards */
.clickable-station-row {
    cursor: pointer;
    transition: all 0.2s ease;
}

.clickable-station-row:hover td {
    background: rgba(56, 189, 248, 0.12) !important;
    border-color: rgba(56, 189, 248, 0.3) !important;
}

.clickable-station-card {
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.clickable-station-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-cyan) !important;
    box-shadow: 0 12px 30px rgba(56, 189, 248, 0.2) !important;
}

/* Rank Badges */
.rank-badge {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    gap: 4px;
}

.rank-1 {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.22), rgba(245, 158, 11, 0.12));
    color: #f59e0b;
    border: 1px solid rgba(251, 191, 36, 0.4);
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.25);
}

.rank-2 {
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.22), rgba(100, 116, 139, 0.12));
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.4);
}

.rank-3 {
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.22), rgba(180, 83, 9, 0.12));
    color: #d97706;
    border: 1px solid rgba(217, 119, 6, 0.4);
}

.rank-default {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border-glass);
}

.total-badge {
    background: rgba(56, 189, 248, 0.2);
    color: var(--accent-cyan);
    border: 1px solid rgba(56, 189, 248, 0.4);
}

/* Station Cell */
.st-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.st-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent-cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.st-icon.total-icon {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
    font-size: 16px;
}

.st-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-primary);
}

/* Metric Number Badges */
.number-cell-tickets {
    font-weight: 700;
    color: var(--accent-cyan);
    background: rgba(56, 189, 248, 0.08);
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 13.5px;
    border: 1px solid rgba(56, 189, 248, 0.18);
    display: inline-block;
}

.number-cell-summa {
    font-weight: 800;
    color: var(--accent-emerald);
    background: rgba(16, 185, 129, 0.1);
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 13.5px;
    border: 1px solid rgba(16, 185, 129, 0.25);
    display: inline-block;
}

.number-cell-avg {
    font-weight: 600;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 13px;
    border: 1px solid var(--border-glass);
    display: inline-block;
}

.number-cell-tickets.total, .number-cell-summa.total, .number-cell-avg.total {
    font-size: 14px;
    padding: 6px 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Share Progress Bar */
.share-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.share-pct-badge {
    font-weight: 800;
    font-size: 13.5px;
    color: var(--accent-cyan);
    min-width: 48px;
}

.share-pct-badge.total {
    color: var(--accent-emerald);
}

.matrix-progress-track {
    flex: 1;
    height: 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    border: 1px solid var(--border-glass);
}

.matrix-progress-fill {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, #38bdf8, #3b82f6);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.matrix-progress-fill.total {
    background: linear-gradient(90deg, #10b981, #059669);
}

/* Highlighted Total Foot Row */
.matrix-total-row td {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(16, 185, 129, 0.12)) !important;
    border-top: 2px solid var(--accent-cyan) !important;
    border-bottom: 2px solid var(--accent-cyan) !important;
    padding: 16px 18px !important;
}

.matrix-total-row td:first-child {
    border-left: 2px solid var(--accent-cyan) !important;
}

.matrix-total-row td:last-child {
    border-right: 2px solid var(--accent-cyan) !important;
}

/* Executive Toast Notifications */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast-card {
    pointer-events: auto;
    min-width: 320px;
    max-width: 420px;
    padding: 16px 20px;
    border-radius: 16px;
    background: rgba(17, 24, 39, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    gap: 14px;
    color: #ffffff;
    animation: toastIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
}

[data-theme="light"] .toast-card {
    background: rgba(255, 255, 255, 0.95);
    color: #0f172a;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 12px 35px rgba(15, 23, 42, 0.15);
}

.toast-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.toast-card.success .toast-icon {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.toast-card.error .toast-icon {
    background: rgba(244, 63, 94, 0.15);
    color: #f43f5e;
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.toast-card.info .toast-icon {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.toast-card.warning .toast-icon {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 2px;
    letter-spacing: -0.2px;
}

.toast-desc {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 4px;
    transition: var(--transition);
}

.toast-close:hover {
    color: var(--text-primary);
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    animation: toastProgress 4s linear forwards;
}

.toast-card.success .toast-progress { background: #10b981; }
.toast-card.error .toast-progress { background: #f43f5e; }
.toast-card.info .toast-progress { background: #38bdf8; }
.toast-card.warning .toast-progress { background: #fbbf24; }

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

@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

/* Token Health Badge & Dot Indicator */
.token-health-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 6px 14px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.status-dot-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    position: relative;
    flex-shrink: 0;
}

.status-dot-indicator.green {
    background-color: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.8);
    animation: pulseDotGreen 2s infinite;
}

.status-dot-indicator.red {
    background-color: #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.8);
    animation: pulseDotRed 2s infinite;
}

.status-dot-indicator.yellow {
    background-color: #f59e0b;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.8);
    animation: pulseDotYellow 1.5s infinite;
}

@keyframes pulseDotGreen {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes pulseDotRed {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

@keyframes pulseDotYellow {
    0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
    100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

.btn-emerald {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    border: none;
    font-weight: 600;
    transition: var(--transition);
}

.btn-emerald:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

/* ==========================================================================
   SENIOR EXECUTIVE PRINT & PDF STYLESHEET (EXACT 2-PAGE PERFECT FIT)
   ========================================================================== */
@media print {
    @page {
        size: A4 portrait;
        margin: 6mm 8mm 6mm 8mm;
    }

    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        box-shadow: none !important;
        text-shadow: none !important;
        animation: none !important;
        transition: none !important;
    }

    html, body {
        background: #ffffff !important;
        color: #0f172a !important;
        font-size: 10px !important;
        line-height: 1.3 !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Force high-contrast crisp dark text for readability on paper */
    .data-table,
    .data-table th,
    .data-table td,
    .data-table span,
    .data-table div,
    .station-name,
    .kpi-value,
    .brand-title,
    .brand-subtitle,
    #directorAiText,
    h1, h2, h3, h4, p {
        color: #0f172a !important;
    }

    .data-table .text-muted,
    .data-table .subtext,
    .section-desc,
    .kpi-title {
        color: #475569 !important;
    }

    /* Hide non-printable web UI components */
    .btn,
    button,
    .top-header .header-right,
    .nav-tabs,
    .upload-section,
    .admin-center,
    .filter-controls,
    .card-badge,
    .logo-live-pulse,
    .glow-border::after,
    ::-webkit-scrollbar {
        display: none !important;
    }

    .app-container {
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
        gap: 6px !important;
        display: block !important;
    }

    .glass-card {
        background: #ffffff !important;
        border: 1px solid #cbd5e1 !important;
        border-radius: 6px !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    /* Printed Document Top Header */
    .top-header {
        background: #f8fafc !important;
        border: 1px solid #cbd5e1 !important;
        padding: 8px 12px !important;
        margin-bottom: 6px !important;
        border-radius: 6px !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
    }

    .logo-icon {
        width: 32px !important;
        height: 32px !important;
        font-size: 14px !important;
        box-shadow: none !important;
    }

    .brand-title {
        font-size: 16px !important;
        font-weight: 800 !important;
    }

    .brand-subtitle {
        font-size: 9.5px !important;
    }

    /* KPI Cards Row (4 Columns in 1 Line) */
    .kpi-grid {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 6px !important;
        margin-bottom: 6px !important;
    }

    .kpi-card {
        padding: 6px 8px !important;
        background: #ffffff !important;
        border: 1px solid #cbd5e1 !important;
        border-radius: 6px !important;
    }

    .kpi-header {
        margin-bottom: 2px !important;
    }

    .kpi-title {
        font-size: 9px !important;
        font-weight: 700 !important;
        text-transform: uppercase !important;
    }

    .kpi-icon {
        display: none !important;
    }

    .kpi-value {
        font-size: 15px !important;
        font-weight: 800 !important;
        margin: 2px 0 !important;
    }

    .kpi-footer {
        font-size: 8.5px !important;
    }

    .kpi-badge {
        padding: 1px 4px !important;
        font-size: 8px !important;
    }

    /* AI Executive Briefing Card */
    .director-ai-avatar {
        display: none !important;
    }

    .section-padding {
        padding: 6px 10px !important;
        margin-bottom: 6px !important;
        background: #f8fafc !important;
        border: 1px solid #cbd5e1 !important;
        border-radius: 6px !important;
    }

    #directorAiText {
        font-size: 10px !important;
        line-height: 1.4 !important;
    }

    /* Charts Grid - Page 1 Bottom */
    .charts-grid {
        display: flex !important;
        flex-direction: row !important;
        gap: 8px !important;
        margin-bottom: 0 !important;
        page-break-after: always !important;
        break-after: page !important;
    }

    .charts-grid > div:nth-child(1) {
        flex: 1.4 !important;
        width: 58% !important;
    }

    .charts-grid > div:nth-child(2) {
        flex: 1 !important;
        width: 42% !important;
    }

    .chart-card {
        padding: 8px !important;
        background: #ffffff !important;
        border: 1px solid #cbd5e1 !important;
        border-radius: 6px !important;
    }

    .chart-card h3 {
        font-size: 11.5px !important;
        font-weight: 700 !important;
    }

    .chart-card .section-desc {
        font-size: 8.5px !important;
        margin-bottom: 4px !important;
    }

    .chart-wrapper {
        height: 270px !important;
        max-height: 270px !important;
        position: relative !important;
    }

    canvas {
        max-width: 100% !important;
        max-height: 270px !important;
    }

    /* PAGE 2: Financial Matrix Table */
    .table-section {
        page-break-before: always !important;
        break-before: page !important;
        padding: 8px 10px !important;
        background: #ffffff !important;
        border: 1px solid #cbd5e1 !important;
        border-radius: 6px !important;
        margin-top: 0 !important;
    }

    .table-section h3 {
        font-size: 13px !important;
        font-weight: 800 !important;
    }

    .table-section .section-desc {
        font-size: 9px !important;
        margin-bottom: 6px !important;
    }

    .table-responsive {
        overflow: visible !important;
    }

    .data-table {
        width: 100% !important;
        border-collapse: collapse !important;
        font-size: 9px !important;
    }

    .data-table th {
        background: #e2e8f0 !important;
        color: #0f172a !important;
        font-weight: 800 !important;
        padding: 4px 6px !important;
        border: 1px solid #cbd5e1 !important;
        font-size: 9px !important;
    }

    .data-table td {
        padding: 3px 6px !important;
        border: 1px solid #cbd5e1 !important;
        color: #0f172a !important;
        font-size: 9px !important;
    }

    .data-table tr:nth-child(even) td {
        background: #f8fafc !important;
    }

    .data-table tfoot tr td {
        background: #e2e8f0 !important;
        font-weight: 800 !important;
        font-size: 9.5px !important;
        padding: 5px 6px !important;
        border-top: 2px solid #0f172a !important;
        color: #0f172a !important;
    }

    .progress-bar-bg {
        height: 5px !important;
        background: #e2e8f0 !important;
        border-radius: 3px !important;
    }

    .progress-bar-fill {
        height: 5px !important;
        border-radius: 3px !important;
    }

    .station-rank-badge {
        width: 18px !important;
        height: 18px !important;
        font-size: 8.5px !important;
    }
}




