/* ==== VARIABLES & THEME ==== */
:root {
    --bg-dark: #07070f;
    --bg-card: rgba(20, 20, 35, 0.6);
    --bg-card-hover: rgba(30, 30, 50, 0.8);
    --border-glass: rgba(255, 255, 255, 0.08);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    /* Brand colors (Default/Uber) */
    --primary: #ffffff;
    --secondary: #333333;
    --accent: #00d4ff;
    
    /* Semantic */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    /* Theme - Electric Blue Data Theme */
    --data-primary: #00d4ff;
    --data-secondary: #7c3aed;
}

/* Dynamic themes applied via JS classes */
body.theme-uber {
    --primary: #ffffff;
    --secondary: #a3a3a3;
    --bg-dark: #050505;
}
body.theme-didi {
    --primary: #ff7b00;
    --secondary: #ffb74d;
    --bg-dark: #0f0702;
    --data-primary: #ff7b00;
}
body.theme-cabify {
    --primary: #7c3aed;
    --secondary: #c4b5fd;
    --bg-dark: #090314;
    --data-primary: #7c3aed;
}

/* ==== RESET & BASE ==== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    /* Subtle grid lines */
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
}

.glass {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* ==== SCREENS ==== */
.screen {
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
    min-height: 100vh;
}
.screen.active {
    display: flex;
    opacity: 1;
}

/* ==== LOGIN SCREEN ==== */
#login-screen {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}
.login-bg-grid {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at center, transparent 0%, var(--bg-dark) 100%);
    z-index: -1;
}
.login-container {
    text-align: center;
    max-width: 900px;
    padding: 2rem;
    z-index: 1;
}
.login-header h1 {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}
.login-header h1 span {
    color: var(--data-primary);
}
.login-header h2 {
    font-size: 1.5rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 1rem;
}
.login-header p {
    color: var(--data-secondary);
    font-weight: 500;
    margin-bottom: 4rem;
}

.operator-cards {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-bottom: 3rem;
}
.operator-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 2rem;
    width: 260px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}
.operator-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.5);
    background: var(--bg-card-hover);
}
.company-logo {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.didi-logo { color: #ff7b00; }
.cabify-logo { color: #7c3aed; }

.btn-login {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}
.btn-login:hover { opacity: 0.9; }
.uber-btn { background: #ffffff; color: #000; }
.didi-btn { background: #ff7b00; color: #fff; }
.cabify-btn { background: #7c3aed; color: #fff; }

.demo-note {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.05);
    padding: 10px 20px;
    border-radius: 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ==== DASHBOARD LAYOUT ==== */
#dashboard-screen {
    flex-direction: row;
}

/* SIDEBAR */
.sidebar {
    width: 260px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
}
.sidebar-header {
    padding: 2rem 1.5rem;
}
.sidebar-header .logo {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}
.sidebar-header .logo span { color: var(--data-primary); }

.active-company-badge {
    background: rgba(255,255,255,0.05);
    padding: 10px 15px;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
    font-weight: 600;
}

.sidebar-nav {
    flex: 1;
    padding: 0 1rem;
}
.sidebar-nav ul {
    list-style: none;
}
.nav-item {
    padding: 12px 15px;
    margin-bottom: 8px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 12px;
}
.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-main);
}
.nav-item.active {
    background: rgba(255,255,255,0.1);
    color: var(--text-main);
    font-weight: 500;
    box-shadow: inset 3px 0 0 var(--primary);
}
.nav-item .icon { font-size: 1.2rem; }

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-glass);
}
.period-selector label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}
.period-selector select {
    width: 100%;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border-glass);
    color: white;
    padding: 8px;
    border-radius: 6px;
    margin-bottom: 15px;
}
.account-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--data-secondary);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
}
.info .name { font-weight: 500; font-size: 0.9rem; }
.info .role { font-size: 0.75rem; color: var(--text-muted); }

