/* ==========================================
   SISDIKBEL - GLOBAL STYLES
   Bootstrap 5 Override + Custom Design System
   Tema: Royal Blue Professional
========================================== */

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

/* ==========================================
   BOOTSTRAP CSS VARIABLE OVERRIDES
========================================== */
:root {
    /* Brand Colors */
    --bs-blue: #2563eb;
    --bs-indigo: #4f46e5;
    --bs-purple: #7c3aed;
    --bs-pink: #db2777;
    --bs-red: #dc2626;
    --bs-orange: #ea580c;
    --bs-yellow: #d97706;
    --bs-green: #16a34a;
    --bs-teal: #0d9488;
    --bs-cyan: #0891b2;

    /* Primary - Royal Blue */
    --bs-primary: #2563eb;
    --bs-primary-rgb: 37, 99, 235;
    --bs-primary-bg-subtle: #dbeafe;
    --bs-primary-text-emphasis: #1e3a8a;

    /* Secondary */
    --bs-secondary: #475569;
    --bs-secondary-rgb: 71, 85, 105;

    /* Success */
    --bs-success: #16a34a;
    --bs-success-rgb: 22, 163, 74;

    /* Danger */
    --bs-danger: #dc2626;
    --bs-danger-rgb: 220, 38, 38;

    /* Warning */
    --bs-warning: #d97706;
    --bs-warning-rgb: 217, 119, 6;

    /* Info */
    --bs-info: #0891b2;
    --bs-info-rgb: 8, 145, 178;

    /* Light */
    --bs-light: #f8fafc;
    --bs-light-rgb: 248, 250, 252;

    /* Dark */
    --bs-dark: #0f172a;
    --bs-dark-rgb: 15, 23, 42;

    /* Theme colors map */
    --bs-theme-color-interval: 8%;

    /* Body */
    --bs-body-color: #0f172a;
    --bs-body-color-rgb: 15, 23, 42;
    --bs-body-bg: #eef2f7;
    --bs-body-bg-rgb: 238, 242, 247;

    /* Border */
    --bs-border-color: #e2e8f0;
    --bs-border-radius: 0.5rem;
    --bs-border-radius-sm: 0.375rem;
    --bs-border-radius-lg: 0.75rem;
    --bs-border-radius-xl: 1rem;
    --bs-border-radius-xxl: 1.5rem;

    /* Font */
    --bs-font-sans-serif: "Manrope", "Poppins", system-ui, -apple-system, sans-serif;
    --bs-body-font-size: 0.9375rem;
    --bs-body-font-weight: 400;
    --bs-body-line-height: 1.6;

    /* Box shadow */
    --bs-box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
    --bs-box-shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
    --bs-box-shadow-lg: 0 12px 30px rgba(15, 23, 42, 0.12);

    /* Links */
    --bs-link-color: #2563eb;
    --bs-link-hover-color: #1d4ed8;

    /* Navbar */
    --navbar-height: 64px;
    --sidebar-width: 260px;
}

/* ==========================================
   BASE STYLES
========================================== */
html {
    scroll-behavior: smooth;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--bs-font-sans-serif);
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    line-height: var(--bs-body-line-height);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--bs-link-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--bs-link-hover-color);
}

/* ==========================================
   BOOTSTRAP COMPONENT OVERRIDES
========================================== */

/* Buttons - Gradient Royal Blue */
.btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    padding: 0.625rem 1.25rem;
    transition: all 0.25s ease;
    color: #fff;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
    color: #fff;
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

/* Secondary button */
.btn-secondary {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    border: none;
    color: #fff;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.25s ease;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    transform: translateY(-2px);
    color: #fff;
}

/* Success button */
.btn-success {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    border: none;
    color: #fff;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.25s ease;
}

.btn-success:hover {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(22, 163, 74, 0.3);
    color: #fff;
}

/* Danger / Delete button */
.btn-danger {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    border: none;
    color: #fff;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.25s ease;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(220, 38, 38, 0.3);
    color: #fff;
}

/* Info button */
.btn-info {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    border: none;
    color: #fff;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.25s ease;
}

.btn-info:hover {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(8, 145, 178, 0.3);
    color: #fff;
}

/* Warning button */
.btn-warning {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    border: none;
    color: #fff;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.25s ease;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(217, 119, 6, 0.3);
    color: #fff;
}

/* Light button */
.btn-light {
    background: #ffffff;
    border: 1px solid var(--bs-border-color);
    color: var(--bs-body-color);
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.25s ease;
}

.btn-light:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-2px);
    color: var(--bs-body-color);
}

/* Dark button */
.btn-dark {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border: none;
    color: #fff;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.25s ease;
}

