/* ============================================================
   ADMIN PANEL — Custom Stylesheet
   Design: Minimalist, clean — sinau-custom.css tokens
   ============================================================ */

/* ── TOKENS ── */
:root {
    --blue:         #1E3A8A;
    --blue-dark:    #172D6E;
    --blue-deeper:  #1E3A8A;
    --blue-tint:    #EEF2FF;
    --blue-tint2:   #C7D7F9;

    --ob-strong:  #FFFFFF;
    --ob-mid:     rgba(255,255,255,0.80);
    --ob-muted:   rgba(255,255,255,0.55);
    --ob-border:  rgba(255,255,255,0.14);
    --ob-hover:   rgba(255,255,255,0.09);

    --teal:        #0D9488;
    --teal-light:  #E6FAF8;
    --amber:       #B45309;
    --amber-light: #FEF3C7;
    --red:         #B91C1C;
    --red-light:   #FEE2E2;

    --text:        #0D1117;
    --text-mid:    #374151;
    --text-muted:  #6B7280;
    --border:      #E5E7EB;
    --border-dark: #D1D5DB;
    --bg:          #F7F9FC;
    --bg-dark:     #EEF3FA;
    --white:       #FFFFFF;

    --radius:      8px;
    --radius-lg:   12px;

    --sb-width:          220px;
    --sb-collapsed-width: 56px;
    --topbar-h:          56px;
}

/* ── BASE ── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text);
    background: var(--bg);
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

body.sb-noscroll { overflow: hidden; }

/* ============================================================
   LAYOUT
   ============================================================ */
#adminWrapper {
    display: flex;
    min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
#adminSidebar {
    width: var(--sb-width);
    flex-shrink: 0;
    background: var(--blue);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 200;
    overflow: hidden;
    transition: width 0.22s ease;
    border-right: 1px solid var(--ob-border);
}

/* Scrollable nav area */
#adminSidebar .sb-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 8px 16px;
    scrollbar-width: thin;
    scrollbar-color: var(--ob-border) transparent;
}
#adminSidebar .sb-nav::-webkit-scrollbar { width: 4px; }
#adminSidebar .sb-nav::-webkit-scrollbar-track { background: transparent; }
#adminSidebar .sb-nav::-webkit-scrollbar-thumb {
    background: var(--ob-border);
    border-radius: 4px;
}

/* ── Brand ── */
.sb-brand {
    height: var(--topbar-h);
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--ob-border);
    flex-shrink: 0;
    overflow: hidden;
    white-space: nowrap;
}

.sb-brand-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--radius);
    background: var(--ob-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--ob-strong);
    font-size: 14px;
}

.sb-brand-text {
    font-size: 14px;
    font-weight: 700;
    color: var(--ob-strong);
    letter-spacing: 0.2px;
    transition: opacity 0.18s, width 0.18s;
}

/* ── Section labels ── */
.sb-section-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--ob-muted);
    padding: 14px 12px 4px;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.18s;
}

/* ── Plain nav links ── */
.sb-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius);
    color: var(--ob-mid);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    transition: background 0.14s, color 0.14s;
    margin-bottom: 1px;
}

.sb-link i {
    font-size: 13px;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
    color: var(--ob-muted);
    transition: color 0.14s;
}

.sb-link:hover,
.sb-link.active {
    background: var(--ob-hover);
    color: var(--ob-strong);
    text-decoration: none;
}

.sb-link:hover i,
.sb-link.active i {
    color: var(--ob-strong);
}

/* ── Accordion group ── */
.sb-group {
    margin-bottom: 1px;
}

.sb-group-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    border-radius: var(--radius);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--ob-mid);
    font-size: 13px;
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
    white-space: nowrap;
    overflow: hidden;
    transition: background 0.14s, color 0.14s;
    text-align: left;
}

.sb-group-trigger:hover,
.sb-group.open .sb-group-trigger {
    background: var(--ob-hover);
    color: var(--ob-strong);
}

.sb-group-trigger-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    overflow: hidden;
}

.sb-group-trigger-left i {
    font-size: 13px;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
    color: var(--ob-muted);
}

.sb-group-trigger:hover .sb-group-trigger-left i,
.sb-group.open .sb-group-trigger .sb-group-trigger-left i {
    color: var(--ob-strong);
}

.sb-chevron {
    font-size: 10px;
    flex-shrink: 0;
    color: var(--ob-muted);
    transition: transform 0.22s ease;
    margin-left: 4px;
}

.sb-group.open .sb-chevron {
    transform: rotate(180deg);
    color: var(--ob-mid);
}

