/* ============================================
   UiTM PERAK DASHBOARD - DESIGN SYSTEM v2.0
   Purple Theme | Sidebar Layout | KPI Visualization
   ============================================ */

/* ============ CSS CUSTOM PROPERTIES ============ */
:root {
    /* Primary Purple Palette */
    --primary-900: #3b0764;
    --primary-800: #4c1d95;
    --primary-700: #5b21b6;
    --primary-600: #6d28d9;
    --primary-500: #7c3aed;
    --primary-400: #8b5cf6;
    --primary-300: #a78bfa;
    --primary-200: #c4b5fd;
    --primary-100: #ddd6fe;
    --primary-50: #f5f3ff;

    /* Semantic Colors */
    --success: #059669;
    --success-light: #d1fae5;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --error: #dc2626;
    --error-light: #fee2e2;
    --info: #0284c7;
    --info-light: #e0f2fe;

    /* Chart Colors */
    --chart-1: #7c3aed;
    --chart-2: #10b981;
    --chart-3: #f59e0b;
    --chart-4: #ef4444;
    --chart-5: #06b6d4;
    --chart-6: #8b5cf6;

    /* Neutrals */
    --gray-900: #1e1b4b;
    --gray-800: #312e81;
    --gray-700: #4c4687;
    --gray-600: #64748b;
    --gray-500: #94a3b8;
    --gray-400: #cbd5e1;
    --gray-300: #e2e8f0;
    --gray-200: #f1f5f9;
    --gray-100: #f8fafc;
    --white: #ffffff;

    /* Surfaces */
    --bg-page: #faf5ff;
    --bg-card: var(--white);
    --bg-elevated: var(--white);
    --border-color: var(--gray-300);
    --border-light: var(--gray-200);

    /* Typography */
    --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --text-primary: var(--gray-900);
    --text-secondary: var(--gray-600);
    --text-muted: var(--gray-500);
    --text-inverse: var(--white);

    /* Spacing Scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;

    /* Layout */
    --sidebar-width: 64px;
    --header-height: 64px;
    --tabs-height: 52px;
    --max-width: 1600px;
}

/* ============ RESET & BASE ============ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-page);
    min-height: 100vh;
    display: flex;
}

/* ============ SIDEBAR ============ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-4) 0;
    background: linear-gradient(180deg, var(--primary-900) 0%, var(--primary-800) 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 200;
}

.sidebar__logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-bottom: var(--space-6);
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
}

.sidebar__logo img {
    width: 32px;
    height: auto;
}

.sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    flex: 1;
}

.sidebar__btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sidebar__btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.sidebar__btn--active {
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
    box-shadow: inset 3px 0 0 var(--primary-400);
}

.sidebar__btn svg {
    flex-shrink: 0;
}

.sidebar__tooltip {
    position: absolute;
    left: calc(100% + 12px);
    padding: var(--space-2) var(--space-3);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--white);
    background: var(--gray-900);
    border-radius: var(--radius-sm);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-8px);
    transition: all var(--transition-fast);
    pointer-events: none;
    z-index: 300;
}

.sidebar__tooltip::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: var(--gray-900);
    border-left: none;
}

.sidebar__btn:hover .sidebar__tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.sidebar__footer {
    margin-top: auto;
}

/* ============ APP CONTAINER ============ */
.app {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ============ HEADER ============ */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    padding: 0 var(--space-6);
    background: linear-gradient(135deg, var(--primary-800) 0%, var(--primary-700) 100%);
    border-bottom: 2px solid var(--primary-900);
}

.header__brand {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.header__title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: -0.01em;
}

.header__subtitle {
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
}

.header__actions {
    display: flex;
    align-items: center;
    gap: var(--space-5);
}

.header__year {
    display: flex;
    align-items: center;
}

.header__year-label {
    padding: var(--space-2) var(--space-4);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--white);
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
}

.header__timestamp {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.header__timestamp .label {
    font-size: 0.6875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.header__timestamp .value {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--white);
}

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
}

.btn--primary {
    color: var(--white);
    background: var(--primary-600);
    border-color: var(--primary-600);
}

.btn--primary:hover {
    background: var(--primary-700);
    border-color: var(--primary-700);
}

.btn--icon {
    width: 40px;
    height: 40px;
    padding: 0;
    color: var(--white);
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.btn--icon:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
}

