/* ============================================================
   ROOT VARIABLES - LIGHT MODE (Default)
   ============================================================ */
:root {
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --header-height: 60px;

    /* Colors - Light Mode */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-hover: #3b82f6;

    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --sidebar-active: #2563eb;
    --sidebar-text: #94a3b8;
    --sidebar-text-hover: #f1f5f9;

    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-filter: #f8fafc;

    --text-primary: #0b1e33;
    --text-secondary: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;

    --border-color: #e2e8f0;
    --border-light: #eef2f6;

    --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.06);
    --shadow-dropdown: 0 8px 24px rgba(0, 0, 0, 0.12);

    --tooltip-bg: #1e293b;
    --tooltip-text: #ffffff;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Target Colors */
    --target-on-track: #10b981;
    --target-warning: #d97706;
    --target-off-track: #ef4444;
}

/* ============================================================
   DARK MODE - Seperti GitHub Dark
   ============================================================ */
[data-theme="dark"] {
    --bg-body: #0d1117;
    --bg-card: #161b22;
    --bg-card-hover: #1c2333;
    --bg-filter: #0d1117;

    --text-primary: #f0f6fc;
    --text-secondary: #c9d1d9;
    --text-muted: #8b949e;
    --text-light: #6e7681;

    --border-color: #30363d;
    --border-light: #21262d;

    --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.4);
    --shadow-dropdown: 0 8px 24px rgba(0, 0, 0, 0.5);

    --sidebar-bg: #0d1117;
    --sidebar-hover: #21262d;
    --sidebar-active: #1f6feb;
    --sidebar-text: #8b949e;
    --sidebar-text-hover: #f0f6fc;

    --tooltip-bg: #21262d;
    --tooltip-text: #f0f6fc;

    --primary: #1f6feb;
    --primary-dark: #1f6feb;
    --primary-hover: #388bfd;
}

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

body {
    background: var(--bg-body);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
    color: var(--text-primary);
}

body.sidebar-collapsed {
    --sidebar-width: var(--sidebar-collapsed);
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1050;
    transition: var(--transition);
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.08);
    scrollbar-width: thin;
    scrollbar-color: #475569 transparent;
    display: flex;
    flex-direction: column;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 10px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    height: var(--header-height);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    z-index: 10;
}

.sidebar-brand .logo-brin {
    width: 36px;
    height: 36px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 6px;
    transition: var(--transition);
}

.sidebar-brand span {
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.3px;
    white-space: nowrap;
    transition: var(--transition);
    color: var(--sidebar-text-hover);
}

body.sidebar-collapsed .sidebar-brand .logo-brin {
    width: 36px;
    height: 36px;
}

body.sidebar-collapsed .sidebar-brand span {
    opacity: 0;
    width: 0;
    margin: 0;
}

@media (max-width: 768px) {
    .sidebar-brand .logo-brin {
        width: 36px;
        height: 36px;
    }

    .sidebar-brand span {
        font-size: 0.95rem;
    }
}

[data-theme="dark"] .sidebar-brand {
    background: var(--sidebar-bg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand i {
    font-size: 1.6rem;
    color: var(--primary);
}

.sidebar-brand span {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.3px;
    white-space: nowrap;
    transition: var(--transition);
    color: var(--sidebar-text-hover);
}

body.sidebar-collapsed .sidebar-brand span {
    opacity: 0;
    width: 0;
}

.sidebar-nav {
    padding: 12px 0 20px;
    flex: 1;
    overflow-y: auto;
}

.sidebar-nav .nav-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--sidebar-text);
    padding: 12px 22px 6px;
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    transition: var(--transition);
}

body.sidebar-collapsed .sidebar-nav .nav-label {
    opacity: 0;
    height: 0;
    padding: 0;
    margin: 0;
}

.sidebar-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 20px;
    margin: 2px 10px;
    border-radius: 10px;
    color: var(--sidebar-text);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    position: relative;
}

.sidebar-nav .nav-item:hover,
.sidebar-nav .nav-item.active {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-hover);
}

.sidebar-nav .nav-item i {
    font-size: 1.1rem;
    min-width: 24px;
    text-align: center;
}

