/* ======================================================
   KPI SYSTEM — Premium Design System
   ====================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Color Palette */
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-active: linear-gradient(135deg, #6366f1, #8b5cf6);
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #ffffff;
    --sidebar-width: 260px;
    --sidebar-collapsed: 0px;

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

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --accent-primary: #6366f1;
    --accent-primary-light: #818cf8;
    --accent-gradient: linear-gradient(135deg, #6366f1, #8b5cf6);
    --accent-gradient-hover: linear-gradient(135deg, #4f46e5, #7c3aed);

    --green: #10b981;
    --green-bg: rgba(16, 185, 129, 0.1);
    --orange: #f59e0b;
    --orange-bg: rgba(245, 158, 11, 0.1);
    --red: #ef4444;
    --red-bg: rgba(239, 68, 68, 0.1);
    --blue: #3b82f6;
    --blue-bg: rgba(59, 130, 246, 0.1);

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --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.04);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 10px 10px -5px rgba(0,0,0,0.03);

    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;

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

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ======================================================
   SIDEBAR
   ====================================================== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
}

/* Brand area */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    text-decoration: none;
}

.sidebar-brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-brand-text {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.3px;
}

.sidebar-brand-text span {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: var(--sidebar-text);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-top: 2px;
}

/* Nav Section */
.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    list-style: none;
    margin: 0;
}

.sidebar-nav-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--sidebar-text);
    padding: 12px 12px 8px;
    opacity: 0.6;
}

.sidebar-nav-item {
    margin-bottom: 2px;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

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

.sidebar-nav-link.active {
    background: var(--sidebar-active);
    color: var(--sidebar-text-active);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.sidebar-nav-link .nav-icon {
    width: 20px;
    text-align: center;
    font-size: 16px;
    flex-shrink: 0;
}

.sidebar-nav-link .nav-badge {
    margin-left: auto;
    background: var(--red);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

/* Sidebar footer / user area */
.sidebar-footer {
    padding: 16px 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 11px;
    color: var(--sidebar-text);
}

.sidebar-logout-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255,255,255,0.06);
    color: var(--sidebar-text);
    text-decoration: none;
    transition: var(--transition);
    font-size: 14px;
    flex-shrink: 0;
}

.sidebar-logout-btn:hover {
    background: rgba(239,68,68,0.2);
    color: var(--red);
}

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

/* Top bar */
.topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    padding: 12px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 60px;
}

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

.topbar-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.topbar-breadcrumb {
    font-size: 13px;
    color: var(--text-muted);
}

.mobile-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: none;
    border: 1px solid rgba(0,0,0,0.1);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 18px;
    transition: var(--transition);
}

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

/* Page content */
.page-content {
    padding: 24px 28px 40px;
}

/* ======================================================
   OVERLAY (mobile)
   ====================================================== */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1030;
}

/* ======================================================
   STAT CARDS
   ====================================================== */
.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 22px 24px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0,0,0,0.04);
    transition: var(--transition);
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-card-icon.blue   { background: var(--blue-bg);   color: var(--blue);   }
.stat-card-icon.green  { background: var(--green-bg);  color: var(--green);  }
.stat-card-icon.orange { background: var(--orange-bg); color: var(--orange); }
.stat-card-icon.red    { background: var(--red-bg);    color: var(--red);    }

.stat-card-body h3 {
    font-size: 28px;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.5px;
    line-height: 1;
}

.stat-card-body p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 6px 0 0;
    font-weight: 500;
}

/* ======================================================
   CARD / PANEL
   ====================================================== */
.panel {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(0,0,0,0.04);
    overflow: hidden;
    transition: var(--transition);
}

.panel:hover {
    box-shadow: var(--shadow-md);
}

