/* Variabel CSS Premium */
:root {
    --primary-color: #4f46e5; /* Indigo 600 */
    --primary-hover: #4338ca;
    --secondary-color: #10b981; /* Emerald 500 */
    --bg-main: #f3f4f6; /* Gray 100 */
    --bg-card: #ffffff;
    --text-dark: #111827;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --sidebar-bg: #ffffff; /* Mengubah ke Putih Terang */
    --sidebar-hover: #f1f5f9;
    --sidebar-text: #1e293b; /* Teks Gelap Kontras Tinggi */
    --sidebar-active: #4f46e5;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset Dasar */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-dark);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* =========================================
   LAYOUT ADMIN (Light Theme - Kontras Tinggi)
========================================= */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
    background-color: var(--bg-main);
}

/* Sidebar Terang Kontras Tinggi */
.sidebar {
    width: 280px;
    background-color: #ffffff;
    color: #1e293b;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    border-right: 1px solid var(--border-color);
    box-shadow: 2px 0 12px rgba(0,0,0,0.03);
    z-index: 100;
}

.sidebar-header {
    padding: 1.75rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: #f8fafc;
}

.sidebar-header h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-header p {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    display: inline-block;
    background: rgba(16, 185, 129, 0.2);
    color: var(--secondary-color);
    padding: 0.2rem 0.8rem;
    border-radius: 999px;
}

.sidebar-menu {
    padding: 1.5rem 1rem;
    list-style: none;
    flex: 1;
}

.sidebar-menu li {
    margin-bottom: 0.5rem;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.875rem 1rem;
    color: #334155; /* Teks Slate gelap kontras tinggi */
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: var(--transition);
}

.sidebar-menu a:hover, .sidebar-menu a.active {
    background-color: #e0e7ff; /* Soft Blue-Indigo Highlight */
    color: #4338ca; /* Indigo Pekat */
}

.sidebar-menu a::before {
    content: "■";
    font-size: 0.6rem;
    color: var(--primary-color);
    opacity: 0;
    transition: var(--transition);
}

.sidebar-menu a:hover::before, .sidebar-menu a.active::before {
    opacity: 1;
}

/* Content Area */
.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Topbar / Header Admin */
.admin-topbar {
    height: 70px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 50;
}

.admin-topbar .page-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
}

.admin-content {
    padding: 2rem;
    flex: 1;
}

/* =========================================
   UI COMPONENTS (Cards, Buttons, Tables)
========================================= */

/* Premium Card */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

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

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

/* Grid System */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Dashboard Stat Cards */
.stat-card {
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, transparent, rgba(0,0,0,0.03));
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-dark);
    margin: 0.5rem 0;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Tables (Premium Look) */
.table-container {
    width: 100%;
    overflow-x: auto;
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

thead {
    background-color: #f9fafb;
    border-bottom: 1px solid var(--border-color);
}

th {
    padding: 1rem 1.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
    color: var(--text-dark);
}

tbody tr:hover {
    background-color: #f9fafb;
}

/* Pagination Premium */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: white;
    border-top: 1px solid var(--border-color);
}

.page-numbers {
    display: flex;
    gap: 0.5rem;
}

.page-link {
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.875rem;
    transition: var(--transition);
}

.page-link:hover, .page-link.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.875rem;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    gap: 0.5rem;
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    transform: translateY(-1px);
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-dark);
}
.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition: var(--transition);
}
.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Admin Topbar Specifics */
.admin-topbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 2rem; background: white; border-bottom: 1px solid var(--border-color);
    height: 70px;
}
.topbar-actions {
    display: flex; align-items: center; gap: 1rem;
}
.action-icon {
    position: relative; cursor: pointer; color: var(--text-muted);
}
.action-icon:hover { color: var(--primary-color); }
.badge {
    position: absolute; top: -5px; right: -5px;
    border-radius: 50%; width: 18px; height: 18px;
    font-size: 0.6rem; color: white; display: flex;
    justify-content: center; align-items: center; font-weight: bold;
}
.badge-primary { background: var(--primary-color); }
.badge-danger { background: #ef4444; }

/* Submenu Dropdown Sidebar */
.has-submenu .chevron {
    margin-left: auto; transition: transform 0.3s;
}
.has-submenu.open .chevron {
    transform: rotate(180deg);
}
.submenu {
    display: none; background: #f8fafc;
    list-style: none; padding-left: 1.5rem;
    border-radius: 8px; margin: 0.25rem 0;
    border: 1px solid #f1f5f9;
}
.submenu a {
    padding: 0.6rem 1rem; font-size: 0.88rem; color: #475569; font-weight: 500;
}
.submenu a:hover, .submenu a.active {
    color: #4338ca !important; background: #e0e7ff !important; font-weight: 700;
}


/* =========================================
   PUBLIC PORTAL SPECIFICS
========================================= */
.main-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}
.logo-area h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 800;
    letter-spacing: -0.5px;
}
.top-nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    align-items: center;
}
.top-nav a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
}
.top-nav a:hover {
    color: var(--primary-color);
}
.btn-login {
    background: var(--primary-color);
    color: white !important;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}
