/* =========================================================
   SIKEREN — Design System
   Hybrid Adaptive UI: desktop dashboard + mobile app
   ========================================================= */
:root {
  --brand: #0d9488;
  --brand-dark: #0f766e;
  --brand-darker: #115e59;
  --brand-soft: #ccfbf1;
  --brand-mist: #f0fdfa;
  --indigo: #4f46e5;
  --amber: #f59e0b;
  --rose: #e11d48;
  --sky: #0284c7;
  --violet: #7c3aed;
  --pink: #db2777;
  --green: #16a34a;
  --bg: #f4f7fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --line: #e6ebf1;
  --line-strong: #d7dee8;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --radius: 16px;
  --radius-sm: 11px;
  --radius-lg: 22px;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, .07), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-md: 0 6px 18px rgba(15, 23, 42, .08);
  --shadow-lg: 0 18px 45px rgba(15, 23, 42, .16);
  --sidebar-w: 264px;
  --topbar-h: 68px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--brand-dark); text-decoration: none; }
a:hover { color: var(--brand); }
::selection { background: var(--brand-soft); color: var(--brand-darker); }
.text-muted-2 { color: var(--muted-2) !important; }
.fw-650 { font-weight: 650; }
.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }
.fs-11 { font-size: 11px; }
.fw-800 { font-weight: 800; }
.cursor-pointer { cursor: pointer; }
.min-w-0 { min-width: 0; }