.sidebar-nav .nav-item .nav-text {
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.9rem;
}

body.sidebar-collapsed .sidebar-nav .nav-item .nav-text {
    opacity: 0;
    width: 0;
}

.sidebar-nav .nav-item .badge-nav {
    margin-left: auto;
    background: var(--primary);
    color: white;
    font-size: 0.65rem;
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: 600;
}

.sidebar-nav .nav-item.has-dropdown {
    cursor: pointer;
}

.sidebar-nav .nav-item.has-dropdown .dropdown-arrow {
    margin-left: auto;
    transition: transform 0.3s;
    font-size: 0.7rem;
}

.sidebar-nav .nav-item.has-dropdown.open .dropdown-arrow {
    transform: rotate(90deg);
}

.sidebar-nav .dropdown-container {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease;
    margin-left: 10px;
}

.sidebar-nav .dropdown-container.open {
    max-height: 1000px;
}

.sidebar-nav .dropdown-container .nav-item {
    padding-left: 44px;
    font-size: 0.85rem;
    margin: 1px 10px;
}

.sidebar-nav .dropdown-container .nav-item i {
    font-size: 0.8rem;
    min-width: 20px;
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 12px 16px;
    flex-shrink: 0;
}

.sidebar-footer .nav-item {
    margin: 0;
    padding: 10px 16px;
}

.sidebar-footer .nav-item i {
    color: #ef4444;
}

.sidebar-footer .nav-item:hover {
    background: rgba(239, 68, 68, 0.15);
}

body.sidebar-collapsed .sidebar-footer .nav-item .nav-text {
    opacity: 0;
    width: 0;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    width: calc(100% - var(--sidebar-width));
    max-width: calc(100% - var(--sidebar-width));
}

/* ============================================================
   TOP HEADER
   ============================================================ */
