/* ========================================
   AKASHA MSPIS — Design System v2
   Rapi, Jelas, Ramah untuk Pengguna Non-IT
   ======================================== */

:root {
    /* Palette utama — indigo profesional dengan aksen hangat */
    --color-primary: #4f46e5;
    --color-primary-light: #818cf8;
    --color-primary-dark: #3730a3;
    --color-primary-bg: #eef2ff;

    --color-accent: #e11d48;         /* aksen hangat untuk highlight tertentu */
    --color-accent-bg: #fff1f2;

    --color-success: #059669;
    --color-success-bg: #ecfdf5;
    --color-warning: #d97706;
    --color-warning-bg: #fffbeb;
    --color-danger: #dc2626;
    --color-danger-bg: #fef2f2;
    --color-info: #0284c7;
    --color-info-bg: #f0f9ff;

    /* Neutrals — lebih hangat, mengurangi kesan teknis */
    --color-bg: #f7f6f3;
    --color-surface: #ffffff;
    --color-surface-alt: #fafaf7;
    --color-border: #e5e4df;
    --color-border-light: #efeeea;
    --color-text: #1f2937;
    --color-text-secondary: #4b5563;
    --color-text-muted: #6b7280;

    /* Sidebar */
    --sidebar-width: 272px;
    --sidebar-bg: #1f2937;
    --sidebar-bg-soft: #111827;
    --sidebar-text: #d1d5db;
    --sidebar-text-muted: #9ca3af;
    --sidebar-hover: #374151;
    --sidebar-active-bg: #4f46e5;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 999px;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(17, 24, 39, 0.04);
    --shadow-sm: 0 1px 3px rgba(17, 24, 39, 0.06), 0 1px 2px rgba(17, 24, 39, 0.04);
    --shadow-md: 0 4px 8px -2px rgba(17, 24, 39, 0.06), 0 2px 4px -2px rgba(17, 24, 39, 0.04);
    --shadow-lg: 0 12px 24px -6px rgba(17, 24, 39, 0.08), 0 4px 8px -4px rgba(17, 24, 39, 0.04);

    --transition: all 0.2s ease;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--color-primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--color-primary-dark); }

h1, h2, h3, h4, h5 { letter-spacing: -0.015em; color: var(--color-text); font-weight: 600; }

/* ========================================
   LAYOUT
   ======================================== */
.app-layout { display: flex; min-height: 100vh; }

.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-wrapper.expanded { margin-left: 0; }

.main-content {
    padding: var(--space-xl);
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* ========================================
   SIDEBAR
   ======================================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    overflow-y: auto;
    border-right: 1px solid rgba(255,255,255,0.04);
}

.sidebar.collapsed { transform: translateX(-100%); }

.sidebar-header {
    padding: var(--space-lg);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-logo { display: flex; align-items: center; gap: 0.75rem; }

.logo-icon {
    width: 44px;
    height: 44px;
    background: #000;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.35), 0 0 0 1px rgba(251, 191, 36, 0.25);
    flex-shrink: 0;
}

.logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.logo-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.logo-sub {
    display: block;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--sidebar-text-muted);
    margin-top: 2px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.logo-accent { color: var(--color-primary-light); }

.sidebar-nav {
    flex: 1;
    padding: var(--space-md) var(--space-sm) var(--space-lg);
}

.nav-group-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--sidebar-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: var(--space-md) var(--space-md) var(--space-sm);
    margin-top: var(--space-sm);
}

.nav-group-label:first-child { margin-top: 0; padding-top: var(--space-sm); }

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.9rem;
    color: var(--sidebar-text);
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 2px;
    line-height: 1.3;
}

.nav-item i { width: 18px; text-align: center; font-size: 0.95rem; opacity: 0.75; }

.nav-item:hover { background: var(--sidebar-hover); color: white; }
.nav-item:hover i { opacity: 1; }

.nav-item.active {
    background: var(--sidebar-active-bg);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
}
.nav-item.active i { opacity: 1; }

.nav-item.nav-highlight {
    background: rgba(79, 70, 229, 0.12);
    color: #c7d2fe;
    border: 1px solid rgba(79, 70, 229, 0.25);
}
.nav-item.nav-highlight:hover { background: var(--color-primary); color: white; border-color: transparent; }
.nav-item.nav-highlight.active { border-color: transparent; }

.nav-divider { height: 1px; background: rgba(255,255,255,0.06); margin: var(--space-sm) 0; }

