/* ========================
   CSS Variables & Reset
   ======================== */
:root {
    /* Minimalist Mint Palette */
    --primary-color: #8cd89f;
    --primary-hover: #7ac78d;
    --secondary-color: #dafae4;

    --bg-light: #f3f4f6;
    --card-bg: #ffffff;
    --sidebar-bg: #ffffff;

    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;

    --border-color: #e5e7eb;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;

    --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);

    --sidebar-width: 280px;
    --header-height: 70px;

    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
    background: var(--bg-light);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ========================
   Login Overlay
   ======================== */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-light);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-header {
    margin-bottom: 30px;
}

.login-header .logo-icon {
    margin: 0 auto 15px;
}

.login-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.login-header p {
    color: var(--text-secondary);
}

.login-overlay.hidden {
    display: none;
}

/* ========================
   Main Layout Structure
   ======================== */
.main-layout {
    display: flex;
    min-height: 100vh;
}

.main-layout.hidden {
    display: none;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 50;
    transition: var(--transition-normal);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-color);
    gap: 12px;
}

.sidebar-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.sidebar-nav {
    flex: 1;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    background: transparent;
    border: none;
    text-align: left;
    width: 100%;
}

.nav-item svg {
    width: 20px;
    height: 20px;
}

.nav-item:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.nav-item.active {
    background: var(--secondary-color);
    color: var(--primary-color);
    font-weight: 600;
}

.nav-divider {
    height: 1px;
    background: var(--border-color);
    margin: 12px 0;
}

.sidebar-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: capitalize;
}

.btn-logout {
    background: var(--bg-light);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-logout:hover {
    background: #fee2e2;
    color: #ef4444;
}

/* Content Area */
.content-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-header {
    height: var(--header-height);
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    position: sticky;
    top: 0;
    z-index: 40;
}

.top-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--text-primary);
    border-radius: 8px;
    transition: var(--transition-fast);
}

.mobile-toggle:hover {
    background: var(--border-color);
}

.mobile-toggle svg {
    width: 24px;
    height: 24px;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 45;
    display: none;
    backdrop-filter: blur(4px);
}

.sidebar-overlay.show {
    display: block;
}

.header-right {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.page-content {
    flex: 1;
    padding: 30px 40px;
}

/* ========================
   Common Components
   ======================== */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.card-header h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 700;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: var(--secondary-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}

.logo-icon.large {
    width: 64px;
    height: 64px;
    border-radius: 16px;
}

.logo-icon.large svg {
    width: 32px;
    height: 32px;
}

.logo-icon.small {
    width: 40px;
    height: 40px;
    border-radius: 10px;
}

.logo-icon.small svg {
    width: 24px;
    height: 24px;
}

/* Tab Content Visibility */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Styles */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--secondary-color);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn.loading::after {
    content: "";
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: var(--bg-light);
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-info {
    background: #3b82f6;
    color: white;
}

.btn-info:hover {
    background: #2563eb;
}

/* Outline Buttons */
.btn-outline {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-outline-success {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid #10b981;
    color: #10b981;
    cursor: pointer;
    background: transparent;
    transition: var(--transition-fast);
}

.btn-outline-success:hover {
    background: #10b981;
    color: white;
}

/* Header Actions & Search */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: var(--bg-light);
    width: 250px;
}

.search-box:focus-within {
    border-color: var(--primary-color);
    background: white;
}

.search-box svg {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
}

.search-box input {
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.template-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

/* Summary Cards at Top */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.summary-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px !important;
    transition: var(--transition-normal);
}

.summary-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.summary-card.card-primary {
    border: 1px solid #bae6fd;
}

.summary-card.card-success {
    border: 1px solid #bbf7d0;
}

.summary-card.card-info {
    border: 1px solid #fef08a;
}

.summary-card.card-warning {
    border: 1px solid #fed7aa;
}

.card-warning .summary-icon {
    background: #fff7ed;
    color: #c2410c;
}

.summary-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.summary-icon svg {
    width: 30px;
    height: 30px;
}

.summary-info {
    display: flex;
    flex-direction: column;
}

.summary-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.summary-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
}

