:root {
    /* Color Palette - Dark Theme */
    --bg-body: #000000;
    --bg-card: #1e1e1e;
    --bg-sidebar: #000000;
    --bg-header: #1e1e1e;
    --bg-input: #2c2c2c;
    
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --text-dark: #121212;
    
    --primary: #ffcc00; /* MTN Yellow */
    --primary-hover: #e6b800;
    --secondary: #333333;
    --accent: #00a8e8;
    
    --success: #2ecc71;
    --danger: #e74c3c;
    --warning: #f39c12;
    --info: #3498db;
    
    --border-color: #333333;
    --sidebar-width: 260px;
    --header-height: 70px;
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.5);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; transition: var(--transition); }
ul { list-style: none; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-body); }
::-webkit-scrollbar-thumb { background: #444; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #666; }

/* Layout Structure */
.wrapper {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 20px 30px;
    background-color: var(--bg-body);
    min-height: 100vh;
    transition: margin-left 0.3s ease;
    display: flex;
    flex-direction: column;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--bg-sidebar);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    overflow-y: auto;
    border-right: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.sidebar-menu { padding: 20px 0; }
.sidebar-link {
    display: flex;
    align-items: center;
    padding: 12px 25px;
    color: var(--text-muted);
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: var(--transition);
}

.sidebar-link:hover, .sidebar-link.active {
    background: rgba(255, 204, 0, 0.05);
    color: var(--primary);
    border-left-color: var(--primary);
}

.sidebar-icon {
    width: 24px;
    margin-right: 15px;
    text-align: center;
    font-size: 1.1rem;
}

.menu-text {
    flex-grow: 1;
    text-align: left;
}

/* Submenu */
.has-submenu .submenu-toggle {
    /* justify-content: space-between; Removed to allow flex-grow on menu-text to handle spacing */
}
.submenu-arrow {
    font-size: 0.8rem;
    transition: transform 0.3s;
}
.has-submenu.open .submenu-arrow { transform: rotate(90deg); }

.submenu {
    max-height: 0;
    overflow: hidden;
    background: rgba(0,0,0,0.2);
    transition: max-height 0.3s ease-out;
}
.has-submenu.open .submenu { max-height: 500px; }
.submenu li a {
    padding-left: 50px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

.submenu-icon {
    width: 20px;
    margin-right: 10px;
    text-align: center;
    font-size: 0.8rem;
    opacity: 0.7;
}
.submenu li a:hover .submenu-icon { opacity: 1; }

/* Header */
.app-header {
    height: var(--header-height);
    background-color: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    margin: -20px -30px 30px -30px; /* Full width compensation */
    position: sticky;
    top: 0;
    z-index: 900;
    box-shadow: var(--shadow-sm);
}

.header-brand {
    display: flex;
    align-items: center;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary);
}
.brand-logo-img { height: 35px; margin-right: 10px; }

.header-nav { display: flex; align-items: center; gap: 20px; }

/* User Profile */
.user-profile-badge {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 20px;
    transition: var(--transition);
}
.user-profile-badge:hover { background: rgba(255,255,255,0.05); }

.user-info {
    text-align: right;
    margin-right: 10px;
    display: flex;
    flex-direction: column;
}
.greeting { font-size: 0.75rem; color: var(--text-muted); }
.user-name-text { font-weight: 600; font-size: 0.9rem; }

.user-avatar-circle {
    width: 35px;
    height: 35px;
    background: var(--primary);
    color: var(--text-dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.user-profile-dropdown-container { position: relative; }
.profile-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 200px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 1000;
}
.profile-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.dropdown-item {
    display: block;
    padding: 10px 15px;
    color: var(--text-main);
    transition: background 0.2s;
}
.dropdown-item:hover { background: rgba(255,255,255,0.05); }
.dropdown-header {
    padding: 10px 15px;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

/* Page Titles */
.page-title-section { margin-bottom: 30px; }
.page-title-large { font-size: 1.8rem; font-weight: 700; margin-bottom: 5px; color: var(--text-main); }
.page-subtitle { color: var(--text-muted); }

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

/* Modern Stat Card */
.modern-stat-card {
    background: linear-gradient(135deg, #00170A 0%, #001308 33%, #000F07 66%, #000B05 100%);
    border: 1px solid #00170A;
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 200px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.modern-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    border-color: rgba(255,255,255,0.1);
}

/* Card Gradients - Unified Dark Green Theme */
.card-blue, .card-green, .card-pink, .card-red, .card-yellow, .card-gold {
    background: linear-gradient(135deg, #00170A 0%, #001308 33%, #000F07 66%, #000B05 100%);
    border: 1px solid #00170A;
}

/* Call Center Status Icons */
.status-icon-thumb {
    font-size: 24px;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: help;
}

.status-icon-thumb:hover {
    transform: scale(1.3) rotate(-10deg);
    filter: brightness(1.2);
}
.card-purple, .card-cyan {
    background: linear-gradient(135deg, #00170A 0%, #001308 33%, #000F07 66%, #000B05 100%);
    border: 1px solid #00170A;
}

.card-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}
.card-icon-box { 
    font-size: 1.2rem; 
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
    color: var(--text-muted);
}
.card-blue .card-icon-box { color: #3498db; background: rgba(52, 152, 219, 0.1); }
.card-green .card-icon-box { color: #2ecc71; background: rgba(46, 204, 113, 0.1); }
.card-pink .card-icon-box, .card-red .card-icon-box { color: #e91e63; background: rgba(233, 30, 99, 0.1); }
.card-yellow .card-icon-box, .card-gold .card-icon-box { color: #f1c40f; background: rgba(241, 196, 15, 0.1); }
.card-purple .card-icon-box { color: #9b59b6; background: rgba(155, 89, 182, 0.1); }
.card-cyan .card-icon-box { color: #00bcd4; background: rgba(0, 188, 212, 0.1); }

.card-label {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: 0.5px;
}

.card-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 5px;
    line-height: 1.1;
}

/* Charts Grid */
.charts-grid, .row-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.modern-content-card {
    background: linear-gradient(135deg, #00170A 0%, #001308 33%, #000F07 66%, #000B05 100%);
    border: 1px solid #00170A;
    border-radius: var(--radius-lg);
    padding: 20px;
    height: 100%;
}

.modern-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.modern-card-title { font-size: 1.1rem; font-weight: 600; }

.chart-wrapper-line {
    width: 100%;
    height: 300px;
    position: relative;
}

/* Breakdown Cards (Restored & Dark Themed) */
.breakdown-card-wrapper {
    position: relative;
    padding-top: 20px;
    margin-bottom: 20px;
    transition: transform 0.3s ease;
}
.breakdown-card-wrapper:hover { transform: translateY(-5px); }

.breakdown-badge {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary); /* Yellow Accent */
    color: #000;
    padding: 6px 20px;
    border-radius: 20px 20px 0 0;
    font-weight: 800;
    font-size: 1rem;
    z-index: 2;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.2);
}

.breakdown-card {
    background: linear-gradient(135deg, #00170A 0%, #001308 33%, #000F07 66%, #000B05 100%);
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    position: relative;
    border: 1px solid #00170A;
}

.breakdown-header {
    background: linear-gradient(135deg, #2c3e50, #000); /* Dark Gradient */
    padding: 25px 20px 15px; 
    color: #fff;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.breakdown-card.fcr .breakdown-header {
    background: linear-gradient(135deg, #1e3c72, #2a5298); /* Blueish Dark */
}

.breakdown-title { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.9; }

.breakdown-body {
    padding: 15px 25px 25px;
    text-align: center;
    background: transparent;
}

.breakdown-value {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 10px 0 20px;
    line-height: 1;
}

.breakdown-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.breakdown-target-block, .breakdown-var-block { display: flex; flex-direction: column; }
.breakdown-var-block { text-align: right; }
.breakdown-label { font-size: 0.7rem; margin-bottom: 2px; text-transform: uppercase; }
.breakdown-val-text, .breakdown-var-val { font-size: 1.1rem; font-weight: 700; color: var(--text-main); }
.breakdown-var-val.positive { color: var(--success); }
.breakdown-var-val.negative { color: var(--danger); }

/* Buttons & Forms */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}
.btn-primary { background: var(--primary); color: #000; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-2px); }

.form-control {
    width: 100%;
    padding: 10px 15px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
}
.form-control:focus { outline: none; border-color: var(--primary); }

/* Responsive Media Queries */
@media (max-width: 992px) {
    .sidebar { transform: translateX(-100%); transition: transform 0.3s ease; }
    .sidebar.active { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 15px; }
    .app-header { margin: -15px -15px 20px -15px; padding: 0 15px; }
    .charts-grid, .row-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .kpi-grid { grid-template-columns: 1fr; }
    .card-value { font-size: 1.8rem; }
    .breakdown-value { font-size: 2.5rem; }
    .page-title-large { font-size: 1.5rem; }
}

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.modern-stat-card, .breakdown-card-wrapper, .modern-content-card { animation: fadeIn 0.5s ease-out backwards; }
.kpi-grid > *:nth-child(1) { animation-delay: 0.1s; }
.kpi-grid > *:nth-child(2) { animation-delay: 0.2s; }
.kpi-grid > *:nth-child(3) { animation-delay: 0.3s; }
.kpi-grid > *:nth-child(4) { animation-delay: 0.4s; }

/* Utilities */
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-muted { color: var(--text-muted) !important; }
.mb-3 { margin-bottom: 1rem; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* Manco Dashboard Styles */
.manco-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
}
.manco-title {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}
.manco-title-icon {
    margin-right: 12px;
    color: var(--primary);
}

.manco-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}
.manco-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.manco-card {
    background: linear-gradient(135deg, #12093D 0%, #000000 100%);
    border: 1px solid #12093D;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
    transition: var(--transition);
    animation: fadeIn 0.5s ease-out backwards;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    position: relative;
}

/* Specific gradients removed to unify style as requested */
.manco-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}

.manco-card-header {
    padding: 20px;
    background: rgba(0,0,0,0.2); /* Darken header for contrast */
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.manco-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #fff; /* Always white on gradients */
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: none;
}
.manco-icon-badge {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.15); /* Glassy look */
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.manco-card-scrollable {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
    background: rgba(0,0,0,0.1); /* Slight darken for content area */
}

.manco-subtitle {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
    font-weight: 600;
}
.manco-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
    margin-bottom: 5px;
    text-shadow: none;
}
.manco-prev {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.8);
    margin-top: 4px;
    font-weight: 500;
}

.divider {
    height: 1px;
    background: rgba(255,255,255,0.15);
    margin: 20px 0;
}

.manco-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: rgba(255,255,255,0.9);
    text-transform: uppercase;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}
.manco-target {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
    text-align: right;
}
.manco-target strong { color: #fff; }

.manco-list-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.manco-list-item {
    background: rgba(0,0,0,0.25);
    padding: 14px 18px;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255,255,255,0.05);
    transition: var(--transition);
}
.manco-list-item:hover {
    background: rgba(0,0,0,0.4);
    border-color: rgba(255,255,255,0.15);
    transform: translateX(5px);
}

.manco-item-header { display: flex; align-items: center; }
.manco-item-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
}
.manco-item-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}
.manco-item-footer { margin-left: 15px; }

/* Improved Pills for Gradient Backgrounds */
.manco-card .pill {
    background: transparent;
    border: none;
    backdrop-filter: none;
    padding: 0;
}
.manco-card .pill-success { color: #2ecc71; }
.manco-card .pill-danger { color: #ff6b6b; }
.manco-card .pill-secondary { color: #ddd; }

/* Toggle Group for HVJ */
.hvj-toggle-group {
    display: inline-flex;
    background: var(--bg-card);
    padding: 4px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}
.hvj-toggle-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}
.hvj-toggle-btn.active {
    background: var(--primary);
    color: #000;
}
.hvj-toggle-btn:hover:not(.active) {
    color: var(--text-main);
    background: rgba(255,255,255,0.05);
}

/* Modern Table */
.modern-table-container {
    overflow-x: auto;
}
.modern-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.modern-table th {
    text-align: left;
    padding: 15px;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}
.modern-table td {
    padding: 15px;
    color: var(--text-main);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.modern-table tr:last-child td { border-bottom: none; }
.modern-table tr:hover td { background: rgba(255,255,255,0.02); }

@media (max-width: 992px) {
    .manco-grid, .manco-grid-3 { grid-template-columns: 1fr; }
}