/* Animated sub-items panel */
.sb-group-items {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
    padding-left: 8px;
}

.sb-sub-link {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 12px;
    border-radius: var(--radius);
    color: var(--ob-mid);
    font-size: 12.5px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    transition: background 0.14s, color 0.14s;
    margin-bottom: 1px;
}

.sb-sub-link i {
    font-size: 12px;
    width: 14px;
    text-align: center;
    flex-shrink: 0;
    color: var(--ob-muted);
}

.sb-sub-link:hover,
.sb-sub-link.active {
    background: var(--ob-hover);
    color: var(--ob-strong);
    text-decoration: none;
}

.sb-sub-link:hover i,
.sb-sub-link.active i {
    color: var(--ob-strong);
}

/* ── Desktop collapse toggle ── */
#sbDesktopToggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 40px;
    border: none;
    border-top: 1px solid var(--ob-border);
    background: transparent;
    cursor: pointer;
    color: var(--ob-muted);
    font-size: 11px;
    transition: background 0.14s, color 0.14s;
    flex-shrink: 0;
}

#sbDesktopToggle:hover {
    background: var(--ob-hover);
    color: var(--ob-strong);
}

#sbDesktopToggle i {
    transition: transform 0.22s ease;
}

/* ── COLLAPSED state (desktop only) ── */
.sidebar-collapsed #adminSidebar {
    width: var(--sb-collapsed-width);
}

.sidebar-collapsed .sb-brand-text,
.sidebar-collapsed .sb-section-label,
.sidebar-collapsed .sb-link span,
.sidebar-collapsed .sb-group-trigger-left span,
.sidebar-collapsed .sb-chevron,
.sidebar-collapsed .sb-group-items,
.sidebar-collapsed .sb-sub-link span {
    opacity: 0;
    width: 0;
    pointer-events: none;
}

.sidebar-collapsed .sb-group-items {
    max-height: 0 !important;
}

.sidebar-collapsed #sbDesktopToggle i {
    transform: rotate(180deg);
}

/* ── Content wrapper offset ── */
#adminContentWrapper {
    flex: 1;
    margin-left: var(--sb-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.22s ease;
}

.sidebar-collapsed #adminContentWrapper {
    margin-left: var(--sb-collapsed-width);
}

/* ── Mobile backdrop ── */
#sidebarBackdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 190;
    opacity: 0;
    transition: opacity 0.22s ease;
}

#sidebarBackdrop.visible {
    display: block;
    opacity: 1;
}

/* ============================================================
   TOPBAR
   ============================================================ */
#adminTopbar {
    height: var(--topbar-h);
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
}

/* Mobile hamburger */
#sbMobileToggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 15px;
    transition: background 0.14s, color 0.14s;
    flex-shrink: 0;
}

#sbMobileToggle:hover {
    background: var(--bg);
    color: var(--text);
}

/* Spacer */
#adminTopbar .topbar-right {
    margin-left: auto;
}

/* User dropdown */
.topbar-user-dropdown {
    position: relative;
}

.topbar-user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--white);
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-mid);
    transition: border-color 0.14s, background 0.14s;
}

.topbar-user-btn:hover {
    border-color: var(--border-dark);
    background: var(--bg);
}

.topbar-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.topbar-caret {
    font-size: 10px;
    color: var(--text-muted);
    transition: transform 0.18s;
}

.topbar-user-dropdown.open .topbar-caret {
    transform: rotate(180deg);
}

.topbar-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 160px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    padding: 4px;
    z-index: 300;
}

.topbar-user-dropdown.open .topbar-dropdown-menu {
    display: block;
}

.topbar-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 12px;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    color: var(--text-mid);
    cursor: pointer;
    text-align: left;
    transition: background 0.14s;
}

.topbar-dropdown-item:hover {
    background: var(--bg);
}

.topbar-dropdown-danger { color: var(--red); }
.topbar-dropdown-danger:hover { background: var(--red-light); }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
#adminMain {
    flex: 1;
    padding: 0;
}

.admin-container {
    padding: 24px 28px;
}

/* ============================================================
   FOOTER
   ============================================================ */
#adminFooter {
    border-top: 1px solid var(--border);
    background: var(--white);
    padding: 14px 28px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

/* ============================================================
   SCROLL TO TOP
   ============================================================ */
#scrollToTop {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 34px;
    height: 34px;
    border-radius: var(--radius);
    background: var(--blue);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 14px;
    z-index: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, background 0.14s;
}