/* Specific Card Colors */
.card-primary .summary-icon {
    background: #e0f2fe;
    color: #0284c7;
}

.card-success .summary-icon {
    background: #dcfce7;
    color: #16a34a;
}

.card-info .summary-icon {
    background: #fef9c3;
    color: #ca8a04;
}

/* Dashboard Grid */
.rekap-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.rekap-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.rekap-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: var(--bg-light);
    border-radius: 20px;
    font-size: 0.85rem;
}

.rekap-item .count {
    background: var(--secondary-color);
    color: #0d0d0d;
    padding: 2px 8px;
    border-radius: 8px;
    font-weight: 700;
}

.rekap-item .label {
    color: #0d0d0d;
    font-weight: 500;
}

.chart-container {
    position: relative;
    height: 250px;
    width: 100%;
}

/* Table Styles */
.table-container {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    background: var(--bg-light);
    padding: 12px 16px;
    text-align: left;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    white-space: nowrap;
}

tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.9rem;
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background: #f9fafb;
}

/* Actions */
.action-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.action-btn svg {
    width: 16px;
    height: 16px;
}

.action-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.action-btn.delete-btn:hover {
    border-color: #ef4444;
    color: #ef4444;
}

/* Icon Backgrounds */
.icon-bg-mint {
    width: 42px;
    height: 42px;
    background: var(--secondary-color);
    color: var(--primary-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.icon-bg-mint svg {
    width: 24px;
    height: 24px;
}

.card-header:hover .icon-bg-mint {
    transform: scale(1.05);
    background: var(--primary-color);
    color: white;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    z-index: 1000;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.modal-content {
    position: relative;
    background: white;
    width: 100%;
    max-width: 600px;
    border-radius: var(--border-radius-lg);
    padding: 30px;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 10;
    box-shadow: var(--shadow-lg);
    animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

/* Responsive Improvements */
@media (max-width: 1200px) {
    .summary-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1024px) {

    .rekap-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .mobile-toggle {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .content-wrapper {
        margin-left: 0;
    }

    .top-header {
        padding: 0 15px;
    }

    .page-content {
        padding: 15px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .summary-cards {
        grid-template-columns: 1fr;
    }
}

/* ========================
   Backup & Restore Styles
   ======================== */
.backup-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.backup-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.backup-info {
    display: flex;
    gap: 20px;
}

.info-item {
    flex: 1;
    padding: 25px;
    background: var(--bg-light);
    border-radius: var(--border-radius-sm);
    text-align: center;
    border: 1px solid var(--border-color);
}

.info-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    font-weight: 600;
}

.info-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.restore-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius-sm);
    text-align: center;
    background: var(--bg-light);
    transition: var(--transition-fast);
    cursor: pointer;
    margin-bottom: 15px;
}

.restore-zone:hover,
.restore-zone.dragover {
    border-color: var(--primary-color);
    background: var(--secondary-color);
}

.restore-zone svg {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.restore-zone p {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.restore-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 10px;
    border-radius: var(--border-radius-sm);
    transition: var(--transition-fast);
}

.checkbox-label:hover {
    background: var(--bg-light);
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
}

input[type="checkbox"] {
    display: none;
}

input[type="checkbox"]:checked+.checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

input[type="checkbox"]:checked+.checkmark::after {
    content: '';
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

.full-width {
    width: 100%;
}

.info-item {
    text-align: center;
    padding: 20px;
    background: var(--bg-light);
    border-radius: 8px;
    margin-bottom: 10px;
}

.info-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: block;
}

.info-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.dragover {
    border-color: var(--primary-color);
    background: var(--secondary-color);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 16px 24px;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    display: none;
    align-items: center;
    gap: 12px;
    z-index: 10000;
    border-left: 4px solid var(--primary-color);
}

.toast.show {
    display: flex;
    animation: slideIn 0.3s ease;
}

.toast.error {
    border-color: #ef4444;
}

.toast-message {
    font-weight: 500;
    font-size: 0.95rem;
}

@keyframes slideIn {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Pagination Styles */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.page-btn {
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.page-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--bg-light);
}

.page-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0 10px;
}

/* Empty State Fix */
.empty-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state.show {
    display: flex;
}

.empty-state h3 {
    margin-bottom: 8px;
    color: var(--text-primary);
}

/* Entries Select Filter */
.entries-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.entries-filter select {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: var(--bg-light);
    outline: none;
    cursor: pointer;
}

.entries-filter select:focus {
    border-color: var(--primary-color);
}

/* ========================
   Public Dashboard Layout Styles
   ======================== */
.public-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg-light);
}

.public-layout.hidden {
    display: none;
}

.public-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.public-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-titles h1 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.header-titles p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.public-main {
    flex: 1;
}

/* Slider Section */
.public-slider-section {
    position: relative;
    width: 100%;
    height: 480px;
    background: var(--bg-light);
    overflow: hidden;
}

.slider-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    z-index: 1;
}