.btn-dark:hover {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    transform: translateY(-2px);
    color: #fff;
}

/* Button sizes */
.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    border-radius: 0.375rem;
}

/* ==========================================
   CARDS
========================================== */
.card {
    border: none;
    border-radius: var(--bs-border-radius-lg);
    box-shadow: var(--bs-box-shadow);
    transition: all 0.25s ease;
    background: #ffffff;
}

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

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--bs-border-color);
    font-weight: 700;
    padding: 1rem 1.25rem;
    border-radius: var(--bs-border-radius-lg) var(--bs-border-radius-lg) 0 0 !important;
}

.card-body {
    padding: 1.25rem;
}

/* Gradient cards */
.card.bg-primary,
.card.text-white {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%) !important;
    color: #ffffff;
    border: none;
}

.card.bg-success,
.card.bg-info,
.card.bg-warning,
.card.bg-danger {
    color: #ffffff;
    border: none;
}

/* ==========================================
   TABLES
========================================== */

/* Table container — horizontal scroll + sticky thead */
.table-container {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 60vh;
    border-radius: var(--bs-border-radius-lg);
    position: relative;
    -webkit-overflow-scrolling: touch;
}

.table {
    border-collapse: separate !important;
    border-spacing: 0;
    margin-bottom: 0;
    width: max-content;
    min-width: 100%;
    table-layout: auto;
}

.table thead th {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.8125rem;
    letter-spacing: 0.3px;
    padding: 0.875rem 1rem;
    border: none;
    vertical-align: middle;
    position: sticky;
    top: 0;
    z-index: 5;
    white-space: nowrap;
    min-width: 80px;
}

.table thead th:first-child {
    border-radius: 0;
}

.table thead th:last-child {
    border-radius: 0;
}

.table td {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    color: var(--bs-body-color);
    white-space: nowrap;
    min-width: 80px;
}

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

.table tbody tr:hover td {
    background: #eff6ff;
}

.table-striped tbody tr:nth-of-type(odd) td {
    background: #f8fafc;
}

.table-striped tbody tr:nth-of-type(even) td {
    background: #f1f5f9;
}

/* Scroll shadow indicator (only show when can scroll) */
.table-container.can-scroll::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 24px;
    background: linear-gradient(to left, rgba(238,242,247,0.8), transparent);
    pointer-events: none;
    border-radius: 0 var(--bs-border-radius-lg) 0 0;
}


/* ==========================================
   ALERTS
========================================== */
.alert {
    border-radius: var(--bs-border-radius-lg);
    border: none;
    padding: 0.875rem 1.125rem;
    font-weight: 600;
    font-size: 0.875rem;
}

.alert-success {
    background: #ecfdf5;
    color: #166534;
    border-left: 4px solid #22c55e;
}

.alert-danger,
.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

.alert-info {
    background: #ecfeff;
    color: #155e75;
    border-left: 4px solid #06b6d4;
}

/* ==========================================
   FORM CONTROLS
========================================== */
.form-control,
.form-select {
    border: 1.5px solid var(--bs-border-color);
    border-radius: 0.5rem;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    min-height: 44px;
    transition: all 0.2s ease;
    background: #ffffff;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
    outline: none;
}

.form-control::placeholder {
    color: #94a3b8;
}

.form-label {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--bs-body-color);
    margin-bottom: 0.375rem;
}

/* Input group */
.input-group-text {
    background: #f8fafc;
    border: 1.5px solid var(--bs-border-color);
    border-radius: 0.5rem 0 0 0.5rem;
    font-weight: 600;
    color: var(--bs-secondary);
}

/* Floating form */
.form-floating > .form-control,
.form-floating > .form-select {
    border-radius: var(--bs-border-radius-lg);
}

/* ==========================================
   BADGES
========================================== */
.badge {
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
    border-radius: 0.375rem;
}

/* ==========================================
   NAVIGATION
========================================== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    height: var(--navbar-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--bs-border-color);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.125rem;
    letter-spacing: 0.5px;
    color: var(--bs-body-color) !important;
}

/* Nav tabs */
.nav-tabs {
    border-bottom: 2px solid var(--bs-border-color);
}

.nav-tabs .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    font-weight: 600;
    color: var(--bs-secondary);
    padding: 0.75rem 1.25rem;
    border-radius: 0;
    transition: all 0.2s;
}

.nav-tabs .nav-link:hover {
    color: var(--bs-primary);
    border-bottom-color: #cbd5e1;
}

.nav-tabs .nav-link.active {
    color: var(--bs-primary);
    background: transparent;
    border-bottom-color: var(--bs-primary);
}