/* ============ TABS NAVIGATION ============ */
.tabs {
    display: flex;
    align-items: stretch;
    height: var(--tabs-height);
    background: var(--white);
    border-bottom: 2px solid var(--border-color);
    padding: 0 var(--space-6);
    gap: var(--space-1);
}

.tab {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0 var(--space-5);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    top: 2px;
}

.tab:hover {
    color: var(--primary-600);
    background: var(--primary-50);
}

.tab--active {
    color: var(--primary-700);
    border-bottom-color: var(--primary-600);
}

.tab svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.tab--active svg {
    opacity: 1;
}

.tab__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 22px;
    padding: 0 var(--space-2);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary-700);
    background: var(--primary-100);
    border-radius: var(--radius-sm);
}

.tab--active .tab__badge {
    color: var(--white);
    background: var(--primary-600);
}

/* ============ MAIN CONTENT ============ */
.main {
    flex: 1;
    padding: var(--space-6);
    max-width: var(--max-width);
    width: 100%;
    margin: 0 auto;
}

.view {
    animation: fadeIn 0.3s ease;
}

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

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

/* ============ LOADING & ERROR STATES ============ */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    padding: var(--space-16) 0;
}

.loading__spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--primary-100);
    border-top-color: var(--primary-600);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading__text {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    padding: var(--space-16) 0;
    color: var(--error);
}

.error__text {
    font-size: 0.9375rem;
    font-weight: 500;
}

.hidden {
    display: none !important;
}

/* ============ VISUALIZATION GRID ============ */
.dashboard-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.viz-grid {
    display: grid;
    gap: var(--space-5);
}

.viz-grid--hero {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.viz-grid--quarters {
    grid-template-columns: 1fr;
}

.viz-grid--charts {
    grid-template-columns: 340px 1fr;
    gap: var(--space-4);
    align-items: stretch;
}

/* ============ VISUALIZATION CARDS ============ */
.viz-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all var(--transition-fast);
}

.viz-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.viz-card--full {
    grid-column: 1 / -1;
}

.viz-card--wide {
    grid-column: span 1;
}

.viz-card__header {
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border-light);
}

.viz-card__title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-primary);
}

.viz-card__subtitle {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
}

.viz-card__body {
    padding: var(--space-3);
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viz-card__footer {
    display: flex;
    justify-content: center;
    gap: var(--space-8);
    padding: var(--space-4) var(--space-5);
    background: var(--gray-50);
    border-top: 1px solid var(--border-light);
}

.viz-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.viz-stat__value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-700);
}

.viz-stat__label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ============ NUMBER CARDS ============ */
.viz-card--number {
    display: flex;
    flex-direction: column;
    padding: var(--space-5);
}

.viz-card--number .viz-card__icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-4);
}

.viz-card__icon--primary {
    background: var(--primary-100);
    color: var(--primary-600);
}

.viz-card__icon--success {
    background: var(--success-light);
    color: var(--success);
}

.viz-card__icon--warning {
    background: var(--warning-light);
    color: var(--warning);
}

.viz-card--number .viz-card__content {
    flex: 1;
}

.viz-card__big-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.viz-card--number .viz-card__label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: var(--space-1);
}

.viz-card__trend {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding-top: var(--space-3);
    margin-top: auto;
    border-top: 1px solid var(--border-light);
    font-size: 0.75rem;
    font-weight: 600;
}

.viz-card__trend--up {
    color: var(--success);
}

.viz-card__trend--down {
    color: var(--error);
}

.viz-card__trend--neutral {
    color: var(--text-muted);
}

/* ============ QUARTER CIRCLES ============ */
.quarter-circles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2) var(--space-4);
    justify-items: center;
    align-content: center;
    height: 100%;
}

.quarter-circle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
}

.quarter-circle__ring {
    position: relative;
    width: 110px;
    height: 110px;
}

.quarter-circle__ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.quarter-circle__value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.35rem;
    font-weight: 800;
    font-weight: 800;
    color: var(--text-primary);
}

.quarter-circle__label {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
}

.quarter-circle__count {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* ============ LEGEND ============ */
.viz-card__legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-4);
    background: var(--gray-50);
    border-top: 1px solid var(--border-light);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.legend-item__color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

/* ============ QUICK STATS (Tables View) ============ */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.quick-stat {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--white);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-500);
    border-radius: var(--radius-md);
}

.quick-stat__value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-700);
}

.quick-stat__label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ============ CARDS (Tables) ============ */
.card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    background: var(--gray-50);
    border-bottom: 1px solid var(--border-color);
}