#scrollToTop.visible {
    opacity: 1;
    pointer-events: auto;
}

#scrollToTop:hover {
    background: var(--blue-dark);
    color: var(--white);
    text-decoration: none;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: none !important;
    background: var(--white);
    margin-bottom: 20px;
}

.card-header {
    background: var(--white) !important;
    border-bottom: 1px solid var(--border) !important;
    padding: 13px 20px !important;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header h6, .card-header .card-title {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: var(--text) !important;
    margin: 0 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}

.card-body { padding: 20px !important; }

.card-footer {
    background: var(--bg) !important;
    border-top: 1px solid var(--border) !important;
    padding: 12px 20px !important;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg) !important;
}

/* Border-left accent cards */
.border-left-primary { border-left: 3px solid var(--blue) !important; }
.border-left-success { border-left: 3px solid var(--teal) !important; }
.border-left-warning { border-left: 3px solid var(--amber) !important; }
.border-left-danger  { border-left: 3px solid var(--red) !important; }
.border-left-info    { border-left: 3px solid #6366F1 !important; }

/* Gradient overrides */
.bg-gradient-primary,.card-header.bg-primary  { background: var(--blue)   !important; background-image:none !important; }
.bg-gradient-success,.card-header.bg-success  { background: var(--teal)   !important; background-image:none !important; }
.bg-gradient-warning,.card-header.bg-warning  { background: var(--amber)  !important; background-image:none !important; }
.bg-gradient-danger,.card-header.bg-danger    { background: var(--red)    !important; background-image:none !important; }
.bg-gradient-info,.card-header.bg-info        { background: #6366F1       !important; background-image:none !important; }

.card-header.bg-primary h6,
.card-header.bg-success h6,
.card-header.bg-warning h6,
.card-header.bg-danger  h6,
.card-header.bg-info    h6 { color: var(--white) !important; }

/* Stat card text */
.text-xs      { font-size: 11px !important; }
.text-gray-800 { color: var(--text)      !important; }
.text-gray-600 { color: var(--text-muted)!important; }
.text-gray-300 { color: var(--border-dark)!important; }
.fa-2x         { font-size: 1.5rem !important; opacity: 0.4; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    border-radius: var(--radius) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    padding: 7px 16px !important;
    box-shadow: none !important;
    font-family: 'Poppins', sans-serif;
    transition: background 0.14s, border-color 0.14s !important;
}

.btn-primary   { background: var(--blue)  !important; border-color: var(--blue)  !important; color: var(--white) !important; }
.btn-primary:hover  { background: var(--blue-dark) !important; border-color: var(--blue-dark) !important; }
.btn-success   { background: var(--teal)  !important; border-color: var(--teal)  !important; color: var(--white) !important; }
.btn-success:hover  { background: #0f766e !important; border-color: #0f766e !important; }
.btn-warning   { background: var(--amber) !important; border-color: var(--amber) !important; color: var(--white) !important; }
.btn-warning:hover  { background: #92400e !important; border-color: #92400e !important; }
.btn-danger    { background: var(--red)   !important; border-color: var(--red)   !important; color: var(--white) !important; }
.btn-danger:hover   { background: #991b1b !important; border-color: #991b1b !important; }
.btn-secondary { background: var(--white) !important; border-color: var(--border-dark) !important; color: var(--text-mid) !important; }
.btn-secondary:hover{ background: var(--bg) !important; color: var(--text) !important; }

.btn-outline-primary { background: transparent !important; border-color: var(--blue) !important; color: var(--blue) !important; }
.btn-outline-primary:hover { background: var(--blue) !important; color: var(--white) !important; }

.btn-sm  { padding: 5px 12px !important; font-size: 12px !important; }
.btn-lg  { padding: 11px 24px !important; font-size: 14px !important; }

/* ============================================================
   TABLES
   ============================================================ */
.table { font-size: 13px; color: var(--text); border-color: var(--border); }

.table thead th {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    background: var(--bg);
    border-bottom: 1px solid var(--border) !important;
    border-top: none !important;
    padding: 10px 16px;
    vertical-align: middle;
}

.table td { padding: 11px 16px; vertical-align: middle; border-top: 1px solid var(--border); }
.table tbody tr:hover td { background: var(--bg); }

.table-bordered  { border: 1px solid var(--border) !important; }
.table-bordered td,
.table-bordered th { border-color: var(--border) !important; }

/* ============================================================
   FORMS
   ============================================================ */
.form-control {
    border: 1px solid var(--border-dark) !important;
    border-radius: var(--radius) !important;
    font-size: 13px !important;
    color: var(--text) !important;
    background: var(--white) !important;
    padding: 8px 12px !important;
    box-shadow: none !important;
    transition: border-color 0.14s !important;
    font-family: 'Poppins', sans-serif;
}

.form-control:focus {
    border-color: var(--blue) !important;
    box-shadow: 0 0 0 3px rgba(30,58,138,0.08) !important;
}

.form-control::placeholder { color: var(--text-muted); }
.form-group label { font-size: 13px; font-weight: 600; color: var(--text-mid); margin-bottom: 6px; }

.input-group .input-group-text {
    background: var(--bg) !important;
    border: 1px solid var(--border-dark) !important;
    border-radius: var(--radius) !important;
    color: var(--text-muted);
    font-size: 13px;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    font-size: 11px !important;
    font-weight: 600 !important;
    padding: 3px 8px !important;
    border-radius: 4px !important;
}

.badge-primary   { background: var(--blue-tint)   !important; color: var(--blue)  !important; }
.badge-success   { background: var(--teal-light)   !important; color: var(--teal)  !important; }
.badge-warning   { background: var(--amber-light)  !important; color: var(--amber) !important; }
.badge-danger    { background: var(--red-light)    !important; color: var(--red)   !important; }
.badge-secondary { background: var(--bg-dark)      !important; color: var(--text-muted) !important; }
.badge-info      { background: #EEF2FF             !important; color: #6366F1      !important; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert { border-radius: var(--radius-lg) !important; font-size: 13px; padding: 12px 16px !important; }
.alert-primary { background: var(--blue-tint) !important; border-color: var(--blue-tint2) !important; color: var(--blue-dark) !important; }
.alert-success { background: var(--teal-light) !important; border-color: #99F6E4 !important; color: #065F46 !important; }
.alert-warning { background: var(--amber-light) !important; border-color: #FDE68A !important; color: var(--amber) !important; }
.alert-danger  { background: var(--red-light) !important; border-color: #FCA5A5 !important; color: var(--red) !important; }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination { gap: 4px; }

.page-link {
    border-radius: var(--radius) !important;
    border: 1px solid var(--border) !important;
    color: var(--text-mid) !important;
    font-size: 13px;
    padding: 7px 12px !important;
    font-family: 'Poppins', sans-serif;
    background: var(--white) !important;
    transition: all 0.14s;
}

.page-link:hover { background: var(--bg) !important; color: var(--blue) !important; border-color: var(--blue-tint2) !important; }
.page-item.active .page-link { background: var(--blue) !important; border-color: var(--blue) !important; color: var(--white) !important; }
.page-item.disabled .page-link { background: var(--bg) !important; color: var(--text-muted) !important; }

/* ============================================================
   DROPDOWNS
   ============================================================ */
.dropdown-menu {
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08) !important;
    padding: 6px !important;
    font-size: 13px;
}

.dropdown-item {
    border-radius: var(--radius) !important;
    padding: 8px 12px !important;
    color: var(--text-mid) !important;
    font-size: 13px;
    transition: background 0.14s;
}

.dropdown-item:hover { background: var(--bg) !important; color: var(--text) !important; }
.dropdown-divider    { border-color: var(--border) !important; margin: 4px 0 !important; }

/* ============================================================
   MODALS
   ============================================================ */
.modal-content { border: 1px solid var(--border) !important; border-radius: var(--radius-lg) !important; box-shadow: 0 8px 32px rgba(0,0,0,0.10) !important; }
.modal-header  { border-bottom: 1px solid var(--border) !important; padding: 16px 20px !important; }
.modal-title   { font-size: 15px !important; font-weight: 700 !important; color: var(--text) !important; }
.modal-body    { padding: 20px !important; font-size: 13px; color: var(--text-mid); }
.modal-footer  { border-top: 1px solid var(--border) !important; padding: 14px 20px !important; gap: 8px; }

/* ============================================================
   PROGRESS
   ============================================================ */
.progress { background: var(--bg-dark) !important; border-radius: var(--radius) !important; height: 6px !important; box-shadow: none !important; }
.progress-bar { background: var(--blue) !important; border-radius: var(--radius) !important; }
.progress-bar.bg-success { background: var(--teal)  !important; }
.progress-bar.bg-warning { background: var(--amber) !important; }
.progress-bar.bg-danger  { background: var(--red)   !important; }

/* ============================================================
   UTILITIES
   ============================================================ */
.shadow    { box-shadow: 0 1px 4px rgba(0,0,0,0.05) !important; }
.shadow-sm { box-shadow: 0 1px 2px rgba(0,0,0,0.04) !important; }

.text-primary { color: var(--blue)       !important; }
.text-success { color: var(--teal)       !important; }
.text-warning { color: var(--amber)      !important; }
.text-danger  { color: var(--red)        !important; }
.text-info    { color: #6366F1           !important; }
.text-muted   { color: var(--text-muted) !important; }

@keyframes growIn {
    from { transform: scale(0.96); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}
.animated--grow-in { animation: growIn 0.15s ease forwards; }

/* CKEditor */
.cke_chrome { border: 1px solid var(--border-dark) !important; border-radius: var(--radius) !important; box-shadow: none !important; }
.cke_top    { background: var(--bg) !important; border-bottom: 1px solid var(--border) !important; }

/* ============================================================
   RESPONSIVE — MOBILE
   ============================================================ */
@media (max-width: 767px) {
    /* Sidebar off-canvas */
    #adminSidebar {
        transform: translateX(-100%);
        width: var(--sb-width) !important; /* always full width when open */
        transition: transform 0.24s ease;
    }

    #adminSidebar.mobile-open {
        transform: translateX(0);
    }

    /* Content takes full width */
    #adminContentWrapper {
        margin-left: 0 !important;
    }

    /* Show hamburger */
    #sbMobileToggle {
        display: flex;
    }

    /* Hide desktop collapse button on mobile */
    #sbDesktopToggle {
        display: none;
    }

    .admin-container {
        padding: 16px;
    }

    #adminTopbar {
        padding: 0 16px;
    }

    /* Collapsed class has no effect on mobile */
    .sidebar-collapsed #adminSidebar {
        width: var(--sb-width) !important;
    }
    .sidebar-collapsed #adminContentWrapper {
        margin-left: 0 !important;
    }
}

/* ============================================================
   TRANSACTION FILTER BAR
   ============================================================ */

/* Outer wrapper — pills kiri, search kanan */
.trx-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 10px 14px;
}

/* ── Status pills ── */
.trx-status-pills {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.trx-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 13px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--white);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-mid);
    text-decoration: none;
    transition: background 0.13s, border-color 0.13s, color 0.13s;
    white-space: nowrap;
}