.panel-header {
    padding: 18px 24px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-header h5 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.panel-body {
    padding: 20px 24px;
}

.panel-body.p-0 { padding: 0; }

/* ======================================================
   TABLE
   ====================================================== */
.table-premium {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table-premium thead th {
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    background: #f8fafc;
    border-bottom: 2px solid rgba(0,0,0,0.06);
    white-space: nowrap;
}

.table-premium tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    color: var(--text-secondary);
    vertical-align: middle;
}

.table-premium tbody tr {
    transition: var(--transition);
}

.table-premium tbody tr:hover {
    background: rgba(99, 102, 241, 0.03);
}

.table-premium tbody tr:last-child td {
    border-bottom: none;
}

/* ======================================================
   BADGES
   ====================================================== */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.badge-green  { background: var(--green-bg);  color: var(--green);  }
.badge-orange { background: var(--orange-bg); color: var(--orange); }
.badge-red    { background: var(--red-bg);    color: var(--red);    }
.badge-grey   { background: rgba(148,163,184,0.1); color: var(--text-muted); }

.badge-approved { background: var(--green-bg); color: var(--green); }
.badge-pending  { background: var(--orange-bg); color: var(--orange); }
.badge-rejected { background: var(--red-bg); color: var(--red); }
.badge-draft    { background: rgba(148,163,184,0.1); color: var(--text-muted); }
.badge-revision { background: var(--blue-bg); color: var(--blue); }

.badge-status .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.badge-category {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(99, 102, 241, 0.08);
    color: var(--accent-primary);
}

/* ======================================================
   BUTTONS
   ====================================================== */
.btn-premium {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary-gradient {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary-gradient:hover {
    background: var(--accent-gradient-hover);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
    color: #fff;
}

.btn-outline-light {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid rgba(0,0,0,0.12);
}

.btn-outline-light:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.04);
}

.btn-success-soft {
    background: var(--green-bg);
    color: var(--green);
    border: 1px solid transparent;
}

.btn-success-soft:hover {
    background: var(--green);
    color: #fff;
}

.btn-danger-soft {
    background: var(--red-bg);
    color: var(--red);
    border: 1px solid transparent;
}

.btn-danger-soft:hover {
    background: var(--red);
    color: #fff;
}

/* ======================================================
   FILTER BAR
   ====================================================== */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.filter-bar .form-select,
.filter-bar .form-control {
    border-radius: var(--radius-sm);
    border: 1px solid rgba(0,0,0,0.1);
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    background-color: var(--bg-card);
    transition: var(--transition);
    min-width: 180px;
}

.filter-bar .form-select:focus,
.filter-bar .form-control:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
    outline: none;
}

/* ======================================================
   FORM ELEMENTS (General)
   ====================================================== */
.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-control, .form-select {
    border-radius: var(--radius-sm);
    border: 1px solid rgba(0,0,0,0.1);
    padding: 10px 14px;
    font-size: 14px;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

/* ======================================================
   LOGIN PAGE
   ====================================================== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99,102,241,0.15) 0%, transparent 70%);
    top: -150px;
    right: -100px;
}

.login-wrapper::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139,92,246,0.12) 0%, transparent 70%);
    bottom: -100px;
    left: -50px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 40px 36px;
    position: relative;
    z-index: 1;
}

.login-card .login-logo {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
    margin: 0 auto 20px;
    box-shadow: 0 8px 20px rgba(99,102,241,0.3);
}

.login-card h3 {
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 6px;
    color: var(--text-primary);
}

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

.login-card .btn-login {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-sm);
    background: var(--accent-gradient);
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}

.login-card .btn-login:hover {
    background: var(--accent-gradient-hover);
    box-shadow: 0 6px 20px rgba(99,102,241,0.4);
    transform: translateY(-1px);
}

/* ======================================================
   EMPTY STATE
   ====================================================== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.4;
}

.empty-state p {
    font-size: 14px;
    margin: 0;
}

/* ======================================================
   KPI INFO ROW
   ====================================================== */
.kpi-info-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-info-item {
    flex: 1;
    min-width: 140px;
    background: var(--bg-body);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
}

.kpi-info-item label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    display: block;
    margin-bottom: 4px;
}

