/**
 * ==========================================================================
 * DASHBOARD PUBLIK & REKAPITULASI - STYLESHEET
 * Kategori: Dashboard, Visualisasi Grafik, Rekapitulasi Usulan Per Unit
 * Mendukung: Theme Light (Default) & Theme Dark (Toggleable)
 * ==========================================================================
 */

/* ==========================================================================
   1. THEME TOKENS & VARIABLES
   ========================================================================== */
:root,
[data-theme="light"] {
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-subtle: #f1f5f9;
    --border: #e2e8f0;
    --border-hover: #cbd5e1;
    --border-glow: rgba(37, 99, 235, 0.15);
    --border-focus: #2563eb;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-glow: rgba(37, 99, 235, 0.25);
    --success: #059669;
    --success-glow: rgba(16, 185, 129, 0.15);
    --warning: #d97706;
    --danger: #dc2626;
    --text-main: #0f172a;
    --text-muted: #475569;
    --text-dim: #64748b;
    --hero-title-grad: linear-gradient(135deg, #0f172a 30%, #334155 100%);
    --card-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
    --card-shadow-hover: 0 10px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.05);
    --table-header-bg: #f8fafc;
    --table-border: #e2e8f0;
    --table-hover: #f1f5f9;
    --subtable-bg: #f8fafc;
    --modal-backdrop: rgba(15, 23, 42, 0.55);
    --modal-card-bg: #ffffff;
    --modal-border: #e2e8f0;
    --input-bg: #ffffff;
    --input-border: #cbd5e1;
    --input-focus-bg: #ffffff;
    --badge-public-bg: rgba(37, 99, 235, 0.08);
    --badge-public-color: #2563eb;
    --badge-public-border: rgba(37, 99, 235, 0.25);
    --role-pill-bg: #eff6ff;
    --role-pill-color: #1d4ed8;
    --role-pill-border: #bfdbfe;
    --unit-pill-bg: #ecfdf5;
    --unit-pill-color: #047857;
    --unit-pill-border: #a7f3d0;
    --btn-logout-bg: #fef2f2;
    --btn-logout-color: #dc2626;
    --btn-logout-border: #fecaca;
    --btn-theme-bg: #ffffff;
    --btn-theme-border: #cbd5e1;
    --btn-theme-color: #334155;
    --status-draft-bg: #f1f5f9;
    --status-draft-color: #475569;
    --status-draft-border: #cbd5e1;
    --status-submitted-bg: #eff6ff;
    --status-submitted-color: #1d4ed8;
    --status-submitted-border: #bfdbfe;
    --status-approved-bg: #ecfdf5;
    --status-approved-color: #047857;
    --status-approved-border: #a7f3d0;
    --status-setujui-bg: #f5f3ff;
    --status-setujui-color: #6d28d9;
    --status-setujui-border: #ddd6fe;
}