.top-header {
    position: sticky;
    top: 0;
    height: var(--header-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1040;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
    width: 100%;
    transition: background 0.3s ease, border-color 0.3s ease;
}

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

.top-header .toggle-btn {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: 0.2s;
}

.top-header .toggle-btn:hover {
    background: var(--bg-card-hover);
}

.top-header .page-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

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

.datetime-container {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: var(--bg-filter);
    padding: 6px 14px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.datetime-container i {
    color: var(--primary);
    font-size: 0.9rem;
}

.datetime-container .time {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.datetime-container .date {
    color: var(--text-muted);
}

.weather-container {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: var(--bg-filter);
    padding: 6px 14px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    cursor: default;
}

.weather-container .weather-icon {
    font-size: 1.1rem;
}

.weather-container .weather-temp {
    font-weight: 600;
}

.weather-container .weather-desc {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.theme-toggle {
    background: var(--bg-filter);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-muted);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.theme-toggle:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
}

.theme-toggle .theme-label {
    font-size: 0.7rem;
    font-weight: 500;
}

.top-header .right .total-badge {
    background: var(--primary);
    color: white;
    padding: 6px 20px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.9rem;
}

/* ============================================================
   CONTENT AREA
   ============================================================ */
.content {
    padding: 24px;
    flex: 1;
    width: 100%;
    max-width: 100%;
}

/* ============================================================
   FOOTER
   ============================================================ */
.app-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
    flex-shrink: 0;
}

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

.app-footer .footer-left i {
    color: var(--primary);
}

.app-footer .footer-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.app-footer .footer-right a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.app-footer .footer-right a:hover {
    color: var(--primary);
}

.app-footer .footer-divider {
    color: var(--border-color);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .top-header .right .date-badge {
        display: none;
    }

    .top-header .right .total-badge {
        font-size: 0.75rem;
        padding: 4px 14px;
    }

    .datetime-container .date {
        display: none;
    }

    .weather-container .weather-desc {
        display: none;
    }

    .theme-toggle .theme-label {
        display: none;
    }

    .app-footer {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .datetime-container {
        padding: 4px 10px;
        font-size: 0.75rem;
    }

    .weather-container {
        padding: 4px 10px;
        font-size: 0.75rem;
    }

    .top-header .right {
        gap: 8px;
    }
}

/* ============================================================
   STAT CARDS
   ============================================================ */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.stat-card .label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
}

.stat-card .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 4px;
}

.stat-card .icon {
    float: right;
    font-size: 1.8rem;
    opacity: 0.12;
    color: var(--primary);
}

.stat-card .sub {
    font-size: 0.75rem;
    color: var(--text-light);
}

.stat-card.primary .value {
    color: var(--primary);
}

.stat-card.success .value {
    color: #059669;
}

.stat-card.warning .value {
    color: #d97706;
}

.stat-card.purple .value {
    color: #7c3aed;
}

.stat-card.rose .value {
    color: #db2777;
}

/* ============================================================
   TARGET CARDS
   ============================================================ */
.target-card .value {
    font-size: 1.8rem;
    font-weight: 700;
}

.target-card .progress-container {
    margin-top: 10px;
    background: var(--bg-filter);
    border-radius: 20px;
    height: 6px;
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.target-card .progress-fill {
    height: 100%;
    border-radius: 20px;
    transition: width 0.8s ease;
}

.target-card .target-status {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 20px;
    margin-top: 6px;
}

.target-status.on-track {
    background: #d1fae5;
    color: #065f46;
}

.target-status.warning {
    background: #fef3c7;
    color: #b45309;
}

.target-status.off-track {
    background: #fecaca;
    color: #991b1b;
}

[data-theme="dark"] .target-status.on-track {
    background: #064e3b;
    color: #6ee7b7;
}

[data-theme="dark"] .target-status.warning {
    background: #78350f;
    color: #fcd34d;
}

[data-theme="dark"] .target-status.off-track {
    background: #7f1d1d;
    color: #fca5a5;
}

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 14px 20px;
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.filter-bar label {
    font-weight: 500;
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.filter-bar select,
.filter-bar input {
    padding: 7px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-filter);
    font-size: 0.8rem;
    color: var(--text-secondary);
    outline: none;
    transition: 0.2s;
    min-width: 120px;
}

.filter-bar select:focus,
.filter-bar input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.filter-bar .btn-reset {
    background: var(--bg-filter);
    border: 1px solid var(--border-color);
    padding: 7px 18px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: 0.2s;
}

.filter-bar .btn-reset:hover {
    background: var(--bg-card-hover);
}

/* FILTER DROPDOWN CHECKBOX */
.filter-dropdown {
    position: relative;
    display: inline-block;
}

.filter-dropdown .dropdown-btn {
    padding: 7px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-filter);
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    min-width: 140px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    transition: 0.2s;
}

.filter-dropdown .dropdown-btn:hover {
    border-color: var(--primary);
}

.filter-dropdown .dropdown-btn .badge-count {
    background: var(--primary);
    color: white;
    border-radius: 50%;
    padding: 0 6px;
    font-size: 0.65rem;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
}

.filter-dropdown .dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 8px 12px;
    min-width: 200px;
    max-height: 250px;
    overflow-y: auto;
    box-shadow: var(--shadow-dropdown);
    z-index: 1000;
    min-width: 220px;
}

.filter-dropdown .dropdown-menu.show {
    display: block;
}

.filter-dropdown .dropdown-menu .checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 4px;
    cursor: pointer;
    border-radius: 4px;
    transition: 0.15s;
}

.filter-dropdown .dropdown-menu .checkbox-item:hover {
    background: var(--bg-card-hover);
}

.filter-dropdown .dropdown-menu .checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.filter-dropdown .dropdown-menu .checkbox-item label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 400;
    flex: 1;
}

.filter-dropdown .dropdown-menu .checkbox-item .count {
    font-size: 0.65rem;
    color: var(--text-light);
}

.filter-dropdown .dropdown-menu .dropdown-actions {
    display: flex;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
    margin-top: 6px;
}

.filter-dropdown .dropdown-menu .dropdown-actions button {
    flex: 1;
    padding: 4px 8px;
    border: none;
    border-radius: 6px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: 0.2s;
}

.filter-dropdown .dropdown-menu .dropdown-actions .select-all {
    background: #dbeafe;
    color: #1d4ed8;
}

