:root {
    --brand-dark: #06402B;
    --brand: #0a6e4d;
    --brand-light: #12996b;
    --gold: #d4a017;
    --gold-light: #f2c744;
    --bg: #f4f7f6;
    --card-radius: 14px;
}

* { font-family: 'Poppins', sans-serif; }

body {
    background: var(--bg);
    margin: 0;
}

/* ---------- Top navbar ---------- */
.top-navbar {
    background: linear-gradient(120deg, var(--brand-dark), var(--brand));
    min-height: 66px;
    padding-top: 8px;
    padding-bottom: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,.15);
    position: sticky;
    top: 0;
    z-index: 1000;
    flex-wrap: nowrap;
}
.brand-logo { height: 38px; width: 38px; border-radius: 50%; background: #fff; object-fit: cover; flex-shrink: 0; }
.navbar-brand-wrap { min-width: 0; flex: 1 1 auto; overflow: hidden; }
.navbar-brand-wrap > div:last-child { min-width: 0; overflow: hidden; }
.brand-title { color: #fff; font-weight: 600; font-size: 1rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-sub { color: var(--gold-light); font-size: .72rem; letter-spacing: .5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-navbar > .ms-auto { flex-shrink: 0; }
.btn-nav-user { background: rgba(255,255,255,.12); color: #fff; border: none; border-radius: 30px; padding: 6px 16px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-nav-user:hover { background: rgba(255,255,255,.22); color: #fff; }

@media (max-width: 575px) {
    .top-navbar { padding-left: 10px; padding-right: 10px; }
    .brand-title { font-size: .82rem; }
    .brand-sub { display: none; }
    .brand-logo { height: 32px; width: 32px; }
    .btn-nav-user { max-width: 110px; padding: 6px 10px; font-size: .82rem; }
    .top-navbar > .ms-auto { gap: 8px !important; }
}

.notif-badge {
    position: absolute; top: -2px; right: -2px;
    background: var(--gold); color: #2b2200; font-weight: 700; font-size: .65rem;
    border-radius: 999px; min-width: 18px; height: 18px; line-height: 18px; text-align: center;
    padding: 0 4px; box-shadow: 0 0 0 2px var(--brand);
}
.notif-dropdown { width: 340px; max-width: 90vw; max-height: 420px; overflow-y: auto; border-radius: 12px; }
.notif-dropdown .dropdown-item { white-space: normal; }

/* ---------- Sidebar ---------- */
.sidebar {
    width: 220px;
    min-height: calc(100vh - 66px);
    background: #ffffff;
    border-right: 1px solid #e7ebe9;
    flex-shrink: 0;
}
.sidebar-inner { padding: 14px 10px; }

.side-link {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 10px; border-radius: 8px; color: #33403c; text-decoration: none;
    font-size: .86rem; font-weight: 500; margin-bottom: 2px; transition: all .15s ease;
}
.side-link i { font-size: 1rem; color: var(--brand); flex-shrink: 0; }
.side-link:hover { background: #eef7f2; color: var(--brand-dark); }
.side-link.active { background: var(--brand); color: #fff; }
.side-link.active i { color: var(--gold-light); }

.side-link.top-link { font-weight: 600; margin-bottom: 4px; }

/* Collapsible nav groups */
.side-group { margin-bottom: 2px; }
.side-group-toggle {
    width: 100%; display: flex; align-items: center; justify-content: space-between;
    background: none; border: none; padding: 9px 10px; border-radius: 8px;
    font-size: .8rem; font-weight: 600; color: #4a5652; text-transform: uppercase; letter-spacing: .4px;
    cursor: pointer;
}
.side-group-toggle span { display: flex; align-items: center; gap: 8px; }
.side-group-toggle i.bi:first-child { font-size: 1rem; color: var(--brand); }
.side-group-toggle:hover { background: #eef7f2; }
.side-group-toggle.active { color: var(--brand-dark); }
.side-group-toggle .chevron { font-size: .7rem; color: #9aa5a1; transition: transform .2s ease; }
.side-group-toggle[aria-expanded="true"] .chevron { transform: rotate(180deg); }

.side-group-links {
    padding: 4px 0 4px 10px;
    margin: 2px 0 2px 12px;
    border-left: 2px solid #eef2f0;
}
.side-link.sub-link { font-size: .82rem; padding: 7px 9px; }

@media (max-width: 767px) {
    .sidebar { position: fixed; left: -260px; top: 66px; z-index: 999; transition: left .2s ease; box-shadow: 4px 0 15px rgba(0,0,0,.1); width: 240px; }
    .sidebar.show { left: 0; }
}

/* ---------- Main content ---------- */
.main-content { padding: 24px; min-height: calc(100vh - 66px); }
.page-title { font-weight: 600; color: var(--brand-dark); margin-bottom: 2px; }
.page-sub { color: #7c8985; font-size: .9rem; margin-bottom: 22px; }

/* ---------- Cards ---------- */
.card { border: none; border-radius: var(--card-radius); box-shadow: 0 2px 14px rgba(15, 40, 30, .06); }
.stat-card { border-radius: var(--card-radius); padding: 22px; color: #fff; position: relative; overflow: hidden; }
.stat-card i.bg-icon { position: absolute; right: 14px; top: 14px; font-size: 2.6rem; opacity: .25; }
.stat-card .stat-label { font-size: .82rem; opacity: .9; }
.stat-card .stat-value { font-size: 1.6rem; font-weight: 700; margin-top: 4px; }
.stat-green { background: linear-gradient(135deg, #0a6e4d, #06402B); }
.stat-gold { background: linear-gradient(135deg, #e0ac1c, #b9860f); }
.stat-blue { background: linear-gradient(135deg, #1c7fc4, #135b8f); }
.stat-red { background: linear-gradient(135deg, #c4433c, #922e29); }
.stat-purple { background: linear-gradient(135deg, #8e5ea2, #5f3a70); }
.stat-teal { background: linear-gradient(135deg, #0f9b8e, #0a6b62); }
.stat-orange { background: linear-gradient(135deg, #e07a1c, #b85e0f); }
.stat-pink { background: linear-gradient(135deg, #d1477a, #9c2f58); }
.stat-indigo { background: linear-gradient(135deg, #4b5fc4, #33408f); }

/* ---------- DataTables Buttons (Excel/PDF/Copy/Print/Columns) ----------
   The plugin's own stylesheet renders these with very low contrast against
   our theme (they were effectively invisible). Style them explicitly and
   solidly instead of relying on it. DataTables always adds a
   "buttons-<name>" class to each button regardless of other classes, so
   these selectors match reliably. */
.dt-buttons { margin-bottom: .75rem; display: flex; flex-wrap: wrap; gap: 6px; }
.dt-buttons .btn,
.dt-button {
    border-radius: 8px !important;
    font-size: .8rem !important;
    font-weight: 500 !important;
    padding: 6px 14px !important;
    border: none !important;
    color: #fff !important;
    opacity: 1 !important;
    box-shadow: none !important;
}
.dt-button.buttons-copy { background: #6c757d !important; }
.dt-button.buttons-excel { background: #12996b !important; }
.dt-button.buttons-pdf { background: #c4433c !important; }
.dt-button.buttons-print { background: #1c7fc4 !important; }
.dt-button.buttons-colvis { background: #8e5ea2 !important; }
.dt-button:hover,
.dt-buttons .btn:hover { filter: brightness(0.9); color: #fff !important; }
.dt-button:focus,
.dt-button:active { color: #fff !important; box-shadow: none !important; }
/* Column-visibility dropdown menu */
.dt-button-collection { background: #fff; border-radius: 10px; box-shadow: 0 4px 20px rgba(0,0,0,.15); padding: 6px; border: 1px solid #eef2f0; }
.dt-button-collection .dt-button { color: #33403c !important; background: none !important; display: block; width: 100%; text-align: left; }
.dt-button-collection .dt-button:hover { background: #eef7f2 !important; }

.section-card { background: #fff; border-radius: var(--card-radius); padding: 22px; box-shadow: 0 2px 14px rgba(15,40,30,.06); }

/* ---------- Buttons ---------- */
.btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #2b2200; font-weight: 600; }
.btn-gold:hover { background: var(--gold-light); border-color: var(--gold-light); color: #2b2200; }

/* ---------- Tables ---------- */
table.dataTable thead th { background: #f0f5f3; color: var(--brand-dark); font-weight: 600; border-bottom: none !important; }
.badge-active { background: #d7f4e6; color: #0a6e4d; }
.badge-inactive { background: #f1f1f1; color: #777; }
.badge-suspended { background: #fde3e1; color: #a1372f; }
.badge-pending { background: #fff2cf; color: #96700a; }
.badge-approved { background: #d7f4e6; color: #0a6e4d; }
.badge-rejected { background: #fde3e1; color: #a1372f; }
.badge-paid { background: #d9e9fb; color: #185a92; }

/* ---------- Login pages ---------- */
.login-wrapper {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle at top left, #0e7a55, #06402B 60%);
    padding: 20px;
}
.login-card { background: #fff; border-radius: 18px; overflow: hidden; max-width: 900px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.login-side { background: linear-gradient(160deg, var(--brand-dark), var(--brand)); color: #fff; padding: 50px 40px; display: flex; flex-direction: column; justify-content: center; }
.login-side h2 { font-weight: 700; }
.login-side .gold-accent { color: var(--gold-light); }
.login-form-side { padding: 50px 40px; }

@media (max-width: 575px) {
    .login-side { padding: 32px 24px; }
    .login-side h2 { font-size: 1.5rem; }
    .login-form-side { padding: 32px 24px; }
}

.avatar-circle { width: 42px; height: 42px; border-radius: 50%; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; }