.trx-pill:hover {
    background: var(--bg);
    border-color: var(--border-dark);
    color: var(--text);
    text-decoration: none;
}

/* Colored dot inside pill */
.trx-pill-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--border-dark); /* default — overridden below */
}

.trx-pill-warning .trx-pill-dot { background: var(--amber); }
.trx-pill-success .trx-pill-dot { background: var(--teal); }
.trx-pill-danger  .trx-pill-dot { background: var(--red); }

/* Active states */
.trx-pill.active {
    background: var(--blue-tint);
    border-color: var(--blue-tint2);
    color: var(--blue);
    font-weight: 600;
}

.trx-pill-warning.active {
    background: var(--amber-light);
    border-color: #FDE68A;
    color: var(--amber);
}

.trx-pill-success.active {
    background: var(--teal-light);
    border-color: #99F6E4;
    color: var(--teal);
}

.trx-pill-danger.active {
    background: var(--red-light);
    border-color: #FCA5A5;
    color: var(--red);
}

/* ── Search form ── */
.trx-search-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.trx-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.trx-search-icon {
    position: absolute;
    left: 10px;
    color: var(--text-muted);
    font-size: 12px;
    pointer-events: none;
}

.trx-search-input {
    height: 34px;
    padding: 0 12px 0 30px;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    font-size: 13px;
    font-family: 'Poppins', sans-serif;
    color: var(--text);
    background: var(--white);
    outline: none;
    width: 240px;
    transition: border-color 0.14s, box-shadow 0.14s;
}