.sidebar-footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid rgba(255,255,255,0.06);
    background: var(--sidebar-bg-soft);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--sidebar-text);
    font-size: 0.88rem;
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-weight: 600; color: white; font-size: 0.9rem; }
.sidebar-user-role { font-size: 0.75rem; color: var(--sidebar-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sidebar-logout {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--sidebar-text-muted);
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}
.sidebar-logout:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.35);
    color: #fecaca;
}

/* ========================================
   TOPBAR
   ======================================== */
.topbar {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-md) var(--space-xl);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    position: sticky;
    top: 0;
    z-index: 50;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
    display: none;
}

.sidebar-toggle:hover { background: var(--color-border-light); }

.topbar-title { flex: 1; }
.topbar-title h1 { font-size: 1.35rem; font-weight: 600; letter-spacing: -0.02em; }
.topbar-subtitle { font-size: 0.88rem; color: var(--color-text-secondary); margin-top: 2px; }

.topbar-actions { display: flex; gap: var(--space-sm); align-items: center; }

/* ========================================
   GREETING & PAGE INTRO
   ======================================== */
.page-intro {
    background: linear-gradient(135deg, #eef2ff 0%, #fef3f2 100%);
    border: 1px solid #e0e7ff;
    border-radius: var(--radius-lg);
    padding: var(--space-lg) var(--space-xl);
    margin-bottom: var(--space-xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
}

.page-intro-text h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 4px;
}

.page-intro-text p {
    font-size: 0.92rem;
    color: var(--color-text-secondary);
    line-height: 1.55;
}

.page-intro-illustration {
    font-size: 2.5rem;
    flex-shrink: 0;
}

/* ========================================
   CARDS
   ======================================== */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-xs);
    transition: var(--transition);
}

.card:hover { box-shadow: var(--shadow-sm); }

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: var(--space-md);
    gap: var(--space-md);
}

.card-header-main { flex: 1; min-width: 0; }

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.card-subtitle {
    font-size: 0.82rem;
    color: var(--color-text-secondary);
    margin-top: 4px;
    font-weight: 400;
}

/* Stat Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card:hover { box-shadow: var(--shadow-sm); border-color: var(--color-border); transform: translateY(-1px); }

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

.stat-icon.purple { background: var(--color-primary-bg); color: var(--color-primary); }
.stat-icon.green { background: var(--color-success-bg); color: var(--color-success); }
.stat-icon.blue { background: var(--color-info-bg); color: var(--color-info); }
.stat-icon.orange { background: var(--color-warning-bg); color: var(--color-warning); }
.stat-icon.rose { background: var(--color-accent-bg); color: var(--color-accent); }

.stat-info { flex: 1; min-width: 0; }
.stat-info h3 { font-size: 1.75rem; font-weight: 700; line-height: 1.15; color: var(--color-text); }
.stat-info p { font-size: 0.85rem; color: var(--color-text-secondary); margin-top: 2px; font-weight: 500; }
.stat-info .stat-hint { font-size: 0.78rem; color: var(--color-text-muted); margin-top: 4px; }

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.15rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    font-family: inherit;
    line-height: 1.2;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
    box-shadow: 0 1px 2px rgba(79, 70, 229, 0.25);
}
.btn-primary:hover { background: var(--color-primary-dark); color: white; box-shadow: 0 2px 6px rgba(79, 70, 229, 0.35); }

.btn-secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}
.btn-secondary:hover { background: var(--color-border-light); color: var(--color-text); border-color: #d1d0cb; }

.btn-success { background: var(--color-success); color: white; }
.btn-success:hover { background: #047857; color: white; }

.btn-danger { background: var(--color-danger); color: white; }
.btn-danger:hover { background: #b91c1c; color: white; }

.btn-ghost {
    background: transparent;
    color: var(--color-text-secondary);
    border: 1px solid transparent;
}
.btn-ghost:hover { background: var(--color-border-light); color: var(--color-text); }

.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.82rem; }
.btn-lg { padding: 0.8rem 1.6rem; font-size: 1rem; }

.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

/* ========================================
   TABLES
   ======================================== */
.table-container {
    overflow-x: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow-xs);
}

table { width: 100%; border-collapse: collapse; }

th {
    text-align: left;
    padding: 0.85rem 1.1rem;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-secondary);
    background: var(--color-surface-alt);
    border-bottom: 1px solid var(--color-border);
}

