/* ========================================================
   Sistem Informasi UKS TK/KB - Custom CSS
   Tema: Bersih, Ceria Ramah Anak, Profesional & Elegan
   ======================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-color: #0d9488;       /* Teal segar kesehatan */
    --primary-hover: #0f766e;
    --primary-light: #ccfbf1;
    --secondary-color: #0284c7;     /* Sky blue */
    --accent-color: #f59e0b;        /* Amber hangat ceria */
    --danger-color: #ef4444;
    --success-color: #10b981;
    --dark-color: #1e293b;
    --light-bg: #f8fafc;
    --sidebar-bg: #0f172a;          /* Slate dark modern */
    --sidebar-hover: #1e293b;
    --card-border: #e2e8f0;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--light-bg);
    color: #334155;
    font-size: 0.93rem;
    overflow-x: hidden;
}

/* Scrollbar halus */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Layout Wrapper */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.app-sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: #94a3b8;
    flex-shrink: 0;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    z-index: 1040;
}

.sidebar-brand {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.15);
}

.sidebar-brand .brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #0d9488, #06b6d4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.3rem;
    box-shadow: 0 4px 10px rgba(13, 148, 136, 0.4);
}

.sidebar-brand .brand-text {
    font-size: 1.05rem;
    font-weight: 700;
    color: #f8fafc;
    line-height: 1.2;
}

.sidebar-brand .brand-sub {
    font-size: 0.72rem;
    color: #0d9488;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.sidebar-menu {
    list-style: none;
    padding: 1rem 0.75rem;
    margin: 0;
    flex-grow: 1;
    overflow-y: auto;
}

.sidebar-heading {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #64748b;
    padding: 0.75rem 0.75rem 0.35rem 0.75rem;
}

.sidebar-item {
    margin-bottom: 0.2rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.65rem 0.85rem;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.88rem;
    transition: all 0.2s ease;
}

.sidebar-link i {
    font-size: 1.15rem;
    width: 22px;
    text-align: center;
    transition: transform 0.2s ease;
}

.sidebar-link:hover {
    color: #f8fafc;
    background: var(--sidebar-hover);
}

.sidebar-link:hover i {
    transform: scale(1.15);
    color: #2dd4bf;
}

.sidebar-link.active {
    color: #ffffff;
    background: linear-gradient(135deg, #0d9488, #14b8a6);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.35);
}

.sidebar-link.active i {
    color: #ffffff;
}

.sidebar-user {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-user .user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #0d9488;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

/* Main Content Area */
.app-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background-color: #f8fafc;
}

/* Navbar */
.app-navbar {
    height: 64px;
    background: #ffffff;
    border-bottom: 1px solid var(--card-border);
    padding: 0 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.navbar-toggle-btn {
    background: none;
    border: none;
    color: #64748b;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}
.navbar-toggle-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

/* Cards & Components */
.card {
    border: 1px solid var(--card-border);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    background: #ffffff;
    margin-bottom: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-header {
    background: #ffffff;
    border-bottom: 1px solid var(--card-border);
    padding: 1rem 1.25rem;
    border-top-left-radius: 12px !important;
    border-top-right-radius: 12px !important;
    font-weight: 600;
}

.stat-card {
    border-radius: 14px;
    border: none;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.25s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.stat-card .card-body {
    padding: 1.4rem;
    position: relative;
    z-index: 2;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.bg-teal-subtle { background-color: #ccfbf1 !important; color: #0d9488 !important; }
.bg-sky-subtle { background-color: #e0f2fe !important; color: #0284c7 !important; }
.bg-amber-subtle { background-color: #fef3c7 !important; color: #d97706 !important; }
.bg-rose-subtle { background-color: #ffe4e6 !important; color: #e11d48 !important; }
.bg-purple-subtle { background-color: #f3e8ff !important; color: #9333ea !important; }

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1rem;
    font-size: 0.88rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 6px;
}

/* Badges */
.badge {
    font-weight: 600;
    border-radius: 6px;
    padding: 0.35rem 0.65rem;
    letter-spacing: 0.3px;
}

/* Tables */
.table {
    vertical-align: middle;
}
.table thead th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
    padding: 0.85rem 1rem;
}
.table tbody td {
    padding: 0.85rem 1rem;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
}
.table-hover tbody tr:hover {
    background-color: #f8fafc;
}

/* Form Controls */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    padding: 0.55rem 0.85rem;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: #0d9488;
    box-shadow: 0 0 0 0.2rem rgba(13, 148, 136, 0.18);
}

.form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #334155;
    margin-bottom: 0.35rem;
}

/* Responsive Sidebar Toggle */
@media (max-width: 991.98px) {
    .app-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: -260px;
    }
    .app-sidebar.show {
        left: 0;
        box-shadow: 0 0 25px rgba(0, 0, 0, 0.4);
    }
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1035;
        display: none;
    }
    .sidebar-overlay.show {
        display: block;
    }
}

/* ========================================================
   Print Styling (Cetak Slip Kunjungan & Laporan)
   ======================================================== */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 11pt;
    }
    .app-sidebar, .app-navbar, .no-print, .btn, .alert, .sidebar-overlay, footer {
        display: none !important;
    }
    .app-wrapper {
        display: block !important;
    }
    .app-main {
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
    }
    .card {
        border: none !important;
        box-shadow: none !important;
        margin-bottom: 0 !important;
    }
    .card-body {
        padding: 0 !important;
    }
    .print-header {
        border-bottom: 3px double #000;
        padding-bottom: 12px;
        margin-bottom: 20px;
        display: flex !important;
        align-items: center;
        gap: 15px;
    }
    .table th, .table td {
        border-color: #000 !important;
        color: #000 !important;
        padding: 6px 8px !important;
    }
    .table thead th {
        background-color: #f0f0f0 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .ttd-box {
        page-break-inside: avoid;
    }
}