.trx-search-input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(30,58,138,0.07);
}

.trx-search-input::placeholder {
    color: var(--text-muted);
    font-size: 12px;
}

/* ── Mobile: stack vertically, search full-width ── */
@media (max-width: 600px) {
    .trx-filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px;
    }

    .trx-status-pills {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 2px;
    }

    .trx-search-form {
        flex-shrink: unset;
    }

    .trx-search-wrap {
        flex: 1;
    }

    .trx-search-input {
        width: 100%;
        flex: 1;
    }
}

/* ============================================================
   CUSTOM PAGINATION (no Bootstrap list, no bullets)
   ============================================================ */
.trx-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.trx-pagination-info {
    font-size: 12px;
    color: var(--text-muted);
}

.trx-pagination-pages {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

/* Every page button — both <a> and <span> */
.trx-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--text-mid);
    font-size: 13px;
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.13s, border-color 0.13s, color 0.13s;
    /* kill any inherited list/bullet styles */
    list-style: none;
}

a.trx-page-btn:hover {
    background: var(--bg);
    border-color: var(--blue-tint2);
    color: var(--blue);
    text-decoration: none;
}

.trx-page-btn.active {
    background: var(--blue);
    border-color: var(--blue);
    color: var(--white);
    font-weight: 600;
    cursor: default;
}