.slide.show {
    opacity: 1;
    z-index: 2;
}

.slider-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: var(--transition-fast);
}

.indicator.active {
    background: white;
    transform: scale(1.2);
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.3);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.slider-btn:hover {
    background: rgba(0,0,0,0.6);
}

.prev-btn { left: 20px; }
.next-btn { right: 20px; }

/* Stats Section */
.public-stats-section {
    padding: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Search Section */
.public-search-section {
    padding: 0 40px 60px;
    max-width: 1000px;
    margin: 0 auto;
}

.public-search-container {
    background: white;
    padding: 30px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
}

.search-box.large {
    width: 100%;
    padding: 12px 20px;
}

.search-box.large input {
    font-size: 1.1rem;
    padding: 5px;
}

/* Search Result Cards */
.public-search-results {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.result-card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 24px 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    border: 1px solid var(--border-color);
    text-align: center;
}

.result-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.result-foto {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-light);
    border: 3px solid var(--border-color);
    flex-shrink: 0;
}

.result-info {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.result-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.result-nip {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.result-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    font-size: 0.9rem;
    width: 100%;
    text-align: left;
    margin-top: 4px;
}

.result-detail-item {
    display: flex;
    flex-direction: column;
}

.result-detail-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.result-detail-val {
    color: var(--text-primary);
    font-weight: 500;
}

.public-footer {
    text-align: center;
    padding: 20px;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Toggle Switch Element */
.config-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--primary-color);
    margin-top: 24px;
}
.config-section-title:first-child { margin-top:0; }

.toggle-switch-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--bg-light);
    border-radius: var(--border-radius-sm);
    margin-bottom: 10px;
    font-weight: 500;
    cursor: pointer;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--text-muted);
    transition: .4s;
}

.switch .slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

.stats-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    padding-left: 28px;
    user-select: none;
}

.checkbox-label input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: white;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    transition: var(--transition-fast);
}

.checkbox-label:hover input ~ .checkmark {
    border-color: var(--primary-color);
}

.checkbox-label input:checked ~ .checkmark {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-label input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-label .checkmark:after {
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.slider-config-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 10px;
}

.slider-config-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--bg-light);
    padding: 10px 15px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
}

.slider-preview {
    width: 120px;
    height: 60px;
    border-radius: 6px;
    object-fit: cover;
    background: white;
    border: 1px solid var(--border-color);
}

.slider-config-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.login-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 3rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}
.login-close-btn:hover {
    color: #ef4444;
}