/* MAIN CONTENT */
.main-content {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-header {
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    border-bottom: 1px solid var(--border-glass);
    background: rgba(7, 7, 15, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 90;
}
.breadcrumbs {
    font-size: 0.9rem;
    font-weight: 500;
}
.breadcrumbs .separator { margin: 0 8px; color: var(--text-muted); }
#breadcrumb-company { color: var(--primary); }

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}
.realtime-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.pulse-dot {
    width: 8px; height: 8px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.icon-btn {
    background: none; border: none;
    font-size: 1.2rem; cursor: pointer;
    opacity: 0.7; transition: opacity 0.2s;
}
.icon-btn:hover { opacity: 1; }

.dashboard-body {
    padding: 2rem;
    flex: 1;
}

/* TABS */
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}
.tab-content.active {
    display: block;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==== COMPONENTS ==== */
/* KPIs */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.kpi-card {
    padding: 1.5rem;
}
.kpi-title {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 500;
}
.kpi-value {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.kpi-trend {
    font-size: 0.85rem;
    display: flex; align-items: center; gap: 4px;
}
.kpi-trend.positive { color: var(--success); }
.kpi-trend.negative { color: var(--danger); }
.kpi-trend.neutral { color: var(--text-muted); }

/* Charts */
.chart-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.chart-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}
.chart-card h3 {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}
.pie-container {
    height: 250px;
}
.full-width { grid-column: 1 / -1; }
.mt-20 { margin-top: 1.5rem; }

/* Map */
.map-container {
    position: relative;
    height: 600px;
    border-radius: 12px;
    overflow: hidden;
}
.mini-map { height: 300px; }
.leaflet-map {
    width: 100%; height: 100%;
    background: #0f0f1a;
}
.map-filters {
    position: absolute;
    top: 20px; left: 50px;
    z-index: 400;
    display: flex; gap: 8px;
}
.filter-chip {
    background: rgba(0,0,0,0.6);
    border: 1px solid var(--border-glass);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    backdrop-filter: blur(4px);
    transition: all 0.2s;
}
.filter-chip.active, .filter-chip:hover {
    background: var(--data-primary);
    border-color: var(--data-primary);
}
.map-info-panel {
    position: absolute;
    top: 20px; right: 20px;
    width: 280px;
    padding: 1.5rem;
    z-index: 400;
}
.map-info-panel h3 { margin-bottom: 1rem; font-size: 1.1rem; }
.info-row { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 0.9rem; }
.info-row .label { color: var(--text-muted); }
.info-row .value { font-weight: 600; }
.info-row .highlight { color: var(--warning); }
.info-row .negative { color: var(--danger); }
.map-legend {
    position: absolute; bottom: 20px; left: 20px; z-index: 400;
    background: rgba(0,0,0,0.6); padding: 10px 15px; border-radius: 8px;
    display: flex; align-items: center; gap: 10px; font-size: 0.8rem;
}
.gradient-bar {
    width: 100px; height: 10px; border-radius: 5px;
    background: linear-gradient(to right, blue, cyan, lime, yellow, red);
}

/* Banners */
.header-banner {
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--data-primary);
}
.header-banner h2 { font-size: 1.4rem; margin-bottom: 0.5rem; }
.alert-banner { border-left-color: var(--warning); display: flex; gap: 1rem; align-items: center; }
.alert-banner .icon { font-size: 2rem; }

/* Tables */
.table-container {
    overflow-x: auto;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}
.data-table th {
    padding: 12px 15px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border-glass);
}
.data-table td {
    padding: 15px;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.data-table tr:hover td {
    background: rgba(255,255,255,0.02);
}
.status-pill {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}
.pill-red { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.pill-orange { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.pill-green { background: rgba(16, 185, 129, 0.2); color: #10b981; }

/* Venn Diagram CSS hack */
.venn-container {
    position: relative;
    height: 300px;
    display: flex; justify-content: center; align-items: center;
}
.venn-circle {
    position: absolute;
    width: 160px; height: 160px;
    border-radius: 50%;
    display: flex; justify-content: center; align-items: center; text-align: center;
    font-weight: 600; font-size: 1.1rem;
    mix-blend-mode: screen;
}
.uber-circle { background: rgba(255,255,255,0.2); top: 20px; left: calc(50% - 80px); border: 2px solid white; }
.didi-circle { background: rgba(255,123,0,0.3); bottom: 40px; left: calc(50% - 130px); border: 2px solid #ff7b00; }
.cabify-circle { background: rgba(124,58,237,0.3); bottom: 40px; right: calc(50% - 130px); border: 2px solid #7c3aed; }
.venn-overlap { position: absolute; font-size: 0.85rem; font-weight: 700; z-index: 10; }
.ud { top: 130px; left: calc(50% - 60px); }
.uc { top: 130px; right: calc(50% - 60px); }
.dc { bottom: 80px; left: calc(50% - 15px); }
.udc { top: 160px; left: calc(50% - 12px); font-size: 1rem; color: white; }

/* Recommendations */
.recommendations { display: flex; flex-direction: column; gap: 1rem; justify-content: center; }
.rec-card { display: flex; gap: 15px; padding: 1.2rem; align-items: center; border-left: 4px solid transparent; }
.rec-card.positive { border-left-color: var(--success); }
.rec-card.neutral { border-left-color: var(--info); }
.rec-card.negative { border-left-color: var(--danger); }
.rec-card .icon { font-size: 1.5rem; }
.rec-card .content { font-size: 0.95rem; line-height: 1.4; }

/* Controls */
.table-controls { display: flex; gap: 15px; margin-bottom: 15px; }
.search-input, .filter-select {
    background: rgba(0,0,0,0.3); border: 1px solid var(--border-glass);
    color: white; padding: 10px 15px; border-radius: 6px; outline: none;
}
.search-input { flex: 1; }
.btn-primary {
    background: var(--data-primary); color: #000; border: none;
    padding: 10px 20px; border-radius: 6px; font-weight: 600; cursor: pointer;
}
.header-action-bar { display: flex; justify-content: space-between; align-items: center; }
.pagination { display: flex; justify-content: flex-end; gap: 5px; margin-top: 15px; }
.page-btn {
    background: rgba(255,255,255,0.05); border: 1px solid var(--border-glass);
    color: white; width: 32px; height: 32px; border-radius: 4px; cursor: pointer;
}
.page-btn.active { background: var(--data-primary); color: #000; border-color: var(--data-primary); }
.page-btn.disabled { opacity: 0.5; cursor: not-allowed; }

/* ==== NEW TABS CSS ==== */
.compliance-gauge-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
}
.compliance-gauge-svg {
    width: 100%;
    height: 100%;
}
.gauge-center {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.gauge-score {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1;
}
.gauge-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.chart-grid-3col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}
.compliance-checklist .check-item {
    margin-bottom: 8px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.event-timeline {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
}
.event-card {
    min-width: 150px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}
.event-card .date { font-weight: 600; font-size: 0.9rem; margin-bottom: 5px; color: var(--text-muted); }
.event-card .icon { font-size: 1.5rem; margin-bottom: 5px; }
.event-card .name { font-size: 0.85rem; }

/* ==== DOWNLOAD BUTTONS ==== */
.btn-download {
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.3);
  color: #00d4ff;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-download:hover {
  background: rgba(0, 212, 255, 0.2);
  transform: translateY(-1px);
}
.btn-excel {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
  color: #22c55e;
}

/* ==== MODAL STYLES ==== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.modal.active {
    display: flex;
    opacity: 1;
}
.modal-content {
    background: rgba(15, 15, 30, 0.85);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 30px;
    width: 90%;
    max-width: 550px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    position: relative;
}
.modal.active .modal-content {
    transform: scale(1);
}
.close-modal-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.8rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}
.close-modal-btn:hover {
    color: var(--text-main);
}
.modal-section {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.95rem;
}
.modal-section strong {
    color: var(--text-muted);
}
.modal-section span {
    color: var(--text-main);
    font-weight: 500;
}
