* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #e0f2fe;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --border-color: #bae6fd;
    --blue-primary: #2563eb;
    --blue-light: #60a5fa;
    --blue-dark: #1d4ed8;
    --blue-bg: #dbeafe;
    --sidebar-width: 200px;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);

    /* Bluish color theme */
    --sidebar-bg: #1e3a5f;
    --sidebar-text: #ffffff;
    --header-blue: #2563eb;
    --icon-blue: #3b82f6;
    --icon-cyan: #06b6d4;
    --icon-teal: #14b8a6;
    --icon-indigo: #6366f1;
    --icon-sky: #0ea5e9;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.5;
}

.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    overflow-y: auto;
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    width: 100%;
    max-width: 180px;
    height: auto;
    object-fit: contain;
}

.sidebar-nav {
    padding: 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 6px;
    margin-bottom: 4px;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 13px;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--sidebar-text);
}

.nav-item.active {
    background-color: var(--header-blue);
    color: white;
}

.nav-item svg {
    flex-shrink: 0;
}


/* Divisions Dropdown */
.divisions-dropdown {
    cursor: pointer;
    margin-bottom: 4px;
}

.nav-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    color: var(--sidebar-text);
    font-weight: 500;
    font-size: 13px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.nav-item-header:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.divisions-dropdown.active .nav-item-header {
    background-color: rgba(255, 255, 255, 0.05);
}

.arrow {
    transition: transform 0.3s ease;
    font-size: 8px;
    opacity: 0.7;
}

.divisions-dropdown.active .arrow {
    transform: rotate(180deg);
}

.divisions-dropdown-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    margin-left: 12px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 4px;
}

.divisions-dropdown.active .divisions-dropdown-menu {
    max-height: 500px;
}

.dropdown-item {
    display: block;
    padding: 8px 12px 8px 24px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 0 6px 6px 0;
    font-size: 12px;
    transition: all 0.2s ease;
    opacity: 0.8;
}

.dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    opacity: 1;
}

.dropdown-item.active {
    background-color: var(--header-blue);
    color: white;
    opacity: 1;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 16px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
    color: var(--text-secondary);
}

.menu-btn:hover {
    background-color: var(--bg-secondary);
}