/* Animations Flag */
.dashboard-anim-enabled .slide {
    transition: opacity 1.2s ease-in-out;
}
.dashboard-anim-enabled .result-card {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
}
.dashboard-anim-enabled .summary-card {
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

@media (max-width: 768px) {
    .public-slider-section { height: 250px; }
    .public-header { padding: 15px 20px; }
    .public-stats-section { padding: 20px; }
    .public-search-section { padding: 0 20px 40px; }
}

/* ========================
   DARK CINEMATIC & GLASSMORPHISM THEME OVERRIDE
   ======================== */

:root {
    /* Accent Colors: Cyan / Soft Violet */
    --primary-color: #0ea5e9;
    --primary-hover: #38bdf8;
    --secondary-color: rgba(14, 165, 233, 0.15);

    /* Backgrounds for Glassmorphism */
    --bg-light: transparent;
    --card-bg: rgba(15, 23, 42, 0.65);
    --sidebar-bg: rgba(9, 14, 23, 0.75);

    /* Text Colors - Dark Mode Optimized */
    --text-primary: #f1f5f9;   /* Slate 100 - soft off-white */
    --text-secondary: #cbd5e1; /* Slate 300 - light light gray */
    --text-muted: #94a3b8;     /* Slate 400 - medium gray */

    /* Borders */
    --border-color: rgba(255, 255, 255, 0.08);

    /* Depth / Shadows */
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255,255,255,0.05) inset;
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255,255,255,0.05) inset;
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.1) inset;

    /* Glows */
    --glow-primary: 0 0 20px rgba(14, 165, 233, 0.3);
    --glow-hover: 0 0 30px rgba(14, 165, 233, 0.6);
    --glow-subtle: 0 0 20px rgba(139, 92, 246, 0.2);
}

/* 1. Base Gradient Background */
body {
    background: #0f172a;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(14, 165, 233, 0.12), transparent 40%),
        radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.12), transparent 40%),
        radial-gradient(circle at 50% 100%, rgba(14, 165, 233, 0.08), transparent 50%);
    background-attachment: fixed;
    color: var(--text-primary);
}

/* 2. Glassmorphism Applied to Panels */
.card, .public-header, .sidebar, .login-card, .public-search-container, .result-card, .public-footer {
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    background: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
}

/* 3. Header Styling */
.public-header {
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(255, 255, 255, 0.05) inset;
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-header {
    background: transparent !important;
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
}

.login-overlay {
    background: rgba(9, 14, 23, 0.85) !important;
    backdrop-filter: blur(12px);
}

/* 4. Form Inputs & Search Bar */
.form-group input, .form-group select, .search-box, .search-box.large input {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--text-primary) !important;
    backdrop-filter: blur(4px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-group input:focus, .form-group select:focus, .search-box:focus-within {
    border-color: var(--primary-hover) !important;
    box-shadow: var(--glow-primary), 0 0 0 1px var(--primary-hover) inset !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

select option {
    background: #0f172a;
    color: var(--text-primary);
}

/* 5. Buttons Styling */
.btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(4px);
}

.btn-primary {
    background: rgba(14, 165, 233, 0.9) !important;
    color: #f8fafc !important;
    box-shadow: var(--glow-primary);
    border: 1px solid rgba(14, 165, 233, 0.5);
    font-weight: 600;
}

.btn-primary:hover {
    background: var(--primary-hover) !important;
    box-shadow: var(--glow-hover);
    transform: translateY(-2px);
}

.btn-outline, .btn-secondary, .action-btn {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--text-primary) !important;
}

.btn-outline:hover, .btn-secondary:hover, .action-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: var(--primary-color) !important;
    box-shadow: var(--glow-primary);
    color: var(--primary-hover) !important;
}

.login-btn {
    background: rgba(255,255,255,0.05) !important;
}

/* 6. Slider Overlay (Cinematic Fade) */
.public-slider-section {
    background: transparent !important;
}
.slide::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 1) 0%, rgba(15, 23, 42, 0.1) 60%, rgba(15, 23, 42, 0.4) 100%);
    pointer-events: none;
    z-index: 1;
}

/* 7. Stat Cards / Admin Dashboard */
.summary-card {
    background: var(--card-bg) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(12px) saturate(180%);
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at 100% 0%, var(--primary-color) 0%, transparent 60%);
    opacity: 0.05;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.summary-card:hover::before {
    opacity: 0.15;
}

