/* ============================================
   PENGURUSAN GUAMAN — admin theme
   Shell (sidebar + topbar) and a light restyle of Bootstrap components for every admin page.
   ============================================ */
:root {
  --adm-ink: #0D0D0D;          /* sidebar */
  --adm-ink-2: #0D0D0D;
  --adm-accent: #F59E0B;       /* amber accent (Black Dodo) */
  --adm-accent-2: #FBBF24;
  --adm-accent-soft: #FEF3C7;
  --adm-teal: #F59E0B;
  --adm-bg: #F9FAFB;
  --adm-card: #FFFFFF;
  --adm-line: #E5E7EB;
  --adm-text: #0D0D0D;
  --adm-muted: #6B7280;
  --adm-radius: 14px;
  --adm-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .04);
  --adm-sidebar-w: 270px;
  --adm-sidebar-w-mini: 78px;
  --bs-primary: #0D0D0D;
  --bs-primary-rgb: 13, 13, 13;
  --bs-link-color: #B45309;
  --bs-link-color-rgb: 180, 83, 9;
  --bs-link-hover-color: #92400E;
  --bs-body-font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --bs-body-color: #0D0D0D;
}

body.adm { background: var(--adm-bg); color: var(--adm-text); font-family: var(--bs-body-font-family); font-size: .93rem; }

