/* =============================================
   SIAS SD - Custom Styles
   Tema: Merah Putih (Identitas Sekolah Dasar Indonesia)
   ============================================= */

:root {
    --sd-red-primary: #b71c1c;
    --sd-red-dark: #7f0000;
    --sd-red-medium: #c62828;
    --sd-red-light: #d32f2f;
    --sd-red-vibrant: #e53935;
    --sd-red-subtle: #ffebee;
    --sd-red-border: #ffcdd2;
    --sd-white: #ffffff;
    --sd-gray-bg: #f8fafc;
    --sd-text-dark: #1e293b;
    --sd-shadow: 0 4px 20px rgba(183, 28, 28, 0.15);
}

/* ---------- Global Tweaks ---------- */
html {
    height: 100%;
    overflow-y: auto;
}

body {
    font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: var(--sd-text-dark);
}

/* Text & Link Accents */
a {
    color: var(--sd-red-medium);
    transition: all 0.2s ease;
}
a:hover {
    color: var(--sd-red-dark);
}
.text-primary {
    color: var(--sd-red-medium) !important;
}

/* ---------- Login Page (Merah Putih Theme) ---------- */
body.login-page {
    min-height: 100vh;
    min-height: 100dvh;
    height: auto !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4a0303 0%, #7a0909 30%, #b71c1c 70%, #c62828 100%);
    background-attachment: fixed;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto !important;
    padding: 2.5rem 1rem;
    margin: 0;
    box-sizing: border-box;
}

.login-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(ellipse at 25% 40%, rgba(255, 255, 255, 0.12) 0%, transparent 45%),
                radial-gradient(ellipse at 80% 20%, rgba(255, 107, 107, 0.15) 0%, transparent 45%),
                radial-gradient(ellipse at 50% 85%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
    animation: loginBgPulse 16s ease-in-out infinite alternate;
}

@keyframes loginBgPulse {
    0% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.05) rotate(1.5deg); }
    100% { transform: scale(1) rotate(-1.5deg); }
}

.login-box {
    width: 440px;
    max-width: 100%;
    position: relative;
    z-index: 2;
    margin: auto;
}

.login-card {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 20px !important;
    border-top: 5px solid var(--sd-red-medium) !important;
    border-bottom: 3px solid rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.login-card-body {
    padding: 2.5rem 2.2rem !important;
}

.login-logo {
    margin-bottom: 1.5rem;
}

.login-logo-img {
    width: 90px;
    height: auto;
    filter: drop-shadow(0 6px 16px rgba(183, 28, 28, 0.35));
    transition: transform 0.3s ease;
}

.login-logo-img:hover {
    transform: scale(1.05);
}

.login-logo b {
    font-size: 1.65rem;
    letter-spacing: 0.5px;
    color: var(--sd-red-primary);
    display: block;
    margin-top: 0.5rem;
}

.login-logo small {
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 500;
}

/* ---------- Sidebar (Merah Putih Accent) ---------- */
.app-sidebar {
    transition: all 0.3s ease !important;
}

.sidebar-brand {
    background: rgb(52, 58, 64) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding: 0.8rem 1rem !important;
    display: flex;
    align-items: center;
}

.sidebar-brand .brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    width: 100%;
}

.brand-logo-wrap {
    background: #ffffff !important;
    padding: 3px 5px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sidebar-brand .brand-link:hover .brand-logo-wrap {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.25);
}

.sidebar-brand .brand-image {
    height: 30px !important;
    max-height: 30px !important;
    width: auto;
    display: block;
    float: none !important;
    margin: 0 !important;
}

.sidebar-brand .brand-text {
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: 1px;
    color: #ffffff !important;
}