.header h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.division-dropdown {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.division-dropdown:hover {
    border-color: var(--header-blue);
}

.division-dropdown:focus {
    outline: none;
    border-color: var(--header-blue);
}

.profile-icon {
    position: relative;
    cursor: pointer;
}

.profile-icon svg {
    color: var(--text-secondary);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--header-blue);
    color: white;
    font-size: 10px;
    font-weight: 600;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Tabs */
.tabs-container {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.tab {
    padding: 10px 24px;
    background: #ffffff;
    border: 1px solid #cce3ff;
    border-radius: 8px;
    text-decoration: none;
    color: #475569;
    font-weight: 500;
    font-size: 14px;
    text-transform: uppercase;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.tab:hover {
    border-color: var(--header-blue);
    color: var(--header-blue);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.tab.active {
    background-color: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.tab:hover {
    border-color: var(--header-blue);
    color: var(--header-blue);
}

.tab.active {
    background-color: var(--header-blue);
    color: white;
    border-color: var(--header-blue);
}

/* Division Banner */
.division-banner {
    background: var(--header-blue);
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.division-banner h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
}

.division-banner p {
    font-size: 13px;
    opacity: 0.9;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

@media (max-width: 1400px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1000px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Divisions Grid */
.divisions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

@media (max-width: 1200px) {
    .divisions-grid {
        grid-template-columns: 1fr;
    }
}

.division-card {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    cursor: pointer;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    border: 1px solid var(--border-color);
}

.division-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
    border-color: var(--header-blue);
}

.division-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.division-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background-color: var(--blue-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--header-blue);
}

.division-icon svg {
    width: 28px;
    height: 28px;
}

.division-card-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.division-card-body {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.division-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.division-stat .stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.division-stat .stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.division-card-footer {
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    text-align: right;
}

.view-details {
    color: var(--header-blue);
    font-weight: 600;
    font-size: 14px;
    transition: color 0.2s ease;
}

.division-card:hover .view-details {
    color: var(--blue-dark);
}

/* Divisions List */
.divisions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 600px;
}

.division-dropdown-container {
    background: var(--bg-primary);
    padding: 24px;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
}

.dropdown-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.division-select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.division-select:hover {
    border-color: var(--header-blue);
}

.division-select:focus {
    outline: none;
    border-color: var(--header-blue);
}

.stat-card {
    background: var(--bg-primary);
    border-radius: 8px;
    padding: 16px;
    box-shadow: var(--card-shadow);
    transition: box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background-color: var(--blue-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--blue-primary);
    margin-bottom: 10px;
}

.stat-icon svg {
    width: 20px;
    height: 20px;
}

.stat-icon.blue {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--icon-blue);
}

.stat-icon.cyan {
    background-color: rgba(6, 182, 212, 0.1);
    color: var(--icon-cyan);
}

.stat-icon.teal {
    background-color: rgba(20, 184, 166, 0.1);
    color: var(--icon-teal);
}

.stat-icon.indigo {
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--icon-indigo);
}

.stat-icon.sky {
    background-color: rgba(14, 165, 233, 0.1);
    color: var(--icon-sky);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Cards */
.card {
    background: var(--bg-primary);
    border-radius: 8px;
    padding: 16px;
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
}

.card h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

/* Table Card */
.table-card {
    overflow: hidden;
}

.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th {
    text-align: center;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: none;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
    background-color: #f8fafc;
}

.data-table td {
    padding: 10px 12px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover {
    background-color: var(--bg-secondary);
}

.clearance-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.clearance-badge.red {
    background-color: #ffe4e6;
    color: #e11d48;
}

.clearance-badge.yellow {
    background-color: #fef9c3;
    color: #854d0e;
}

.clearance-badge.green {
    background-color: #dcfce7;
    color: #15803d;
}

.unit-total-badge {
    color: #8b5cf6;
    font-weight: 600;
    background: none;
    padding: 0;
}

.data-table td:nth-child(10) {
    font-weight: 500;
}

.data-table td:nth-child(2) {
    font-weight: 600;
    color: #1e293b;
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

@media (max-width: 1200px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

.chart-card {
    min-height: 300px;
}

.chart-card.full-width {
    grid-column: 1 / -1;
}

.chart-container {
    height: 250px;
    position: relative;
}

.chart-card.full-width .chart-container {
    height: 280px;
}

.stats-summary {
    padding: 10px 0;
}

.stats-summary p {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-secondary);
}

.stats-summary p:last-child {
    border-bottom: none;
}

.stats-summary span {
    font-weight: 600;
    color: var(--text-primary);
}

.stats-summary .text-purple {
    color: var(--purple-primary);
}

.stats-summary .text-red {
    color: #ef4444;
}

canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 16px;
    }
    
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .header-left {
        width: 100%;
        justify-content: space-between;
    }
    
    .tabs-container {
        overflow-x: auto;
        padding-bottom: 8px;
    }
    
    .data-table {
        font-size: 11px;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 8px;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Report View Styles */
.report-banner {
    background: var(--header-blue);
    border-radius: 8px;
    padding: 24px 32px;
    margin-bottom: 24px;
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.banner-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.pin-icon {
    font-size: 28px;
    background: rgba(255, 255, 255, 0.2);
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.banner-text h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.5px;
}

.status-date {
    font-size: 13px;
    opacity: 0.8;
    display: block;
    margin-top: 4px;
}

/* Report Grid */
.report-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.report-stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
    border: 1px solid #f1f5f9;
}

.report-stat-icon-container {
    width: 48px;
    height: 48px;
    background: #f8fafc;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.report-stat-icon-container.orange { background: #fff7ed; }
.report-stat-icon-container.yellow { background: #fefce8; }

.report-stat-info {
    display: flex;
    flex-direction: column;
}

.report-stat-label {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.report-stat-value {
    font-size: 20px;
    font-weight: 800;
    color: #1e293b;
}

/* Report Table */
.report-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
    margin-top: 24px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 20px;
}

.report-table-container {
    overflow-x: auto;
}

.report-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.report-data-table th {
    background: #f8fafc;
    padding: 12px;
    text-align: center;
    font-weight: 600;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.report-data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: middle;
    text-align: center;
}

.report-data-table tr:hover {
    background: #f1f5f9;
}

.text-blue { color: #2563eb; font-weight: 600; }
.text-orange { color: #f97316; font-weight: 600; }
.text-green { color: #16a34a; font-weight: 600; }

.highlight-green {
    background-color: #dcfce7 !important;
    color: #166534 !important;
    font-weight: 700;
    text-align: center;
}

.period-cell {
    font-size: 12px;
    color: #475569;
    line-height: 1.4;
    max-width: 150px;
}