.btn-login:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}
.public-wrapper {
    flex: 1;
    padding: 3rem 5%;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    min-height: 80vh;
}
.main-footer {
    text-align: center;
    padding: 2rem;
    background: white;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.875rem;
}


/* =========================================
   PUBLIC DASHBOARD & HOMEPAGE STYLES
========================================= */
.hero-banner {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
    border-radius: var(--radius-lg);
    padding: 4rem 3rem;
    color: white;
    margin-bottom: 2.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(49, 46, 129, 0.25);
}

.hero-banner::after {
    content: "";
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero-content {
    max-width: 750px;
    position: relative;
    z-index: 2;
}

.hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 0.4rem 1rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1.2rem;
    color: #e0e7ff;
}

.hero-content h1 {
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    letter-spacing: -0.025em;
}

.hero-content p {
    font-size: 1.15rem;
    color: #c7d2fe;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-hero {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
}

.btn-hero-secondary {
    background: rgba(255, 255, 255, 0.12);
    color: white;
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition);
}

.btn-hero-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

/* Stats Infografis Container */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-box {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: var(--transition);
}

.stat-box:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

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

.bg-blue { background: #eff6ff; }
.bg-green { background: #ecfdf5; }
.bg-purple { background: #f5f3ff; }
.bg-orange { background: #fff7ed; }

.stat-info h3 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 0.2rem;
}

.stat-info p {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Section Titles */
.section-title {
    text-align: center;
    margin-bottom: 2rem;
}

.section-title h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: -0.02em;
}

.section-title p {
    color: var(--text-muted);
    font-size: 1.05rem;
}

/* Service Grid */
.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.75rem;
    margin-bottom: 3.5rem;
}

.service-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.service-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.service-icon {
    font-size: 2.5rem;
    margin-bottom: 1.25rem;
}

.service-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
}

.service-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex: 1;
}

.service-link {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--primary-color);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: var(--transition);
}

.service-link:hover {
    color: var(--primary-hover);
    transform: translateX(4px);
}

/* Split Grid for Budget & News */
.content-split-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 2rem;
    margin-bottom: 3.5rem;
}

.budget-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.budget-item {
    background: #f9fafb;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.budget-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 99px;
}

.budget-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.percent-badge {
    background: #d1fae5;
    color: #047857;
    font-weight: 700;
    padding: 0.1rem 0.5rem;
    border-radius: 99px;
}

/* News List */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.news-item {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.news-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.news-date {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.news-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.35rem;
}

.news-snippet {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Info Footer Card */
.info-footer-card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.info-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.info-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.info-item h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.info-item p {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Global DataTables Spacing & Alignment Fixes */
table.dataTable {
    margin-top: 1.25rem !important;
    margin-bottom: 1.25rem !important;
    clear: both !important;
}

.dataTables_wrapper::after {
    content: "";
    display: table;
    clear: both;
}

.dataTables_wrapper .dt-buttons,
.dataTables_wrapper .dataTables_length {
    float: left !important;
    margin-bottom: 0.75rem !important;
}

.dataTables_wrapper .dataTables_filter {
    float: right !important;
    margin-bottom: 0.75rem !important;
}

.dataTables_wrapper .dataTables_info {
    float: left !important;
    margin-top: 1.25rem !important;
}

.dataTables_wrapper .dataTables_paginate {
    float: right !important;
    margin-top: 1.25rem !important;
}

.dataTables_wrapper .dataTables_filter input {
    margin-left: 0.5rem !important;
    padding: 0.4rem 0.8rem !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    outline: none !important;
}

.dataTables_wrapper .dataTables_length select {
    padding: 0.4rem !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    outline: none !important;
}