.card__title {
    font-size: 1.35rem;
    font-weight: 800;
    font-weight: 700;
    color: var(--text-primary);
}

.card__filters {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.card__body {
    padding: 0;
}

/* ============ SEARCH BOX ============ */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box__icon {
    position: absolute;
    left: var(--space-3);
    color: var(--text-muted);
    pointer-events: none;
}

.search-box__input {
    width: 220px;
    padding: var(--space-2) var(--space-3);
    padding-left: var(--space-10);
    font-family: inherit;
    font-size: 0.8125rem;
    color: var(--text-primary);
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.search-box__input:focus {
    outline: none;
    border-color: var(--primary-400);
    box-shadow: 0 0 0 3px var(--primary-100);
}

/* ============ SELECT ============ */
.select {
    padding: var(--space-2) var(--space-8) var(--space-2) var(--space-3);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%2364748b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: all var(--transition-fast);
}

.select:focus {
    outline: none;
    border-color: var(--primary-400);
    box-shadow: 0 0 0 3px var(--primary-100);
}

.select--sm {
    padding: var(--space-1) var(--space-6) var(--space-1) var(--space-2);
    font-size: 0.75rem;
}

/* ============ TABLE ============ */
.table-wrapper {
    overflow-x: auto;
}

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

/* Keep table height consistent across pages */
.table tbody {
    display: block;
    min-height: 410px;
}

.table thead,
.table tbody tr {
    display: table;
    width: 100%;
    table-layout: fixed;
}

.table th,
.table td {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.table th {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--gray-50);
    position: sticky;
    top: 0;
}

.table tbody tr:hover {
    background: var(--primary-50);
}

/* Narrower width for SUKU and STATUS columns */
.table th:first-child,
.table td:first-child {
    width: 60px;
}

.table th:last-child,
.table td:last-child {
    width: 90px;
}

/* Wider width for NAMA PROGRAM / TAJUK column (2nd column) */
.table th:nth-child(2),
.table td:nth-child(2) {
    width: 35%;
}

.table td {
    color: var(--text-primary);
}

/* ============ STATUS BADGES ============ */
.status {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-2);
}

.status--verified {
    color: var(--success);
    background: var(--success-light);
}

.status--pending {
    color: var(--warning);
    background: var(--warning-light);
}

.status--3star {
    color: var(--info);
    background: var(--info-light);
}

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

/* ============ PAGINATION ============ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    background: var(--gray-50);
    border-top: 1px solid var(--border-color);
}

.pagination__info {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.pagination__status {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.pagination__controls {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.pagination__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-family: inherit;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pagination__btn:hover:not(:disabled) {
    background: var(--primary-50);
    border-color: var(--primary-300);
    color: var(--primary-600);
}

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

.pagination__pages {
    display: flex;
    gap: var(--space-1);
}

.pagination__page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 var(--space-2);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pagination__page:hover {
    background: var(--primary-50);
    border-color: var(--primary-300);
    color: var(--primary-600);
}

.pagination__page--active {
    background: var(--primary-600);
    border-color: var(--primary-600);
    color: var(--white);
}

/* ============ FOOTER ============ */
.footer {
    padding: var(--space-4) var(--space-6);
    text-align: center;
    background: var(--white);
    border-top: 1px solid var(--border-color);
}

.footer p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1200px) {
    .viz-grid--hero {
        grid-template-columns: 1fr 1fr;
    }

    .viz-card--gauge {
        grid-column: 1 / -1;
    }

    .viz-grid--charts {
        grid-template-columns: 340px 1fr;
        gap: var(--space-4);
        align-items: stretch;
    }
}

@media (max-width: 900px) {
    .viz-grid--hero {
        grid-template-columns: 1fr;
    }

    .quarter-circles {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
    }

    .sidebar {
        display: none;
    }

    .header__timestamp {
        display: none;
    }

    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tab span:not(.tab__badge) {
        display: none;
    }

    .card__filters {
        flex-wrap: wrap;
    }

    .search-box__input {
        width: 160px;
    }
}

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

    .viz-card__big-number {
        font-size: 2rem;
    }
}



/* Add to styles.css */

/* Container for the mini bars */
.mini-chart {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 32px;
    /* Fixed height for the chart area */
    margin-top: var(--space-2);
    opacity: 0.8;
}

/* Individual bars */
.mini-bar {
    width: 8px;
    background-color: var(--primary-200);
    border-radius: 2px;
    transition: height 0.3s ease, background-color 0.2s;
    position: relative;
}