.summary-card:hover {
    box-shadow: var(--shadow-lg), var(--glow-primary) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

.summary-value {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

/* 8. Result Card (Profil) Smooth Slide-in */
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-card.dashboard-anim-enabled, .result-card {
    animation: fadeSlideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.result-card:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: var(--primary-color) !important;
    box-shadow: var(--shadow-lg), var(--glow-subtle) !important;
}

/* 9. Modal Overlays */
.modal-content, .sertifikasi-detail {
    background: var(--card-bg) !important;
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-lg), var(--glow-primary);
}

.modal-header h3 {
    color: var(--primary-hover);
    text-shadow: var(--glow-subtle);
}

/* 10. Table Styling Fixes for Dark Mode */
table { color: var(--text-primary); }

thead th {
    background: rgba(255, 255, 255, 0.03) !important;
    border-bottom: 1px solid var(--border-color) !important;
    color: var(--primary-hover);
    font-weight: 600;
}

tbody td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}

/* 11. Custom Toggle Switches for Admin */
.switch .slider {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid var(--border-color);
}
input:checked + .slider {
    background-color: var(--primary-color) !important;
    box-shadow: var(--glow-primary);
    border-color: var(--primary-color);
}

/* 12. Rekap Stats specific adjustments */
.rekap-item {
    background: rgba(255, 255, 255, 0.05) !important;
}
.rekap-item .count {
    background: var(--primary-color) !important;
    color: #0f172a !important;
    box-shadow: var(--glow-primary);
}
.rekap-item .label {
    color: var(--text-primary) !important;
}

/* 13. Typographic Enforcements */
h1, h2, h3, h4, h5 { 
    color: var(--text-primary) !important;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); 
}
p, span, li, td, a { color: var(--text-primary); }
label { color: var(--text-secondary); font-weight: 500; font-size: 0.9rem; }
small { color: var(--text-muted); }

.text-primary { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted { color: var(--text-muted) !important; }

/* Placeholder Global Fix */
::placeholder { color: var(--text-muted) !important; opacity: 0.7; }
:-ms-input-placeholder { color: var(--text-muted) !important; }
::-ms-input-placeholder { color: var(--text-muted) !important; }

/* 14. Status Badges */
.status-badge {
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    backdrop-filter: blur(4px);
}

/* Base list items fixes */
.sidebar-nav .nav-item {
    color: var(--text-secondary) !important;
    opacity: 0.8;
}
.sidebar-nav .nav-item:hover, .sidebar-nav .nav-item.active {
    background: var(--secondary-color) !important;
    color: var(--primary-color) !important;
    opacity: 1;
}

/* Chart Canvas Fix */
canvas { background: transparent !important; }

/* ========================
   THEME: SOFT WARM WHITE
   ======================== */
body.theme-warm {
    background: #fffef2;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(218, 165, 32, 0.08), transparent 40%),
        radial-gradient(circle at 85% 30%, rgba(139, 69, 19, 0.04), transparent 40%),
        radial-gradient(circle at 50% 100%, rgba(205, 133, 63, 0.08), transparent 50%);
    color: #0f172a !important;
    --primary-color: #7c3aed;
    --primary-hover: #6d28d9;
    --secondary-color: rgba(124, 58, 237, 0.1);
    --bg-light: transparent;
    --card-bg: rgba(255, 255, 255, 0.92);
    --sidebar-bg: rgba(250, 248, 237, 0.95);
    --border-color: rgba(0, 0, 0, 0.08);
    --text-primary: #0f172a;    /* Navy Dark - Better visibility */
    --text-secondary: #334155;  /* Slate 700 */
    --text-muted: #64748b;     /* Slate 500 */
    --glow-primary: 0 4px 20px rgba(124, 58, 237, 0.15);
}

body.theme-warm .card, 
body.theme-warm .public-header, 
body.theme-warm .sidebar, 
body.theme-warm .login-card, 
body.theme-warm .public-search-container, 
body.theme-warm .result-card, 
body.theme-warm .public-footer,
body.theme-warm .modal-content,
body.theme-warm .sertifikasi-detail {
    background: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0,0,0,0.02) !important;
}

body.theme-warm .login-overlay {
    background: rgba(255, 254, 242, 0.85) !important;
}

body.theme-warm .public-header {
    box-shadow: 0 4px 20px -5px rgba(0, 0, 0, 0.05) !important;
}

body.theme-warm .text-primary, body.theme-warm h1, body.theme-warm h2, body.theme-warm h3, body.theme-warm h4, body.theme-warm h5 {
    color: var(--text-primary) !important;
    text-shadow: none;
}

