/* =========================================================
   CASETA - Custom Styles
   ========================================================= */

/* ---------- Layout ---------- */
body {
    background: #f1f5f9;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 0.9rem;
}

.wrapper {
    min-height: 100vh;
}

/* ---------- Sidebar ---------- */
#sidebar {
    width: 260px;
    min-height: 100vh;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: #cbd5e1;
    flex-shrink: 0;
    transition: width 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#sidebar.collapsed {
    width: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 20px 16px;
    color: #fff;
    font-size: 1.4rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,.08);
    letter-spacing: .5px;
}

.sidebar-brand i {
    color: #3b82f6;
    font-size: 1.6rem;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    color: #94a3b8;
}

.user-name {
    font-size: .85rem;
    font-weight: 600;
    color: #e2e8f0;
    line-height: 1.2;
}

.user-role {
    font-size: .73rem;
    color: #64748b;
}

.sidebar-menu {
    list-style: none;
    padding: 8px 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 20px;
    color: #94a3b8;
    text-decoration: none;
    transition: all .2s;
    font-size: .875rem;
    border-left: 3px solid transparent;
}

.sidebar-menu li a:hover {
    background: rgba(255,255,255,.06);
    color: #e2e8f0;
    border-left-color: #3b82f6;
}

.sidebar-menu li.active > a,
.sidebar-menu li a.active {
    background: rgba(59,130,246,.18);
    color: #93c5fd;
    border-left-color: #3b82f6;
    font-weight: 600;
}

.sidebar-menu li a i {
    width: 18px;
    text-align: center;
    font-size: .9rem;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 12px 20px 4px;
    cursor: default;
}

.sidebar-header span {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #475569;
}

/* ---------- Top Navbar ---------- */
#content > nav.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
}

/* ---------- Stat Cards ---------- */
.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    border-left: 4px solid transparent;
    transition: transform .2s, box-shadow .2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,.1);
}

.stat-card .stat-icon {
    font-size: 1.6rem;
    margin-bottom: 4px;
    opacity: .8;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    color: #1e293b;
}

.stat-card .stat-label {
    font-size: .78rem;
    color: #64748b;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.stat-card-primary  { border-left-color: #3b82f6; }
.stat-card-primary .stat-icon { color: #3b82f6; }

.stat-card-success  { border-left-color: #22c55e; }
.stat-card-success .stat-icon { color: #22c55e; }

.stat-card-warning  { border-left-color: #f59e0b; }
.stat-card-warning .stat-icon { color: #f59e0b; }

.stat-card-danger   { border-left-color: #ef4444; }
.stat-card-danger .stat-icon { color: #ef4444; }

.stat-card-info     { border-left-color: #06b6d4; }
.stat-card-info .stat-icon { color: #06b6d4; }

.stat-card-secondary { border-left-color: #94a3b8; }
.stat-card-secondary .stat-icon { color: #94a3b8; }

/* ---------- Cards ---------- */
.card {
    border: none;
    border-radius: 10px;
}

.card-header {
    border-radius: 10px 10px 0 0 !important;
    border-bottom: 1px solid #f1f5f9;
}

/* ---------- Tables ---------- */
.table > thead > tr > th {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #64748b;
    background: #f8fafc;
}

.table-hover > tbody > tr:hover {
    background-color: #f8faff;
}

/* ---------- Buttons XS ---------- */
.btn-xs {
    padding: 2px 7px;
    font-size: .75rem;
    border-radius: 4px;
}

/* ---------- Badges ---------- */
.badge {
    font-weight: 600;
    letter-spacing: .3px;
}

/* ---------- Forms ---------- */
.form-control:focus,
.form-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}

.form-label {
    font-weight: 600;
    font-size: .83rem;
    color: #374151;
    margin-bottom: 4px;
}

/* ---------- Alert flash ---------- */
.alert {
    border-radius: 8px;
    border: none;
    font-size: .88rem;
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
    font-size: .83rem;
    margin: 0;
}

/* ---------- DataTables overrides ---------- */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 10px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff !important;
    border-radius: 6px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #1e293b !important;
    border-radius: 6px;
}

/* ---------- Login page ---------- */
.login-card {
    border-radius: 16px;
}

/* ---------- Select2 ---------- */
.select2-container--bootstrap-5 .select2-selection {
    font-size: .9rem;
}

/* ---------- Scrollbar (sidebar) ---------- */
.sidebar-menu::-webkit-scrollbar {
    width: 4px;
}
.sidebar-menu::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-menu::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    #sidebar {
        width: 0;
        position: fixed;
        z-index: 1050;
        height: 100vh;
    }

    #sidebar.show-mobile {
        width: 260px;
    }

    #content {
        width: 100%;
    }

    .stat-card .stat-value {
        font-size: 1.5rem;
    }
}
