/* ==========================================================
   SIPYayasan - Modern Bootstrap Theme
   Skin layer on top of Bootstrap 5.3 - no markup/behavior changes.
   ========================================================== */

:root {
    --brand: #2563eb;
    --brand-dark: #1d4ed8;
    --brand-soft: rgba(37, 99, 235, .12);
    --ink: #1e293b;
    --muted: #64748b;
    --bg: #f5f7fb;
    --border: #eef1f6;
    --radius: 14px;
    --radius-sm: 10px;
}

body {
    background-color: var(--bg);
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

/* ---------- Brand color (unifies sidebar accent with buttons/badges) ----------
   Overriding Bootstrap's shared --bs-primary-rgb (instead of hardcoding
   background-color/color on .bg-primary/.text-primary) keeps bg-opacity-*
   utilities working - a flat !important background-color would ignore the
   opacity variable and paint bg-opacity-10 combos fully solid. */
:root {
    --bs-primary: var(--brand);
    --bs-primary-rgb: 37, 99, 235;
    --bs-link-color: var(--brand);
    --bs-link-color-rgb: 37, 99, 235;
    --bs-link-hover-color: var(--brand-dark);
    --bs-link-hover-color-rgb: 29, 78, 216;
}
.btn-primary {
    background-color: var(--brand) !important;
    border-color: var(--brand) !important;
    box-shadow: 0 4px 10px rgba(37, 99, 235, .22);
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background-color: var(--brand-dark) !important;
    border-color: var(--brand-dark) !important;
}
.btn-outline-primary { color: var(--brand); border-color: var(--brand); }
.btn-outline-primary:hover { background-color: var(--brand); border-color: var(--brand); }

/* ---------- Buttons ---------- */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 600;
    letter-spacing: .01em;
}
.btn-sm { border-radius: 8px; }
.btn-lg { border-radius: 12px; }

/* ---------- Sidebar ---------- */
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    background-color: #111827;
    box-shadow: none;
    border-right: none;
}
.sidebar a {
    color: #94a3b8;
    text-decoration: none;
    padding: 11px 15px;
    display: flex;
    align-items: center;
    gap: .6rem;
    white-space: nowrap;
    overflow: hidden;
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    font-weight: 500;
    font-size: .92rem;
    transition: background-color .2s ease, color .2s ease;
    position: relative;
}
.sidebar a i { font-size: 1.05rem; width: 1.3rem; flex-shrink: 0; text-align: center; margin-right: 0 !important; }
.sidebar a:hover {
    background-color: rgba(255, 255, 255, .06);
    color: #fff;
}
.sidebar a.active {
    background-color: var(--brand-soft);
    color: #fff;
    font-weight: 600;
}
.sidebar hr { border-color: rgba(255, 255, 255, .12); opacity: 1; }

/* ---------- Sidebar collapse toggle ---------- */
.sidebar { transition: flex-basis .25s ease, max-width .25s ease, padding .25s ease; overflow-x: hidden; }

.btn-sidebar-toggle {
    border: none;
    background: transparent;
    color: var(--ink);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-right: .75rem;
    flex-shrink: 0;
    transition: background-color .2s ease;
}
.btn-sidebar-toggle:hover { background-color: #eef2f7; }

@media (min-width: 768px) {
    html.sidebar-collapsed .sidebar { flex: 0 0 84px; max-width: 84px; padding-left: .5rem !important; padding-right: .5rem !important; }
    html.sidebar-collapsed .col-md-10 { flex: 1 1 auto; max-width: calc(100% - 84px); }
    html.sidebar-collapsed .sidebar-brand-text,
    html.sidebar-collapsed .sidebar-label { display: none; }
    html.sidebar-collapsed .sidebar img { max-height: 32px !important; margin-bottom: 0 !important; }
    html.sidebar-collapsed .sidebar a { justify-content: center; }
}

/* ---------- Navbar ---------- */
.navbar-custom {
    background-color: #fff !important;
    box-shadow: none;
    border-bottom: 1px solid var(--border);
}

/* ---------- Cards ---------- */
.card {
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.card.shadow-sm, .card.shadow { box-shadow: none !important; }
.widget-card {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: none !important;
    transition: transform .2s ease, border-color .2s ease;
}
.widget-card:hover {
    transform: translateY(-2px);
    border-color: #dbe3ee;
}
.icon-box { border-radius: 12px; }

/* ---------- Tables ---------- */
.table-custom th {
    background-color: var(--ink) !important;
    color: #fff !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: .74rem;
    letter-spacing: .04em;
    border: none;
}
.table-custom td { border-color: var(--border); }
.table-hover > tbody > tr:hover > * { background-color: #f1f5f9; }

/* ---------- Forms ---------- */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border-color: #e2e8f0;
}
.form-control:focus, .form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 .2rem var(--brand-soft);
}
.input-group-text {
    background-color: #f8fafc;
    border-color: #e2e8f0;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.filter-wrapper {
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: all .2s ease;
}
.filter-wrapper:focus-within {
    border-color: var(--brand);
    box-shadow: 0 0 0 .2rem var(--brand-soft);
}

/* ---------- Badges ---------- */
.badge { border-radius: 999px; font-weight: 600; letter-spacing: .01em; }

/* ---------- Modals ---------- */
.modal-content { border-radius: 18px; overflow: hidden; border: none; }
.modal-footer { border-top: 1px solid var(--border); }
.modal.fade .modal-dialog { transition: transform .15s ease-out; }
.modal-backdrop.fade { transition: opacity .1s linear; }

/* ---------- Dropdown ---------- */
.dropdown-menu { border-radius: 12px; border: 1px solid var(--border); }
.dropdown-item { border-radius: 8px; margin: 2px 6px; width: calc(100% - 12px); }

/* ---------- Accordion ---------- */
.accordion-button { font-weight: 500; }
.accordion-button:not(.collapsed) { background-color: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.accordion-button:focus { box-shadow: none; }

/* ---------- Alerts ---------- */
.alert { border-radius: var(--radius-sm); border: none; }

/* ---------- Nav pills (Pencarian Cerdas) ---------- */
.nav-pills .nav-link { border-radius: var(--radius-sm); font-weight: 600; color: var(--muted); }
.nav-pills .nav-link.active { background-color: var(--ink); box-shadow: none; }

/* ---------- Scrollbar (sidebar) ---------- */
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .15); border-radius: 3px; }