.trx-page-btn.disabled {
    background: var(--bg);
    border-color: var(--border);
    color: var(--border-dark);
    cursor: default;
    pointer-events: none;
}

/* Chevron icons inside prev/next */
.trx-page-btn i {
    font-size: 11px;
}

@media (max-width: 480px) {
    .trx-pagination {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* ============================================================
   PAGE COMPONENTS — shared across all admin pages
   ============================================================ */

/* Page title row */
.page-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.page-title-row h1 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

/* Generic pagination using <ul class="pagination"> — kill bullets */
ul.pagination {
    display: flex !important;
    flex-direction: row !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    gap: 4px;
    flex-wrap: wrap;
}

ul.pagination li,
ul.pagination .page-item {
    list-style: none !important;
    list-style-type: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

ul.pagination .page-link {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 10px !important;
    border-radius: var(--radius) !important;
    border: 1px solid var(--border) !important;
    background: var(--white) !important;
    color: var(--text-mid) !important;
    font-size: 13px;
    font-family: 'Poppins', sans-serif;
    text-decoration: none;
    transition: background 0.13s, border-color 0.13s, color 0.13s;
}

ul.pagination .page-link:hover {
    background: var(--bg) !important;
    border-color: var(--blue-tint2) !important;
    color: var(--blue) !important;
}

ul.pagination .page-item.active .page-link {
    background: var(--blue) !important;
    border-color: var(--blue) !important;
    color: var(--white) !important;
    font-weight: 600;
}

ul.pagination .page-item.disabled .page-link {
    background: var(--bg) !important;
    color: var(--border-dark) !important;
    cursor: default;
    pointer-events: none;
}

/* Bootstrap 5 bg-success/bg-secondary badges (pages index uses these) */
.badge.bg-success  { background: var(--teal-light) !important; color: var(--teal) !important; }
.badge.bg-secondary{ background: var(--bg-dark)    !important; color: var(--text-muted) !important; }
.badge.bg-primary  { background: var(--blue-tint)  !important; color: var(--blue) !important; }
.badge.bg-danger   { background: var(--red-light)  !important; color: var(--red) !important; }
.badge.bg-warning  { background: var(--amber-light)!important; color: var(--amber) !important; }

/* Alert dismissible — Bootstrap 5 btn-close */
.btn-close {
    background: transparent;
    border: none;
    cursor: pointer;
    opacity: 0.5;
    padding: 4px;
    font-size: 16px;
}
.btn-close:hover { opacity: 1; }

/* ============================================================
   FAQ ROWS (blog article create/edit)
   ============================================================ */
.faq-row {
    background: var(--bg);
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg) !important;
    padding: 16px !important;
    margin-bottom: 12px !important;
}

.faq-row .faq-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.faq-row .faq-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* ============================================================
   SELECTED BADGES (paket create/edit — materi & tryout)
   ============================================================ */
#selectedMateriList,
#selectedTryoutList {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    min-height: 28px;
}

#selectedMateriList .badge,
#selectedTryoutList .badge {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    padding: 5px 10px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    border-radius: 6px !important;
    background: var(--blue-tint) !important;
    color: var(--blue) !important;
    border: 1px solid var(--blue-tint2);
    white-space: nowrap;
}

#selectedMateriList .badge .delete-item,
#selectedTryoutList .badge .delete-item {
    color: var(--blue) !important;
    font-size: 14px;
    line-height: 1;
    opacity: 0.6;
    cursor: pointer;
    margin-left: 2px;
    transition: opacity 0.13s;
}

#selectedMateriList .badge .delete-item:hover,
#selectedTryoutList .badge .delete-item:hover {
    opacity: 1;
}

/* ============================================================
   DROPDOWN SEARCH (paket create/edit)
   ============================================================ */
#dropdownMateri,
#dropdownTryout {
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08) !important;
    padding: 4px !important;
    background: var(--white);
    z-index: 1060;
}