.filter-dropdown .dropdown-menu .dropdown-actions .select-all:hover {
    background: #bfdbfe;
}

.filter-dropdown .dropdown-menu .dropdown-actions .clear-all {
    background: var(--bg-filter);
    color: var(--text-muted);
}

.filter-dropdown .dropdown-menu .dropdown-actions .clear-all:hover {
    background: var(--bg-card-hover);
}

/* ============================================================
   CHARTS
   ============================================================ */
.chart-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
    width: 100%;
}

.chart-grid-2 {
    grid-template-columns: 1fr 1fr;
}

.chart-grid-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.chart-grid-4 {
    grid-template-columns: 1fr 1fr 1fr 1fr;
}

.card-chart {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 18px 18px 14px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
    min-width: 0;
    overflow: hidden;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.card-chart .title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
}

.card-chart .title i {
    color: var(--primary);
}

.chart-container {
    position: relative;
    height: 200px;
    width: 100%;
}

.chart-container.tall {
    height: 260px;
}

.chart-container.short {
    height: 160px;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 0 0 16px 0;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.breadcrumb .separator {
    color: var(--text-light);
    font-size: 0.6rem;
}

.breadcrumb .current {
    color: var(--text-secondary);
    font-weight: 500;
}

/* ============================================================
   ANALYSIS PANEL
   ============================================================ */
.analysis-panel {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px 24px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
    margin-bottom: 20px;
    display: none;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.analysis-panel.visible {
    display: block;
}

.analysis-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.analysis-panel .panel-header h3 {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.analysis-panel .panel-header h3 i {
    color: var(--primary);
    margin-right: 8px;
}

.analysis-panel .panel-header .close-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: 0.2s;
}

.analysis-panel .panel-header .close-btn:hover {
    background: var(--bg-card-hover);
    color: #ef4444;
}

.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.analysis-item {
    background: var(--bg-filter);
    padding: 14px 18px;
    border-radius: 12px;
    border-left: 4px solid var(--primary);
    transition: background 0.3s ease;
}

.analysis-item .label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-light);
    letter-spacing: 0.3px;
    font-weight: 600;
}

.analysis-item .value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 4px;
}

.analysis-item .value .highlight {
    color: var(--primary);
}

.analysis-item .value .success {
    color: #059669;
}

.analysis-item .value .danger {
    color: #ef4444;
}

.analysis-item .value .warning {
    color: #d97706;
}

.analysis-item .sub {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 4px;
}

.analysis-item .bullet-list {
    list-style: none;
    padding: 0;
    margin: 6px 0 0;
}

.analysis-item .bullet-list li {
    padding: 4px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
}

.analysis-item .bullet-list li:last-child {
    border-bottom: none;
}

.analysis-item .bullet-list li i {
    margin-right: 6px;
    font-size: 0.7rem;
}

.analysis-item .bullet-list li .badge {
    float: right;
    font-size: 0.65rem;
}

/* ============================================================
   TABLE
   ============================================================ */
.table-wrapper {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 16px 20px 20px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
    overflow: visible;
    transition: background 0.3s ease, border-color 0.3s ease;
}

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