.kpi-info-item span {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ======================================================
   MODAL OVERRIDES
   ====================================================== */
.modal-content {
    position: relative;
    z-index: 1061;
    border-radius: var(--radius);
    border: none;
    box-shadow: var(--shadow-xl);
}

.modal {
    z-index: 1060;
}

.modal-backdrop {
    z-index: 1050;
}

.modal-backdrop.show {
    opacity: 0.22;
}

.modal-header {
    border-bottom: 1px solid rgba(0,0,0,0.06);
    padding: 18px 24px;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    border-top: 1px solid rgba(0,0,0,0.06);
    padding: 16px 24px;
}

/* ======================================================
   APPROVAL CARDS
   ====================================================== */
.approval-card-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 14px;
    padding: 16px;
}

.approval-card {
    background: var(--bg-card);
    border: 1px solid rgba(148,163,184,0.18);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    padding: 16px;
}

.approval-card-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.approval-card-title {
    min-width: 0;
}

.approval-card-program {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    overflow-wrap: anywhere;
}

.approval-card-kpi {
    display: block;
    margin-top: 3px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    overflow-wrap: anywhere;
}

.approval-card-status {
    flex: 0 0 auto;
}

.approval-card-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.approval-meta-item {
    min-width: 0;
}

.approval-meta-item span {
    display: block;
    margin-bottom: 3px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.approval-meta-item strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    overflow-wrap: anywhere;
}

.approval-meta-item em {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    margin-left: 4px;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--purple-bg);
    color: var(--accent-primary);
    font-style: normal;
    font-size: 10px;
    font-weight: 800;
}

.approval-card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

/* ======================================================
   DASHBOARD KPI CARDS
   ====================================================== */
.dashboard-kpi-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 14px;
    padding: 16px;
}

.dashboard-kpi-card {
    background: var(--bg-card);
    border: 1px solid rgba(148,163,184,0.18);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    padding: 16px;
}

.dkc-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.dkc-program {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-primary);
}

.dkc-name {
    margin-top: 3px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}

.dkc-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.dkc-metric span {
    display: block;
    margin-bottom: 3px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.dkc-metric strong {
    display: block;
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary);
    overflow-wrap: anywhere;
}

.dkc-status-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.dkc-revision-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(148,163,184,0.12);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 800;
}

.dkc-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 14px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent-primary);
    font-size: 13px;
    font-weight: 800;
}

.dkc-history {
    margin-top: 12px;
    padding: 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-body);
}

.dkc-history-title {
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 800;
    color: var(--text-primary);
}

.dkc-history-item {
    padding: 10px 0;
    border-top: 1px solid rgba(0,0,0,0.06);
}

.dkc-history-item:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.dkc-history-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.dkc-history-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.dkc-history-grid b {
    color: var(--text-primary);
}

.dkc-rejection {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    background: var(--red-bg);
    color: var(--red);
    font-size: 12px;
    font-weight: 600;
}

/* ======================================================
   SCROLLBAR
   ====================================================== */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

/* ======================================================
   ANIMATIONS
   ====================================================== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.animate-in {
    animation: fadeInUp 0.4s ease-out backwards;
}

.animate-in:nth-child(1) { animation-delay: 0.05s; }
.animate-in:nth-child(2) { animation-delay: 0.10s; }
.animate-in:nth-child(3) { animation-delay: 0.15s; }
.animate-in:nth-child(4) { animation-delay: 0.20s; }

/* ======================================================
   RESPONSIVE — Tablet & Mobile
   ====================================================== */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

    .sidebar-overlay.show {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-toggle {
        display: flex;
    }

    .topbar {
        padding: 10px 16px;
    }

    .page-content {
        padding: 16px;
    }

    .stat-card {
        padding: 16px 18px;
    }

    .stat-card-body h3 {
        font-size: 22px;
    }

    .filter-bar {
        flex-direction: column;
    }

    .filter-bar .form-select,
    .filter-bar .form-control {
        min-width: 100%;
    }

    .table-premium {
        font-size: 13px;
    }

    .table-premium thead th,
    .table-premium tbody td {
        padding: 10px 12px;
    }

    .panel-header,
    .panel-body {
        padding: 14px 16px;
    }
}