#dropdownMateri .dropdown-item,
#dropdownTryout .dropdown-item,
#dropdownMateri li,
#dropdownTryout li {
    padding: 8px 12px !important;
    border-radius: var(--radius) !important;
    font-size: 13px;
    color: var(--text-mid);
    cursor: pointer;
    list-style: none;
    transition: background 0.13s;
}

#dropdownMateri .dropdown-item:hover,
#dropdownTryout .dropdown-item:hover {
    background: var(--bg) !important;
    color: var(--text) !important;
}

/* ============================================================
   SELECT2 OVERRIDE
   ============================================================ */
.select2-container--default .select2-selection--multiple {
    border: 1px solid var(--border-dark) !important;
    border-radius: var(--radius) !important;
    min-height: 38px !important;
    padding: 3px 8px !important;
    background: var(--white) !important;
    box-shadow: none !important;
}

.select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: var(--blue) !important;
    box-shadow: 0 0 0 3px rgba(30,58,138,0.07) !important;
    outline: none !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: var(--blue-tint) !important;
    border: 1px solid var(--blue-tint2) !important;
    border-radius: 4px !important;
    color: var(--blue) !important;
    font-size: 12px !important;
    padding: 2px 8px !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: var(--blue) !important;
    margin-right: 4px;
    font-size: 14px;
}

.select2-dropdown {
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08) !important;
    font-size: 13px;
    font-family: 'Poppins', sans-serif;
}

.select2-container--default .select2-results__option--highlighted {
    background: var(--blue) !important;
    color: var(--white) !important;
}

.select2-search--dropdown .select2-search__field {
    border: 1px solid var(--border-dark) !important;
    border-radius: var(--radius) !important;
    padding: 6px 10px !important;
    font-size: 13px !important;
    font-family: 'Poppins', sans-serif;
    outline: none;
}

/* ============================================================
   SUMMERNOTE OVERRIDE
   ============================================================ */
.note-editor.note-frame {
    border: 1px solid var(--border-dark) !important;
    border-radius: var(--radius) !important;
    box-shadow: none !important;
}

.note-toolbar {
    background: var(--bg) !important;
    border-bottom: 1px solid var(--border) !important;
    padding: 6px 8px !important;
}

.note-btn {
    border-radius: var(--radius) !important;
    font-size: 12px !important;
    border-color: var(--border) !important;
    background: var(--white) !important;
    color: var(--text-mid) !important;
}

.note-btn:hover {
    background: var(--bg-dark) !important;
    border-color: var(--border-dark) !important;
}

/* ============================================================
   FORM PAGE LAYOUT — form cards max readable width
   ============================================================ */
.form-section-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

/* Featured image preview */
.img-preview {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    max-height: 180px;
    width: auto;
    display: block;
    margin-bottom: 10px;
}

/* File input */
input[type="file"].form-control-file {
    font-size: 13px;
    color: var(--text-mid);
    padding: 6px 0;
}

/* btn-block */
.btn-block {
    display: block;
    width: 100%;
}

/* thead-dark override */
.thead-dark th {
    background: var(--text) !important;
    color: var(--white) !important;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

/* table-light thead */
thead.table-light th,
.table-light th {
    background: var(--bg) !important;
    color: var(--text-muted) !important;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border) !important;
}

/* Modal close button (Bootstrap 4 style) */
button.close {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius);
    transition: background 0.13s, color 0.13s;
}

button.close:hover {
    background: var(--bg);
    color: var(--text);
}

/* data-dismiss modal (Bootstrap 4) */
[data-dismiss="modal"] { cursor: pointer; }

/* ============================================================
   TRYOUT PAGES
   ============================================================ */

/* Loading overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.65);
    display: none !important;
    justify-content: center;
    align-items: center;
    z-index: 99999;
}
.loading-overlay.show { display: flex !important; }
.loading-container { text-align: center; }
.spinner-border-lg {
    width: 3.5rem; height: 3.5rem;
    border-width: 0.4em;
    color: #93C5FD;
}
.loading-overlay p {
    font-size: 14px;
    font-weight: 600;
    color: var(--ob-mid);
    margin-top: 16px;
    animation: lo-pulse 1.6s ease-in-out infinite;
}
@keyframes lo-pulse { 0%,100%{opacity:.6} 50%{opacity:1} }

/* TKP checkbox section in modal */
.tkp-toggle-section {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 16px;
}
.tkp-toggle-section .tkp-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--blue);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.tkp-toggle-section small {
    font-size: 12px;
    color: var(--text-muted);
    display: block;
    margin-top: 4px;
    margin-left: 22px;
}