.sidebar-brand .brand-text .sd-badge {
    background: #ffffff;
    color: var(--sd-red-primary);
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-left: 4px;
    font-weight: 900;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.sidebar-menu .nav-link {
    border-radius: 9px;
    margin: 2px 10px;
    padding: 0.55rem 0.9rem;
    transition: all 0.2s ease;
    color: rgba(255, 255, 255, 0.85);
}

.sidebar-menu .nav-link .nav-icon {
    color: #ef9a9a;
    transition: color 0.2s ease;
}

.sidebar-menu .nav-link:hover {
    background: rgba(183, 28, 28, 0.22) !important;
    color: #ffffff !important;
}

.sidebar-menu .nav-link:hover .nav-icon {
    color: #ffffff;
}

.sidebar-menu .nav-link.active {
    background: linear-gradient(135deg, #b71c1c 0%, #c62828 50%, #d32f2f 100%) !important;
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(183, 28, 28, 0.45) !important;
}

.sidebar-menu .nav-link.active .nav-icon {
    color: #ffffff !important;
}

.nav-header {
    font-size: 0.68rem !important;
    letter-spacing: 1.6px !important;
    padding: 0.85rem 1.4rem 0.35rem !important;
    color: #ffcdd2 !important;
    font-weight: 700 !important;
    text-transform: uppercase;
}

/* ---------- Top Navbar ---------- */
.app-header {
    background: #ffffff !important;
    border-bottom: 2px solid var(--sd-red-primary) !important;
    box-shadow: 0 2px 14px rgba(183, 28, 28, 0.08) !important;
}

[data-bs-theme="dark"] .app-header {
    background: #18181b !important;
    border-bottom: 2px solid var(--sd-red-medium) !important;
}

.app-header .navbar-nav .nav-link {
    color: #475569;
    transition: color 0.2s ease;
}

.app-header .navbar-nav .nav-link:hover {
    color: var(--sd-red-medium);
}

.user-header.text-bg-primary {
    background: linear-gradient(135deg, #700000 0%, #8b0000 45%, #b71c1c 100%) !important;
    color: #ffffff !important;
}

/* ---------- Stat Cards / Small Box ---------- */
.small-box {
    border-radius: 14px !important;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
}

.small-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 35px rgba(183, 28, 28, 0.2) !important;
}

.small-box .inner h3 {
    font-size: 2.3rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.small-box .inner p {
    font-weight: 600;
    font-size: 1rem;
    opacity: 0.92;
}

.small-box-footer {
    background: rgba(0, 0, 0, 0.12) !important;
    transition: background 0.2s ease;
    font-weight: 600;
}

.small-box-footer:hover {
    background: rgba(0, 0, 0, 0.22) !important;
}

/* Red & White theme gradients for stat cards */
.bg-gradient-primary {
    background: linear-gradient(135deg, #7f0000 0%, #b71c1c 50%, #c62828 100%) !important;
}
.bg-gradient-danger {
    background: linear-gradient(135deg, #b71c1c 0%, #d32f2f 50%, #e53935 100%) !important;
}
.bg-gradient-warning {
    background: linear-gradient(135deg, #c2410c 0%, #ea580c 60%, #f97316 100%) !important;
}
.bg-gradient-success {
    background: linear-gradient(135deg, #15803d 0%, #16a34a 60%, #22c55e 100%) !important;
}
.bg-gradient-info {
    background: linear-gradient(135deg, #0369a1 0%, #0284c7 60%, #38bdf8 100%) !important;
}
.bg-gradient-merahputih {
    background: linear-gradient(135deg, #8b0000 0%, #b71c1c 45%, #c62828 75%, #ffffff 135%) !important;
}

/* ---------- Content Header & Breadcrumbs ---------- */
.app-content-header {
    padding: 1.25rem 0 0.75rem !important;
}

.app-content-header h1 {
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.5px;
}

[data-bs-theme="dark"] .app-content-header h1 {
    color: #f1f5f9;
}

.breadcrumb-item a {
    color: var(--sd-red-medium);
    text-decoration: none;
}
.breadcrumb-item a:hover {
    color: var(--sd-red-dark);
    text-decoration: underline;
}

/* ---------- Cards ---------- */
.card {
    border-radius: 14px !important;
    border: none !important;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.05) !important;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.card:hover {
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.08) !important;
}

.card-header {
    border-radius: 14px 14px 0 0 !important;
    background-color: transparent !important;
    border-bottom: 1.5px solid #f1f5f9 !important;
    padding: 1rem 1.25rem !important;
}

[data-bs-theme="dark"] .card-header {
    border-bottom: 1.5px solid #27272a !important;
}

.card-title {
    font-weight: 700 !important;
    font-size: 1.08rem !important;
    color: #1e293b;
}

[data-bs-theme="dark"] .card-title {
    color: #f1f5f9;
}

/* ---------- Buttons (Red Primary) ---------- */
.btn {
    border-radius: 9px !important;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0.5rem 1rem;
}

.btn:hover {
    transform: translateY(-1.5px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #b71c1c 0%, #c62828 50%, #d32f2f 100%) !important;
    border: none !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(183, 28, 28, 0.3) !important;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #c62828 0%, #d32f2f 50%, #e53935 100%) !important;
    box-shadow: 0 6px 20px rgba(183, 28, 28, 0.4) !important;
}

.btn-outline-primary {
    border: 1.5px solid var(--sd-red-medium) !important;
    color: var(--sd-red-medium) !important;
    background: transparent !important;
}

.btn-outline-primary:hover {
    background: var(--sd-red-medium) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(183, 28, 28, 0.25) !important;
}

/* ---------- Form Controls ---------- */
.form-control, .form-select {
    border-radius: 9px !important;
    border: 1.5px solid #e2e8f0 !important;
    padding: 0.65rem 0.95rem !important;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--sd-red-medium) !important;
    box-shadow: 0 0 0 3.5px rgba(183, 28, 28, 0.18) !important;
}

.input-group-text {
    border-radius: 9px !important;
    border: 1.5px solid #e2e8f0 !important;
    background-color: #f8fafc;
    color: var(--sd-red-medium);
}

/* ---------- Tables & DataTables ---------- */
.table th {
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--sd-red-primary);
    border-bottom: 2px solid #ffcdd2 !important;
    background-color: #fffafa;
}

[data-bs-theme="dark"] .table th {
    color: #ff8a80;
    background-color: #27272a;
    border-bottom: 2px solid #3f3f46 !important;
}

.table-hover tbody tr:hover {
    background-color: rgba(183, 28, 28, 0.035) !important;
}

.page-item.active .page-link {
    background-color: var(--sd-red-primary) !important;
    border-color: var(--sd-red-primary) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(183, 28, 28, 0.3);
}

.page-link {
    color: var(--sd-red-medium);
    border-radius: 6px !important;
    margin: 0 2px;
}

/* DataTables Length Menu & Filter Controls */
.dt-container .dt-length,
div.dataTables_length {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: #475569;
}

.dt-container .dt-length select,
div.dataTables_length select {
    min-width: 82px !important;
    width: auto !important;
    padding: 0.38rem 2rem 0.38rem 0.85rem !important;
    border-radius: 8px !important;
    border: 1.5px solid #cbd5e1 !important;
    background-color: #ffffff !important;
    background-position: right 0.6rem center !important;
    background-size: 14px 10px !important;
    font-size: 0.9rem !important;
    font-weight: 500;
    line-height: 1.5 !important;
    color: #1e293b !important;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.dt-container .dt-length select:focus,
div.dataTables_length select:focus {
    border-color: var(--sd-red-medium) !important;
    box-shadow: 0 0 0 3px rgba(183, 28, 28, 0.15) !important;
    outline: none !important;
}

.dt-container .dt-search,
div.dataTables_filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: #475569;
}

.dt-container .dt-search input,
div.dataTables_filter input {
    border-radius: 8px !important;
    border: 1.5px solid #cbd5e1 !important;
    padding: 0.4rem 0.85rem !important;
    font-size: 0.9rem !important;
    min-width: 200px;
    transition: all 0.2s ease;
}

.dt-container .dt-search input:focus,
div.dataTables_filter input:focus {
    border-color: var(--sd-red-medium) !important;
    box-shadow: 0 0 0 3px rgba(183, 28, 28, 0.15) !important;
    outline: none !important;
}

/* DataTables Info and Pagination */
.dt-container .dt-info,
div.dataTables_info {
    font-size: 0.85rem;
    color: #64748b;
    padding-top: 0.85rem !important;
}

.dt-container .dt-paging,
div.dataTables_paginate {
    padding-top: 0.65rem !important;
}

.dt-container .dt-paging .dt-paging-button,
div.dataTables_paginate .paginate_button {
    border-radius: 8px !important;
    padding: 0.35rem 0.75rem !important;
    margin: 0 2px !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    border: 1px solid transparent !important;
    transition: all 0.2s ease;
}

.dt-container .dt-paging .dt-paging-button.current,
div.dataTables_paginate .paginate_button.current {
    background: linear-gradient(135deg, #b71c1c, #c62828) !important;
    border-color: var(--sd-red-primary) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(183, 28, 28, 0.3) !important;
}

.dt-container .dt-paging .dt-paging-button:hover:not(.current):not(.disabled),
div.dataTables_paginate .paginate_button:hover:not(.current):not(.disabled) {
    background: rgba(183, 28, 28, 0.1) !important;
    border-color: rgba(183, 28, 28, 0.2) !important;
    color: var(--sd-red-medium) !important;
}

/* Processing indicator */
.dt-container .dt-processing,
div.dataTables_processing {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1.5px solid var(--sd-red-primary) !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 18px rgba(0,0,0,0.12) !important;
    color: var(--sd-red-primary) !important;
    font-weight: 700 !important;
    padding: 12px 28px !important;
    z-index: 100;
}

/* ---------- Badges ---------- */
.badge {
    font-weight: 600;
    padding: 0.45em 0.8em;
    border-radius: 6px;
    letter-spacing: 0.3px;
}

.badge.bg-primary {
    background: linear-gradient(135deg, #b71c1c, #c62828) !important;
}

/* Attendance & Payment status tags */
.status-hadir   { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.status-izin    { background: #ffedd5; color: #c2410c; border: 1px solid #fed7aa; }
.status-sakit   { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
.status-alpha   { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.status-paid    { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.status-unpaid  { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.status-partial { background: #ffedd5; color: #c2410c; border: 1px solid #fed7aa; }

/* ---------- SD Welcome Hero Banner (White Theme) ---------- */
.sd-hero-banner-white {
    background: #ffffff !important;
    border-radius: 16px;
    color: #1e293b;
    position: relative;
    overflow: hidden;
    border: 1px solid #edf2f7;
    border-left: 6px solid var(--sd-red-primary) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.sd-hero-banner-white::after {
    content: '';
    position: absolute;
    right: -40px;
    bottom: -40px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(183, 28, 28, 0.03) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.sd-hero-logo-white {
    width: 74px;
    height: auto;
    filter: drop-shadow(0 4px 10px rgba(183, 28, 28, 0.12));
    transition: transform 0.3s ease;
}

.sd-hero-logo-white:hover {
    transform: scale(1.05);
}

/* White Stat Cards */
.stat-card-white {
    background: #ffffff !important;
    border: 1px solid #edf2f7 !important;
    border-radius: 14px !important;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.035) !important;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.stat-card-white:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.07) !important;
}

.stat-icon-circle {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ---------- Official Raport SD Print Styles ---------- */
.raport-card {
    background: #ffffff;
    border: 2px solid #000000;
    padding: 2.5rem;
    color: #000000;
}

.raport-header {
    border-bottom: 3px double #000000;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.raport-logo {
    width: 75px;
    height: auto;
}

@media print {
    body * {
        visibility: hidden;
    }
    .print-area, .print-area * {
        visibility: visible;
    }
    .print-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        padding: 0;
        margin: 0;
    }
    .no-print {
        display: none !important;
    }
    .app-header, .app-sidebar, .app-footer {
        display: none !important;
    }
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .login-box {
        width: 100%;
        padding: 0 1rem;
    }
    .login-card-body {
        padding: 2rem 1.5rem !important;
    }
    .small-box .inner h3 {
        font-size: 1.75rem;
    }
}

/* ==========================================================================
   DataTables Merah Putih Custom UI & Length Dropdown Fix
   ========================================================================== */
.dt-container,
.dataTables_wrapper {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

/* Fix squished length select dropdown (Tampilkan [ 25 v ] entri) */
.dt-container .dt-length,
.dataTables_wrapper .dataTables_length {
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.92rem;
    color: #475569;
    font-weight: 500;
}

.dt-container .dt-length select,
.dataTables_wrapper .dataTables_length select,
div.dt-length select.form-select,
div.dataTables_length select.form-select {
    min-width: 86px !important;
    width: auto !important;
    padding: 0.38rem 2.2rem 0.38rem 0.85rem !important;
    margin: 0 0.35rem !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    background-color: #ffffff !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 8px !important;
    background-position: right 0.75rem center !important;
    background-size: 14px 10px !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.dt-container .dt-length select:focus,
.dataTables_wrapper .dataTables_length select:focus {
    border-color: var(--sd-red-primary, #b71c1c) !important;
    box-shadow: 0 0 0 3px rgba(183, 28, 28, 0.15) !important;
    outline: none !important;
}

/* Search input field */
.dt-container .dt-search,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    font-size: 0.92rem;
    color: #475569;
    font-weight: 500;
}

.dt-container .dt-search input,
.dataTables_wrapper .dataTables_filter input,
div.dt-search input.form-control,
div.dataTables_filter input.form-control {
    min-width: 200px;
    padding: 0.4rem 0.85rem !important;
    margin-left: 0.35rem !important;
    font-size: 0.9rem !important;
    border-radius: 8px !important;
    border: 1.5px solid #cbd5e1 !important;
    transition: all 0.2s ease-in-out;
}

.dt-container .dt-search input:focus,
.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--sd-red-primary, #b71c1c) !important;
    box-shadow: 0 0 0 3px rgba(183, 28, 28, 0.15) !important;
    outline: none !important;
}

/* Info text & summary */
.dt-container .dt-info,
.dataTables_wrapper .dataTables_info {
    padding-top: 0.85rem;
    font-size: 0.88rem;
    color: #64748b;
    font-weight: 500;
}

/* Pagination container & buttons */
.dt-container .dt-paging,
.dataTables_wrapper .dataTables_paginate {
    padding-top: 0.75rem;
    display: flex;
    justify-content: flex-end;
}

.dt-container .dt-paging .pagination,
.dataTables_wrapper .pagination {
    gap: 4px;
    margin: 0;
}

.dt-container .dt-paging .page-item .page-link,
.dataTables_wrapper .page-item .page-link {
    border-radius: 8px !important;
    border: 1px solid #e2e8f0;
    color: #334155;
    font-weight: 600;
    font-size: 0.88rem;
    padding: 0.4rem 0.8rem;
    transition: all 0.15s ease-in-out;
}

.dt-container .dt-paging .page-item .page-link:hover,
.dataTables_wrapper .page-item .page-link:hover {
    background-color: #ffebee !important;
    color: var(--sd-red-primary, #b71c1c) !important;
    border-color: #ef9a9a !important;
}

.dt-container .dt-paging .page-item.active .page-link,
.dataTables_wrapper .page-item.active .page-link {
    background: linear-gradient(135deg, #b71c1c 0%, #c62828 100%) !important;
    border-color: #b71c1c !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(183, 28, 28, 0.35) !important;
}

.dt-container .dt-paging .page-item.disabled .page-link,
.dataTables_wrapper .page-item.disabled .page-link {
    background-color: #f8fafc;
    border-color: #e2e8f0;
    color: #94a3b8;
    opacity: 0.7;
}

/* Processing indicator overlay */
.dt-container .dt-processing,
.dataTables_wrapper .dataTables_processing {
    background: rgba(255, 255, 255, 0.92) !important;
    border: 1px solid rgba(183, 28, 28, 0.2) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1) !important;
    border-radius: 12px !important;
    padding: 1rem 2rem !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    color: var(--sd-red-primary, #b71c1c) !important;
    z-index: 1050 !important;
}

/* ===================================================
   ORGANIZATION CHART (TREE WITH CONNECTING LINES)
   =================================================== */
.org-chart-container {
    display: flex;
    justify-content: center;
    overflow-x: auto;
    padding: 2.5rem 1.5rem;
    background: #f8fafc;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    min-height: 480px;
}

.org-tree {
    display: inline-flex;
    margin: 0 auto;
}

.org-tree ul {
    padding-top: 32px;
    margin: 0;
    position: relative;
    display: flex;
    justify-content: center;
    padding-left: 0;
    margin-bottom: 0;
    list-style-type: none;
}

.org-tree li {
    text-align: center;
    list-style-type: none;
    position: relative;
    padding: 32px 16px 0 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s;
}

/* Root level (Kepala Sekolah) - no parent line above it */
.org-tree > ul > li::before,
.org-tree > ul > li::after {
    display: none !important;
}
.org-tree > ul > li {
    padding-top: 0 !important;
}

/* 1. Vertical drop line down into EVERY child card (including first, middle, and last) */
.org-tree li::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    border-left: 3px solid #b71c1c;
    width: 0;
    height: 32px;
    transform: translateX(-50%);
    z-index: 1;
}

/* 2. Horizontal connector bar across siblings */
.org-tree li::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    border-top: 3px solid #b71c1c;
    height: 0;
    z-index: 1;
}

/* First child: horizontal bar only spans from 50% to right (100%) */
.org-tree li:first-child::after {
    left: 50%;
    width: 50%;
}

/* Last child: horizontal bar only spans from left (0) to 50% */
.org-tree li:last-child::after {
    left: 0;
    width: 50%;
}

/* Single child: no horizontal bar needed */
.org-tree li:only-child::after {
    display: none;
}

/* Downward vertical connector from parent node with children */
.org-node-has-children::after {
    content: '';
    position: absolute;
    bottom: -32px;
    left: 50%;
    border-left: 3px solid #b71c1c;
    width: 0;
    height: 32px;
    transform: translateX(-50%);
    z-index: 1;
}

/* Node Cards */
.org-node-card {
    position: relative;
    display: inline-block;
    width: 220px;
    min-height: 84px;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
    cursor: default;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    z-index: 2;
}

.org-node-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08) !important;
}

/* Level 1: Kepala Sekolah */
.org-node-card.level-1 {
    background: linear-gradient(135deg, #7f0000 0%, #b71c1c 100%) !important;
    color: #ffffff !important;
    border-color: #b71c1c !important;
    width: 250px;
    box-shadow: 0 8px 25px rgba(183, 28, 28, 0.35) !important;
}
.org-node-card.level-1 .org-node-badge {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.4);
}
.org-node-card.level-1 .org-node-name {
    color: #ffffff;
    font-size: 1.05rem;
}

/* Level 2: Wakil & Tata Usaha */
.org-node-card.level-2 {
    border: 2px solid #b71c1c !important;
    background: #ffffff !important;
    box-shadow: 0 6px 18px rgba(183, 28, 28, 0.1) !important;
}
.org-node-card.level-2 .org-node-badge {
    background: #ffebee;
    color: #b71c1c;
    border: 1px solid #ffcdd2;
}
.org-node-card.level-2 .org-node-name {
    color: #1e293b;
    font-size: 1rem;
}

/* Level 3: Koordinator & Guru */
.org-node-card.level-3 {
    border: 2px solid #cbd5e1 !important;
    background: #ffffff !important;
}
.org-node-card.level-3 .org-node-badge {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}
.org-node-card.level-3 .org-node-name {
    color: #1e293b;
    font-size: 0.95rem;
}

/* Typography inside card */
.org-node-badge {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 20px;
    margin-bottom: 0.4rem;
}

.org-node-name {
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0;
}