body.theme-warm table {
    color: var(--text-primary);
}

body.theme-warm thead th {
    background: rgba(0, 0, 0, 0.03) !important;
    color: var(--text-primary) !important;
    border-bottom: 2px solid rgba(0, 0, 0, 0.05) !important;
}

body.theme-warm tbody td {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
}

body.theme-warm tbody tr:hover {
    background: rgba(0, 0, 0, 0.02) !important;
}

body.theme-warm .form-group input, 
body.theme-warm .form-group select, 
body.theme-warm .search-box, 
body.theme-warm .search-box.large input {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    color: var(--text-primary) !important;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.02) !important;
}

body.theme-warm .form-group input:focus, 
body.theme-warm .form-group select:focus, 
body.theme-warm .search-box:focus-within {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15) !important;
    background: #ffffff !important;
}

body.theme-warm select option {
    background: #ffffff;
    color: var(--text-primary);
}

body.theme-warm .btn-primary {
    background: var(--primary-color) !important;
    color: #ffffff !important;
    border: none;
}

body.theme-warm .btn-primary:hover {
    background: var(--primary-hover) !important;
    box-shadow: 0 6px 15px rgba(139, 92, 246, 0.3) !important;
}

body.theme-warm .btn-outline, 
body.theme-warm .btn-secondary, 
body.theme-warm .action-btn {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.15) !important;
    color: var(--text-secondary) !important;
}

body.theme-warm .btn-outline:hover, 
body.theme-warm .btn-secondary:hover, 
body.theme-warm .action-btn:hover {
    background: #f8fafc !important;
    border-color: var(--primary-color) !important;
    color: var(--primary-color) !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05) !important;
}

body.theme-warm .summary-card:hover {
    box-shadow: 0 10px 25px rgba(0,0,0,0.08) !important;
    border-color: rgba(139, 92, 246, 0.3) !important;
}

body.theme-warm .summary-card::before {
    background: radial-gradient(circle at 100% 0%, var(--primary-color) 0%, transparent 60%);
    opacity: 0.08;
}

body.theme-warm .result-card:hover {
    background: #ffffff !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08) !important;
}