/* TKP score select inside input-group */
.tkp-score {
    max-width: 72px !important;
    border-left: 1px solid var(--border-dark) !important;
    border-radius: 0 var(--radius) var(--radius) 0 !important;
    font-size: 13px !important;
    font-family: 'Poppins', sans-serif !important;
    color: var(--text-mid) !important;
    background: var(--bg) !important;
}

/* Question preview cell */
.question-preview {
    font-size: 13px;
    color: var(--text-mid);
    line-height: 1.5;
}

/* Excel upload card */
.excel-upload-card .card-header {
    background: var(--bg) !important;
}

/* Modal — Bootstrap 5 btn-close */
.modal .btn-close {
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%236B7280'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center/12px no-repeat;
    opacity: 0.6;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: var(--radius);
    padding: 0;
    transition: opacity 0.14s, background-color 0.14s;
}
.modal .btn-close:hover {
    opacity: 1;
    background-color: var(--bg);
}

/* Bootstrap 5 spacing helpers used in tryout (ms-1, ms-2, fw-bold, me-1) */
.ms-1 { margin-left: 4px !important; }
.ms-2 { margin-left: 8px !important; }
.me-1 { margin-right: 4px !important; }
.fw-bold { font-weight: 700 !important; }
.bg-light { background: var(--bg) !important; }
.visually-hidden { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; }

/* ============================================================
   BOOTSTRAP 4 MODAL — base rules
   (Required because we dropped sb-admin-2.min.css)
   ============================================================ */
.modal-open { overflow: hidden; }
.modal-open .modal { overflow-x: hidden; overflow-y: auto; }

.modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1050;
    display: none;
    overflow: hidden;
    outline: 0;
}

.modal.show { display: block !important; }

.modal-dialog {
    position: relative;
    width: auto;
    margin: 48px auto;
    pointer-events: none;
    max-width: 500px;
}

.modal-dialog-centered {
    display: flex;
    align-items: center;
    min-height: calc(100% - 96px);
}

.modal-lg { max-width: 800px; }
.modal-xl { max-width: 1140px; }
.modal-sm { max-width: 300px; }

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    outline: 0;
}

.modal-backdrop {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: 1040;
    background: rgba(0,0,0,0.5);
}

.modal-backdrop.fade { opacity: 0; }
.modal-backdrop.show { opacity: 0.5; }

.modal.fade .modal-dialog {
    transition: transform 0.2s ease-out;
    transform: translateY(-40px);
}

.modal.show .modal-dialog { transform: none; }

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.4;
}

.modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 20px;
    font-size: 13px;
    color: var(--text-mid);
    overflow-y: auto;
    max-height: calc(100vh - 220px);
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Close button (BS4 style) */
.modal-header .close {
    padding: 4px 8px;
    margin: -4px -8px -4px auto;
    background: transparent;
    border: none;
    font-size: 20px;
    font-weight: 400;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0.6;
    border-radius: var(--radius);
    transition: opacity 0.14s, background 0.14s;
}
.modal-header .close:hover { opacity: 1; background: var(--bg); }

@media (max-width: 576px) {
    .modal-dialog { margin: 12px; max-width: calc(100% - 24px); }
    .modal-lg     { max-width: calc(100% - 24px); }
}

/* ============================================================
   ACTION BUTTON CELLS — universal fix
   Prevents buttons from stacking vertically in tight table cells
   ============================================================ */
.table td .btn + .btn,
.table td .btn + form,
.table td form + .btn {
    margin-left: 4px;
}

/* d-inline forms inside flex containers */
.table td form.d-inline {
    display: inline-flex !important;
    vertical-align: middle;
}

/* Bootstrap 4 .row inside modal body */
.modal-body .row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -10px;
    margin-left: -10px;
}

.modal-body .col-md-6 {
    position: relative;
    width: 100%;
    padding-right: 10px;
    padding-left: 10px;
    flex: 0 0 50%;
    max-width: 50%;
}

@media (max-width: 576px) {
    .modal-body .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* input-group in modal */
.modal-body .input-group {
    display: flex;
    align-items: stretch;
}

.modal-body .input-group .form-control {
    flex: 1;
    border-radius: var(--radius) 0 0 var(--radius) !important;
}

.modal-body .input-group .form-control:last-child {
    border-radius: 0 var(--radius) var(--radius) 0 !important;
}

.modal-body .input-group .tkp-score {
    border-radius: 0 var(--radius) var(--radius) 0 !important;
    border-left: none !important;
}