@media (max-width: 575.98px) {
    .approval-card-list {
        grid-template-columns: 1fr;
        padding: 12px;
    }

    .approval-card {
        padding: 14px;
    }

    .approval-card-main {
        display: block;
    }

    .approval-card-status {
        margin-top: 10px;
    }

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

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

    .approval-card-actions .btn-premium {
        width: 100%;
        justify-content: center;
    }

    .dashboard-kpi-cards {
        grid-template-columns: 1fr;
        padding: 12px;
    }

    .dashboard-kpi-card {
        padding: 14px;
    }

    .dkc-head {
        display: block;
    }

    .dkc-head .badge-category {
        margin-top: 10px;
    }

    .dkc-metrics,
    .dkc-history-grid,
    .report-revision-grid {
        grid-template-columns: 1fr;
    }

    .report-revision-pill {
        margin-left: 0;
    }

    .login-card {
        padding: 28px 20px;
    }

    .kpi-info-row {
        flex-direction: column;
    }

    .stat-card {
        padding: 14px;
    }
}

/* ======================================================
   REPORT PAGE — Corporate Annual Results Style
   ====================================================== */

/* Report Header */
.report-header {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(0,0,0,0.04);
    padding: 24px 28px;
    margin-bottom: 24px;
}

.report-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
}

.report-main-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.5px;
}

.report-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin: 4px 0 0;
}

.report-header-stats {
    display: flex;
    gap: 20px;
}

.rh-stat {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rh-stat-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.rh-stat-dot.green  { background: var(--green); }
.rh-stat-dot.orange { background: var(--orange); }
.rh-stat-dot.red    { background: var(--red); }

.rh-stat-val {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
}

.rh-stat-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Report Filter Bar */
.report-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    padding-top: 16px;
    border-top: 1px solid rgba(0,0,0,0.06);
}

.rf-item {
    flex: 1;
    min-width: 140px;
}

.rf-item label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.rf-actions {
    display: flex;
    gap: 8px;
    flex: 0;
    min-width: auto;
}

/* ======================================================
   REPORT GRID — Category Columns × KPI Type Rows
   ====================================================== */
.report-grid {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(0,0,0,0.04);
    overflow: hidden;
}

.report-grid-header {
    display: flex;
}

.rg-row-label-header {
    width: 100px;
    min-width: 100px;
    background: #f8fafc;
    flex-shrink: 0;
}

.rg-col-header {
    flex: 1;
    padding: 14px 16px;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.rg-row {
    display: flex;
    border-top: 1px solid rgba(0,0,0,0.06);
}

.rg-row-label {
    width: 100px;
    min-width: 100px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 16px 8px;
    border-right: 1px solid rgba(0,0,0,0.06);
    flex-shrink: 0;
}

.rg-row-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--accent-primary);
}

.rg-row-label span {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    text-align: center;
}

.rg-cell {
    flex: 1;
    padding: 12px;
    border-right: 1px solid rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rg-cell:last-child {
    border-right: none;
}

/* Report Card inside Grid */
.rg-card {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    border: 1px solid rgba(0,0,0,0.06);
    transition: var(--transition);
}

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

.rg-card-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    background: #fafbfc;
    border: 1px dashed rgba(0,0,0,0.1);
}

.rg-card-program {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.rg-card-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.3;
}

.rg-card-values {
    display: flex;
    gap: 16px;
    margin-bottom: 10px;
}

.rg-val-col {
    flex: 1;
    text-align: center;
}

.rg-val-col.target {
    opacity: 0.65;
}