[data-theme="dark"] {
    --bg-body: #0b0f19;
    --bg-card: #111827;
    --bg-card-subtle: #1f2937;
    --border: #374151;
    --border-hover: #4b5563;
    --border-glow: rgba(59, 130, 246, 0.25);
    --border-focus: #3b82f6;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-glow: rgba(59, 130, 246, 0.25);
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.15);
    --warning: #f59e0b;
    --danger: #ef4444;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dim: #64748b;
    --hero-title-grad: linear-gradient(135deg, #ffffff 40%, #94a3b8 100%);
    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
    --card-shadow-hover: 0 15px 30px -5px rgba(0, 0, 0, 0.5);
    --table-header-bg: #1f2937;
    --table-border: rgba(55, 65, 81, 0.5);
    --table-hover: rgba(31, 41, 55, 0.8);
    --subtable-bg: rgba(15, 23, 42, 0.95);
    --modal-backdrop: rgba(0, 0, 0, 0.75);
    --modal-card-bg: #111827;
    --modal-border: #374151;
    --input-bg: rgba(15, 23, 42, 0.85);
    --input-border: rgba(75, 85, 99, 0.8);
    --input-focus-bg: rgba(15, 23, 42, 0.98);
    --badge-public-bg: rgba(56, 189, 248, 0.12);
    --badge-public-color: #38bdf8;
    --badge-public-border: rgba(56, 189, 248, 0.3);
    --role-pill-bg: rgba(59, 130, 246, 0.15);
    --role-pill-color: #60a5fa;
    --role-pill-border: rgba(59, 130, 246, 0.3);
    --unit-pill-bg: rgba(16, 185, 129, 0.15);
    --unit-pill-color: #34d399;
    --unit-pill-border: rgba(16, 185, 129, 0.3);
    --btn-logout-bg: rgba(239, 68, 68, 0.12);
    --btn-logout-color: #f87171;
    --btn-logout-border: rgba(239, 68, 68, 0.3);
    --btn-theme-bg: rgba(31, 41, 55, 0.7);
    --btn-theme-border: rgba(75, 85, 99, 0.6);
    --btn-theme-color: #cbd5e1;
    --status-draft-bg: rgba(156, 163, 175, 0.15);
    --status-draft-color: #9ca3af;
    --status-draft-border: rgba(156, 163, 175, 0.3);
    --status-submitted-bg: rgba(59, 130, 246, 0.15);
    --status-submitted-color: #60a5fa;
    --status-submitted-border: rgba(59, 130, 246, 0.3);
    --status-approved-bg: rgba(16, 185, 129, 0.15);
    --status-approved-color: #34d399;
    --status-approved-border: rgba(16, 185, 129, 0.3);
    --status-setujui-bg: rgba(168, 85, 247, 0.15);
    --status-setujui-color: #c084fc;
    --status-setujui-border: rgba(168, 85, 247, 0.3);
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 180px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.kpi-grid,
.analytics-grid,
.section-box,
[id="dashboard"],
[id="rekap-grafik"],
[id="rekap-usulan"],
[id="rekap-barang"],
[id="rekap-berkas"] {
    scroll-margin-top: 180px;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--bg-body);
    color: var(--text-main);
    min-height: 100vh;
    padding: 1.5rem 1.25rem 4rem;
    line-height: 1.6;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.container {
    max-width: 96%;
    width: 96%;
    margin: 0 auto;
}

/* ==========================================================================
   HEADER & HERO
   ========================================================================== */
header.hero-header {
    margin-bottom: 2.5rem;
    text-align: center;
}

.hero-logo-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.85rem;
}

.hero-unsoed-logo {
    width: 82px;
    height: 82px;
    object-fit: contain;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.12));
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hero-unsoed-logo:hover {
    transform: scale(1.08) rotate(-2deg);
}

.hero-institution {
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 0.65rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.badge-public {
    background: var(--badge-public-bg);
    color: var(--badge-public-color);
    border: 1px solid var(--badge-public-border);
}

.badge-pulse-blue {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--primary);
    display: inline-block;
}

header.hero-header h1.hero-title,
header.hero-header .hero-title,
h1.hero-title {
    font-size: 2.35rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    background: var(--hero-title-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.4rem;
    text-align: center !important;
    justify-content: center !important;
    display: flex !important;
    width: 100% !important;
}

p.hero-subtitle {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 780px;
    margin: 0 auto;
}

/* ==========================================================================
   KPI SUMMARY CARDS
   ========================================================================== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2.25rem;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-2px);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #10b981);
}

.kpi-card-nominal::before {
    background: linear-gradient(90deg, #10b981, #059669);
}

.kpi-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.kpi-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.kpi-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-main);
    font-family: 'JetBrains Mono', monospace;
    line-height: 1.2;
}

.kpi-subtext {
    font-size: 0.82rem;
    color: var(--text-dim);
    margin-top: 0.45rem;
}

/* ==========================================================================
   SECTION BOXES & VISUAL CHARTS
   ========================================================================== */
.section-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 1.85rem;
    margin-bottom: 2.25rem;
    box-shadow: var(--card-shadow);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

/* 2-Column Grid for Charts & Status */
.analytics-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 1.75rem;
    margin-bottom: 2.25rem;
}

/* Horizontal Bar Chart Component */
.chart-container {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.chart-bar-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.chart-bar-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.88rem;
}

.chart-unit-name {
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.chart-unit-val {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: var(--success);
}

.chart-bar-track {
    width: 100%;
    height: 10px;
    background: var(--bg-card-subtle);
    border-radius: 9999px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border);
}