/* ==========================================
   MODALS
========================================== */
.modal-content {
    border: none;
    border-radius: var(--bs-border-radius-xl);
    box-shadow: var(--bs-box-shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--bs-border-color);
    padding: 1.25rem 1.5rem;
}

.modal-header .btn-close {
    border-radius: 50%;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--bs-border-color);
    padding: 1rem 1.5rem;
}

/* ==========================================
   PAGINATION
========================================== */
.pagination {
    gap: 0.25rem;
}

.page-link {
    border-radius: 0.5rem;
    padding: 0.5rem 0.875rem;
    font-weight: 600;
    font-size: 0.875rem;
    border: 1px solid var(--bs-border-color);
    color: var(--bs-body-color);
    transition: all 0.2s;
}

.page-link:hover {
    background: #eff6ff;
    border-color: var(--bs-primary);
    color: var(--bs-primary);
}

.page-item.active .page-link {
    background: var(--bs-primary);
    border-color: var(--bs-primary);
    color: #fff;
}

.page-item.disabled .page-link {
    color: #94a3b8;
    background: #f8fafc;
}

/* ==========================================
   PROGRESS
========================================== */
.progress {
    border-radius: 999px;
    height: 10px;
    background: #f1f5f9;
    overflow: hidden;
}

.progress-bar {
    border-radius: 999px;
    background: linear-gradient(90deg, #2563eb, #3b82f6);
}

/* ==========================================
   DROPDOWNS
========================================== */
.dropdown-menu {
    border: none;
    border-radius: var(--bs-border-radius-lg);
    box-shadow: var(--bs-box-shadow-lg);
    padding: 0.5rem;
    min-width: 180px;
}

.dropdown-item {
    border-radius: 0.375rem;
    padding: 0.5rem 0.875rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--bs-body-color);
    transition: all 0.15s;
}

.dropdown-item:hover {
    background: #eff6ff;
    color: var(--bs-primary);
}

.dropdown-item.active,
.dropdown-item:active {
    background: var(--bs-primary);
    color: #fff;
}

/* ==========================================
   LIST GROUPS
========================================== */
.list-group-item {
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem !important;
    margin-bottom: 0.375rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.list-group-item:hover {
    background: #f8fafc;
}

/* ==========================================
   SCROLLBAR
========================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f8fafc;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bs-primary);
}

/* ==========================================
   UTILITIES
========================================== */

/* Text gradient */
.text-gradient {
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Glassmorphism */
.glass {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Subtle shadows */
.shadow-sm {
    box-shadow: var(--bs-box-shadow-sm) !important;
}

/* Focus ring */
:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.2);
    outline-offset: 2px;
}

/* Smooth transitions on all elements */
*,
*::before,
*::after {
    transition-timing-function: ease;
}

/* ==========================================
   TABLE COLUMN TOGGLE UTILITIES
========================================== */

/* Columns hidden via JS */
.col-hidden {
    display: none !important;
}

.col-visible {
    display: table-cell !important;
}

/* Table column toggler button */
.table-column-toggler .btn {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
}

/* Column checklist in dropdown */
.column-checklist {
    list-style: none;
    padding: 0;
    margin: 0;
    min-width: 200px;
}

.column-checklist li {
    padding: 0;
}

.column-checklist label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.5rem 0.875rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--bs-body-color);
    border-radius: 0.375rem;
    transition: all 0.15s;
    user-select: none;
    margin: 0;
}

.column-checklist label:hover {
    background: #eff6ff;
    color: var(--bs-primary);
}

.column-checklist input[type="checkbox"] {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: var(--bs-primary);
}

/* Table header cell transitions */
.table thead th,
.table tbody td {
    transition: all 0.2s ease;
}

/* ==========================================
   DASHBOARD STAT CARDS ENHANCEMENT
========================================== */
.stat-card {
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    color: #ffffff;
    border: none;
    border-radius: var(--bs-border-radius-lg);
    box-shadow: var(--bs-box-shadow);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px rgba(37, 99, 235, 0.3);
}

.stat-card .card-body {
    padding: 1.25rem;
    position: relative;
    z-index: 1;
}

.stat-card .stat-icon {
    font-size: 2rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.stat-card .stat-number {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 0.25rem;
}

.stat-card .stat-label {
    font-size: 0.8125rem;
    font-weight: 600;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
/* =========================
   GLOBAL FOOTER (ALL ROLE)
========================= */
.site-footer {
    background: linear-gradient(135deg, #0f172a, #1e3a8a);
    color: #e2e8f0;
    padding: 16px 20px;
    text-align: center;
    font-size: 0.85rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.site-footer a {
    color: #93c5fd;
    text-decoration: none;
    font-weight: 600;
}

.site-footer a:hover {
    color: #ffffff;
}

.footer-divider {
    opacity: 0.4;
}