/* ---------- Sidebar ---------- */
.adm-sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--adm-sidebar-w); z-index: 1040;
  background: linear-gradient(180deg, #0D0D0D 0%, #1A1A1A 100%); color: #D1D5DB;
  display: flex; flex-direction: column; transition: width .2s ease, transform .2s ease;
}
.adm-brand { display: flex; align-items: center; gap: 12px; padding: 22px 20px 18px; color: #fff; text-decoration: none; position: relative; }
.adm-brand:hover { color: #fff; }
.adm-brand-mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0;
  background: rgba(255, 255, 255, .08); color: #E9C46A; font-size: 1.35rem; }
.adm-brand-text { line-height: 1.2; overflow: hidden; white-space: nowrap; }
.adm-brand-text strong { display: block; font-size: 1.05rem; font-weight: 700; }
.adm-brand-text small { color: #A79FC0; font-size: .78rem; }
.adm-collapse-btn {
  position: absolute; right: -14px; top: 30px; width: 28px; height: 28px; border-radius: 50%; border: 0;
  background: #2E1F55; color: #fff; display: grid; place-items: center; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); font-size: .8rem;
}
.adm-nav { flex: 1; overflow-y: auto; padding: 6px 14px 20px; scrollbar-width: thin; scrollbar-color: #3A2A66 transparent; }
.adm-nav-group { padding: 18px 12px 6px; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: #9CA3AF; font-weight: 600; white-space: nowrap; }
.adm-nav a {
  display: flex; align-items: center; gap: 14px; padding: 10px 14px; margin: 2px 0; border-radius: 10px;
  color: #D1D5DB; text-decoration: none; font-size: .92rem; white-space: nowrap; position: relative;
}
.adm-nav a i { font-size: 1.1rem; width: 20px; text-align: center; flex-shrink: 0; opacity: .9; }
.adm-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.adm-nav a.active { background: linear-gradient(90deg, var(--adm-accent), var(--adm-accent-2)); color: #0D0D0D; font-weight: 600; box-shadow: 0 6px 16px rgba(245, 158, 11, .35); }
.adm-nav .adm-badge { margin-left: auto; background: #EF4444; color: #fff; font-size: .7rem; border-radius: 999px; padding: 1px 7px; }

/* Collapsed sidebar (desktop) */
body.adm-mini .adm-sidebar { width: var(--adm-sidebar-w-mini); }
body.adm-mini .adm-brand-text, body.adm-mini .adm-nav-group, body.adm-mini .adm-nav a span { display: none; }
body.adm-mini .adm-nav a { justify-content: center; padding: 11px 0; }
body.adm-mini .adm-nav .adm-badge { position: absolute; top: 4px; right: 8px; padding: 0 5px; }
body.adm-mini .adm-collapse-btn i { transform: rotate(180deg); }
body.adm-mini .adm-main { margin-left: var(--adm-sidebar-w-mini); }

/* ---------- Main + topbar ---------- */
.adm-main { margin-left: var(--adm-sidebar-w); min-height: 100vh; transition: margin-left .2s ease; }
.adm-header {
  position: sticky; top: 0; z-index: 1030; display: flex; align-items: center; gap: 16px;
  padding: 14px 32px; background: rgba(246, 247, 251, .9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--adm-line);
}
.adm-menu-btn { display: none; border: 0; background: none; font-size: 1.4rem; color: var(--adm-text); }
.adm-search {
  flex: 1; max-width: 600px; display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--adm-line);
  border-radius: 12px; padding: 9px 14px; color: var(--adm-muted); cursor: text; text-align: left;
}
.adm-search:hover { border-color: #D5D8E3; }
.adm-search span { flex: 1; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-search .adm-kbd { flex: 0 0 auto; }
.adm-kbd { border: 1px solid var(--adm-line); border-radius: 6px; padding: 1px 7px; font-size: .75rem; color: var(--adm-muted); background: #FAFBFD; }
.adm-header-right { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.adm-bell { position: relative; border: 0; background: none; font-size: 1.3rem; color: var(--adm-text); padding: 4px; }
.adm-bell .dot { position: absolute; top: 3px; right: 2px; width: 9px; height: 9px; border-radius: 50%; background: #EF4444; border: 2px solid var(--adm-bg); }
.adm-user { display: flex; align-items: center; gap: 12px; border: 0; background: none; padding: 0; text-align: left; border-left: 1px solid var(--adm-line); padding-left: 18px; }
.adm-avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #374151, #0D0D0D); color: #fff; font-weight: 700; flex-shrink: 0; }
.adm-user-text { line-height: 1.2; }
.adm-user-text strong { display: block; font-size: .9rem; color: var(--adm-text); }
.adm-user-text small { color: var(--adm-muted); font-size: .78rem; }
.adm-dropdown { border: 1px solid var(--adm-line); border-radius: 12px; box-shadow: 0 16px 40px rgba(16, 24, 40, .12); padding: 6px; }
.adm-dropdown .dropdown-item { border-radius: 8px; padding: 8px 12px; font-size: .9rem; }
.adm-notif { width: 360px; max-height: 440px; overflow-y: auto; padding: 0; }
.adm-notif-head { padding: 12px 16px; border-bottom: 1px solid var(--adm-line); font-weight: 700; display: flex; justify-content: space-between; }
.adm-notif a { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #F2F3F7; color: var(--adm-text); text-decoration: none; font-size: .86rem; }
.adm-notif a:hover { background: #FAFAFA; }
.adm-notif .ni { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.adm-notif small { color: var(--adm-muted); display: block; }
.adm-notif-empty { padding: 28px 16px; text-align: center; color: var(--adm-muted); font-size: .88rem; }

.admin-content { padding: 26px 32px 40px; }

/* ---------- Page header (every admin page uses .admin-topbar) ---------- */
.admin-topbar { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 22px; gap: 12px; flex-wrap: wrap; }
.admin-topbar h2 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; margin: 0; color: var(--adm-text); }
.admin-topbar > div > a.small:first-child { color: var(--adm-muted); text-decoration: none; }
.adm-page-sub { color: var(--adm-muted); margin: 4px 0 0; }
.adm-date { display: flex; align-items: center; gap: 12px; text-align: left; }
.adm-date i { font-size: 1.5rem; color: var(--adm-muted); }
.adm-date strong { display: block; font-size: .92rem; }
.adm-date small { color: var(--adm-muted); }

/* ---------- Bootstrap restyle ---------- */
.admin-content .card { border: 1px solid var(--adm-line); border-radius: var(--adm-radius); box-shadow: var(--adm-shadow); background: var(--adm-card); }
.admin-content .card-header { background: transparent; border-bottom: 1px solid var(--adm-line); font-weight: 600; padding: 14px 18px; border-radius: var(--adm-radius) var(--adm-radius) 0 0 !important; }
.admin-content .card-footer { background: #FBFBFD; border-top: 1px solid var(--adm-line); border-radius: 0 0 var(--adm-radius) var(--adm-radius) !important; }
.admin-content .card-body { padding: 18px; }
.admin-content .card > .table, .admin-content .card > .table-responsive > .table { margin-bottom: 0; }
.admin-content .table { --bs-table-bg: transparent; font-size: .9rem; }
.admin-content .table > thead th { background: #F8F9FC; color: var(--adm-muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--adm-line); }
.admin-content .table > :not(caption) > * > * { padding: .7rem .9rem; border-bottom-color: #F3F4F6; }
.admin-content .table-hover > tbody > tr:hover > * { background: #FAFAFA; }
.admin-content .list-group-item { border-color: #F3F4F6; }
.btn { border-radius: 10px; font-weight: 500; }
.btn-sm { border-radius: 8px; }
.btn-primary { background: #0D0D0D; border-color: #0D0D0D; color: #fff; }
.btn-primary:hover, .btn-primary:focus, .btn-primary:active { background: var(--adm-accent); border-color: var(--adm-accent); color: #0D0D0D; }
.btn-outline-primary { color: #0D0D0D; border-color: #D1D5DB; }
.btn-outline-primary:hover { background: #0D0D0D; border-color: #0D0D0D; color: #fff; }
.btn-outline-secondary { color: #4B5563; border-color: #D1D5DB; background: #fff; }
.btn-outline-secondary:hover { background: #F3F4F6; color: var(--adm-text); border-color: #9CA3AF; }
.form-control, .form-select { border-radius: 10px; border-color: #D1D5DB; }
.form-control:focus, .form-select:focus { border-color: #FBBF24; box-shadow: 0 0 0 3px rgba(245, 158, 11, .15); }
.form-label { font-weight: 500; font-size: .86rem; color: #374151; }
.form-check-input:checked { background-color: #0D0D0D; border-color: #0D0D0D; }
.nav-tabs .nav-link { border-radius: 10px 10px 0 0; color: var(--adm-muted); }
.nav-tabs .nav-link.active { color: var(--adm-accent); font-weight: 600; }
.nav-pills .nav-link.active { background: var(--adm-accent); }
.nav-pills .nav-link { border-radius: 10px; }
.alert { border-radius: 12px; border: 0; }
.alert-success { background: #E8F7EF; color: #17663F; }
.alert-danger { background: #FDECEC; color: #9B1C1C; }
.alert-warning { background: #FFF6E0; color: #8A5A00; }
.alert-info { background: #EAF3FF; color: #1E4E8C; }
.badge { font-weight: 600; border-radius: 6px; }
.page-link { color: var(--adm-accent); border-radius: 8px !important; margin: 0 2px; }
.page-item.active .page-link { background: var(--adm-accent); border-color: var(--adm-accent); }
.modal-content { border-radius: 16px; border: 0; }
.step-num { background: var(--adm-accent) !important; }

/* ---------- Search (Ctrl+K) ---------- */
.adm-search-modal .modal-content { overflow: hidden; }
.adm-search-input { border: 0; border-bottom: 1px solid var(--adm-line); border-radius: 0; padding: 18px 20px 18px 52px; font-size: 1.05rem; box-shadow: none !important; }
.adm-search-wrap { position: relative; }
.adm-search-wrap > i { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); color: var(--adm-muted); font-size: 1.1rem; }
.adm-search-results { max-height: 420px; overflow-y: auto; }
.adm-search-group { padding: 10px 20px 4px; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--adm-muted); font-weight: 700; }
.adm-search-item { display: flex; align-items: center; gap: 12px; padding: 10px 20px; color: var(--adm-text); text-decoration: none; }
.adm-search-item i { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--adm-accent-soft); color: var(--adm-accent); flex-shrink: 0; }
.adm-search-item small { display: block; color: var(--adm-muted); }
.adm-search-item.sel, .adm-search-item:hover { background: #F5F2FE; color: var(--adm-text); }
.adm-search-hint { padding: 22px 20px; color: var(--adm-muted); font-size: .88rem; text-align: center; }

/* ---------- Dashboard ---------- */
.dash-hero { position: relative; overflow: hidden; display: flex; gap: 18px; padding: 22px; border-radius: var(--adm-radius); border: 1px solid var(--adm-line); background: #fff; box-shadow: var(--adm-shadow); min-height: 150px; }
.dash-hero.purple { background: linear-gradient(120deg, #fff 55%, #FEF3C7 100%); }
.dash-hero.amber { background: linear-gradient(120deg, #FFFCF5 55%, #FFF1D6 100%); }
.dash-hero-icon { width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; font-size: 1.35rem; flex-shrink: 0; }
.dash-hero h3 { font-size: 1.05rem; font-weight: 700; margin: 2px 0 2px; }
.dash-hero p { color: var(--adm-muted); font-size: .86rem; margin: 0; }
.dash-hero .big { font-size: 2.1rem; font-weight: 800; line-height: 1.1; margin-top: 12px; }
.dash-hero .big + small { color: var(--adm-muted); }
.dash-hero .art { position: absolute; right: 26px; bottom: 18px; font-size: 3.6rem; opacity: .9; }
.dash-hero .more { position: absolute; right: 18px; top: 18px; }
.dash-hero ul { list-style: none; padding: 0; margin: 10px 0 0; font-size: .86rem; max-width: 72%; }
.dash-hero li { padding: 5px 0; border-bottom: 1px dashed var(--adm-line); }
.dash-hero li:last-child { border-bottom: 0; }

.dash-section { background: #fff; border: 1px solid var(--adm-line); border-radius: var(--adm-radius); box-shadow: var(--adm-shadow); padding: 18px; }
.dash-section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.dash-section-head h3 { font-size: .95rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; margin: 0; display: flex; align-items: center; gap: 10px; }
.dash-section-head h3 i { color: var(--adm-accent); }

.dash-stat { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--adm-line); text-decoration: none; color: var(--adm-text); height: 100%; background: #fff; transition: transform .15s ease, box-shadow .15s ease; }
.dash-stat:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(16, 24, 40, .06); color: var(--adm-text); }
.dash-stat small { color: var(--adm-muted); font-size: .82rem; }
.dash-stat .n { font-size: 1.6rem; font-weight: 800; line-height: 1.1; }
.dash-stat .ic { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-size: 1.15rem; }
.dash-stat.first { border-left: 4px solid var(--adm-accent); }

.dash-value { position: relative; overflow: hidden; display: flex; gap: 16px; padding: 18px; border-radius: 12px; border: 1px solid var(--adm-line); height: 100%; }
.dash-value.blue { background: #F6F8FF; }
.dash-value.green { background: #F2FBF6; }
.dash-value .ic { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; font-size: 1.2rem; flex-shrink: 0; }
.dash-value small { color: var(--adm-muted); }
.dash-value .amt { font-size: 1.75rem; font-weight: 800; line-height: 1.2; margin-top: 4px; }
.dash-trend { font-size: .78rem; font-weight: 600; border-radius: 6px; padding: 1px 7px; margin-left: 8px; }
.dash-trend.up { color: #17803D; background: #DDF5E6; }
.dash-trend.down { color: #B42318; background: #FDE7E5; }
.dash-trend.flat { color: #4B5563; background: #F3F4F6; }
.dash-spark { position: absolute; right: 18px; bottom: 14px; opacity: .55; }

.dash-mini { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: 12px; border: 1px solid var(--adm-line); height: 100%; background: #fff; }
.dash-mini .ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.dash-mini .n { font-size: 1.4rem; font-weight: 800; line-height: 1.1; }
.dash-mini ul { list-style: none; padding: 0; margin: 6px 0 0; font-size: .82rem; }
.dash-mini li { padding: 3px 0; }

.dash-quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; }
.dash-quick a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 16px 8px; min-height: 86px;
  border: 1px solid var(--adm-line); border-radius: 12px; color: var(--adm-text); text-decoration: none; font-size: .84rem; font-weight: 500; text-align: center; background: #fff; }
.dash-quick a i { font-size: 1.3rem; color: var(--adm-accent); }
.dash-quick a:hover { border-color: #FDE68A; background: #FFFBEB; }
.dash-quick a.primary { background: linear-gradient(135deg, var(--adm-accent), var(--adm-accent-2)); color: #0D0D0D; border-color: transparent; box-shadow: 0 8px 18px rgba(245, 158, 11, .3); }
.dash-quick a.primary i { color: #0D0D0D; }

.dash-activity { list-style: none; padding: 0; margin: 0; }
.dash-activity li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid #F3F4F6; font-size: .86rem; }
.dash-activity li:last-child { border-bottom: 0; }
.dash-activity .ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--adm-accent-soft); color: var(--adm-accent); flex-shrink: 0; }
.dash-activity small { color: var(--adm-muted); display: block; }
.dash-empty { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 22px; color: var(--adm-muted); }
.dash-empty i { font-size: 2.2rem; opacity: .6; }

.soft-purple { background: var(--adm-accent-soft); color: #B45309; }
.soft-blue { background: #E7F0FF; color: #2563EB; }
.soft-teal { background: #E2F6F5; color: #13827E; }
.soft-green { background: #E3F6EA; color: #17803D; }
.soft-red { background: #FDE7E7; color: #DC2626; }
.soft-amber { background: #FFF1D6; color: #C27803; }
.soft-gray { background: #F3F4F6; color: #4B5563; }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  .adm-sidebar { transform: translateX(-100%); width: var(--adm-sidebar-w) !important; }
  body.adm-open .adm-sidebar { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .35); }
  body.adm-open::after { content: ""; position: fixed; inset: 0; background: rgba(15, 10, 30, .4); z-index: 1035; }
  body.adm-mini .adm-brand-text, body.adm-mini .adm-nav-group, body.adm-mini .adm-nav a span { display: initial; }
  .adm-main, body.adm-mini .adm-main { margin-left: 0; }
  .adm-collapse-btn { display: none; }
  .adm-menu-btn { display: block; }
  .adm-header { padding: 12px 16px; }
  .adm-user-text, .adm-kbd { display: none; }
  .admin-content { padding: 20px 16px 32px; }
  .dash-hero ul { max-width: 100%; }
  .dash-hero .art { display: none; }
}
@media print {
  .adm-sidebar, .adm-header { display: none !important; }
  .adm-main { margin-left: 0 !important; }
}

/* Bootstrap has no 7-column row helper */
@media (min-width: 1200px) { .row-cols-xl-7 > * { flex: 0 0 auto; width: 14.2857%; } }

/* ---------- Login / password pages ---------- */
body.adm-auth { min-height: 100vh; display: flex; align-items: center; background: radial-gradient(circle at 20% 10%, #262626 0%, #0D0D0D 55%, #0A0A0A 100%); }
.adm-auth .container { max-width: 430px !important; }
.adm-auth .card { border: 0; border-radius: 18px; box-shadow: 0 24px 60px rgba(0, 0, 0, .35) !important; }
.adm-auth .card-body { padding: 34px !important; }
.adm-auth-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 6px; }
.adm-auth-brand .adm-brand-mark { width: 52px; height: 52px; font-size: 1.6rem; background: linear-gradient(135deg, var(--adm-accent), var(--adm-accent-2)); color: #0D0D0D; border-radius: 14px; }
.adm-auth-brand strong { font-size: 1.25rem; font-weight: 800; color: var(--adm-text); }
.adm-auth .btn-primary { padding: 10px; }