/* Scrollbar */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ========================== Layout ========================== */
.app-shell { min-height: 100vh; }
.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #0b3b39 0%, #0c2f2e 55%, #0a2928 100%);
  color: #d7f4f0;
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: transform .28s cubic-bezier(.4, 0, .2, 1);
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  color: #fff;
}
.brand-logo {
  width: 42px; height: 42px; border-radius: 13px;
  background: linear-gradient(135deg, #2dd4bf, #0d9488);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px; color: #062e2c;
  box-shadow: 0 6px 16px rgba(45, 212, 191, .35);
  flex: 0 0 auto;
}
.brand-name { font-weight: 800; font-size: 16px; letter-spacing: .4px; line-height: 1.1; }
.brand-sub { font-size: 10.5px; color: #8fd3cb; letter-spacing: .3px; }
.sidebar-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 12px 20px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); }
.nav-section {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1.3px;
  color: #6fb5ac; padding: 16px 12px 7px; font-weight: 700;
}
.side-link {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 11px;
  color: #b9e7e1; font-weight: 500; font-size: 13.5px;
  margin-bottom: 2px; position: relative; transition: .16s ease;
}
.side-link i { font-size: 17px; width: 21px; text-align: center; opacity: .9; }
.side-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side-link.active {
  background: linear-gradient(100deg, rgba(45, 212, 191, .22), rgba(45, 212, 191, .08));
  color: #fff; font-weight: 650;
  box-shadow: inset 0 0 0 1px rgba(45, 212, 191, .18);
}
.side-link.active::before {
  content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px;
  width: 3.5px; border-radius: 0 4px 4px 0; background: #2dd4bf;
}
.side-link .badge-count { margin-left: auto; }
.sidebar-foot { padding: 12px 16px 18px; border-top: 1px solid rgba(255,255,255,.07); }
.sidebar-user { display: flex; align-items: center; gap: 10px; }
.sidebar-user .u-name { font-size: 13px; font-weight: 650; color: #fff; line-height: 1.2; }
.sidebar-user .u-role { font-size: 11px; color: #8fd3cb; }
.side-logout {
  width: 34px; height: 34px; border-radius: 10px; display: inline-flex;
  align-items: center; justify-content: center; color: #b9e7e1;
  background: rgba(255,255,255,.06); border: 0;
}
.side-logout:hover { background: rgba(239, 68, 68, .28); color: #fff; }

.app-main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h); position: sticky; top: 0; z-index: 1030;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px; padding: 0 22px;
}
.topbar-title { font-size: 18px; font-weight: 750; line-height: 1.15; letter-spacing: -.2px; }
.topbar-sub { font-size: 11.5px; color: var(--muted); }
.ctx-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--brand-mist); color: var(--brand-darker);
  border: 1px solid #c9f2ea; white-space: nowrap;
}
.ctx-badge i { font-size: 13px; }
.topbar-icon {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line);
  background: #fff; display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-2); position: relative; transition: .15s;
}
.topbar-icon:hover { border-color: #b7e6df; color: var(--brand-dark); background: var(--brand-mist); }
.topbar-icon .dot {
  position: absolute; top: 7px; right: 8px; width: 8px; height: 8px;
  background: var(--rose); border-radius: 50%; border: 2px solid #fff;
}
.profile-btn {
  display: flex; align-items: center; gap: 9px; border: 1px solid var(--line);
  background: #fff; border-radius: 12px; padding: 5px 10px 5px 6px;
}
.profile-btn:hover { background: var(--surface-2); }
.profile-btn .p-name { font-size: 12.5px; font-weight: 650; line-height: 1.15; }
.profile-btn .p-role { font-size: 10.5px; color: var(--muted); }

.page { padding: 22px; flex: 1; max-width: 1600px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: 21px; font-weight: 800; margin: 0; letter-spacing: -.3px; }
.page-head p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ========================== Cards ========================== */
.card-app {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-xs);
}
.card-app .card-head {
  padding: 15px 18px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.card-title { font-size: 14.5px; font-weight: 750; margin: 0; display: flex; align-items: center; gap: 8px; }
.card-title i { color: var(--brand); }
.card-sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.card-body-app { padding: 16px 18px; }

.stat-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; display: flex; gap: 13px; align-items: flex-start; box-shadow: var(--shadow-xs);
  position: relative; overflow: hidden; height: 100%;
}
.stat-card::after {
  content: ""; position: absolute; right: -22px; bottom: -26px;
  width: 92px; height: 92px; border-radius: 50%; background: var(--brand-mist); opacity: .8;
}
.stat-ico {
  width: 46px; height: 46px; border-radius: 14px; display: inline-flex; align-items: center;
  justify-content: center; font-size: 21px; flex: 0 0 auto;
}
.tone-teal { background: #ccfbf1; color: #0f766e; }
.tone-blue { background: #dbeafe; color: #1d4ed8; }
.tone-violet { background: #ede9fe; color: #6d28d9; }
.tone-amber { background: #fef3c7; color: #b45309; }
.tone-rose { background: #ffe4e6; color: #be123c; }
.tone-green { background: #dcfce7; color: #15803d; }
.tone-sky { background: #e0f2fe; color: #0369a1; }
.tone-pink { background: #fce7f3; color: #be185d; }
.tone-slate { background: #e2e8f0; color: #334155; }
.stat-label { font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.stat-value { font-size: 26px; font-weight: 800; letter-spacing: -.6px; line-height: 1.2; }
.stat-note { font-size: 11.5px; color: var(--muted); }
.stat-spark { margin-left: auto; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--brand-mist); color: var(--brand-dark); }

.hero-grad {
  position: relative; overflow: hidden; border-radius: var(--radius-lg);
  background: linear-gradient(120deg, #0f766e 0%, #0d9488 52%, #14b8a6 100%);
  color: #fff; padding: 22px 24px; box-shadow: 0 14px 30px rgba(13, 148, 136, .28);
}
.hero-grad::before, .hero-grad::after {
  content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.09);
}
.hero-grad::before { width: 220px; height: 220px; right: -60px; top: -90px; }
.hero-grad::after { width: 150px; height: 150px; right: 110px; bottom: -90px; }
.hero-grad .h-title { font-size: 19px; font-weight: 800; letter-spacing: -.3px; }
.hero-grad .h-sub { color: rgba(255,255,255,.82); font-size: 12.5px; }
.hero-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.22);
  padding: 5px 11px; border-radius: 999px; color: #fff;
}

/* ========================== Buttons ========================== */
.btn { border-radius: 10px; font-size: 13px; font-weight: 600; padding: 8px 14px; }
.btn-sm { font-size: 12px; padding: 5px 10px; border-radius: 8px; }
.btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-brand:hover, .btn-brand:focus { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-soft {
  background: var(--brand-mist); color: var(--brand-dark); border: 1px solid #c9f2ea;
}
.btn-soft:hover { background: var(--brand-soft); color: var(--brand-darker); }
.btn-icon {
  width: 34px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px;
}
.btn-white { background: #fff; border: 1px solid var(--line); color: var(--text-2); }
.btn-white:hover { background: var(--surface-2); border-color: var(--line-strong); }
.btn-ghost { background: transparent; border: 1px solid transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger-soft { background: #fff1f2; border: 1px solid #fecdd3; color: #be123c; }
.btn-danger-soft:hover { background: #ffe4e6; color: #9f1239; }
.btn-xs { font-size: 11px; padding: 4px 8px; border-radius: 7px; }

/* ========================== Forms ========================== */
.form-label { font-size: 12px; font-weight: 650; color: var(--text-2); margin-bottom: 5px; }
.form-control, .form-select {
  border-radius: 10px; border-color: var(--line-strong); font-size: 13px; padding: 8px 12px;
  color: var(--text); background-color: #fff;
}
.form-control:focus, .form-select:focus {
  border-color: #5eead4; box-shadow: 0 0 0 3.5px rgba(13, 148, 136, .12);
}
.form-control-sm, .form-select-sm { font-size: 12.5px; padding: 5px 10px; border-radius: 9px; }
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted-2); font-size: 14px; }
.input-icon > .form-control { padding-left: 34px; }
.form-hint { font-size: 11px; color: var(--muted); margin-top: 4px; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-switch .form-check-input:focus { box-shadow: 0 0 0 3px rgba(13,148,136,.12); }
.required::after { content: " *"; color: var(--rose); }

/* Select2 (Bootstrap 5 theme) */
.select2-container--bootstrap-5 .select2-selection {
  border-radius: 10px; border-color: var(--line-strong); font-size: 13px; color: var(--text);
}
.select2-container--bootstrap-5 .select2-selection--single { min-height: 38px; padding: 7px 10px; }
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered { padding: 0; line-height: 1.4; color: var(--text); }
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow { height: 100%; right: 6px; }
.select2-container--bootstrap-5.select2-container--focus .select2-selection,
.select2-container--bootstrap-5.select2-container--open .select2-selection {
  border-color: #5eead4; box-shadow: 0 0 0 3.5px rgba(13, 148, 136, .12);
}
.select2-container--bootstrap-5 .select2-dropdown { border-color: var(--line-strong); border-radius: 10px; font-size: 13px; }
.select2-container--bootstrap-5 .select2-results__option--highlighted { background: var(--brand); }
.offcanvas .select2-container--open, .modal .select2-container--open { z-index: 2000; }

/* ========================== Tables ========================== */
.table-wrap { overflow-x: auto; }
.table-app { width: 100%; margin: 0; font-size: 13px; border-collapse: separate; border-spacing: 0; }
.table-app thead th {
  background: var(--surface-2); color: var(--muted); font-size: 10.5px; font-weight: 750;
  text-transform: uppercase; letter-spacing: .55px; padding: 10px 14px;
  border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; z-index: 2;
}
.table-app tbody td { padding: 10px 14px; border-bottom: 1px solid #eef2f6; vertical-align: middle; }
.table-app tbody tr:last-child td { border-bottom: 0; }
.table-app tbody tr:hover { background: #fbfdfe; }
.table-app .td-strong { font-weight: 650; }
.row-click { cursor: pointer; }
.avatar-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar-cell .ac-name { font-weight: 650; font-size: 13px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar-cell .ac-sub { font-size: 11px; color: var(--muted); }
.avatar-img, .avatar-init { border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.avatar-init { color: #fff; font-weight: 750; letter-spacing: .3px; }
.avatar-img { border: 1.5px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.avatar-square.avatar-img, .avatar-square.avatar-init { border-radius: 12px; }

/* Mobile list cards */
.m-list { display: flex; flex-direction: column; gap: 10px; }
.m-item {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 13px;
  display: flex; gap: 11px; align-items: flex-start; box-shadow: var(--shadow-xs);
}
.m-item .mi-main { flex: 1; min-width: 0; }
.m-item .mi-title { font-weight: 700; font-size: 13.5px; line-height: 1.25; }
.m-item .mi-sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.m-item .mi-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }

/* ========================== Badges & chips ========================== */
.badge { font-weight: 650; font-size: 10.5px; padding: 4px 8px; border-radius: 6px; letter-spacing: .2px; }
.badge-soft-success { background: #dcfce7; color: #15803d; }
.badge-soft-warning { background: #fef3c7; color: #b45309; }
.badge-soft-danger { background: #ffe4e6; color: #be123c; }
.badge-soft-info { background: #e0f2fe; color: #0369a1; }
.badge-soft-primary { background: #dbeafe; color: #1d4ed8; }
.badge-soft-purple { background: #ede9fe; color: #6d28d9; }
.badge-soft-pink { background: #fce7f3; color: #be185d; }
.badge-soft-secondary { background: #eef2f6; color: #475569; }
.badge-soft-teal { background: #ccfbf1; color: #0f766e; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600;
  padding: 4px 9px; border-radius: 999px; background: var(--surface-2);
  border: 1px solid var(--line); color: var(--text-2); white-space: nowrap;
}
.chip-teal { background: var(--brand-mist); border-color: #c9f2ea; color: var(--brand-dark); }
.dot-status { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }

/* Segmented control */
.seg { display: inline-flex; background: #eef2f6; border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg .seg-btn {
  border: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 650;
  padding: 6px 12px; border-radius: 8px; transition: .15s;
}
.seg .seg-btn.active { background: #fff; color: var(--brand-dark); box-shadow: var(--shadow-sm); }
.seg .seg-btn .cnt { font-size: 10px; opacity: .7; margin-left: 3px; }

/* Filter bar */
.filter-bar {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end;
  padding: 12px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line);
}
.filter-bar .f-item { min-width: 130px; }
.filter-bar .f-item.grow { flex: 1; min-width: 180px; }

/* Tabs (bootstrap pill restyle) */
.nav-pills-app { gap: 4px; border-bottom: 1px solid var(--line); padding: 0 14px; flex-wrap: nowrap; overflow-x: auto; }
.nav-pills-app .nav-link {
  border-radius: 0; color: var(--muted); font-size: 12.5px; font-weight: 650;
  padding: 12px 12px; border-bottom: 2px solid transparent; white-space: nowrap;
}
.nav-pills-app .nav-link:hover { color: var(--brand-dark); }
.nav-pills-app .nav-link.active { color: var(--brand-dark); background: transparent; border-bottom-color: var(--brand); }

/* ========================== Charts ========================== */
.mini-bar { height: 6px; border-radius: 99px; background: #eef2f6; overflow: hidden; }
.mini-bar > span { display: block; height: 100%; border-radius: 99px; background: var(--brand); transition: width .5s ease; }
.stacked-bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: #eef2f6; }
.stacked-bar > span { height: 100%; }
.trend-chart { display: flex; align-items: flex-end; gap: 8px; height: 130px; padding-top: 8px; }
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.trend-col .bar {
  width: 100%; max-width: 34px; border-radius: 7px 7px 4px 4px;
  background: linear-gradient(180deg, #2dd4bf, #0d9488); min-height: 4px; position: relative;
  transition: height .45s ease;
}
.trend-col .bar:hover { filter: brightness(1.08); }
.trend-col .lbl { font-size: 10px; color: var(--muted); font-weight: 600; }
.donut {
  width: 108px; height: 108px; border-radius: 50%; display: grid; place-items: center;
  flex: 0 0 auto; position: relative;
}
.donut::after { content: ""; position: absolute; inset: 13px; background: #fff; border-radius: 50%; }
.donut .donut-val { position: relative; z-index: 1; font-weight: 800; font-size: 19px; color: var(--text); }
.donut .donut-lbl { position: relative; z-index: 1; font-size: 9px; color: var(--muted); margin-top: -2px; }

/* Legend */
.legend { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-2); }
.legend-item .sw { width: 9px; height: 9px; border-radius: 3px; }

/* ========================== Mobile app chrome ========================== */
.mobile-topbar { display: none; }
.bottom-nav { display: none; }
.fab { display: none; }
.mobile-page-title { display: none; }

@media (max-width: 991.98px) {
  .app-sidebar { transform: translateX(-100%); width: 280px; box-shadow: var(--shadow-lg); }
  .app-sidebar.show { transform: translateX(0); }
  .app-main { margin-left: 0; }
  .topbar { display: none; }
  .page { padding: 14px 14px 108px; }
  .page-head h1 { font-size: 19px; }
  .desktop-only { display: none !important; }

  .mobile-topbar {
    display: flex; align-items: center; gap: 10px; padding: 12px 14px 10px;
    background: rgba(255,255,255,.94); backdrop-filter: blur(12px);
    position: sticky; top: 0; z-index: 1020; border-bottom: 1px solid var(--line);
  }
  .mobile-topbar .mt-brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
  .mobile-topbar .mt-logo { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg,#2dd4bf,#0d9488); color: #04302e; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; }
  .mobile-topbar .mt-title { font-size: 14px; font-weight: 800; line-height: 1.1; }
  .mobile-topbar .mt-sub { font-size: 10px; color: var(--muted); }
  .mobile-topbar .mt-btn { width: 38px; height: 38px; border-radius: 11px; background: #fff; border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); position: relative; }
  .mobile-topbar .mt-btn .dot { position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--rose); border: 2px solid #fff; }

  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1035;
    background: rgba(255,255,255,.96); backdrop-filter: blur(14px);
    border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -6px 22px rgba(15,23,42,.06);
  }
  .bn-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 6px 2px; color: var(--muted); font-size: 9.5px; font-weight: 650; border-radius: 10px;
  }
  .bn-item i { font-size: 20px; }
  .bn-item.active { color: var(--brand-dark); }
  .bn-item.active i { transform: translateY(-1px); }
  .bn-item .bn-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--brand); opacity: 0; }
  .bn-item.active .bn-dot { opacity: 1; }
  .bn-fab-space { width: 58px; flex: 0 0 58px; }

  .fab {
    display: inline-flex; position: fixed; right: 18px; z-index: 1036;
    bottom: calc(78px + env(safe-area-inset-bottom));
    width: 54px; height: 54px; border-radius: 18px; border: 0; color: #fff;
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    align-items: center; justify-content: center; font-size: 23px;
    box-shadow: 0 12px 24px rgba(13, 148, 136, .38);
  }
  .fab:active { transform: scale(.95); }

  .hide-mobile { display: none !important; }
  .filter-bar { padding: 10px 12px; }
  .filter-bar .f-item { min-width: calc(50% - 4px); flex: 1; }
  .filter-bar .f-item.grow { min-width: 100%; }
  .card-head { padding: 13px 14px; }
  .card-body-app { padding: 14px; }
  .stat-value { font-size: 22px; }
  .stat-card { padding: 13px; gap: 10px; }
  .stat-ico { width: 40px; height: 40px; font-size: 18px; border-radius: 12px; }
  .hero-grad { padding: 18px; }
  .hero-grad .h-title { font-size: 17px; }
  .modal-dialog { margin: 0; align-items: flex-end; min-height: 100%; }
  .modal-content { border-radius: 20px 20px 0 0 !important; border: 0; }
  .offcanvas-end { border-radius: 20px 20px 0 0 !important; height: 88vh !important; top: auto !important; }
  .sheet-bottom { height: 91vh !important; }
  .modal-dialog-scrollable .modal-content { max-height: 92vh; }
  .page-head .page-actions { width: 100%; }
  .page-head .page-actions .btn { flex: 1; }
}

@media (min-width: 992px) {
  .mobile-only { display: none !important; }
  .offcanvas-lg.offcanvas { position: static; transform: none; visibility: visible; }
}

/* ========================== Sheets / modals ========================== */
.modal-content, .offcanvas { border: 0; box-shadow: var(--shadow-lg); }
.modal-header, .offcanvas-header { border-bottom: 1px solid var(--line); padding: 15px 18px; }
.modal-title, .offcanvas-title { font-size: 15px; font-weight: 750; }
.modal-body { padding: 18px; }
.modal-footer { border-top: 1px solid var(--line); padding: 12px 18px; }
.offcanvas { border-radius: 0; }
.sheet-handle { width: 42px; height: 4px; border-radius: 99px; background: #dbe3ec; margin: 8px auto 0; }
@media (max-width: 991.98px) { .sheet-handle { display: block !important; } }

/* ========================== Toast ========================== */
.toast-stack { position: fixed; top: 78px; right: 18px; z-index: 1090; display: flex; flex-direction: column; gap: 8px; max-width: 360px; }
@media (max-width: 991.98px) { .toast-stack { top: auto; bottom: 100px; left: 14px; right: 14px; max-width: none; align-items: stretch; } }
.toast-app {
  display: flex; gap: 10px; align-items: flex-start; background: #0f172a; color: #fff;
  border-radius: 13px; padding: 12px 14px; box-shadow: var(--shadow-lg); font-size: 12.5px;
  animation: toastIn .25s ease; border-left: 3px solid var(--brand);
}
.toast-app.t-success { border-left-color: #34d399; }
.toast-app.t-error { border-left-color: #fb7185; }
.toast-app.t-warning { border-left-color: #fbbf24; }
.toast-app .t-ico { font-size: 15px; margin-top: 1px; }
.toast-app .t-close { margin-left: auto; background: transparent; border: 0; color: rgba(255,255,255,.7); font-size: 15px; padding: 0 2px; }
.toast-app .t-title { font-weight: 700; font-size: 12px; }
.toast-app .t-msg { color: rgba(255,255,255,.82); font-size: 11.5px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ========================== Login ========================== */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.login-hero {
  background: linear-gradient(150deg, #062f2d 0%, #0f766e 58%, #0d9488 100%);
  color: #fff; padding: 46px 52px; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.login-hero::before { content: ""; position: absolute; width: 480px; height: 480px; border-radius: 50%; background: rgba(255,255,255,.06); right: -160px; top: -150px; }
.login-hero::after { content: ""; position: absolute; width: 280px; height: 280px; border-radius: 50%; background: rgba(45,212,191,.14); left: -80px; bottom: -120px; }
.login-hero .lh-inner { position: relative; z-index: 2; }
.login-hero h1 { font-size: 30px; font-weight: 800; letter-spacing: -.6px; line-height: 1.22; max-width: 440px; }
.login-hero p { color: rgba(255,255,255,.8); font-size: 13.5px; max-width: 420px; }
.hero-feature { display: flex; gap: 12px; align-items: flex-start; margin-top: 18px; }
.hero-feature .hf-ico { width: 38px; height: 38px; border-radius: 11px; background: rgba(255,255,255,.13); display: inline-flex; align-items: center; justify-content: center; font-size: 17px; color: #99f6e4; flex: 0 0 auto; }
.hero-feature .hf-t { font-weight: 650; font-size: 13px; }
.hero-feature .hf-s { color: rgba(255,255,255,.66); font-size: 11.5px; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 30px 24px; background: #fff; }
.login-card { width: 100%; max-width: 390px; }
.login-card .brand-logo { width: 54px; height: 54px; border-radius: 16px; font-size: 19px; }
.login-card h2 { font-size: 23px; font-weight: 800; letter-spacing: -.4px; margin: 18px 0 4px; }
.login-card .lc-sub { color: var(--muted); font-size: 12.5px; margin-bottom: 22px; }
.demo-accounts { background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: 12px; padding: 11px 13px; font-size: 11px; color: var(--muted); margin-top: 18px; }
.demo-accounts code { color: var(--brand-dark); font-size: 10.5px; }
@media (max-width: 991.98px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .login-panel { padding: 28px 22px; background: linear-gradient(180deg, #f0fdfa, #fff 240px); align-items: flex-start; padding-top: 46px; }
}

/* ========================== Scan / camera ========================== */
.scan-stage {
  position: relative; border-radius: 18px; overflow: hidden; background: #08110f;
  aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center;
}
.scan-stage video, .scan-stage canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-stage #qr-reader { width: 100%; border: 0 !important; }
.scan-stage #qr-reader video { object-fit: cover; }
.scan-overlay {
  position: absolute; inset: 0; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
}
.scan-frame { width: 58%; aspect-ratio: 1; border-radius: 18px; position: relative; box-shadow: 0 0 0 2000px rgba(3, 12, 10, .45); }
.scan-frame::before, .scan-frame::after { content: ""; position: absolute; width: 26px; height: 26px; border: 3px solid #2dd4bf; }
.scan-frame::before { left: -2px; top: -2px; border-right: 0; border-bottom: 0; border-radius: 12px 0 0 0; }
.scan-frame::after { right: -2px; bottom: -2px; border-left: 0; border-top: 0; border-radius: 0 0 12px 0; }
.scan-laser { position: absolute; left: 8%; right: 8%; height: 2px; background: rgba(45,212,191,.85); box-shadow: 0 0 12px rgba(45,212,191,.9); animation: laser 2.2s ease-in-out infinite; }
@keyframes laser { 0%, 100% { top: 18%; } 50% { top: 82%; } }
.scan-placeholder { color: #94a3b8; text-align: center; padding: 26px; }
.scan-placeholder i { font-size: 40px; opacity: .5; }
.scan-badge { position: absolute; top: 12px; left: 12px; z-index: 3; display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 650; color: #ecfdf5; background: rgba(6, 45, 42, .7); border: 1px solid rgba(45,212,191,.35); padding: 5px 10px; border-radius: 999px; backdrop-filter: blur(6px); }
.scan-controls { position: absolute; bottom: 12px; left: 0; right: 0; z-index: 3; display: flex; justify-content: center; gap: 10px; }
.cam-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 0; color: #fff;
  background: rgba(15, 23, 42, .55); backdrop-filter: blur(6px);
  display: inline-flex; align-items: center; justify-content: center; font-size: 18px;
}
.cam-btn:hover { background: rgba(15, 23, 42, .75); }
.cam-btn.primary { width: 58px; height: 58px; background: #0d9488; font-size: 23px; box-shadow: 0 8px 20px rgba(13,148,136,.5); }
.scan-result { position: absolute; left: 12px; right: 12px; bottom: 68px; z-index: 4; }
.scan-hit {
  display: flex; align-items: center; gap: 11px; border-radius: 14px; padding: 10px 12px;
  background: rgba(255,255,255,.97); box-shadow: var(--shadow-lg); animation: hitIn .25s ease;
}
@keyframes hitIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.scan-hit .hit-name { font-weight: 750; font-size: 14px; line-height: 1.2; }
.scan-hit .hit-sub { font-size: 11px; color: var(--muted); }
.face-roster { display: flex; gap: 6px; flex-wrap: wrap; }
.face-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; padding: 3px 7px; background: var(--surface-2); border-radius: 999px; border: 1px solid var(--line); }
.face-enroll-video { width: 100%; aspect-ratio: 4/3; border-radius: 14px; background: #0b1220; object-fit: cover; }

/* ========================== ID Card ========================== */
.id-card {
  width: 340px; border-radius: 18px; overflow: hidden; background: #fff;
  box-shadow: var(--shadow-md); border: 1px solid var(--line); position: relative;
  font-family: var(--font);
}
.id-card .idc-top {
  background: linear-gradient(120deg, #0f766e, #0d9488 60%, #14b8a6);
  color: #fff; padding: 14px 16px; position: relative; overflow: hidden;
}
.id-card .idc-top::after { content: ""; position: absolute; width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.1); right: -40px; top: -50px; }
.idc-school { font-size: 10px; font-weight: 700; letter-spacing: .3px; opacity: .95; }
.idc-app { font-size: 8.5px; opacity: .7; }
.idc-body { padding: 14px 16px 10px; display: flex; gap: 12px; }
.idc-photo { width: 76px; height: 94px; border-radius: 10px; object-fit: cover; background: #e2e8f0; flex: 0 0 auto; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.idc-photo-init { width: 76px; height: 94px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 24px; flex: 0 0 auto; }
.idc-info { min-width: 0; flex: 1; }
.idc-name { font-size: 14.5px; font-weight: 800; line-height: 1.2; color: var(--text); }
.idc-nis { font-size: 10.5px; color: var(--muted); margin-bottom: 6px; }
.idc-row { display: flex; justify-content: space-between; gap: 8px; font-size: 9.5px; color: var(--text-2); padding: 1.5px 0; }
.idc-row span:first-child { color: var(--muted); }
.idc-row span:last-child { font-weight: 650; text-align: right; }
.idc-qr { text-align: center; padding: 0 16px 12px; }
.idc-qr img { width: 74px; height: 74px; border-radius: 6px; }
.idc-qr .qr-note { font-size: 8px; color: var(--muted); letter-spacing: .4px; text-transform: uppercase; margin-top: 2px; }
.idc-foot { background: var(--surface-2); border-top: 1px dashed var(--line-strong); padding: 7px 16px; font-size: 8px; color: var(--muted); text-align: center; }
.id-card.back .idc-body { display: block; }
.id-back-line { font-size: 9px; color: var(--text-2); display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px dotted #e2e8f0; }
.id-back-title { font-size: 10px; font-weight: 800; color: var(--brand-dark); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.id-card-list { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
.id-card { width: 360px; }
.idc-brand { display: flex; align-items: center; gap: 9px; position: relative; z-index: 1; }
.idc-logo {
  width: 30px; height: 30px; border-radius: 9px; flex: 0 0 auto;
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.28);
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.idc-brand-text { min-width: 0; }
.idc-school { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 265px; }
.idc-body { align-items: flex-start; }
.idc-photo, .idc-photo-init { width: 80px; height: 100px; }
.idc-row small { color: var(--muted); }
.idc-qr-side { width: 62px; flex: 0 0 auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.idc-qr-side img { width: 54px; height: 54px; border-radius: 5px; background: #fff; padding: 2px; border: 1px solid #e2e8f0; }
.idc-qr-side .qr-cap { font-size: 7px; text-transform: uppercase; letter-spacing: .35px; color: var(--muted); line-height: 1.25; }
.id-card.back .idc-body { display: flex; gap: 12px; }
.id-back-col { flex: 1; min-width: 0; }
.id-back-title { font-size: 9.5px; font-weight: 800; color: var(--brand-dark); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.id-back-note { font-size: 8px; color: var(--muted); line-height: 1.45; }
.id-back-child { display: flex; justify-content: space-between; gap: 6px; font-size: 9px; padding: 2.5px 0; border-bottom: 1px dotted #e2e8f0; }
.id-back-child:last-child { border-bottom: 0; }
.id-back-child b { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.id-back-child span { color: var(--muted); white-space: nowrap; }

/* kartu picker */
.kartu-list-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  border: 0; border-bottom: 1px solid #eef2f6; background: transparent; padding: 10px 14px; cursor: pointer;
}
.kartu-list-item:last-child { border-bottom: 0; }
.kartu-list-item:hover { background: #f8fafc; }
.kartu-list-item.active { background: var(--brand-mist); box-shadow: inset 3px 0 0 var(--brand); }
.kartu-li-main { min-width: 0; flex: 1; }
.kartu-li-name { font-weight: 650; font-size: 12.5px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kartu-li-sub { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kartu-li-go { color: var(--muted-2); font-size: 12px; flex: 0 0 auto; }
.kartu-preview-pair { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; align-items: flex-start; }
.kartu-preview-col { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.kartu-preview-label { font-size: 9.5px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted-2); font-weight: 750; }
.kartu-progress { font-size: 11.5px; color: var(--muted); }
@media (max-width: 420px) {
  .id-card { width: 100%; max-width: 360px; }
}

/* ========================== Laporan print ========================== */
.lap-print-area { display: none; }
.lap-doc { font-family: "Times New Roman", Georgia, serif; color: #111827; padding: 6mm 2mm; }
.lap-doc-kop { text-align: center; border-bottom: 3px double #111827; padding-bottom: 8px; margin-bottom: 12px; }
.lap-doc-kop .instansi { font-size: 16px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; }
.lap-doc-kop .alamat { font-size: 10.5px; color: #4b5563; margin-top: 2px; }
.lap-doc-title { text-align: center; margin: 6px 0 2px; }
.lap-doc-title h1 { font-size: 15px; margin: 0; text-transform: uppercase; letter-spacing: .8px; }
.lap-doc-meta { text-align: center; font-size: 11px; color: #374151; margin-bottom: 10px; }
.lap-doc-note { font-size: 10.5px; margin: 8px 0 10px; }
.lap-doc table { width: 100%; border-collapse: collapse; font-size: 10px; }
.lap-doc th, .lap-doc td { border: 1px solid #9ca3af; padding: 4px 5px; text-align: left; vertical-align: top; }
.lap-doc th { background: #f3f4f6; font-size: 9px; text-transform: uppercase; letter-spacing: .2px; }
.lap-doc tbody tr:nth-child(even) td { background: #fafafa; }
.lap-doc-foot { margin-top: 12px; font-size: 10px; color: #4b5563; display: flex; justify-content: space-between; }

/* ========================== Misc ========================== */
.empty-state { text-align: center; padding: 38px 18px; color: var(--muted); }
.empty-state .es-ico { width: 62px; height: 62px; border-radius: 20px; background: var(--brand-mist); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-size: 26px; margin-bottom: 10px; }
.empty-state .es-title { font-weight: 700; color: var(--text-2); font-size: 13.5px; }
.empty-state .es-sub { font-size: 11.5px; margin-top: 2px; }
.skeleton { background: linear-gradient(90deg, #eef2f6 25%, #f6f9fc 37%, #eef2f6 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: 8px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.loading-row { display: flex; justify-content: center; padding: 34px; color: var(--muted); }
.spinner-app { width: 22px; height: 22px; border: 2.5px solid #d9f2ee; border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.alert-soft { border: 0; border-radius: 12px; font-size: 12px; padding: 10px 13px; }
.alert-soft.alert-warning { background: #fffbeb; color: #92400e; }
.alert-soft.alert-danger { background: #fff1f2; color: #9f1239; }
.alert-soft.alert-info { background: #eff6ff; color: #1e40af; }
.alert-soft.alert-success { background: #f0fdf4; color: #166534; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 12.5px; border-bottom: 1px dashed #eef2f6; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--muted); flex: 0 0 40%; }
.kv .v { font-weight: 650; text-align: right; }
.section-label { font-size: 10px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted-2); font-weight: 750; margin-bottom: 8px; }
.nav-scroll-x { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.nav-scroll-x::-webkit-scrollbar { height: 0; }
.notif-item { display: flex; gap: 11px; padding: 12px 14px; border-bottom: 1px solid #eef2f6; position: relative; }
.notif-item.unread { background: #f8fffd; }
.notif-item .n-ico { width: 36px; height: 36px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; font-size: 15px; }
.notif-item .n-title { font-size: 12.5px; font-weight: 700; line-height: 1.25; }
.notif-item .n-msg { font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.notif-item .n-time { font-size: 10px; color: var(--muted-2); margin-top: 2px; }
.notif-item .n-del { position: absolute; top: 10px; right: 10px; }
.perm-avatar { width: 44px; height: 44px; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700; padding: 4px 9px; border-radius: 99px; }
.list-group-app .list-group-item { border-color: #eef2f6; padding: 11px 14px; font-size: 12.5px; }
.camera-permission { background: #fffbeb; border: 1px solid #fde68a; border-radius: 12px; padding: 10px 12px; font-size: 11.5px; color: #92400e; }
.pwa-install { display: none; }
.gate-result { border-radius: 16px; padding: 16px; background: var(--surface-2); border: 1px dashed var(--line-strong); }
.progress-thin { height: 5px; border-radius: 99px; background: #eef2f6; }
.progress-thin .progress-bar { border-radius: 99px; }
.progress-app { height: 4px; border-radius: 99px; background: #eef2f6; margin-top: 5px; overflow: hidden; }
.progress-app span { display: block; height: 100%; border-radius: 99px; background: var(--brand); }
.table-actions { display: flex; gap: 4px; justify-content: flex-end; }
.row-selected { background: #f0fdfa !important; }
.check-cell { width: 36px; }
.abs-status-select { min-width: 106px; font-size: 11.5px; padding: 4px 8px; border-radius: 8px; }
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quick-tile { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 8px; text-align: center; font-size: 11px; font-weight: 650; color: var(--text-2); transition: .15s; }
.quick-tile i { display: block; font-size: 21px; color: var(--brand); margin-bottom: 5px; }
.quick-tile:hover { border-color: #b7e6df; background: var(--brand-mist); color: var(--brand-darker); }
@media (max-width: 575.98px) { .quick-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; } .quick-tile { padding: 11px 4px; font-size: 10px; } }

/* Approval flow & QR panel */
.approval-flow { display: flex; flex-direction: column; }
.approval-step { position: relative; padding: 0 0 16px 30px; }
.approval-step::before { content: ""; position: absolute; left: 9px; top: 8px; bottom: -2px; width: 2px; background: #e2e8f0; }
.approval-step:last-child { padding-bottom: 2px; }
.approval-step:last-child::before { display: none; }
.approval-step .ap-dot {
  position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 50%;
  background: #eef2f6; color: #94a3b8; display: flex; align-items: center; justify-content: center; font-size: 11px;
}
.approval-step.done .ap-dot { background: #dcfce7; color: #15803d; }
.approval-step.current .ap-dot { background: #fef3c7; color: #b45309; }
.approval-step.reject .ap-dot { background: #ffe4e6; color: #be123c; }
.approval-step .ap-title { font-size: 12.5px; font-weight: 700; line-height: 1.3; }
.approval-step .ap-meta { font-size: 11px; color: var(--muted); }
.list-group-app .ap-dot {
  width: 22px; height: 22px; border-radius: 50%; background: #dcfce7; color: #15803d;
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px;
}
.qr-panel {
  background: var(--surface-2); border: 1px dashed var(--line-strong);
  border-radius: 14px; padding: 14px; text-align: center;
}
.qr-panel img { width: 150px; height: 150px; background: #fff; border-radius: 10px; padding: 6px; border: 1px solid var(--line); }

/* Print */
@media print {
  .app-sidebar, .topbar, .mobile-topbar, .bottom-nav, .fab, .no-print, .toast-stack { display: none !important; }
  .app-main { margin: 0 !important; }
  .page { padding: 0 !important; max-width: none; }
  body { background: #fff; }
  .card-app { box-shadow: none; border: 0; }
  .lap-screen { display: none !important; }
  .lap-print-area { display: block !important; }
}