td {
    padding: 0.95rem 1.1rem;
    font-size: 0.92rem;
    border-bottom: 1px solid var(--color-border-light);
    vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #fdfcf9; }

/* ========================================
   FORMS
   ======================================== */
.form-group { margin-bottom: var(--space-lg); }

.form-label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.4rem;
}

.form-label-hint {
    display: block;
    font-weight: 400;
    color: var(--color-text-muted);
    font-size: 0.82rem;
    margin-top: 2px;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-family: inherit;
    color: var(--color-text);
    background: var(--color-surface);
    transition: var(--transition);
    line-height: 1.4;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.form-textarea { min-height: 90px; resize: vertical; }

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-md);
}

.form-actions {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
    padding-top: var(--space-md);
    border-top: 1px solid var(--color-border-light);
    margin-top: var(--space-xl);
}

/* ========================================
   ALERTS & BADGES
   ======================================== */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
    font-size: 0.92rem;
    transition: all 0.3s ease;
}

.alert i { font-size: 1.1rem; margin-top: 1px; }

.alert-success {
    background: var(--color-success-bg);
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: var(--color-danger-bg);
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-info {
    background: var(--color-info-bg);
    color: #075985;
    border: 1px solid #bae6fd;
}

.alert-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    opacity: 0.5;
    color: inherit;
    padding: 0 0.25rem;
    line-height: 1;
}
.alert-close:hover { opacity: 1; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 500;
}