/* Hover effect to show exact number */
.mini-bar:hover {
    background-color: var(--primary-600);
}

.mini-bar:hover::after {
    content: attr(data-value);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-900);
    color: var(--white);
    font-size: 10px;
    padding: 2px 4px;
    border-radius: 2px;
    margin-bottom: 4px;
    white-space: nowrap;
    z-index: 10;
}

/* Adjust the card layout to fit the chart on the right */
.viz-card--number .viz-card__content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
}

.viz-card__row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    width: 100%;
}


/* Adjust the Gauge and Donut canvas containers to fit the new smaller boxes */
.viz-card--gauge canvas,
.viz-card canvas {
    max-height: 130px;
    /* Limit canvas height */
    width: auto;
}

/* Make the text inside the Gauge smaller to fit */
.viz-card--gauge .viz-stat__value {
    font-size: 1.35rem;
    font-weight: 800;
}

/* Make the bottom bar chart short so it doesn't push off screen */
/* Target the bar charts specifically to be responsive */
#alumniBarChart,
#industriBarChart,
#komunitiBarChart {
    width: 100%;
    /* Force it to fill the container width */
    height: auto;
    /* Maintain aspect ratio */
    max-height: 250px;
    /* Keep strict height limit */
}

/* 4. Ensure the body height allows the 2x2 grid to fit */
.viz-grid--charts .viz-card__body {
    height: auto;
    min-height: 250px;
}

/* Optional: Make the Q1/Q2 labels slightly closer to the ring */
.quarter-circle {
    gap: var(--space-1);
}



/* ============ COMPACT TABLE OVERRIDES ============ */
.table {
    font-size: 0.75rem !important;
}

.table th,
.table td {
    padding: var(--space-2) var(--space-3) !important;
}

.table th {
    font-size: 0.625rem !important;
}

/* ============ MINI CHART ============ */
.mini-chart {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 32px;
    width: 60px;
    margin-left: auto;
}

.mini-bar {
    flex: 1;
    background-color: var(--primary-500);
    border-radius: 2px 2px 0 0;
    min-height: 2px;
    transition: height 0.3s ease;
}

/* ============ PI SUMMARY CARDS ============ */
.pi-cards-row {
    display: flex;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
    overflow-x: auto;
    padding-bottom: var(--space-2);
    scrollbar-width: thin;
    justify-content: center;
}

.pi-cards-row::-webkit-scrollbar {
    height: 6px;
}

.pi-cards-row::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

.pi-card {
    flex: 0 0 auto;
    min-width: 200px;
    max-width: 300px;
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    box-shadow: var(--shadow-sm);
}

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

.pi-card__code {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--primary-600);
    background: var(--primary-50);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
}

.pi-card__chart {
    width: 48px;
    height: 48px;
    position: relative;
}

.pi-card__chart svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.pi-card__chart-bg {
    fill: none;
    stroke: var(--gray-200);
    stroke-width: 4;
}

.pi-card__chart-progress {
    fill: none;
    stroke: var(--primary-500);
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease;
}

.pi-card__chart-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--text-primary);
}

.pi-card__stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
}

.pi-card__stat {
    text-align: center;
    padding: var(--space-2);
    background: var(--gray-50);
    border-radius: var(--radius-sm);
}

.pi-card__stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
}

.pi-card__stat-label {
    font-size: 0.625rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.pi-card__stat--success .pi-card__stat-value {
    color: var(--success);
}

.pi-card__stat--warning .pi-card__stat-value {
    color: var(--warning);
}

.pi-card__stat--error .pi-card__stat-value {
    color: var(--error);
}

/* ============ SUMMARY STATS CARDS ============ */
.summary-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-6);
}

.summary-stat-card {
    background: linear-gradient(135deg, #1a1f2e 0%, #0f172a 100%);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    position: relative;
    overflow: hidden;
    min-height: 160px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.summary-stat-card--dark {
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.summary-stat-card__content {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    z-index: 1;
}

.summary-stat-card__label {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.summary-stat-card__value {
    font-size: 3.5rem;
    font-weight: 800;
    color: #38bdf8;
    line-height: 1;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.summary-stat-card__subtitle {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: var(--space-2);
}

.summary-stat-card__icon {
    position: absolute;
    bottom: var(--space-4);
    right: var(--space-4);
    color: rgba(255, 255, 255, 0.15);
}