body.theme-warm .slide::after {
    background: linear-gradient(to top, #fffef2 0%, rgba(255, 254, 242, 0.3) 50%, rgba(255, 254, 242, 0) 100%);
}

body.theme-warm .rekap-item {
    background: #ffffff !important;
    border: 1px solid rgba(0,0,0,0.08) !important;
}
body.theme-warm .rekap-item .count {
    background: var(--primary-color) !important;
    color: #ffffff !important;
    box-shadow: none !important;
}
body.theme-warm .rekap-item .label {
    color: var(--text-secondary) !important;
}
body.theme-warm .navbar, body.theme-warm .sidebar-nav .nav-item {
    color: var(--text-secondary) !important;
}
body.theme-warm .sidebar-nav .nav-item:hover, body.theme-warm .sidebar-nav .nav-item.active {
    background: rgba(139, 92, 246, 0.08) !important;
    color: var(--primary-hover) !important;
}

body.theme-warm .switch .slider {
    background-color: rgba(0, 0, 0, 0.1) !important;
    border: none !important;
}
body.theme-warm input:checked + .slider {
    background-color: var(--primary-color) !important;
    box-shadow: none !important;
}

body.theme-warm .theme-warm-chart-text canvas {
    /* No inversion needed for warm white base */
}

/* ========================
   PUBLIC SEARCH MODAL
   ======================== */
.search-modal {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.search-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.search-modal.hidden {
    display: none !important;
}

.search-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

body.theme-warm .search-modal-overlay {
    background: rgba(255, 255, 255, 0.4);
}

.search-modal-content {
    position: relative;
    z-index: 1;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    background: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg), var(--glow-primary);
    padding: 30px;
    backdrop-filter: blur(16px);
    transform: scale(0.95) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.search-modal.show .search-modal-content {
    transform: scale(1) translateY(0);
}

.search-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 1.8rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
    z-index: 10;
}

.search-modal-close:hover {
    color: var(--primary-hover);
    transform: scale(1.1);
}

.search-modal-content .result-card {
    animation: none; /* remove fadeSlideUp as modal already animated */
    transform: none;
    box-shadow: var(--shadow-sm);
    margin: 0;
}

/* ========================
   FIX: Dark Mode Visibility (Strict Comprehensive Override)
   ======================== */
/* Target all possible dark state indicators to ensure Cinematic Dark works */
body.theme-dark, 
body.dark, 
body[data-theme="dark"], 
body:not(.theme-warm) {
    color: #f1f5f9 !important;
}

/* Force white text for all primary elements in any dark variant */
body.theme-dark h1, body.theme-dark h2, body.theme-dark h3, body.theme-dark h4, body.theme-dark h5, body.theme-dark h6,
body.theme-dark p, body.theme-dark span, body.theme-dark li, body.theme-dark td, body.theme-dark th, 
body.theme-dark label, body.theme-dark b, body.theme-dark strong, body.theme-dark a,
body.dark h1, body.dark h2, body.dark h3, body.dark h4, body.dark h5, body.dark h6,
body:not(.theme-warm) h1, body:not(.theme-warm) h2, body:not(.theme-warm) h3, body:not(.theme-warm) h4, body:not(.theme-warm) h5, body:not(.theme-warm) h6,
body:not(.theme-warm) p, body:not(.theme-warm) span, body:not(.theme-warm) li, body:not(.theme-warm) td, body:not(.theme-warm) th, 
body:not(.theme-warm) label, body:not(.theme-warm) b, body:not(.theme-warm) strong, body:not(.theme-warm) a {
    color: #ffffff !important;
}

/* UI Components: Menu, Sidebar, Toast, and Dashboard specific fixes */
body.theme-dark .nav-item, body.theme-dark .nav-item svg, body.theme-dark .btn-logout,
body.dark .nav-item, body.dark .nav-item svg,
body:not(.theme-warm) .nav-item, body:not(.theme-warm) .nav-item svg,
body.theme-dark .sidebar-header h3, body.theme-dark .user-name, body.theme-dark .user-role,
body.theme-dark .public-header h1, body.theme-dark .public-header p, body.theme-dark .public-footer,
body:not(.theme-warm) .public-header h1, body:not(.theme-warm) .public-header p, body:not(.theme-warm) .public-footer,
body.theme-dark .login-header h2, body.theme-dark .login-header p,
body.theme-dark .summary-label, body.theme-dark .rekap-item .label,
body:not(.theme-warm) .summary-label, body:not(.theme-warm) .rekap-item .label {
    color: #ffffff !important;
}

/* Toast fix for Dark Mode */
body.theme-dark .toast, body.dark .toast, body:not(.theme-warm) .toast {
    background: #1e293b !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}
body.theme-dark .toast-message, body:not(.theme-warm) .toast-message {
    color: #ffffff !important;
}

/* Menu Hover and active states */
body.theme-dark .nav-item:hover, body:not(.theme-warm) .nav-item:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #0ea5e9 !important;
}
body.theme-dark .nav-item.active, body:not(.theme-warm) .nav-item.active {
    background: rgba(14, 165, 233, 0.2) !important;
    color: #38bdf8 !important;
}

/* Input Placeholder */
body.theme-dark input::placeholder, body:not(.theme-warm) input::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}


/* ========================
   STRICT VERTICAL CARD LAYOUT (OVERRIDE)
   ======================== */
.result-card, .search-modal-content .result-card {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    padding: 30px 20px !important;
    gap: 20px !important;
}

.result-foto {
    width: 140px !important;
    height: 140px !important;
    border-radius: 50% !important;
    margin: 0 auto !important;
    border: 4px solid var(--primary-color) !important;
    object-fit: cover !important;
    display: block !important;
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.4) !important;
}

.result-info {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

.result-details {
    width: 100% !important;
    margin-top: 15px !important;
    text-align: left !important;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
}

/* ========================
   DETAIL PEGAWAI MODAL & TABS
   ======================== */
.detail-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-normal);
}

.detail-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.detail-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
}