.rg-val-year {
    display: block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.rg-val-number {
    display: block;
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    line-height: 1;
}

.rg-val-unit {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Progress Bar */
.rg-progress-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.rg-progress-bar {
    flex: 1;
    height: 6px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.rg-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

.rg-progress-fill.green  { background: var(--green); }
.rg-progress-fill.orange { background: var(--orange); }
.rg-progress-fill.red    { background: var(--red); }
.rg-progress-fill.grey   { background: var(--text-muted); }

.rg-progress-pct {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    min-width: 38px;
    text-align: right;
}

/* Traffic Light Dot */
.rg-traffic-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.rg-traffic-dot.green  { background: var(--green); }
.rg-traffic-dot.orange { background: var(--orange); }
.rg-traffic-dot.red    { background: var(--red); }
.rg-traffic-dot.grey   { background: var(--text-muted); }

.rg-card-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.report-revision-pill {
    margin-left: auto;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(148,163,184,0.12);
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 800;
}

.report-revision-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent-primary);
    font-size: 12px;
    font-weight: 800;
}

.report-revision-history {
    margin-top: 10px;
    padding: 10px;
    border-radius: var(--radius-sm);
    background: var(--bg-body);
}

.report-revision-item {
    padding: 9px 0;
    border-top: 1px solid rgba(0,0,0,0.06);
}

.report-revision-item:first-child {
    border-top: 0;
    padding-top: 0;
}

.report-revision-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 7px;
}

.report-revision-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px 10px;
    font-size: 11px;
    color: var(--text-muted);
}

.report-revision-grid b {
    color: var(--text-primary);
}

.rg-card-status {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.rg-card-status.green  { color: var(--green); }
.rg-card-status.orange { color: var(--orange); }
.rg-card-status.red    { color: var(--red); }
.rg-card-status.grey   { color: var(--text-muted); }

.rg-approved-badge {
    margin-left: auto;
    color: var(--green);
    font-size: 13px;
}

/* ======================================================
   DETAIL PANELS — Deployment / Adoption / Impact
   ====================================================== */
.detail-panel {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(0,0,0,0.04);
    overflow: hidden;
    height: 100%;
}

.dp-header {
    padding: 16px 20px;
    background: #0d3b66;
    color: #fff;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.dp-num {
    font-size: 24px;
    font-weight: 800;
    opacity: 0.6;
}

.dp-type-label {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
}

/* KPI Item inside detail panel */
.dp-kpi-item {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.dp-kpi-item:last-of-type {
    border-bottom: none;
}

.dp-kpi-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.dp-kpi-program {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

/* Horizontal Bars */
.dp-bars {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dp-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dp-bar-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 48px;
}

.dp-bar-track {
    flex: 1;
    height: 14px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.dp-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.dp-bar-fill.target-bar {
    background: #94a3b8;
}

.dp-bar-fill.actual-bar.green  { background: var(--green); }
.dp-bar-fill.actual-bar.orange { background: var(--orange); }
.dp-bar-fill.actual-bar.red    { background: var(--red); }
.dp-bar-fill.actual-bar.grey   { background: var(--text-muted); }

.dp-bar-val {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 50px;
    text-align: right;
}

/* Traffic Light Summary Table */
.dp-traffic-summary {
    padding: 16px 20px;
    background: #f8fafc;
    border-top: 1px solid rgba(0,0,0,0.06);
}

.dp-ts-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.dp-ts-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.dp-ts-table thead th {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 4px 8px;
    text-align: left;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

.dp-ts-table tbody td {
    padding: 6px 8px;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

.dp-ts-table tbody td:first-child {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ======================================================
   REPORT RESPONSIVE
   ====================================================== */
@media (max-width: 991.98px) {
    .report-grid-header,
    .rg-row {
        flex-direction: column;
    }

    .rg-row-label-header {
        display: none;
    }

    .rg-col-header {
        padding: 10px 12px;
        font-size: 13px;
    }

    .rg-row-label {
        width: 100%;
        min-width: 100%;
        flex-direction: row;
        padding: 12px 16px;
        border-right: none;
        border-bottom: 1px solid rgba(0,0,0,0.06);
    }

    .rg-cell {
        border-right: none;
        border-bottom: 1px solid rgba(0,0,0,0.04);
    }

    .report-header-top {
        flex-direction: column;
    }

    .report-filters {
        flex-direction: column;
    }

    .rf-item {
        min-width: 100%;
    }

    .rf-actions {
        flex: 1;
        min-width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 575.98px) {
    .rg-val-number {
        font-size: 18px;
    }

    .report-main-title {
        font-size: 18px;
    }

    .report-header {
        padding: 16px;
    }
}