.badge-success { background: var(--color-success-bg); color: #065f46; }
.badge-warning { background: var(--color-warning-bg); color: #92400e; }
.badge-danger { background: var(--color-danger-bg); color: #991b1b; }
.badge-info { background: var(--color-info-bg); color: #075985; }
.badge-primary { background: var(--color-primary-bg); color: var(--color-primary-dark); }
.badge-neutral { background: var(--color-border-light); color: var(--color-text-secondary); }
.badge-accent { background: var(--color-accent-bg); color: #9f1239; }

.badge-dot::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* ========================================
   SCORING COMPONENTS
   ======================================== */
.score-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.85rem;
    line-height: 1;
}

.score-pill-value { font-size: 0.92rem; }
.score-pill-label { font-size: 0.75rem; font-weight: 500; opacity: 0.85; }

.score-excellent { background: #d1fae5; color: #065f46; }
.score-good      { background: #dbeafe; color: #1e40af; }
.score-average   { background: #fef3c7; color: #92400e; }
.score-below     { background: #fed7aa; color: #9a3412; }
.score-poor      { background: #fecaca; color: #991b1b; }

/* legacy alias */
.score-badge { display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.85rem; border-radius: var(--radius-full); padding: 0.3rem 0.8rem; }

.score-bar {
    height: 8px;
    background: var(--color-border-light);
    border-radius: 999px;
    overflow: hidden;
}

.score-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.6s ease;
    background: linear-gradient(90deg, var(--color-primary-light), var(--color-primary));
}

/* Score selector */
.score-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.score-option { position: relative; }
.score-option input { display: none; }

.score-option label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--color-border);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    background: var(--color-surface);
    color: var(--color-text-secondary);
}

.score-option label:hover {
    border-color: var(--color-primary-light);
    background: var(--color-primary-bg);
    color: var(--color-primary);
}

.score-option input:checked + label {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: white;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.kpi-eval-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
    transition: var(--transition);
}

.kpi-eval-card:hover { border-color: var(--color-primary-light); box-shadow: var(--shadow-sm); }

.kpi-eval-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: var(--space-md); gap: var(--space-md); }

.kpi-eval-title { font-weight: 600; font-size: 1rem; }

.kpi-eval-weight {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-primary);
    background: var(--color-primary-bg);
    padding: 0.25rem 0.7rem;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.kpi-eval-desc { font-size: 0.88rem; color: var(--color-text-secondary); margin-bottom: var(--space-md); }

.criteria-toggle {
    font-size: 0.85rem;
    color: var(--color-primary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: var(--space-sm);
    font-weight: 500;
}

.criteria-toggle:hover { color: var(--color-primary-dark); }

.criteria-list { display: none; margin-top: var(--space-sm); background: var(--color-surface-alt); border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: var(--space-md); }
.criteria-list.open { display: block; }

.criteria-item { display: flex; gap: var(--space-sm); padding: 0.5rem 0; font-size: 0.88rem; border-bottom: 1px solid var(--color-border); }
.criteria-item:last-child { border-bottom: none; }
.criteria-score { font-weight: 700; color: var(--color-primary); min-width: 26px; }
.criteria-label { font-weight: 600; color: var(--color-text); }
.criteria-desc { color: var(--color-text-secondary); }

/* ========================================
   INSIGHTS / AI
   ======================================== */
.ins-ai-card {
    background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
    border: 1px solid #e0e7ff;
}

.ins-ai-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: var(--space-md); }

.ins-ai-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.15rem;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.ins-ai-body { font-size: 0.95rem; line-height: 1.7; color: var(--color-text-secondary); }
.ins-ai-body strong { color: var(--color-text); font-weight: 600; }

.ins-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
}
.ins-trend-up    { color: #065f46; background: #d1fae5; }
.ins-trend-down  { color: #991b1b; background: #fee2e2; }
.ins-trend-stable { color: #4b5563; background: #e5e7eb; }

.ins-rec { display: flex; gap: var(--space-md); padding: var(--space-md); border-radius: var(--radius-md); border: 1px solid var(--color-border); margin-bottom: var(--space-sm); background: var(--color-surface); }

.ins-rec-positive { border-left: 4px solid var(--color-success); }
.ins-rec-warning  { border-left: 4px solid var(--color-warning); }
.ins-rec-info     { border-left: 4px solid var(--color-info); }

.ins-rec-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}
.ins-rec-positive .ins-rec-icon { background: var(--color-success-bg); color: var(--color-success); }
.ins-rec-warning .ins-rec-icon  { background: var(--color-warning-bg); color: var(--color-warning); }
.ins-rec-info .ins-rec-icon     { background: var(--color-info-bg); color: var(--color-info); }

.ins-rec-content { flex: 1; }
.ins-rec-content h4 { font-size: 0.95rem; font-weight: 600; margin-bottom: 4px; }
.ins-rec-content p { font-size: 0.88rem; color: var(--color-text-secondary); line-height: 1.55; }

.ins-source {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: var(--space-md);
    color: var(--color-text-muted);
    font-size: 0.82rem;
    border-top: 1px dashed var(--color-border);
    margin-top: var(--space-lg);
}

/* ========================================
   DASHBOARD / PAGE-SPECIFIC
   ======================================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    margin-top: var(--space-lg);
}

.dashboard-full { grid-column: 1 / -1; }

/* Department Card Grid */
.dept-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-md);
}

.dept-card { position: relative; overflow: hidden; }

.dept-card-color {
    height: 4px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    margin: calc(var(--space-lg) * -1) calc(var(--space-lg) * -1) var(--space-md);
}

.dept-team-list { display: flex; flex-direction: column; gap: 8px; margin-top: var(--space-sm); }

.dept-team-member {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.dept-team-member:hover { background: var(--color-border-light); }

.dept-team-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.82rem;
    flex-shrink: 0;
}

.dept-team-info { display: flex; flex-direction: column; min-width: 0; }
.dept-team-name { font-size: 0.9rem; font-weight: 600; color: var(--color-text); line-height: 1.2; }
.dept-team-position { font-size: 0.78rem; color: var(--color-text-secondary); }

.dept-empty-team {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg) var(--space-md);
    margin-top: var(--space-sm);
    background: var(--color-surface-alt);
    border-radius: var(--radius-sm);
    border: 1px dashed var(--color-border);
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

/* List rows (evaluations, pending list) */
.list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--color-border-light);
    gap: var(--space-md);
}
.list-row:last-child { border-bottom: none; }

.list-row-main { flex: 1; min-width: 0; }
.list-row-title { font-weight: 600; font-size: 0.95rem; color: var(--color-text); }
.list-row-sub { font-size: 0.82rem; color: var(--color-text-secondary); margin-top: 2px; }
.list-row-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }

/* Avatar */
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: white;
    flex-shrink: 0;
    background: linear-gradient(135deg, #818cf8, #6366f1);
}

/* Section */
.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: var(--space-md);
    color: var(--color-text);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--space-2xl) var(--space-lg);
    color: var(--color-text-muted);
}

.empty-state i { font-size: 2.5rem; margin-bottom: var(--space-md); display: block; color: var(--color-text-muted); opacity: 0.6; }
.empty-state .empty-title { font-size: 1rem; font-weight: 600; color: var(--color-text); margin-bottom: 4px; }
.empty-state p { font-size: 0.9rem; line-height: 1.55; max-width: 360px; margin: 0 auto; }
.empty-state .btn { margin-top: var(--space-md); }