.chart-bar-fill {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Gradient themes for bars */
.bar-grad-1 { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.bar-grad-2 { background: linear-gradient(90deg, #10b981, #34d399); }
.bar-grad-3 { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.bar-grad-4 { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.bar-grad-5 { background: linear-gradient(90deg, #ec4899, #f472b6); }

/* Status Analytics Cards */
.status-card-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.status-summary-card {
    background: var(--bg-card-subtle);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.status-badge-lg {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.35rem 0.85rem;
    border-radius: 8px;
}

.status-approved-lg { background: var(--status-approved-bg); color: var(--status-approved-color); border: 1px solid var(--status-approved-border); }
.status-submitted-lg { background: var(--status-submitted-bg); color: var(--status-submitted-color); border: 1px solid var(--status-submitted-border); }
.status-draft-lg { background: var(--status-draft-bg); color: var(--status-draft-color); border: 1px solid var(--status-draft-border); }

/* ==========================================================================
   TABLES & ACCORDION EXPANSION
   ========================================================================== */
.table-responsive {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-card);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    color: var(--text-main);
}

th {
    background: var(--table-header-bg);
    color: var(--text-muted);
    padding: 0.9rem 1.1rem;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: left;
    font-weight: 700;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 1rem 1.1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

tr.clickable-row {
    cursor: pointer;
    transition: background 0.15s;
}

tr.clickable-row:hover {
    background: var(--table-hover);
}

/* Subtable Accordion per Unit */
tr.subtable-row {
    background: var(--subtable-bg);
    border-top: 1px solid var(--border);
    border-bottom: 2px solid var(--border);
}

.subtable-container {
    padding: 1.25rem 1.5rem;
}

.subtable-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-toggle-subtable {
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary);
    border: 1px solid var(--border);
    padding: 0.4rem 0.85rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
}

.btn-toggle-subtable:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.btn-toggle-subtable.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

/* Search Bar Filter */
.search-bar-wrapper {
    position: relative;
    max-width: 380px;
    width: 100%;
}

.search-input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 10px;
    padding: 0.55rem 0.9rem 0.55rem 2.4rem;
    font-size: 0.88rem;
    color: var(--text-main);
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-icon {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

/* Topbar components */
.user-topbar {
    position: sticky;
    top: 0.75rem;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0.85rem 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--card-shadow);
    flex-wrap: wrap;
    gap: 1rem;
    transition: background-color 0.2s, border-color 0.2s;
}

.user-topbar-public {
    border-color: var(--border);
}

.user-profile-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #ffffff;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
    flex-shrink: 0;
}

.user-avatar-public {
    background: linear-gradient(135deg, #0284c7, #0369a1);
}

.user-avatar-unsoed {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.topbar-unsoed-img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.15));
    transition: transform 0.2s ease;
}

.topbar-unsoed-img:hover {
    transform: scale(1.08);
}

.topbar-brand-unsoed {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-right: 0.75rem;
    border-right: 1px solid var(--border);
    margin-right: 0.25rem;
}

.topbar-unsoed-img-small {
    width: 36px;
    height: 36px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.12));
    transition: transform 0.2s ease;
}

.topbar-unsoed-img-small:hover {
    transform: scale(1.08);
}

.user-meta-name {
    font-weight: 700;
    color: var(--text-main);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.user-meta-details {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
    flex-wrap: wrap;
}

.role-pill {
    background: var(--role-pill-bg);
    color: var(--role-pill-color);
    border: 1px solid var(--role-pill-border);
    font-size: 0.72rem;
    font-weight: 800;
    padding: 0.15rem 0.55rem;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.unit-pill {
    background: var(--unit-pill-bg);
    color: var(--unit-pill-color);
    border: 1px solid var(--unit-pill-border);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.55rem;
    border-radius: 6px;
}

/* ==========================================================================
   USER NAV MENU BAR (USER LOGIN)
   ========================================================================== */
.user-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 0.75rem;
}

.user-nav-links {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.user-nav-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.95rem;
    border-radius: 9px;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    background: transparent;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.user-nav-item:hover {
    color: var(--text-main);
    background: var(--bg-card-subtle);
    border-color: var(--border);
    transform: translateY(-1px);
}

.user-nav-item.active {
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border-color: #1d4ed8;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.user-nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
    line-height: 1;
}

.user-nav-item.active .user-nav-badge {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
}

.user-nav-unit-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.12rem 0.45rem;
    border-radius: 6px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    border: 1px solid rgba(37, 99, 235, 0.25);
    font-family: 'JetBrains Mono', monospace;
}

.user-nav-item.active .user-nav-unit-badge {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.4);
}

/* Theme Toggle Button */
.btn-theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.95rem;
    border-radius: 10px;
    background: var(--btn-theme-bg);
    border: 1px solid var(--btn-theme-border);
    color: var(--btn-theme-color);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.btn-theme-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.btn-create-top {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    padding: 0.55rem 1.15rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
    border: none;
    cursor: pointer;
}

.btn-create-top:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.btn-logout {
    background: var(--btn-logout-bg);
    color: var(--btn-logout-color);
    border: 1px solid var(--btn-logout-border);
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}

.btn-logout:hover {
    filter: brightness(0.95);
    transform: translateY(-1px);
}

/* Status pills in table */
.status-pill {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-APPROVED { background: var(--status-approved-bg); color: var(--status-approved-color); border: 1px solid var(--status-approved-border); }
.status-SUBMITTED { background: var(--status-submitted-bg); color: var(--status-submitted-color); border: 1px solid var(--status-submitted-border); }
.status-DRAFT { background: var(--status-draft-bg); color: var(--status-draft-color); border: 1px solid var(--status-draft-border); }
.status-SETUJUI_IJIN { background: var(--status-setujui-bg); color: var(--status-setujui-color); border: 1px solid var(--status-setujui-border); }

/* Responsive adjustments */
@media (max-width: 960px) {
    .analytics-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   MODAL DIALOG & MODAL CREATE USULAN
   ========================================================================== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-backdrop);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.modal-overlay.active {
    display: flex !important;
    animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-card {
    background: var(--modal-card-bg);
    border: 1px solid var(--modal-border);
    border-radius: 20px;
    width: 94%;
    max-width: 960px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    animation: modalSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-card > form,
.modal-card form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2.25rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    flex-shrink: 0;
}

.modal-title {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}

.modal-close-btn:hover {
    background: var(--bg-card-subtle);
    color: var(--text-main);
}

.modal-body {
    padding: 2.25rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    background: var(--bg-card);
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.25rem 2.25rem;
    border-top: 1px solid var(--border);
    background: var(--bg-card-subtle);
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    z-index: 10;
}

.modal-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.modal-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.modal-grid-4 {
    display: grid;
    grid-template-columns: 1fr 1fr 1.25fr 1.25fr;
    gap: 1rem;
}

@media (max-width: 768px) {
    .modal-grid-3, .modal-grid-2, .modal-grid-4 {
        grid-template-columns: 1fr !important;
    }
    .modal-body {
        padding: 1.25rem;
    }
    .modal-header, .modal-footer {
        padding: 1rem 1.25rem;
    }
}

.form-group-modal {
    display: flex;
    flex-direction: column;
}

.form-group-modal label {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.45rem;
}

.form-group-modal input,
.form-group-modal select,
.form-group-modal textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 10px;
    color: var(--text-main);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.form-group-modal input:focus,
.form-group-modal select:focus,
.form-group-modal textarea:focus {
    outline: none;
    background: var(--input-focus-bg);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.modal-table-responsive {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border);
}

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

.modal-specs-table th {
    background: var(--table-header-bg);
    color: var(--text-muted);
    padding: 0.65rem 0.75rem;
    text-align: left;
    font-weight: 700;
    border-bottom: 1px solid var(--border);
}

.modal-specs-table td {
    padding: 0.5rem 0.65rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    vertical-align: top;
}

.modal-specs-table input,
.modal-specs-table textarea,
.modal-specs-table select {
    width: 100%;
    padding: 0.45rem 0.6rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 6px;
    color: var(--text-main);
    font-size: 0.8rem;
    font-family: inherit;
}

.btn-add-spec-modal {
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid var(--border);
    color: var(--primary);
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.15s;
}

.btn-add-spec-modal:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.btn-del-spec-modal {
    background: var(--btn-logout-bg);
    border: 1px solid var(--btn-logout-border);
    color: var(--btn-logout-color);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    transition: all 0.15s;
}

.btn-del-spec-modal:hover {
    background: var(--danger);
    color: #ffffff;
    border-color: var(--danger);
}

/* ==========================================================================
   TABLE PAGINATION CONTROLS
   ========================================================================== */
.table-pagination-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 14px 14px;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.table-pagination-info {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
}

.table-pagination-info strong {
    color: var(--text-main);
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.table-pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 0.65rem;
    border-radius: 8px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    color: var(--text-main);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

.pagination-btn.active {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border-color: #3b82f6;
    color: #ffffff;
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: var(--border);
    color: var(--text-muted);
}

.pagination-select:focus {
    outline: none;
    border-color: var(--primary);
}