.table-header h3 {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.table-header h3 i {
    color: var(--primary);
    margin-right: 8px;
}

.table-info {
    font-size: 0.8rem;
    color: var(--text-light);
}

.table-scroll {
    overflow-x: auto;
    overflow-y: visible;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

th {
    text-align: left;
    padding: 10px 8px 8px;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 2px solid var(--border-light);
}

td {
    padding: 8px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
    vertical-align: middle;
}

tr:hover td {
    background: var(--bg-card-hover);
}

/* ============================================================
   TOOLTIP
   ============================================================ */
.tooltip-cell {
    position: relative;
    display: inline-block;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: help;
}

.tooltip-cell .tooltip-content {
    visibility: hidden;
    opacity: 0;
    width: 350px;
    max-width: 90vw;
    background: var(--tooltip-bg);
    color: var(--tooltip-text);
    text-align: left;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 400;
    font-size: 0.8rem;
    line-height: 1.5;
    white-space: normal;
    word-wrap: break-word;
    position: fixed;
    z-index: 99999;
    box-shadow: var(--shadow-dropdown);
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    transform: translateY(-10px);
}

.tooltip-cell:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.tooltip-cell .tooltip-content::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 20px;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid var(--tooltip-bg);
}

/* ============================================================
   BADGE
   ============================================================ */
.badge {
    display: inline-block;
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 600;
}

.badge-aktif {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-proyeksi {
    background: #fef3c7;
    color: #b45309;
}

.badge-selesai {
    background: #d1fae5;
    color: #065f46;
}

.badge-internal {
    background: #e0e7ff;
    color: #4338ca;
}

.badge-eksternal {
    background: #fce7f3;
    color: #be185d;
}

.badge-kelris {
    background: var(--bg-filter);
    color: var(--text-muted);
}

/* ============================================================
   SEARCH BAR
   ============================================================ */
.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-filter);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 4px 12px;
    flex: 1;
    min-width: 200px;
    max-width: 400px;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.search-bar i {
    color: var(--text-light);
    font-size: 0.9rem;
}

.search-bar input {
    border: none;
    background: transparent;
    padding: 8px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    outline: none;
    width: 100%;
}

.search-bar input::placeholder {
    color: var(--text-light);
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.pagination button {
    padding: 5px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: 0.2s;
}

.pagination button:hover:not(:disabled) {
    background: var(--bg-card-hover);
    border-color: var(--text-muted);
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination .page-info {
    font-size: 0.8rem;
    color: var(--text-light);
}

.pagination .page-buttons {
    display: flex;
    gap: 4px;
}

.pagination .page-buttons button.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ============================================================
   MOBILE OVERLAY
   ============================================================ */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1045;
}

body.sidebar-open .sidebar-overlay {
    display: block;
}

@media (min-width: 769px) {
    .sidebar-overlay {
        display: none !important;
    }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .chart-grid-3 {
        grid-template-columns: 1fr 1fr;
    }

    .chart-grid-4 {
        grid-template-columns: 1fr 1fr;
    }

    .analysis-grid {
        grid-template-columns: 1fr 1fr;
    }

    .search-bar {
        max-width: 100%;
    }

    .tooltip-cell {
        max-width: 120px;
    }

    .tooltip-cell .tooltip-content {
        width: 280px;
        left: 0;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .chart-grid,
    .chart-grid-2,
    .chart-grid-3,
    .chart-grid-4 {
        grid-template-columns: 1fr;
    }

    .card-grid {
        grid-template-columns: 1fr 1fr;
    }

    .top-header .page-title {
        display: none;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .analysis-grid {
        grid-template-columns: 1fr;
    }

    .table-header {
        flex-direction: column;
        align-items: stretch;
    }

    .search-bar {
        max-width: 100%;
    }

    .tooltip-cell {
        max-width: 80px;
    }

    .tooltip-cell .tooltip-content {
        width: 220px;
        left: -20px;
    }

    .filter-dropdown .dropdown-menu {
        left: 0;
        right: 0;
        min-width: unset;
        width: 100%;
    }

    .datetime-container .date {
        display: none;
    }

    .weather-container .weather-desc {
        display: none;
    }

    .theme-toggle .theme-label {
        display: none;
    }
}

@media (max-width: 480px) {
    .card-grid {
        grid-template-columns: 1fr;
    }

    .content {
        padding: 12px;
    }

    .tooltip-cell {
        max-width: 60px;
    }

    .tooltip-cell .tooltip-content {
        width: 180px;
        left: -40px;
    }

    .datetime-container {
        padding: 4px 10px;
        font-size: 0.75rem;
    }

    .weather-container {
        padding: 4px 10px;
        font-size: 0.75rem;
    }

    .top-header .right {
        gap: 8px;
    }
}

.chart-container canvas {
    cursor: pointer;
}

/* ============================================================
   Tambahan CSS untuk Login Page - Masukkan ke style.css
   ============================================================ */

/* Login Container */
.login-container {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 40px 36px;
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
    transition: background 0.3s ease, border-color 0.3s ease;
    margin: 40px auto;
}

.login-container .logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
}

.login-container .logo img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.login-container .logo h1 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.login-container .logo h1 span {
    color: var(--primary);
}

.login-container .subtitle {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 28px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-input);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 24px;
    border: 1px solid var(--border-light);
}

.tabs .tab-btn {
    flex: 1;
    padding: 10px 12px;
    border: none;
    border-radius: 10px;
    background: transparent;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
}

.tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.tabs .tab-btn:hover:not(.active) {
    color: var(--text-secondary);
    background: var(--bg-card-hover);
}

/* Form Panels */
.form-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.form-panel.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Groups */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group label .required {
    color: var(--error, #ef4444);
    margin-left: 2px;
}

.form-group .input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    transition: all 0.2s ease;
}

.form-group .input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group .input-wrapper .icon {
    padding: 0 12px;
    color: var(--text-light);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.form-group .input-wrapper input {
    width: 100%;
    padding: 12px 12px 12px 4px;
    border: none;
    background: transparent;
    font-size: 0.9rem;
    color: var(--text-secondary);
    outline: none;
}

.form-group .input-wrapper input::placeholder {
    color: var(--text-light);
    font-size: 0.85rem;
}

.form-group .input-wrapper .toggle-password {
    padding: 0 12px;
    color: var(--text-light);
    cursor: pointer;
    transition: 0.2s;
    flex-shrink: 0;
}

.form-group .input-wrapper .toggle-password:hover {
    color: var(--text-secondary);
}

.form-group .help-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-group .help-text .link {
    color: var(--primary);
    cursor: pointer;
    text-decoration: none;
}

.form-group .help-text .link:hover {
    text-decoration: underline;
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 10px;
    background: var(--primary);
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-primary .spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn-primary.loading .spinner {
    display: inline-block;
}

.btn-primary.loading .btn-text {
    display: none;
}

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

/* Messages */
.message {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.85rem;
    margin-bottom: 16px;
    display: none;
}

.message.show {
    display: block;
}

.message.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.message.success {
    background: #f0fdf4;
    color: #065f46;
    border: 1px solid #bbf7d0;
}

.message.info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

[data-theme="dark"] .message.error {
    background: #7f1d1d;
    color: #fca5a5;
    border: 1px solid #991b1b;
}

[data-theme="dark"] .message.success {
    background: #064e3b;
    color: #6ee7b7;
    border: 1px solid #065f46;
}

[data-theme="dark"] .message.info {
    background: #1e3a5f;
    color: #93c5fd;
    border: 1px solid #1e40af;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 20px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.divider span {
    font-size: 0.75rem;
    color: var(--text-light);
    white-space: nowrap;
}

/* Quick Login */
.quick-login {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
}

.quick-login .quick-btn {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-input);
    font-size: 0.7rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: 0.2s;
    text-align: center;
}

.quick-login .quick-btn:hover {
    border-color: var(--primary);
    background: var(--bg-card-hover);
}

.quick-login .quick-btn .role {
    display: block;
    font-size: 0.6rem;
    color: var(--text-light);
    margin-top: 2px;
}

/* Theme Toggle Float */
.theme-toggle-float {
    position: fixed;
    top: 16px;
    right: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 100;
    box-shadow: var(--shadow-card);
}

.theme-toggle-float:hover {
    border-color: var(--primary);
}

.theme-toggle-float .theme-label-float {
    font-size: 0.7rem;
    font-weight: 500;
}

/* Login Footer */
.login-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.7rem;
    color: var(--text-light);
}

.login-footer a {
    color: var(--primary);
    text-decoration: none;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* Responsive Login */
@media (max-width: 480px) {
    .login-container {
        padding: 24px 20px;
        margin: 20px auto;
    }

    .login-container .logo h1 {
        font-size: 1rem;
    }

    .tabs .tab-btn {
        font-size: 0.7rem;
        padding: 8px 10px;
    }

    .quick-login {
        grid-template-columns: 1fr 1fr;
    }

    .theme-toggle-float .theme-label-float {
        display: none;
    }
}

@media (max-width: 380px) {
    .quick-login {
        grid-template-columns: 1fr;
    }
}