/* Pagination */
.pagination-wrapper { display: flex; justify-content: center; padding: var(--space-md) 0; }
.pagination-wrapper nav { display: flex; gap: 4px; }
.pagination-wrapper .page-link {
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
}
.pagination-wrapper .page-link:hover { background: var(--color-border-light); }
.pagination-wrapper .active .page-link {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* Filters */
.filters-bar {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: var(--space-lg);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    box-shadow: var(--shadow-xs);
}

.filters-bar-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-right: 0.25rem;
}

.filters-bar .form-select, .filters-bar .form-input {
    width: auto;
    min-width: 180px;
    padding: 0.5rem 0.8rem;
    font-size: 0.88rem;
}

/* Detail view */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); }
.detail-item { padding: var(--space-sm) 0; }
.detail-label { font-size: 0.78rem; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.detail-value { font-size: 0.95rem; font-weight: 500; color: var(--color-text); margin-top: 4px; }

/* Score display in show */
.total-score-display { text-align: center; padding: var(--space-xl); }
.total-score-number { font-size: 3.5rem; font-weight: 800; line-height: 1; color: var(--color-text); }
.total-score-label { font-size: 0.9rem; color: var(--color-text-secondary); margin-top: var(--space-sm); }

/* ========================================
   UTILITIES
   ======================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--color-text-secondary); }
.text-xs { font-size: 0.78rem; }
.text-sm { font-size: 0.85rem; }
.text-lg { font-size: 1.05rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.flex { display: flex; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.w-full { width: 100%; }

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1024px) {
    .sidebar-toggle { display: block; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.collapsed { transform: translateX(0); }
    .main-wrapper { margin-left: 0; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .page-intro { flex-direction: column; align-items: flex-start; text-align: left; }
}

@media (max-width: 768px) {
    .main-content { padding: var(--space-md); }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .filters-bar { flex-direction: column; align-items: stretch; }
    .filters-bar .form-select, .filters-bar .form-input { width: 100%; }
    .dept-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .topbar { padding: var(--space-md); }
    html { font-size: 15px; }
}

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


/* ========================================
   FILTER CARD (reusable across pages)
   ======================================== */
.filter-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-md) var(--space-lg);
    box-shadow: var(--shadow-xs);
}

.filter-card-row {
    display: flex;
    align-items: flex-end;
    gap: var(--space-lg);
    flex-wrap: wrap;
}

.filter-form {
    display: flex;
    gap: var(--space-md);
    align-items: flex-end;
    flex-wrap: wrap;
    margin: 0;
}

.filter-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.filter-form-group label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.filter-form-group .form-input,
.filter-form-group .form-select {
    width: auto;
    min-width: 180px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

.filter-form-actions {
    display: flex;
    gap: 0.4rem;
    padding-bottom: 1px;
}

.filter-card-divider {
    width: 1px;
    background: var(--color-border);
    align-self: stretch;
    margin: 0.25rem 0;
}

.filter-quick {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 240px;
}

.filter-quick-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.filter-quick .form-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

.filter-refresh {
    margin: 0 0 0 auto;
    padding-bottom: 1px;
}

.filter-active-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px dashed var(--color-border);
}

.filter-active-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 500;
    background: var(--color-border-light);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.filter-chip-accent {
    background: var(--color-primary-bg);
    color: var(--color-primary-dark);
    border-color: #c7d2fe;
}

.filter-chip-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(79, 70, 229, 0.15);
    color: var(--color-primary-dark);
    font-size: 0.65rem;
    transition: var(--transition);
    margin-left: 0.15rem;
}
.filter-chip-close:hover {
    background: var(--color-primary);
    color: white;
}

@media (max-width: 900px) {
    .filter-card-divider { display: none; }
    .filter-refresh { margin-left: 0; width: 100%; }
    .filter-refresh button { width: 100%; justify-content: center; }
}

@media (max-width: 640px) {
    .filter-form { width: 100%; }
    .filter-form-group { flex: 1 1 100%; }
    .filter-form-group .form-input,
    .filter-form-group .form-select { width: 100%; min-width: 0; }
    .filter-form-actions { width: 100%; }
    .filter-form-actions .btn { flex: 1; justify-content: center; }
    .filter-quick { width: 100%; }
}


/* ========================================
   SELECTED EMPLOYEE BANNER (evaluations/create)
   ======================================== */
.selected-employee-banner {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    background: var(--color-primary-bg);
    border: 1px solid #c7d2fe;
    border-radius: var(--radius-md);
    margin-top: var(--space-md);
}
.selected-employee-banner .list-row-title { font-size: 0.95rem; }
.selected-employee-banner .list-row-sub { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