.detail-modal-content {
    position: relative;
    z-index: 1;
    width: 95%;
    max-width: 1000px;
    height: 90vh;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg), var(--glow-primary);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.4s ease;
}

.detail-modal.show .detail-modal-content {
    transform: translateY(0);
}

.detail-modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
}

.detail-header-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.detail-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
}

.detail-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* Tabs System */
.detail-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    padding: 0 20px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(5px);
}

.detail-tab-btn {
    padding: 15px 20px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: var(--transition-fast);
}

.detail-tab-btn:hover {
    color: var(--text-primary);
}

.detail-tab-btn.active {
    color: var(--primary-color);
}

.detail-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
}

.detail-tab-content {
    display: none;
    padding: 30px;
    animation: fadeIn 0.3s ease;
}

.detail-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Detail Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.info-item-block {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.info-item-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.info-item-value {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* Arsip Digital Styles */
.arsip-section {
    margin-bottom: 30px;
}

.arsip-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-hover);
}

.arsip-list {
    display: grid;
    gap: 12px;
}

.arsip-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.03);
    padding: 12px 18px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    transition: var(--transition-fast);
}

.arsip-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--primary-color);
}

.arsip-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.arsip-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(14, 165, 233, 0.1);
    color: var(--primary-color);
    border-radius: 8px;
}

.arsip-name {
    font-weight: 600;
    color: var(--text-primary);
}

.arsip-actions {
    display: flex;
    gap: 8px;
}

/* Preview Modal */
.preview-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-normal);
}

.preview-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.preview-modal-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    height: 85vh;
    background: #1e293b;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.preview-modal-header {
    padding: 15px 20px;
    background: #0f172a;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-iframe {
    width: 100%;
    flex: 1;
    border: none;
    background: white;
}

/* Print Only Styles */
@media print {
    body * { visibility: hidden; }
    #printArea, #printArea * { visibility: visible; }
    #printArea {
        position: absolute;
        left: 0; top: 0; width: 100%;
        padding: 40px;
        background: white !important;
        color: black !important;
    }
    .no-print { display: none !important; }
    .print-header {
        text-align: center;
        border-bottom: 2px solid black;
        margin-bottom: 30px;
        padding-bottom: 10px;
    }
    .print-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
    .print-section {
        margin-bottom: 20px;
    }
    .print-section h3 {
        border-bottom: 1px solid #ccc;
        margin-bottom: 10px;
        color: black !important;
    }
}

/* ========================
   FORM SECTION STYLES
   ======================== */
.form-section {
    margin-bottom: 35px;
    padding: 25px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: var(--transition-fast);
}

.form-section:hover {
    border-color: rgba(14, 165, 233, 0.3);
    background: rgba(255, 255, 255, 0.04);
}

.form-section-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--primary-hover);
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.form-section-title svg {
    width: 22px;
    height: 22px;
    color: var(--primary-color);
}

.helper-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 6px;
    font-style: italic;
    display: block;
}

/* Sidebar Collapsed State */
.sidebar.collapsed { width: 80px; }
.sidebar.collapsed #sidebarAppTitle, .sidebar.collapsed .nav-item span, .sidebar.collapsed .user-info { display: none; }
.sidebar.collapsed .sidebar-header { padding: 0; justify-content: center; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 12px; }
.sidebar.collapsed .sidebar-footer { padding: 20px 0; justify-content: center; }

.content-wrapper { flex: 1; margin-left: var(--sidebar-width); transition: margin-left 0.3s ease; }
.content-wrapper.expanded { margin-left: 80px; }

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); width: 280px !important; z-index: 1000; transition: transform 0.3s ease; }
    .sidebar.open { transform: translateX(0); }
    .sidebar.collapsed { transform: translateX(-100%); }
    .content-wrapper { margin-left: 0 !important; }
    .header-actions { flex-direction: column; align-items: stretch; }
}

/* General Responsive Utilities */
img, video, canvas { max-width: 100%; height: auto; }

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
@media (max-width: 768px) { .form-row { grid-template-columns: 1fr; } }

.detail-modal-content { max-width: 95vw; max-height: 95vh; }

