/* =========================
   GLOBAL FONT STANDARD
   Baseline: Page Ahli Residensi
========================= */
html {
    font-size: 17px; /* Bootstrap default 16px → compact */
}

body {
    height: 100%;
    margin: 0;
    font-size: 0.875rem; /* ±14px */
    line-height: 1.5;
    background: #f5f6f8;
    overflow-x: hidden;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* =========================
   APP WRAPPER
========================= */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* =========================
   SIDEBAR
========================= */
.sidebar {
    width: 240px;
    background: #2f6b1b;
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1040;
    transition: transform .3s ease, width .3s ease;
    overflow-y: auto;
}

/* LOGO */
.sidebar .logo-box {
    text-align: center;
    padding: 18px;
}

.sidebar .logo-box img {
    max-width: 140px;
}

/* MENU */
.sidebar a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    color: #fff;
    text-decoration: none;
    font-size: 0.95rem;      
    font-weight: 500;
    letter-spacing: 0.2px;
    position: relative;
    z-index: 2000;
    pointer-events: auto;
}

.sidebar a:hover {
    background: rgba(255,255,255,.15);
}

.sidebar i {
    font-size: 18px;
    min-width: 22px;
}

/* SECTION TITLE */
.sidebar .section-title {
    padding: 10px 18px 6px;
    font-size: 0.75rem;
    opacity: .7;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.6px;
}

/* FOOTER */
.sidebar-footer {
    padding: 12px 18px;
    font-size: 0.7rem;
    opacity: .7;
}

/* =========================
   DESKTOP COLLAPSE
========================= */
@media (min-width: 769px) {

    .sidebar.collapsed {
        width: 70px;
    }

    .sidebar.collapsed span,
    .sidebar.collapsed .section-title,
    .sidebar.collapsed .logo-box img {
        display: none;
    }
}

/* =========================
   MAIN AREA
========================= */
.main {
    margin-left: 240px;
    width: 100%;
    transition: margin-left .3s ease;
}

.sidebar.collapsed ~ .main {
    margin-left: 70px;
}

/* =========================
   TOPBAR
========================= */
.topbar {
    height: 52px;
    background: #fff;
    border-bottom: 1px solid #ddd;
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
}

/* =========================
   CONTENT
========================= */
.content-wrapper {
    padding: 18px;
}

/* =========================
   CARD & GLOBAL COMPONENT
========================= */
.card {
    font-size: 0.875rem;
}

.card-header h1,
.card-header h2,
.card-header h3,
.card-header h4,
.card-header h5 {
    font-size: 0.95rem;
    margin-bottom: 0;
}

.alert {
    font-size: 0.85rem;
}

/* =========================
   FORM
========================= */
.form-control,
.form-select {
    font-size: 0.875rem;
    padding: 0.35rem 0.5rem;
}

label,
.form-label {
    font-size: 0.8rem;
}

/* =========================
   BUTTON & BADGE
========================= */
.btn {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
}

.badge {
    font-size: 0.7rem;
    padding: 0.35em 0.55em;
}

/* =========================
   TABLE (GLOBAL)
========================= */
table {
    font-size: 0.875rem;
}

/* =========================
   DATATABLES (BOOTSTRAP 5)
========================= */

/* Force pagination ke hujung kanan */
.dataTables_wrapper .dataTables_paginate .pagination {
    justify-content: flex-end !important;
}

/* Font table DataTables */
table.dataTable,
table.dataTable td,
table.dataTable th {
    font-size: 0.875rem !important;
}

/* Header */
table.dataTable thead th {
    white-space: nowrap;
    cursor: pointer;
}

/* Sorting arrow kecil (Bootstrap 5) */
table.dataTable thead th.sorting::before,
table.dataTable thead th.sorting::after,
table.dataTable thead th.sorting_asc::before,
table.dataTable thead th.sorting_asc::after,
table.dataTable thead th.sorting_desc::before,
table.dataTable thead th.sorting_desc::after {
    font-size: 0.6rem !important;
}

/* Sorting icon lembut bila idle */
table.dataTable thead th.sorting::before,
table.dataTable thead th.sorting::after {
    opacity: 0.35;
}

table.dataTable thead th.sorting:hover::before,
table.dataTable thead th.sorting:hover::after {
    opacity: 1;
}

/* Info text */
.dataTables_info {
    font-size: 0.8rem;
}

/* Length menu */
.dataTables_length select {
    font-size: 0.8rem;
    padding: 0.25rem 1.4rem;
}

/* Search box */
.dataTables_filter input {
    font-size: 0.8rem;
    padding: 0.25rem 0.4rem;
}

/* Button dalam table */
table.dataTable .btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* =========================
   MOBILE MODE
========================= */
@media (max-width: 768px) {

    .sidebar {
        transform: translateX(-100%);
        width: 240px;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main {
        margin-left: 0 !important;
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.4);
        z-index: 1030;
        display: none;
    }

    .sidebar-overlay.show {
        display: block;
    }

    /* Compact padding mobile */
    .content-wrapper {
        padding: 12px;
    }
}