/* =====================================================
   GLOBAL THEME — SISTEM KEHADIRAN WISUDA & QR UNDANGAN
   Prinsip warna 60-30-10:
   60% background soft/white, 30% navy/blue, 10% teal/gold
===================================================== */

/* =====================================================
   LOCAL FONTS
===================================================== */

@font-face {
    font-family: 'Poppins';
    src: url('../fonts/poppins/Poppins-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Poppins';
    src: url('../fonts/poppins/Poppins-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Poppins';
    src: url('../fonts/poppins/Poppins-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Poppins';
    src: url('../fonts/poppins/Poppins-ExtraBold.ttf') format('truetype');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Roboto';
    src: url('../fonts/roboto/Roboto-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Roboto';
    src: url('../fonts/roboto/Roboto-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Roboto';
    src: url('../fonts/roboto/Roboto-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
  --primary: #1E3A5F;
  --primary-dark: #162B45;
  --primary-deep: #0F1F33;
  --primary-soft: rgba(30, 58, 95, 0.10);

  --secondary: #2563EB;
  --secondary-dark: #1D4ED8;
  --secondary-soft: rgba(37, 99, 235, 0.10);

  --accent: #0F766E;
  --accent-dark: #115E59;
  --accent-soft: rgba(15, 118, 110, 0.12);

  --gold: #F59E0B;
  --gold-dark: #D97706;
  --gold-soft: rgba(245, 158, 11, 0.14);

  --bg-main: #F3F6FA;
  --bg-soft: #F8FAFC;
  --bg-card: #FFFFFF;
  --white: #FFFFFF;

  --text-main: #1F2937;
  --text-muted: #64748B;
  --text-soft: #94A3B8;
  --text: var(--text-main);
  --muted: var(--text-muted);
  --font-heading: 'Poppins', sans-serif;

  --border: #E2E8F0;
  --border-dark: #CBD5E1;

  --success: #16A34A;
  --success-dark: #15803D;
  --warning: #F59E0B;
  --warning-dark: #D97706;
  --danger: #DC2626;
  --danger-dark: #B91C1C;
  --info: #2563EB;
  --manual: #7C3AED;
  --gray: #64748B;

  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 6px 16px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 14px 28px rgba(15, 23, 42, 0.12);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;

  --transition: all 0.25s ease;
}

* {
  box-sizing: border-box;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg-main);
  color: var(--text-main);
  font-family: 'Roboto', sans-serif;
  line-height: 1.6;
}

body.no-scroll {
  overflow: hidden;
}

a,
button,
h1,
h2,
h3,
h4,
h5,
h6,
.sidebar,
.menu,
.btn,
.badge,
.status-badge {
  font-family: 'Poppins', sans-serif;
}

a {
  color: var(--secondary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--accent-dark);
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  opacity: .65;
  cursor: not-allowed;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 2px;
}

/* =====================================================
   KEYFRAMES
===================================================== */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(22px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shineBright {
  from {
    transform: rotate(25deg) translateX(-20%);
  }

  to {
    transform: rotate(25deg) translateX(20%);
  }
}

@keyframes scanLine {
  from {
    top: 18px;
    opacity: .35;
  }

  to {
    top: calc(100% - 22px);
    opacity: .8;
  }
}

/* =====================================================
   LAYOUT APP
   Catatan:
   - .content-grid dipertahankan untuk Blade lama.
   - .col-* custom hanya berlaku di dalam .content-grid.
   - Bootstrap .row > .col-* tetap aman.
===================================================== */

.app-shell {
  min-height: 100vh;
}

.content {
  min-height: 100vh;
  margin-left: 270px;
  padding: 26px 30px;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 28%),
    var(--bg-main);
  transition: var(--transition);
}

/* Legacy grid lama. Blade baru nanti pakai Bootstrap row/col. */
.content-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
}

/* Bootstrap bridge */
.row,
.row > * {
  min-width: 0;
}

.content .row {
  --bs-gutter-x: 1rem;
  --bs-gutter-y: 1rem;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.page-actions-between {
  justify-content: space-between;
}

.page-actions-center {
  justify-content: center;
  margin-bottom: 0;
}

.page-actions-compact {
  margin-bottom: 0;
}

.filter-actions {
  align-items: center;
}

.filter-select-lg {
  max-width: 280px;
}

.filter-select-md {
  max-width: 230px;
}

.filter-select-sm {
  max-width: 180px;
}

/* =====================================================
   SIDEBAR
===================================================== */

.sidebar {
  width: 270px;
  min-height: 100vh;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 999;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px 0;
  color: var(--white);
  background: linear-gradient(180deg, var(--primary), var(--primary-dark) 58%, var(--primary-deep));
  box-shadow: 3px 0 18px rgba(15, 23, 42, 0.18);
  overflow-y: auto;
  transition: transform .28s ease, box-shadow .28s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px 18px;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.brand-icon {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 46px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .14);
  color: var(--white);
}

.brand-icon svg {
  width: 25px;
  height: 25px;
}

.sidebar-brand h5 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
}

.sidebar-brand span {
  display: block;
  font-size: .78rem;
  color: rgba(255, 255, 255, .72);
}

.menu-section {
  margin: 20px 18px 6px;
  color: rgba(186, 230, 253, .86);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
}

.menu a,
.menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: calc(100% - 28px);
  margin: 4px 14px;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: rgba(248, 250, 252, .92);
  font-size: .88rem;
  font-weight: 600;
  text-align: left;
  transition: var(--transition);
}

.menu a svg,
.menu button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.menu a:hover,
.menu a.active,
.menu button:hover {
  background: rgba(37, 99, 235, .24);
  color: var(--white);
  transform: translateX(4px);
  box-shadow: inset 3px 0 0 #38BDF8;
}

.sidebar-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 18px 14px 0;
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, .10);
  color: rgba(255, 255, 255, .78);
  font-size: .78rem;
}

.sidebar-footer strong {
  color: var(--white);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 998;
  background: rgba(15, 23, 42, .45);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

.logout-form {
  margin: 0;
}

.menu-logout {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 12px;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.menu-logout:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* =====================================================
   TOPBAR
===================================================== */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  margin-bottom: 20px;
  border-bottom: 1.5px solid transparent;
  border-image: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent), var(--gold));
  border-image-slice: 1;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar h1 {
  margin: 0;
  color: var(--text-main);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.25;
}

.topbar p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: .92rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.event-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--white);
  color: var(--text-muted);
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
}

.event-chip svg {
  width: 15px;
  height: 15px;
}

.event-chip-live {
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-color: rgba(15, 118, 110, .18);
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--white);
  box-shadow: var(--shadow-md);
}

.menu-toggle svg {
  width: 20px;
  height: 20px;
}

/* =====================================================
   CARD & BUTTON DASAR
   KPI dipusatkan pada FIX UI 5 agar tidak didefinisikan dua kali.
===================================================== */

.card {
  border: 1px solid rgba(226, 232, 240, .9);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-md);
  padding: 20px;
  color: var(--text-main);
}

.card-hover {
  transition: var(--transition);
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-title {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 700;
}

.card-subtitle {
  margin: -4px 0 14px;
  color: var(--text-muted);
  font-size: .88rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 15px;
  border: 0;
  border-radius: var(--radius-md);
  font-size: .88rem;
  font-weight: 700;
  line-height: 1;
  transition: var(--transition);
  text-decoration: none;
}

.btn svg {
  width: 17px;
  height: 17px;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--white);
}

.btn-primary:hover {
  color: var(--white);
  background: linear-gradient(135deg, var(--primary-dark), var(--secondary-dark));
}

.btn-secondary {
  background: #E2E8F0;
  color: #334155;
}

.btn-secondary:hover {
  color: #0F172A;
  background: #CBD5E1;
}

.btn-success {
  background: var(--accent);
  color: var(--white);
}

.btn-warning {
  background: var(--gold);
  color: var(--white);
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
}

.btn-ghost {
  background: transparent;
  color: var(--secondary);
  border: 1px solid var(--border);
}

.btn-sm {
  min-height: 32px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: .76rem;
}

.btn.disabled,
.btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  pointer-events: none;
}

/* =====================================================
   FORM — KOMPONEN TAMBAHAN
   Form utama dipusatkan pada FIX UI 6.
===================================================== */

.form-section-title svg {
  width: 19px;
  height: 19px;
}

.radio-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.radio-card {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  cursor: pointer;
  font-weight: 700;
}

.radio-card input {
  accent-color: var(--secondary);
}

.checkbox-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, .28);
  border-radius: 14px;
  background: #ffffff;
  cursor: pointer;
}

.checkbox-card span {
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.checkbox-card input {
  width: 18px;
  height: 18px;
  accent-color: #2563eb;
}

.upload-proof-card {
  padding: 18px;
  border: 1px dashed rgba(37, 99, 235, .36);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--secondary-soft), var(--bg-soft));
}


/* =====================================================
   LOGIN PAGE
===================================================== */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, .12), transparent 34%),
    radial-gradient(circle at bottom right, rgba(245, 158, 11, .13), transparent 32%),
    linear-gradient(135deg, #F3F6FA, #EAF2FF);
}

.login-card {
  width: 880px;
  max-width: 96%;
  min-height: 470px;
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  overflow: hidden;
  border-radius: 22px;
  background: var(--white);
  box-shadow: 0 18px 44px rgba(15, 23, 42, .14);
  animation: fadeInUp .55s ease forwards;
}

.login-info {
  position: relative;
  display: flex;
  align-items: center;
  padding: 34px;
  overflow: hidden;
  color: var(--white);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.login-info::before {
  content: '';
  position: absolute;
  inset: -50%;
  background: linear-gradient(120deg, transparent, rgba(56, 189, 248, .14), rgba(245, 158, 11, .30), rgba(20, 184, 166, .22), transparent);
  filter: blur(14px);
  opacity: .55;
  animation: shineBright 7s linear infinite;
}

.login-info-content {
  position: relative;
  z-index: 1;
}

.login-logo {
  width: 66px;
  height: 66px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .14);
}

.login-logo svg {
  width: 34px;
  height: 34px;
}

.login-info h2 {
  margin: 0 0 10px;
  font-size: 1.75rem;
  line-height: 1.2;
}

.login-info p {
  margin: 0;
  color: rgba(255, 255, 255, .82);
}

.login-form {
  padding: 34px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--bg-soft);
}

.login-form h3 {
  margin: 0;
  color: var(--primary);
  font-size: 1.55rem;
}

.login-form p {
  margin: 6px 0 18px;
  color: var(--text-muted);
}

/* =====================================================
   DASHBOARD ATTENDANCE
===================================================== */

.attendance-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.summary-item {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
}

.summary-item span {
  display: block;
  color: var(--text-muted);
  font-size: .78rem;
  font-weight: 700;
}

.summary-item strong {
  display: block;
  margin-top: 4px;
  color: var(--primary);
  font-size: 1.15rem;
}

.capacity-bar {
  height: 14px;
  overflow: hidden;
  margin: 12px 0;
  border-radius: 999px;
  background: #E2E8F0;
}

.capacity-fill {
  height: 100%;
  width: 64%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--secondary), var(--gold));
}

/* =====================================================
   REGISTRATION PAGE
===================================================== */

.registration-hero {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 18px;
  align-items: center;
}

.hero-panel {
  padding: 28px;
  border-radius: var(--radius-xl);
  color: var(--white);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: var(--shadow-lg);
}

.hero-panel h2 {
  margin: 0 0 8px;
  font-size: 1.65rem;
}

.hero-panel p {
  margin: 0 0 16px;
  color: rgba(255, 255, 255, .84);
}

.step-list {
  display: grid;
  gap: 10px;
}

.step-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.step-number {
  width: 27px;
  height: 27px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 27px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  font-weight: 800;
}

.guest-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.guest-card {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-soft);
}

.guest-card h4 {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: .95rem;
}

/* =====================================================
   INVOICE / PAYMENT
===================================================== */

.invoice-box {
  max-width: 760px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--white);
  box-shadow: var(--shadow-md);
}

.invoice-header {
  padding: 22px;
  color: var(--white);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.invoice-header h2 {
  margin: 0;
  font-size: 1.3rem;
}

.invoice-header p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, .78);
}

.invoice-body {
  padding: 22px;
}

.invoice-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}

.invoice-row span {
  color: var(--text-muted);
}

.invoice-row strong {
  text-align: right;
}

.invoice-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--gold-soft);
  color: #92400E;
  font-weight: 800;
}

.payment-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: .78rem;
}

/* =====================================================
   QR CARD
===================================================== */

.qr-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.qr-card {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.qr-placeholder {
  width: 150px;
  height: 150px;
  margin: 0 auto 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 16px;
  background:
    linear-gradient(90deg, rgba(15, 23, 42, .08) 1px, transparent 1px),
    linear-gradient(rgba(15, 23, 42, .08) 1px, transparent 1px),
    var(--bg-soft);
  background-size: 18px 18px;
  color: var(--primary);
}

.qr-placeholder svg {
  width: 46px;
  height: 46px;
  margin-bottom: 8px;
}

.qr-code-label {
  color: var(--primary);
  font-size: .85rem;
  font-weight: 800;
}

.qr-owner {
  margin: 0 0 4px;
  font-weight: 800;
}

.qr-status {
  margin-top: 10px;
}

/* =====================================================
   SCANNER PAGE - ADMIN /admin/scan
===================================================== */

.scan-page {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(330px, .8fr);
  gap: 18px;
  align-items: stretch;
}

.scan-panel,
.scan-result,
.scan-person-card,
.scan-log-list {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--white);
  box-shadow: var(--shadow-md);
}

.scan-panel {
  display: grid;
  gap: 14px;
}

.scan-side {
  display: grid;
  grid-template-rows: minmax(260px, auto) auto;
  gap: 18px;
}

.scan-form-grid {
  display: grid;
  grid-template-columns: 1.2fr .7fr .7fr;
  gap: 12px;
  align-items: end;
}

.scan-form-grid .form-group {
  margin-bottom: 0;
}

.scan-frame {
  position: relative;
  min-height: 410px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 3px dashed rgba(37, 99, 235, .35);
  border-radius: 22px;
  background:
    radial-gradient(circle, rgba(37, 99, 235, .08), transparent 56%),
    var(--bg-soft);
}

.scan-frame:not(.camera-active)::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px dashed rgba(37, 99, 235, .22);
  border-radius: 18px;
  pointer-events: none;
}

.scan-frame:not(.camera-active)::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #38BDF8, var(--gold), transparent);
  animation: scanLine 1.9s ease-in-out infinite alternate;
  opacity: .7;
  pointer-events: none;
}

.scan-placeholder {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  gap: 8px;
  max-width: 430px;
  padding: 20px;
  color: var(--primary);
  text-align: center;
}

.scan-placeholder svg {
  width: 72px;
  height: 72px;
  stroke-width: 2.2;
}

.scan-placeholder strong {
  font-size: 15px;
  font-weight: 800;
}

.scan-placeholder span {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}

.qr-reader-box {
  position: relative;
  z-index: 5;
  display: none;
  width: 100% !important;
  max-width: 620px !important;
  min-height: 360px !important;
  padding: 0 !important;
}

.scan-frame.camera-active {
  background: #0f172a;
  border-color: rgba(56, 189, 248, .55);
}

.scan-frame.camera-active .qr-reader-box {
  display: block !important;
}

.scan-frame.camera-active .scan-placeholder {
  display: none !important;
}

#qr-reader,
#qr-reader div,
#qr-reader video,
#qr-reader canvas {
  max-width: none !important;
  padding: 0 !important;
  text-align: initial !important;
  color: inherit !important;
}

#qr-reader {
  width: 100% !important;
  border: 0 !important;
}

#qr-reader div {
  display: block;
}

#qr-reader__scan_region {
  width: 100% !important;
  min-height: 340px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  border-radius: 18px !important;
  background: #111827 !important;
}

#qr-reader video {
  width: 100% !important;
  height: auto !important;
  min-height: 340px !important;
  object-fit: cover !important;
  border-radius: 18px !important;
}

#qr-reader canvas {
  border-radius: 18px !important;
}

#qr-reader img {
  display: none !important;
}

#qr-reader__dashboard {
  margin-top: 8px !important;
  padding: 8px !important;
  border-radius: 12px !important;
  background: #f8fafc !important;
  font-size: 12px !important;
}

#qr-reader__dashboard_section {
  text-align: center !important;
}

#qr-reader__dashboard button,
#qr-reader__dashboard select {
  margin: 4px !important;
  padding: 7px 10px !important;
  border: 1px solid var(--border-dark) !important;
  border-radius: 10px !important;
  font-size: 12px !important;
}

.scan-input-row {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 10px;
}

.scan-input-row input {
  min-height: 44px;
  font-weight: 800;
  letter-spacing: .02em;
}

.scan-input-row .btn {
  width: 100%;
  justify-content: center;
}

.scan-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.scan-actions .btn {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 800;
}

.scan-result {
  min-height: 278px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  text-align: center;
}

.scan-result > div {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.scan-result svg {
  width: 56px;
  height: 56px;
  stroke-width: 2.4;
}

.scan-result h2,
.scan-result h3 {
  margin: 8px 0 0;
  font-size: 24px;
  line-height: 1.25;
  font-weight: 800;
}

.scan-result p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.scan-result small {
  display: inline-block;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 800;
}

.scan-result.success {
  background: rgba(22, 163, 74, .13);
  border-color: rgba(22, 163, 74, .30);
  color: var(--success-dark);
}

.scan-result.warning {
  background: var(--gold-soft);
  border-color: rgba(245, 158, 11, .35);
  color: #92400E;
}

.scan-result.danger {
  background: rgba(220, 38, 38, .12);
  border-color: rgba(220, 38, 38, .30);
  color: var(--danger-dark);
}

.scan-result.info {
  background: var(--secondary-soft);
  border-color: rgba(37, 99, 235, .24);
  color: var(--secondary-dark);
}

.scan-person-card {
  min-height: 170px;
  color: var(--text-main);
}

.scan-person-card > strong {
  display: block;
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.45;
}

.scan-person-card p {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}

.scan-person-detail {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.scan-person-detail div {
  display: grid;
  gap: 3px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border);
}

.scan-person-detail div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.scan-person-detail span {
  color: var(--text-muted);
  font-size: 12px;
}

.scan-person-detail strong {
  color: var(--text-main);
  font-size: 13px;
  word-break: break-word;
}

.scan-log-list {
  grid-column: 1 / -1;
  margin-top: 0;
}

.scan-log-list h2 {
  margin: 0 0 14px;
  color: var(--text-main);
  font-size: 21px;
}

.scan-log-list .table-wrapper {
  overflow-x: auto;
}

.scan-log-list table {
  width: 100%;
  min-width: 720px;
}

.scan-log-list th,
.scan-log-list td {
  vertical-align: top;
}

/* =====================================================
   TOOLTIP CURSOR
   Alert global dipusatkan pada FIX UI 11.
===================================================== */

.tooltip-cursor {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-4px);
  padding: 7px 10px;
  border-radius: var(--radius-md);
  color: var(--white);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 5px 16px rgba(37, 99, 235, .25);
  transition: opacity .15s ease, transform .15s ease;
}

.tooltip-cursor.show {
  opacity: 1;
  transform: translateY(0);
}

/* =====================================================
   MODAL GLOBAL FINAL
   Satu definisi untuk modal biasa, modal besar, form panjang,
   desktop, tablet, dan mobile.
===================================================== */

body.modal-open {
  overflow: hidden;
}

.modal-kpi-grid {
  margin-bottom: 18px;
}

.custom-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
  overscroll-behavior: contain;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(3px);
}

.custom-modal[aria-hidden="true"] {
  display: none;
  visibility: hidden;
}

.custom-modal.show,
.custom-modal.show[aria-hidden="false"] {
  display: flex;
  visibility: visible;
}

.custom-modal-dialog,
.custom-modal-box,
.custom-modal-content,
.modal-dialog-custom {
  width: min(760px, 100%);
  max-width: 100%;
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, .25);
  animation: uiModalUp .18s ease-out;
}

.custom-modal-dialog.custom-modal-lg,
.custom-modal-dialog > .custom-modal-lg,
.custom-modal-lg {
  width: min(980px, 100%);
  max-width: 980px;
}

.custom-modal-dialog:focus,
.custom-modal-dialog[role="dialog"] {
  outline: none;
}

.custom-modal-dialog > form,
.custom-modal-box > form,
.custom-modal-content > form,
.modal-dialog-custom > form {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.custom-modal-header,
.custom-modal-footer,
.modal-header-custom,
.modal-footer-custom {
  position: relative;
  z-index: 3;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  background: #ffffff;
}

.custom-modal-header,
.modal-header-custom {
  border-bottom: 1px solid rgba(148, 163, 184, .25);
}

.custom-modal-footer,
.modal-footer-custom {
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: auto;
  border-top: 1px solid rgba(148, 163, 184, .25);
  box-shadow: 0 -8px 18px rgba(15, 23, 42, .05);
}

.custom-modal-header h3 {
  margin: 0;
  color: #0f172a;
  font-size: 18px;
  font-weight: 800;
}

.custom-modal-header p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 13px;
}

.custom-modal-body,
.modal-body-custom {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  padding: 22px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}

.modal-close {
  position: relative;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 36px;
  border: 0;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  cursor: pointer;
}

.custom-modal-body::-webkit-scrollbar,
.modal-body-custom::-webkit-scrollbar {
  width: 9px;
}

.custom-modal-body::-webkit-scrollbar-thumb,
.modal-body-custom::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(100, 116, 139, .42);
  background-clip: padding-box;
}

.custom-modal-body::-webkit-scrollbar-track,
.modal-body-custom::-webkit-scrollbar-track {
  background: transparent;
}

@keyframes uiModalUp {
  from {
    opacity: 0;
    transform: translateY(12px) scale(.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 768px) {
  .custom-modal,
  .custom-modal.show {
    align-items: flex-end;
    padding: 10px;
  }

  .custom-modal-dialog,
  .custom-modal-box,
  .custom-modal-content,
  .modal-dialog-custom,
  .custom-modal-dialog.custom-modal-lg,
  .custom-modal-lg {
    width: 100%;
    max-width: 100%;
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
    border-radius: 18px 18px 0 0;
  }

  .custom-modal-header,
  .modal-header-custom {
    padding: 15px 16px;
  }

  .custom-modal-body,
  .modal-body-custom {
    padding: 16px;
  }

  .custom-modal-footer,
  .modal-footer-custom {
    padding: 14px 16px;
    gap: 8px;
  }

  .custom-modal-footer .btn,
  .modal-footer-custom .btn {
    width: 100%;
    flex: 1 1 100%;
    justify-content: center;
  }
}

@media (max-height: 620px) and (min-width: 769px) {
  .custom-modal,
  .custom-modal.show {
    align-items: flex-start;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .custom-modal-dialog,
  .custom-modal-box,
  .custom-modal-content,
  .modal-dialog-custom {
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
  }
}

/* =====================================================
   SEAT MAP / KURSI
===================================================== */

.seat-map-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.seat-stage,
.seat-gate {
  width: 100%;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 16px;
  font-weight: 800;
  letter-spacing: .04em;
  text-align: center;
}

.seat-stage {
  margin: 10px 0 18px;
  background: linear-gradient(135deg, #0f172a, #334155);
  color: #ffffff;
}

.seat-gate {
  margin-top: 24px;
  border: 1px dashed rgba(100, 116, 139, .45);
  background: #f1f5f9;
  color: #334155;
}

.seat-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 14px 0 20px;
  color: #64748b;
  font-size: 13px;
}

.seat-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.seat-dot {
  width: 12px;
  height: 12px;
  display: inline-block;
  border-radius: 999px;
}

.seat-dot.tersedia {
  background: #16a34a;
}

.seat-dot.dipesan {
  background: #f59e0b;
}

.seat-dot.ditetapkan {
  background: #0ea5e9;
}

.seat-dot.diblokir {
  background: #ef4444;
}

.seat-dot.prioritas {
  background: #7c3aed;
}

.seat-zone {
  margin-bottom: 24px;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, .24);
  border-radius: 20px;
  background: #ffffff;
}

.seat-zone-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 16px;
}

.seat-zone-title strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
}

.seat-zone-title span {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  opacity: .82;
}

.seat-zone-title small {
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .65);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.seat-zone-title.front {
  background: #eff6ff;
  color: #1e3a8a;
}

.seat-zone-title.back {
  background: #f8fafc;
  color: #334155;
}

.seat-zone-title.mixed {
  background: #fffbeb;
  color: #92400e;
}

.seat-zone-empty {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed rgba(148, 163, 184, .55);
  border-radius: 16px;
  background: #f8fafc;
  color: #64748b;
  font-size: 13px;
}

.seat-aisle {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 24px 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-align: center;
}

.seat-aisle span {
  flex: 1;
  height: 1px;
  border-top: 1px dashed rgba(100, 116, 139, .45);
}

.seat-layout-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px 0 12px;
}

.seat-layout-flex {
  display: flex;
  align-items: flex-start;
  gap: 32px;
  min-width: max-content;
  padding: 4px;
}

.seat-map-block {
  flex: 0 0 auto;
  width: max-content;
  min-width: 260px;
  max-width: none;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, .28);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .06);
}

.seat-map-block.front-block {
  border-top: 5px solid #2563eb;
}

.seat-map-block.back-block {
  border-top: 5px solid #64748b;
}

.seat-map-block.mixed-block {
  border-top: 5px solid #f59e0b;
}

.seat-map-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(148, 163, 184, .22);
}

.seat-map-title strong {
  display: block;
  color: #0f172a;
  font-size: 16px;
  font-weight: 800;
}

.seat-map-title span {
  display: block;
  max-width: 220px;
  margin-top: 2px;
  color: #64748b;
  font-size: 13px;
}

.seat-map-title small {
  padding: 5px 9px;
  border-radius: 999px;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  white-space: nowrap;
}

.seat-map-grid {
  display: inline-flex;
  flex-direction: column;
  gap: 8px;
}

.seat-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.seat-row-label {
  min-width: 38px;
  height: 38px;
  position: sticky;
  left: 0;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #f1f5f9;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.seat-box {
  min-width: 72px;
  height: 48px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px;
  border: 0;
  border-radius: 12px;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .10);
  transition: .15s ease;
}

.seat-box span {
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.seat-box small {
  font-size: 10px;
  line-height: 1;
  opacity: .92;
  white-space: nowrap;
}

.seat-box.tersedia {
  background: #16a34a;
}

.seat-box.dipesan {
  background: #f59e0b;
}

.seat-box.ditetapkan {
  background: #0ea5e9;
}

.seat-box.diblokir {
  background: #ef4444;
}

.seat-box.prioritas {
  outline: 3px solid rgba(124, 58, 237, .35);
}

.seat-box:hover {
  transform: translateY(-1px);
  filter: brightness(.96);
}


/* =====================================================
   PAGINATION LEGACY
   Dipertahankan untuk halaman yang masih memakai pagination-simple.
===================================================== */

.pagination-simple {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(148, 163, 184, .22);
}

.pagination-info {
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.pagination-simple .btn {
  width: auto;
}

/* =====================================================
   BOOTSTRAP GRID COMPATIBILITY — FINAL
   Bootstrap dipakai untuk grid/utilities.
   Custom CSS dipakai untuk visual sistem.
===================================================== */

.row > [class*="col-"] > .card,
.row > [class*="col-"] > .kpi-card,
.row > [class*="col-"] > .scan-panel,
.row > [class*="col-"] > .scan-result,
.row > [class*="col-"] > .scan-person-card,
.row > [class*="col-"] > .scan-log-list,
.row > [class*="col-"] > .form-section {
  height: 100%;
}

/* Mode transisi ke Bootstrap layout.
   Gunakan class .bootstrap-layout pada wrapper halaman baru. */
.bootstrap-layout .kpi-grid,
.bootstrap-layout .form-grid,
.bootstrap-layout .guest-grid,
.bootstrap-layout .attendance-summary {
  display: contents;
}

/* Tombol dalam tabel jangan otomatis full width di mobile */
.table-wrapper .btn,
td .btn,
th .btn {
  width: auto;
}

/* Tombol action tetap bisa berjejer */
.page-actions .btn,
.custom-modal-footer .btn,
.pagination-simple .btn {
  width: auto;
}

/* =====================================================
   DESKTOP LAYOUT
===================================================== */

@media (min-width: 769px) {
  .sidebar {
    width: 250px;
  }

  .content {
    margin-left: 250px;
    padding: 22px 26px;
  }

  .menu a,
  .menu button {
    width: calc(100% - 24px);
    margin: 3px 12px;
    padding: 9px 11px;
    font-size: .84rem;
  }

  .menu-section {
    margin: 18px 16px 6px;
    font-size: .68rem;
  }

  .sidebar-brand {
    padding-right: 16px;
    padding-left: 16px;
  }
}


/* =====================================================
   SCANNER SIMPLE MODE
===================================================== */

.scan-simple-page {
    align-items: stretch;
}

.scan-compact-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #ffffff, #f8fbff);
    box-shadow: var(--shadow-sm);
}

.scan-compact-header h1 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
}

.scan-compact-header p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.scan-event-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 360px;
    padding: 10px 13px;
    border-radius: 999px;
    background: #eef6ff;
    color: #155f9f;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.scan-event-chip svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.scan-summary-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.scan-summary-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.scan-summary-pill span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.scan-summary-pill strong {
    color: var(--text);
    font-size: 18px;
    font-weight: 800;
}

.scan-summary-pill.success {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.scan-summary-pill.info {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.scan-summary-pill.warning {
    border-color: #fde68a;
    background: #fffbeb;
}

.scan-summary-pill.danger {
    border-color: #fecaca;
    background: #fef2f2;
}

.scan-simple-card {
    padding: 18px;
}

.scan-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(160px, .75fr) minmax(140px, .65fr);
    gap: 12px;
    margin-bottom: 12px;
}

.scanner-settings {
    margin-bottom: 14px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: #f8fafc;
    overflow: hidden;
}

.scanner-settings summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    list-style: none;
}

.scanner-settings summary::-webkit-details-marker {
    display: none;
}

.scanner-settings summary svg {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

.scanner-settings .scan-form-grid.compact {
    padding: 0 14px 14px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.scan-frame.simple {
    min-height: 310px;
    margin-top: 12px;
    border-radius: 18px;
}

.scan-input-row.simple {
    margin-top: 14px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.scan-input-row.simple .form-control {
    min-height: 48px;
    font-size: 15px;
    font-weight: 700;
}

.scan-input-row.simple .btn {
    min-height: 48px;
}

.scan-actions.simple {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.scan-actions.simple .btn {
    min-height: 40px;
    padding: 9px 13px;
}

.scan-result-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
}

.scan-result.simple {
    min-height: 210px;
    border-radius: 18px;
}

.scan-result.simple h2 {
    font-size: 22px;
}

.scan-result.simple p {
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
}

.scan-person-card.simple {
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
}

.scan-person-name {
    display: grid;
    gap: 4px;
    margin-bottom: 12px;
}

.scan-person-name strong {
    color: var(--text);
    font-size: 17px;
}

.scan-person-name span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.section-heading.compact {
    margin-bottom: 12px;
}

@media (max-width: 992px) {
    .scan-toolbar {
        grid-template-columns: 1fr;
    }

    .scanner-settings .scan-form-grid.compact {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .scan-compact-header {
        align-items: flex-start;
        flex-direction: column;
        padding: 16px;
    }

    .scan-compact-header h1 {
        font-size: 19px;
    }

    .scan-event-chip {
        width: 100%;
        max-width: 100%;
        border-radius: 14px;
    }

    .scan-summary-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .scan-input-row.simple {
        grid-template-columns: 1fr;
    }

    .scan-actions.simple .btn {
        flex: 1 1 calc(50% - 8px);
        justify-content: center;
    }

    .scan-frame.simple {
        min-height: 260px;
    }
}

@media (max-width: 480px) {
    .scan-summary-strip {
        grid-template-columns: 1fr;
    }

    .scan-actions.simple .btn {
        flex-basis: 100%;
    }
}


/* =====================================================
   GLOBAL COMPONENT POLISH
   Card, topbar, page action, button, dan scrollbar.
   Tabel, KPI, form, tab, alert, dan modal memiliki bagian final sendiri.
===================================================== */

.content {
  width: auto;
  max-width: 100%;
}

.topbar {
  padding: 0 0 16px;
  margin-bottom: 22px;
}

.topbar h1 {
  letter-spacing: -.02em;
}

.topbar p {
  max-width: 760px;
}

.card {
  position: relative;
  overflow: visible;
}

.card + .card {
  margin-top: 16px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: -20px -20px 18px;
  padding: 17px 20px;
  border-bottom: 1px solid rgba(148, 163, 184, .22);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: linear-gradient(135deg, #ffffff, #f8fafc);
}

.card-header > div {
  min-width: 0;
  flex: 1 1 auto;
}

.card-header > .btn,
.card-header > button,
.card-header > a.btn {
  width: auto;
  flex: 0 0 auto;
  white-space: nowrap;
}

.card-header h1,
.card-header h2,
.card-header h3,
.card-header h4,
.card-header h5 {
  margin: 0;
  color: var(--text-main);
  font-weight: 800;
  letter-spacing: -.015em;
}

.card-header p,
.card-header small {
  margin: 4px 0 0;
  color: var(--text-muted);
}

.card-body {
  min-width: 0;
}

.card-footer {
  margin: 18px -20px -20px;
  padding: 16px 20px;
  border-top: 1px solid rgba(148, 163, 184, .22);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background: #f8fafc;
}

.page-actions,
.page-actions-between {
  gap: 10px;
}

.page-actions-between {
  align-items: flex-start;
}

.page-actions-between > div {
  min-width: 0;
}

.btn {
  box-shadow: none;
  user-select: none;
}

.btn:hover {
  box-shadow: 0 8px 20px rgba(15, 23, 42, .10);
}

.btn-ghost:hover {
  border-color: rgba(37, 99, 235, .28);
  background: #f8fafc;
}

.btn-success:hover,
.btn-warning:hover,
.btn-danger:hover {
  color: #ffffff;
}

.btn-icon,
.btn-square {
  width: 38px;
  min-width: 38px;
  padding-right: 0;
  padding-left: 0;
}

.table-wrapper::-webkit-scrollbar,
.custom-modal-body::-webkit-scrollbar,
.sidebar::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

.table-wrapper::-webkit-scrollbar-thumb,
.custom-modal-body::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(100, 116, 139, .32);
}

.table-wrapper::-webkit-scrollbar-track,
.custom-modal-body::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

@media (max-width: 992px) {
  .page-actions-between {
    flex-direction: column;
  }

  .page-actions-between .page-actions,
  .page-actions-between .filter-actions {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .card {
    padding: 16px;
    border-radius: 16px;
  }

  .card-header {
    align-items: stretch;
    flex-direction: column;
    margin: -16px -16px 16px;
    padding: 15px 16px;
  }

  .card-header > .btn,
  .card-header > button,
  .card-header > a.btn {
    width: 100%;
    justify-content: center;
  }

  .card-footer {
    margin: 16px -16px -16px;
    padding: 14px 16px;
  }
}

@media (max-width: 480px) {
  .card {
    padding: 14px;
  }

  .card-header {
    margin: -14px -14px 14px;
    padding: 14px;
  }
}


/* =====================================================
   FIX UI 2 — SCANNER HARI-H
   File: resources/views/admin/scan/index.blade.php
   Tidak mengubah route, name input, method, atau proses bisnis.
===================================================== */

.btn-info {
  color: #ffffff;
  background: linear-gradient(135deg, var(--info), var(--secondary-dark));
}

.btn-info:hover {
  color: #ffffff;
  background: linear-gradient(135deg, var(--secondary-dark), #1e40af);
}

.scan-operation-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border: 1px solid rgba(148, 163, 184, .28);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #ffffff, #f8fbff);
  box-shadow: var(--shadow-sm);
}

.scan-operation-context {
  min-width: 0;
}

.scan-operation-label {
  display: inline-flex;
  margin-bottom: 4px;
  color: var(--secondary-dark);
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.scan-operation-context > strong {
  display: block;
  color: var(--text-main);
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.3;
}

.scan-operation-context p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}

.scan-operation-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
}

.scan-event-chip.warning {
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
}

.scan-device-state {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 150px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f8fafc;
}

.scan-device-state > svg {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
}

.scan-device-state span {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.scan-device-state small {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
}

.scan-device-state strong {
  color: var(--text-main);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.scan-device-state.idle {
  color: var(--gray);
}

.scan-device-state.loading {
  color: var(--secondary-dark);
  border-color: rgba(37, 99, 235, .25);
  background: var(--secondary-soft);
}

.scan-device-state.active {
  color: var(--success-dark);
  border-color: rgba(22, 163, 74, .28);
  background: rgba(22, 163, 74, .10);
}

.scan-device-state.error {
  color: var(--danger-dark);
  border-color: rgba(220, 38, 38, .28);
  background: rgba(220, 38, 38, .08);
}

.scan-frame.camera-loading .scan-placeholder svg {
  animation: scannerCameraPulse 1s ease-in-out infinite alternate;
}

.scan-frame.camera-loading .scan-placeholder strong::after {
  content: "…";
}

@keyframes scannerCameraPulse {
  from {
    opacity: .45;
    transform: scale(.94);
  }

  to {
    opacity: 1;
    transform: scale(1.04);
  }
}

.scan-camera-feedback {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
  padding: 11px 13px;
  border: 1px solid rgba(37, 99, 235, .22);
  border-radius: 13px;
  background: rgba(37, 99, 235, .06);
  color: var(--secondary-dark);
}

.scan-camera-feedback[hidden] {
  display: none !important;
}

.scan-camera-feedback > svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin-top: 1px;
}

.scan-camera-feedback > div {
  display: grid;
  gap: 2px;
}

.scan-camera-feedback strong {
  font-size: 12px;
  font-weight: 800;
}

.scan-camera-feedback span {
  color: inherit;
  font-size: 12px;
  line-height: 1.45;
}

.scan-camera-feedback.danger {
  color: var(--danger-dark);
  border-color: rgba(220, 38, 38, .26);
  background: rgba(220, 38, 38, .07);
}

.scan-code-field {
  margin-top: 14px;
}

.scan-code-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.scan-code-label-row .form-label {
  margin: 0;
}

.scan-code-label-row span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-align: right;
}

.scan-input-row.simple {
  margin-top: 0;
}

.scan-input-row.simple .form-control {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  letter-spacing: .025em;
}

.scan-actions.simple {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.scan-actions.simple .btn {
  width: 100%;
  min-width: 0;
  white-space: nowrap;
}

.scan-mode-button {
  position: relative;
}

.scan-mode-button.is-active {
  outline: 3px solid rgba(37, 99, 235, .22);
  outline-offset: 2px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .12);
}

.scan-mode-button.is-active::after {
  content: "";
  position: absolute;
  top: 5px;
  right: 6px;
  width: 7px;
  height: 7px;
  border: 2px solid rgba(255, 255, 255, .8);
  border-radius: 999px;
  background: #ffffff;
}

.scan-fallback-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px dashed rgba(100, 116, 139, .32);
  border-radius: 12px;
  background: #f8fafc;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.45;
}

.scan-fallback-note svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  margin-top: 1px;
  color: var(--primary);
}

.scan-result.simple {
  border-width: 2px;
}

.scan-result.simple svg {
  width: 64px;
  height: 64px;
}

.scan-result.simple h2 {
  font-size: clamp(21px, 2vw, 28px);
}

.scan-result.simple p {
  font-size: 14px;
  font-weight: 600;
}

.scan-result.simple small {
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .58);
}

@media (max-width: 1200px) {
  .scan-actions.simple {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .scan-operation-bar {
    align-items: stretch;
    flex-direction: column;
    padding: 14px;
  }

  .scan-operation-meta {
    justify-content: stretch;
  }

  .scan-operation-meta > * {
    flex: 1 1 220px;
  }

  .scan-device-state {
    min-width: 0;
  }

  .scan-actions.simple {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .scan-code-label-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .scan-code-label-row span {
    text-align: left;
  }
}

@media (max-width: 480px) {
  .scan-operation-meta {
    display: grid;
    grid-template-columns: 1fr;
  }

  .scan-operation-context > strong {
    font-size: 16px;
  }

  .scan-summary-pill {
    min-height: 58px;
  }

  .scan-actions.simple {
    grid-template-columns: 1fr;
  }

  .scan-result.simple svg {
    width: 54px;
    height: 54px;
  }
}


/* =====================================================
   FIX UI 4B FINAL — CONTENT GRID DASHBOARD
   Menetralkan bentrok class Bootstrap .col-* dengan
   CSS Grid custom pada .content-grid.
===================================================== */

.content-grid {
    width: 100%;
    max-width: 100%;
    grid-template-columns: repeat(12, minmax(0, 1fr));
}

/*
 * Bootstrap memberi width, flex, dan padding pada .col-*.
 * Di dalam content-grid, ukuran harus dikendalikan CSS Grid.
 */
.content-grid > [class*="col-"] {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding-right: 0 !important;
    padding-left: 0 !important;
    margin: 0 !important;
    flex: none !important;
    flex-basis: auto !important;
}

/* Pembagian kolom desktop */
.content-grid > .col-12 {
    grid-column: span 12;
}

.content-grid > .col-8 {
    grid-column: span 8;
}

.content-grid > .col-6 {
    grid-column: span 6;
}

.content-grid > .col-4 {
    grid-column: span 4;
}

.content-grid > .col-3 {
    grid-column: span 3;
}

/* Seluruh isi harus memenuhi area grid */
.content-grid > [class*="col-"] > .card,
.content-grid > [class*="col-"] > .alert-card,
.content-grid > [class*="col-"] > .kpi-grid,
.content-grid > [class*="col-"] > form {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

/* Mencegah card dan tabel mendorong layout */
.content-grid .card,
.content-grid .card-body,
.content-grid .table-wrapper {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

/*
 * Ringkasan Tagihan berada di kolom kanan.
 * Item ringkasan disusun vertikal agar tidak menjadi sempit.
 */
.content-grid > .col-4 .attendance-summary {
    grid-template-columns: 1fr;
}

/* Jangan menambahkan margin antar-card di dalam section grid */
.content-grid > [class*="col-"] > .card + .card {
    margin-top: 0;
}

/* Laptop kecil dan tablet landscape */
@media (max-width: 1100px) {
    .content-grid > .col-8,
    .content-grid > .col-6,
    .content-grid > .col-4,
    .content-grid > .col-3 {
        grid-column: span 12;
    }

    .content-grid > .col-4 .attendance-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Tablet portrait dan mobile */
@media (max-width: 768px) {
    .content-grid {
        gap: 14px;
    }

    .content-grid > [class*="col-"] {
        grid-column: span 12;
    }
}

/* Mobile kecil */
@media (max-width: 576px) {
    .content-grid > .col-4 .attendance-summary {
        grid-template-columns: 1fr;
    }
}


/* =====================================================
   FIX UI 5 — KPI GLOBAL TERSTANDAR
   Berlaku untuk dashboard, laporan, log scan,
   pembayaran, registrasi, peserta, dan monitoring.
===================================================== */

.kpi-grid {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
    gap: 16px;
    margin: 0;
}

/* Menghilangkan margin lama ketika KPI berada di content-grid */
.content-grid > [class*="col-"] > .kpi-grid {
    margin-bottom: 0;
}

.kpi-card {
    --kpi-color-start: var(--primary);
    --kpi-color-end: var(--secondary);
    --kpi-color-soft: rgba(37, 99, 235, .10);
    --kpi-color-text: var(--secondary-dark);

    position: relative;
    isolation: isolate;
    min-width: 0;
    min-height: 108px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    overflow: hidden;

    border: 1px solid rgba(148, 163, 184, .26);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .06);

    color: var(--text-main);
    transition:
        transform .18s ease,
        box-shadow .18s ease,
        border-color .18s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
    border-color: rgba(37, 99, 235, .22);
    box-shadow: 0 12px 28px rgba(15, 23, 42, .10);
}

/* Garis warna di bagian atas */
.kpi-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    z-index: 0;
    height: 4px;
    background: linear-gradient(
        90deg,
        var(--kpi-color-start),
        var(--kpi-color-end)
    );
}

/* Ornamen lingkaran kanan bawah */
.kpi-card::after {
    content: "";
    position: absolute;
    right: -32px;
    bottom: -42px;
    z-index: 0;
    width: 110px;
    height: 110px;
    border-radius: 999px;
    background: var(--kpi-color-soft);
    opacity: 1;
}

.kpi-card > * {
    position: relative;
    z-index: 1;
}

.kpi-card > div:not(.kpi-icon),
.kpi-content {
    min-width: 0;
    flex: 1 1 auto;
}

.kpi-icon {
    width: 50px;
    height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 50px;

    border-radius: 15px;
    color: #ffffff;
    background: linear-gradient(
        135deg,
        var(--kpi-color-start),
        var(--kpi-color-end)
    );

    box-shadow: 0 9px 20px var(--kpi-color-soft);
}

.kpi-icon svg {
    width: 23px;
    height: 23px;
    stroke-width: 2.3;
}

.kpi-label {
    margin: 0;
    overflow: hidden;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    text-overflow: ellipsis;
}

.kpi-value {
    margin: 4px 0 0;
    color: var(--text-main);
    font-family: var(--font-heading);
    font-size: clamp(24px, 2vw, 31px);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -.03em;
    word-break: break-word;
}

.kpi-note,
.kpi-description {
    margin: 5px 0 0;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
}

/* =====================================================
   WARNA KPI
===================================================== */

.kpi-card.primary {
    --kpi-color-start: #1e3a5f;
    --kpi-color-end: #2563eb;
    --kpi-color-soft: rgba(37, 99, 235, .14);
    --kpi-color-text: #1d4ed8;
}

.kpi-card.blue,
.kpi-card.info {
    --kpi-color-start: #2563eb;
    --kpi-color-end: #1d4ed8;
    --kpi-color-soft: rgba(37, 99, 235, .14);
    --kpi-color-text: #1d4ed8;
}

.kpi-card.teal {
    --kpi-color-start: #0f766e;
    --kpi-color-end: #115e59;
    --kpi-color-soft: rgba(15, 118, 110, .14);
    --kpi-color-text: #115e59;
}

.kpi-card.green,
.kpi-card.success {
    --kpi-color-start: #16a34a;
    --kpi-color-end: #15803d;
    --kpi-color-soft: rgba(22, 163, 74, .14);
    --kpi-color-text: #15803d;
}

.kpi-card.gold,
.kpi-card.warning {
    --kpi-color-start: #f59e0b;
    --kpi-color-end: #d97706;
    --kpi-color-soft: rgba(245, 158, 11, .16);
    --kpi-color-text: #b45309;
}

.kpi-card.red,
.kpi-card.danger {
    --kpi-color-start: #dc2626;
    --kpi-color-end: #b91c1c;
    --kpi-color-soft: rgba(220, 38, 38, .14);
    --kpi-color-text: #b91c1c;
}

.kpi-card.gray,
.kpi-card.secondary {
    --kpi-color-start: #64748b;
    --kpi-color-end: #475569;
    --kpi-color-soft: rgba(100, 116, 139, .14);
    --kpi-color-text: #475569;
}

.kpi-card.purple,
.kpi-card.manual {
    --kpi-color-start: #7c3aed;
    --kpi-color-end: #6d28d9;
    --kpi-color-soft: rgba(124, 58, 237, .14);
    --kpi-color-text: #6d28d9;
}

/* Angka atau keterangan berwarna sesuai variant */
.kpi-card .kpi-highlight {
    color: var(--kpi-color-text);
}

/* =====================================================
   KPI DENGAN LINK
===================================================== */

a.kpi-card {
    text-decoration: none;
}

a.kpi-card:hover {
    color: var(--text-main);
}

a.kpi-card:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .22);
    outline-offset: 3px;
}

/* =====================================================
   KPI COMPACT
===================================================== */

.kpi-grid.compact {
    gap: 12px;
}

.kpi-grid.compact .kpi-card,
.kpi-card.compact {
    min-height: 88px;
    padding: 14px;
}

.kpi-grid.compact .kpi-icon,
.kpi-card.compact .kpi-icon {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
    border-radius: 13px;
}

.kpi-grid.compact .kpi-icon svg,
.kpi-card.compact .kpi-icon svg {
    width: 20px;
    height: 20px;
}

.kpi-grid.compact .kpi-value,
.kpi-card.compact .kpi-value {
    font-size: 23px;
}

/* =====================================================
   RESPONSIVE KPI
===================================================== */

@media (max-width: 1200px) {
    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .kpi-grid {
        gap: 12px;
    }

    .kpi-card {
        min-height: 96px;
        padding: 15px;
    }

    .kpi-icon {
        width: 46px;
        height: 46px;
        flex-basis: 46px;
        border-radius: 14px;
    }

    .kpi-icon svg {
        width: 21px;
        height: 21px;
    }

    .kpi-value {
        font-size: 25px;
    }
}

@media (max-width: 576px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .kpi-card {
        min-height: 88px;
    }

    .kpi-label {
        white-space: normal;
    }
}

@media (prefers-reduced-motion: reduce) {
    .kpi-card {
        transition: none;
    }

    .kpi-card:hover {
        transform: none;
    }
}

/* =====================================================
   FIX UI 6 — FORM & FILTER GLOBAL
   Penempatan:
   - Diletakkan setelah Fix UI 5 agar menjadi override final.
   - Menggantikan blok filter collapsible lama.
   - Tidak mengubah name input, route, method, atau proses bisnis.
===================================================== */

/* =====================================================
   FORM GRID
===================================================== */

.form-grid {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-grid-1 {
    grid-template-columns: 1fr;
}

.form-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.form-group {
    min-width: 0;
    margin: 0;
}

.form-group-full {
    grid-column: 1 / -1;
}

/* =====================================================
   LABEL, INPUT, SELECT, TEXTAREA
===================================================== */

.form-label {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0 0 7px;
    color: #334155;
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
}

.form-label-required::after {
    content: "*";
    color: var(--danger);
    font-weight: 800;
}

.form-label .required {
    color: var(--danger);
    font-weight: 800;
}

.form-control,
.form-select,
textarea.form-control,
input[type="file"].form-control {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--border-dark);
    border-radius: 11px;
    outline: 0;
    background: #ffffff;
    color: var(--text-main);
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    box-shadow: none;
    transition:
        border-color .18s ease,
        box-shadow .18s ease,
        background-color .18s ease;
}

.form-select {
    padding-right: 38px;
    cursor: pointer;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

input[type="date"].form-control,
input[type="time"].form-control,
input[type="datetime-local"].form-control {
    min-height: 44px;
}

.form-control::placeholder,
textarea.form-control::placeholder {
    color: #94a3b8;
    opacity: 1;
}

.form-control:hover,
.form-select:hover {
    border-color: #94a3b8;
}

.form-control:focus,
.form-select:focus,
textarea.form-control:focus {
    border-color: var(--secondary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .13);
}

.form-control:disabled,
.form-select:disabled,
.form-control[readonly] {
    cursor: not-allowed;
    border-color: #e2e8f0;
    background: #f1f5f9;
    color: #64748b;
    opacity: 1;
}

/* =====================================================
   HELP, VALIDATION, ERROR
===================================================== */

.form-help {
    display: block;
    margin: 5px 0 0;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.45;
}

.form-error,
.invalid-feedback {
    display: block;
    margin: 5px 0 0;
    color: var(--danger-dark);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.45;
}

.form-control.is-invalid,
.form-select.is-invalid,
.is-invalid {
    border-color: var(--danger) !important;
    background-color: #fffafa;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .10) !important;
}

.form-control.is-valid,
.form-select.is-valid,
.is-valid {
    border-color: var(--success) !important;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, .10) !important;
}

/* =====================================================
   INPUT GROUP
===================================================== */

.input-group-custom {
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: stretch;
}

.input-group-custom .form-control,
.input-group-custom .form-select {
    position: relative;
    flex: 1 1 auto;
    border-radius: 11px 0 0 11px;
}

.input-group-custom .btn,
.input-group-addon {
    flex: 0 0 auto;
    min-height: 44px;
    border-radius: 0 11px 11px 0;
}

.input-group-addon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 13px;
    border: 1px solid var(--border-dark);
    border-left: 0;
    background: #f8fafc;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
}

/* =====================================================
   CHECKBOX DAN RADIO
===================================================== */

.form-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
}

.form-check-input {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    margin: 2px 0 0;
    accent-color: var(--secondary);
}

.form-check-label {
    color: #334155;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
}

.checkbox-card,
.radio-card {
    min-width: 0;
    border-color: rgba(148, 163, 184, .32);
    background: #ffffff;
}

.checkbox-card:hover,
.radio-card:hover {
    border-color: rgba(37, 99, 235, .35);
    background: #f8fbff;
}

.checkbox-card.is-selected,
.radio-card.is-selected {
    border-color: rgba(37, 99, 235, .45);
    background: rgba(37, 99, 235, .07);
}

/* =====================================================
   FORM SECTION
===================================================== */

.form-section {
    width: 100%;
    min-width: 0;
    padding: 18px;
    margin: 0 0 16px;
    border: 1px solid rgba(148, 163, 184, .26);
    border-radius: 16px;
    background: #ffffff;
}

.form-section:last-child {
    margin-bottom: 0;
}

.form-section-title {
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(148, 163, 184, .20);
}

.form-section-description {
    margin: -10px 0 16px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.5;
}

/* =====================================================
   FILTER COLLAPSIBLE GLOBAL
===================================================== */

.filter-panel {
    width: 100%;
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, .28);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.filter-panel-summary {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 17px;
    list-style: none;
    cursor: pointer;
    user-select: none;
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    transition: background-color .18s ease;
}

.filter-panel-summary::-webkit-details-marker {
    display: none;
}

.filter-panel-summary::marker {
    content: "";
}

.filter-panel-summary:hover {
    background: #f8fbff;
}

.filter-panel-heading {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-panel-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    border-radius: 13px;
    background: var(--secondary-soft);
    color: var(--secondary-dark);
}

.filter-panel-icon svg {
    width: 20px;
    height: 20px;
}

.filter-panel-title {
    min-width: 0;
}

.filter-panel-title strong {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    color: var(--text-main);
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.4;
}

.filter-panel-title > span {
    display: block;
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.45;
}

.filter-panel-toggle {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    flex: 0 0 auto;
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #ffffff;
    color: var(--secondary-dark);
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.filter-panel-toggle svg {
    width: 16px;
    height: 16px;
    transition: transform .18s ease;
}

.filter-text-open {
    display: none;
}

.filter-panel[open] .filter-text-closed {
    display: none;
}

.filter-panel[open] .filter-text-open {
    display: inline;
}

.filter-panel[open] .filter-panel-toggle svg {
    transform: rotate(180deg);
}

.filter-panel[open] .filter-panel-summary {
    border-bottom: 1px solid rgba(148, 163, 184, .22);
}

.filter-panel-body {
    min-width: 0;
    padding: 18px;
    background: #ffffff;
}

.filter-panel.has-active-filter {
    border-color: rgba(37, 99, 235, .36);
}

.filter-panel.has-active-filter .filter-panel-icon {
    color: #ffffff;
    background: linear-gradient(
        135deg,
        var(--primary),
        var(--secondary)
    );
}

.filter-active-badge {
    min-height: 21px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--secondary-soft);
    color: var(--secondary-dark);
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
}

/* =====================================================
   FILTER DAN FORM ACTIONS
===================================================== */

.filter-actions,
.form-actions {
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.form-actions-end {
    justify-content: flex-end;
}

.filter-actions .btn,
.form-actions .btn {
    width: auto;
    min-width: 94px;
    min-height: 40px;
    flex: 0 0 auto;
    justify-content: center;
}

.filter-summary {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.filter-summary-label {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
}

.filter-chip {
    min-height: 27px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 9px;
    border: 1px solid rgba(37, 99, 235, .18);
    border-radius: 999px;
    background: rgba(37, 99, 235, .07);
    color: var(--secondary-dark);
    font-size: 11px;
    font-weight: 700;
}

/* =====================================================
   RESPONSIVE FORM & FILTER
===================================================== */

@media (max-width: 1100px) {
    .form-grid-3,
    .form-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .form-grid,
    .form-grid-1,
    .form-grid-2,
    .form-grid-3,
    .form-grid-4 {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .form-group-full {
        grid-column: auto;
    }

    .form-section {
        padding: 15px;
    }

    .filter-panel-summary {
        min-height: 62px;
        align-items: flex-start;
        padding: 13px 14px;
    }

    .filter-panel-icon {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }

    .filter-panel-title > span {
        display: none;
    }

    .filter-panel-toggle {
        width: 36px;
        min-width: 36px;
        height: 36px;
        padding: 0;
        border-radius: 11px;
    }

    .filter-panel-toggle span {
        display: none !important;
    }

    .filter-panel-body {
        padding: 14px;
    }

    .filter-actions,
    .form-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-actions .btn,
    .form-actions .btn {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 480px) {
    .filter-actions,
    .form-actions {
        grid-template-columns: 1fr;
    }

    .input-group-custom {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .input-group-custom .form-control,
    .input-group-custom .form-select,
    .input-group-custom .btn,
    .input-group-addon {
        width: 100%;
        border: 1px solid var(--border-dark);
        border-radius: 11px;
    }
}


/* =====================================================
   FIX UI 6B — FILTER FORM LEBIH RINGKAS
   Filter tidak lagi memakai field yang terlalu panjang.
===================================================== */

.filter-panel-body .filter-form-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 14px;
    align-items: end;
}

.filter-panel-body .filter-form-grid .form-group {
    width: 100%;
    min-width: 0;
    margin: 0;
}

.filter-panel-body .filter-form-grid .form-control,
.filter-panel-body .filter-form-grid .form-select {
    width: 100%;
    min-width: 0;
}

/* Input pencarian boleh sedikit lebih panjang */
.filter-panel-body .filter-form-grid .filter-field-wide {
    grid-column: span 2;
}

/* Laptop */
@media (max-width: 1200px) {
    .filter-panel-body .filter-form-grid {
        grid-template-columns: repeat(3, minmax(160px, 1fr));
    }
}

/* Tablet */
@media (max-width: 900px) {
    .filter-panel-body .filter-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-panel-body .filter-form-grid .filter-field-wide {
        grid-column: span 2;
    }
}

/* Mobile */
@media (max-width: 600px) {
    .filter-panel-body .filter-form-grid {
        grid-template-columns: 1fr;
    }

    .filter-panel-body .filter-form-grid .filter-field-wide {
        grid-column: auto;
    }
}

/* =====================================================
   FIX UI 7 — TABLE, ACTION, BADGE & PAGINATION GLOBAL
   Diletakkan setelah Fix UI 6 sebagai override final.
===================================================== */

/* =====================================================
   TABLE CONTAINER
===================================================== */

.table-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: visible;

    padding: 0;
    border: 1px solid rgba(148, 163, 184, .26);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: none;

    scrollbar-width: thin;
    scrollbar-color: rgba(100, 116, 139, .35) transparent;
}

.table-wrapper::-webkit-scrollbar {
    height: 9px;
}

.table-wrapper::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(100, 116, 139, .35);
}

.table-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

/* =====================================================
   TABLE GLOBAL
===================================================== */

.table-wrapper table,
table.data-table {
    width: 100%;
    min-width: 760px;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    background: #ffffff;
}

.table-wrapper thead th,
.data-table thead th {
    position: sticky;
    top: 0;
    z-index: 4;

    padding: 12px 14px;
    border-bottom: 1px solid rgba(148, 163, 184, .26);

    background: #f8fafc;
    color: #475569;

    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: .045em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.table-wrapper tbody td,
.data-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(148, 163, 184, .18);

    background: #ffffff;
    color: #475569;

    font-size: 13px;
    font-weight: 500;
    line-height: 1.45;
    vertical-align: middle;
}

.table-wrapper tbody tr:last-child td,
.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.table-wrapper tbody tr:hover td,
.data-table tbody tr:hover td {
    background: #f8fbff;
}

.table-wrapper tbody tr:focus-within td,
.data-table tbody tr:focus-within td {
    background: #eff6ff;
}

/* =====================================================
   TABLE COLUMN UTILITIES
===================================================== */

.table-nowrap {
    white-space: nowrap;
}

.table-wrap {
    white-space: normal;
    word-break: break-word;
}

.table-cell-main {
    min-width: 180px;
}

.table-cell-wide {
    min-width: 240px;
}

.table-cell-number {
    width: 56px;
    min-width: 56px;
    text-align: center;
}

.table-cell-date {
    min-width: 130px;
    white-space: nowrap;
}

.table-cell-status {
    min-width: 120px;
    white-space: nowrap;
}

.table-cell-action {
    width: 1%;
    min-width: 170px;
    white-space: nowrap;
}

.table-primary-text {
    display: block;
    color: var(--text-main);
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.4;
}

.table-secondary-text {
    display: block;
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
}

.table-code {
    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        "Liberation Mono",
        monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .02em;
}

/* =====================================================
   TABLE CHECKBOX
===================================================== */

.table-check-cell {
    width: 46px;
    min-width: 46px;
    padding-right: 8px !important;
    padding-left: 14px !important;
    text-align: center !important;
}

.table-check-cell input[type="checkbox"] {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: var(--secondary);
    cursor: pointer;
}

/* =====================================================
   TABLE ACTIONS
===================================================== */

.table-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    flex-wrap: nowrap;

    width: max-content;
    min-width: 0;
    white-space: nowrap;
}

.table-actions form {
    display: inline-flex;
    flex: 0 0 auto;
    margin: 0;
}

.table-actions .btn {
    width: auto;
    min-width: 34px;
    min-height: 34px;
    flex: 0 0 auto;

    padding: 7px 10px;
    border-radius: 9px;

    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;

    box-shadow: none;
}

.table-actions .btn:hover {
    transform: translateY(-1px);
    box-shadow: none;
}

.table-actions .btn svg {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
}

.table-actions .btn-icon {
    width: 34px;
    min-width: 34px;
    padding: 0;
}

/* =====================================================
   ACTION BUTTON VARIANTS
===================================================== */

.btn-view {
    border: 1px solid rgba(37, 99, 235, .22);
    background: rgba(37, 99, 235, .08);
    color: var(--secondary-dark);
}

.btn-view:hover {
    border-color: rgba(37, 99, 235, .36);
    background: rgba(37, 99, 235, .14);
    color: var(--secondary-dark);
}

.btn-edit {
    border: 1px solid rgba(245, 158, 11, .28);
    background: rgba(245, 158, 11, .10);
    color: #b45309;
}

.btn-edit:hover {
    border-color: rgba(245, 158, 11, .40);
    background: rgba(245, 158, 11, .17);
    color: #92400e;
}

.btn-delete {
    border: 1px solid rgba(220, 38, 38, .24);
    background: rgba(220, 38, 38, .08);
    color: var(--danger-dark);
}

.btn-delete:hover {
    border-color: rgba(220, 38, 38, .38);
    background: rgba(220, 38, 38, .14);
    color: var(--danger-dark);
}

/* =====================================================
   BADGE & STATUS GLOBAL
===================================================== */

.badge,
.status-badge {
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;

    padding: 5px 9px;
    border: 1px solid transparent;
    border-radius: 999px;

    font-family: var(--font-heading);
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: .01em;
    white-space: nowrap;
}

.badge svg,
.status-badge svg {
    width: 13px;
    height: 13px;
    flex: 0 0 13px;
}

/* Biru */
.badge-primary,
.badge-info,
.status-registered,
.status-info {
    border-color: rgba(37, 99, 235, .18);
    background: rgba(37, 99, 235, .10);
    color: var(--secondary-dark);
}

/* Hijau */
.badge-success,
.badge-active,
.badge-paid,
.badge-in,
.status-active,
.status-paid,
.status-in,
.status-success {
    border-color: rgba(22, 163, 74, .20);
    background: rgba(22, 163, 74, .11);
    color: var(--success-dark);
}

/* Kuning */
.badge-warning,
.badge-pending,
.status-pending,
.status-warning {
    border-color: rgba(245, 158, 11, .24);
    background: rgba(245, 158, 11, .13);
    color: #92400e;
}

/* Merah */
.badge-danger,
.badge-invalid,
.status-invalid,
.status-danger,
.status-rejected {
    border-color: rgba(220, 38, 38, .20);
    background: rgba(220, 38, 38, .10);
    color: var(--danger-dark);
}

/* Abu */
.badge-secondary,
.badge-gray,
.badge-out,
.status-out,
.status-inactive,
.status-secondary {
    border-color: rgba(100, 116, 139, .20);
    background: rgba(100, 116, 139, .11);
    color: #475569;
}

/* Ungu */
.badge-manual,
.status-manual {
    border-color: rgba(124, 58, 237, .20);
    background: rgba(124, 58, 237, .10);
    color: #6d28d9;
}

/* Teal */
.badge-teal,
.status-verified {
    border-color: rgba(15, 118, 110, .20);
    background: rgba(15, 118, 110, .11);
    color: var(--accent-dark);
}

/* =====================================================
   EMPTY TABLE
===================================================== */

.table-empty,
.empty-state {
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 28px 18px;
    color: var(--text-muted);
    text-align: center;
}

.table-empty svg,
.empty-state svg {
    width: 44px;
    height: 44px;
    margin-bottom: 10px;
    color: #94a3b8;
}

.table-empty strong,
.empty-state strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text-main);
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 800;
}

.table-empty p,
.empty-state p {
    max-width: 420px;
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
}

/* =====================================================
   TABLE FOOTER
===================================================== */

.table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;

    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(148, 163, 184, .20);
}

.table-result-info {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
}

.table-result-info strong {
    color: var(--text-main);
    font-weight: 800;
}

/* =====================================================
   PAGINATION GLOBAL
===================================================== */

.pagination-container {
    width: 100%;
    min-width: 0;
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

.pagination-container nav {
    width: 100%;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    flex-wrap: wrap;

    margin: 0;
    padding: 0;
    list-style: none;
}

.page-item {
    display: inline-flex;
}

.page-link {
    min-width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0 9px;
    border: 1px solid rgba(148, 163, 184, .30);
    border-radius: 9px;

    background: #ffffff;
    color: #475569;

    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 800;
    line-height: 1;

    transition:
        background-color .18s ease,
        border-color .18s ease,
        color .18s ease;
}

.page-link:hover {
    border-color: rgba(37, 99, 235, .32);
    background: #eff6ff;
    color: var(--secondary-dark);
}

.page-item.active .page-link {
    border-color: var(--secondary);
    background: linear-gradient(
        135deg,
        var(--primary),
        var(--secondary)
    );
    color: #ffffff;
}

.page-item.disabled .page-link {
    cursor: not-allowed;
    border-color: #e2e8f0;
    background: #f8fafc;
    color: #94a3b8;
}

/* =====================================================
   LARAVEL PAGINATION TAILWIND COMPATIBILITY
===================================================== */

.pagination-container nav > div:first-child {
    margin-bottom: 8px;
}

.pagination-container nav svg {
    width: 16px;
    height: 16px;
}

.pagination-container nav a,
.pagination-container nav span {
    box-shadow: none !important;
}

/* =====================================================
   RESPONSIVE TABLE
===================================================== */

@media (max-width: 768px) {
    .table-wrapper {
        border-radius: 14px;
    }

    .table-wrapper table,
    table.data-table {
        min-width: 720px;
    }

    .table-wrapper thead th,
    .data-table thead th {
        padding: 11px 12px;
        font-size: 10px;
    }

    .table-wrapper tbody td,
    .data-table tbody td {
        padding: 11px 12px;
        font-size: 12px;
    }

    .table-actions .btn {
        min-height: 33px;
        padding: 7px 9px;
    }

    .table-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .pagination-container {
        justify-content: center;
    }

    .pagination {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .table-wrapper table,
    table.data-table {
        min-width: 680px;
    }

    .badge,
    .status-badge {
        min-height: 24px;
        padding: 4px 8px;
        font-size: 9px;
    }

    .page-link {
        min-width: 32px;
        height: 32px;
        padding: 0 8px;
    }
}

/* =====================================================
   FIX UI 8 — TAB GLOBAL TERSTANDAR
   Menyatukan ui-tabs dan kursi-tabs.
   Diletakkan setelah Fix UI 7 sebagai override final.
===================================================== */

/* =====================================================
   WRAPPER TAB
===================================================== */

.ui-tabs,
.kursi-tabs {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.ui-tabs-card,
.kursi-tabs-card {
    width: 100%;
    min-width: 0;
    overflow: visible;
}

/* =====================================================
   HEADER TAB
===================================================== */

.ui-tabs-header,
.kursi-tabs-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.ui-tabs-title,
.kursi-tabs-title {
    min-width: 0;
    flex: 1 1 auto;
}

.ui-tabs-title .card-title,
.kursi-tabs-title .card-title {
    margin: 0 0 4px;
}

.ui-tabs-title .card-subtitle,
.kursi-tabs-title .card-subtitle {
    margin: 0;
}

/* =====================================================
   NAVIGATION TAB
===================================================== */

.ui-tabs-nav,
.kursi-tabs-nav {
    width: 100%;
    max-width: 100%;
    min-width: 0;

    display: flex;
    align-items: center;
    gap: 8px;

    margin: 0 0 18px;
    padding: 7px;

    overflow-x: auto;
    overflow-y: hidden;

    border: 1px solid rgba(148, 163, 184, .25);
    border-radius: 15px;

    background: linear-gradient(
        135deg,
        #f8fafc,
        #ffffff
    );

    scrollbar-width: thin;
    scrollbar-color: rgba(100, 116, 139, .28) transparent;
}

.ui-tabs-nav::-webkit-scrollbar,
.kursi-tabs-nav::-webkit-scrollbar {
    height: 6px;
}

.ui-tabs-nav::-webkit-scrollbar-thumb,
.kursi-tabs-nav::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(100, 116, 139, .28);
}

.ui-tabs-nav::-webkit-scrollbar-track,
.kursi-tabs-nav::-webkit-scrollbar-track {
    background: transparent;
}

/* =====================================================
   TOMBOL TAB
===================================================== */

.ui-tab-button,
.kursi-tab-button {
    position: relative;

    min-width: max-content;
    min-height: 40px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    flex: 0 0 auto;

    padding: 9px 14px;

    border: 1px solid transparent;
    border-radius: 10px;

    background: transparent;
    color: #475569;

    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 800;
    line-height: 1;

    cursor: pointer;
    white-space: nowrap;

    box-shadow: none;

    transition:
        color .18s ease,
        background-color .18s ease,
        border-color .18s ease,
        box-shadow .18s ease;
}

.ui-tab-button svg,
.kursi-tab-button svg {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
}

.ui-tab-button:hover,
.kursi-tab-button:hover {
    transform: none;

    border-color: rgba(37, 99, 235, .15);
    background: rgba(37, 99, 235, .07);
    color: var(--secondary-dark);
}

/* =====================================================
   TAB AKTIF
===================================================== */

.ui-tab-button.active,
.ui-tab-button[aria-selected="true"],
.kursi-tab-button.active,
.kursi-tab-button[aria-selected="true"] {
    border-color: transparent;

    background: linear-gradient(
        135deg,
        var(--primary),
        var(--secondary)
    );

    color: #ffffff;

    box-shadow: 0 7px 18px rgba(37, 99, 235, .20);
}

.ui-tab-button.active svg,
.ui-tab-button[aria-selected="true"] svg,
.kursi-tab-button.active svg,
.kursi-tab-button[aria-selected="true"] svg {
    color: #ffffff;
}

/* Garis kecil penanda tab aktif */
.ui-tab-button.active::after,
.ui-tab-button[aria-selected="true"]::after,
.kursi-tab-button.active::after,
.kursi-tab-button[aria-selected="true"]::after {
    content: "";

    position: absolute;
    right: 12px;
    bottom: -7px;
    left: 12px;

    height: 3px;

    border-radius: 999px;

    background: var(--gold);
}

/* =====================================================
   JUMLAH DATA PADA TAB
===================================================== */

.ui-tab-count,
.kursi-tab-count {
    min-width: 21px;
    height: 21px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0 6px;

    border-radius: 999px;

    background: rgba(100, 116, 139, .12);
    color: #475569;

    font-size: 10px;
    font-weight: 900;
    line-height: 1;
}

.ui-tab-button.active .ui-tab-count,
.ui-tab-button[aria-selected="true"] .ui-tab-count,
.kursi-tab-button.active .kursi-tab-count,
.kursi-tab-button[aria-selected="true"] .kursi-tab-count {
    background: rgba(255, 255, 255, .20);
    color: #ffffff;
}

/* =====================================================
   PANEL TAB
===================================================== */

.ui-tabs-content,
.kursi-tabs-content {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.ui-tab-panel,
.kursi-tab-panel {
    display: none;
    width: 100%;
    min-width: 0;
}

.ui-tab-panel.active,
.kursi-tab-panel.active {
    display: block;
    animation: tabPanelEnter .16s ease-out;
}

.ui-tab-panel[hidden],
.kursi-tab-panel[hidden] {
    display: none !important;
}

@keyframes tabPanelEnter {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =====================================================
   HEADER DI DALAM PANEL
===================================================== */

.ui-tab-panel-header,
.kursi-tab-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;

    margin-bottom: 14px;
}

.ui-tab-panel-header > div,
.kursi-tab-panel-header > div {
    min-width: 0;
}

.ui-tab-panel-header .card-title,
.kursi-tab-panel-header .card-title {
    margin: 0 0 4px;
}

.ui-tab-panel-header .card-subtitle,
.kursi-tab-panel-header .card-subtitle {
    margin: 0;
}

/* =====================================================
   VARIANT TAB FULL
===================================================== */

.ui-tabs-fill .ui-tabs-nav,
.kursi-tabs-fill .kursi-tabs-nav {
    display: grid;
    grid-template-columns: repeat(
        auto-fit,
        minmax(150px, 1fr)
    );
    overflow: visible;
}

.ui-tabs-fill .ui-tab-button,
.kursi-tabs-fill .kursi-tab-button {
    width: 100%;
    min-width: 0;
}

/* =====================================================
   VARIANT TAB COMPACT
===================================================== */

.ui-tabs-compact .ui-tabs-nav,
.kursi-tabs-compact .kursi-tabs-nav {
    gap: 5px;
    padding: 5px;
    border-radius: 12px;
}

.ui-tabs-compact .ui-tab-button,
.kursi-tabs-compact .kursi-tab-button {
    min-height: 34px;
    padding: 7px 11px;
    font-size: 11px;
}

/* =====================================================
   TAB DI DALAM CARD
===================================================== */

.card > .ui-tabs-nav:first-child,
.card > .kursi-tabs-nav:first-child {
    margin-top: 0;
}

.card .ui-tab-panel > .card,
.card .kursi-tab-panel > .card {
    box-shadow: none;
}

/* =====================================================
   RESPONSIVE TAB
===================================================== */

@media (max-width: 768px) {
    .ui-tabs-header,
    .kursi-tabs-header,
    .ui-tab-panel-header,
    .kursi-tab-panel-header {
        flex-direction: column;
    }

    .ui-tabs-nav,
    .kursi-tabs-nav {
        gap: 6px;
        margin-bottom: 14px;
        padding: 6px;
        border-radius: 13px;
    }

    .ui-tab-button,
    .kursi-tab-button {
        min-height: 38px;
        padding: 8px 12px;
        font-size: 11px;
    }

    .ui-tabs-fill .ui-tabs-nav,
    .kursi-tabs-fill .kursi-tabs-nav {
        grid-template-columns: repeat(
            2,
            minmax(0, 1fr)
        );
    }

    .ui-tab-panel-header .btn,
    .kursi-tab-panel-header .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    /*
     * Pada layar kecil tab tetap horizontal.
     * Tidak dipaksa menjadi tombol panjang satu per baris.
     */
    .ui-tabs-nav,
    .kursi-tabs-nav {
        display: flex;
        overflow-x: auto;
    }

    .ui-tabs-fill .ui-tabs-nav,
    .kursi-tabs-fill .kursi-tabs-nav {
        display: grid;
        grid-template-columns: 1fr;
        overflow: visible;
    }

    .ui-tab-button,
    .kursi-tab-button {
        min-width: max-content;
    }

    .ui-tabs-fill .ui-tab-button,
    .kursi-tabs-fill .kursi-tab-button {
        min-width: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ui-tab-panel.active,
    .kursi-tab-panel.active {
        animation: none;
    }
}

/* =====================================================
   FIX UI 9 — RESPONSIVE GLOBAL FINAL
   Diletakkan paling bawah setelah Fix UI 8.
   Tidak mengubah route, controller, input, atau proses bisnis.
===================================================== */

/* =====================================================
   PROTEKSI LAYOUT GLOBAL
===================================================== */

html,
body {
    width: 100%;
    max-width: 100%;
}

.app-shell,
.content,
.content-grid,
.content > *,
.card,
.card-body,
.form-section,
.table-wrapper,
.ui-tabs,
.kursi-tabs {
    min-width: 0;
}

.content {
    width: auto;
    max-width: 100%;
    overflow-x: hidden;
}

.content img,
.content video,
.content canvas,
.content iframe {
    max-width: 100%;
}

.card,
.form-section,
.alert-card,
.filter-panel,
.scan-panel,
.scan-result-card,
.scan-log-list {
    max-width: 100%;
}

/* =====================================================
   DESKTOP MENENGAH
===================================================== */

@media (max-width: 1280px) {
    .content {
        padding: 20px 22px;
    }

    .topbar {
        gap: 14px;
    }

    .topbar h1 {
        font-size: 1.35rem;
    }

    .event-chip {
        max-width: 280px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .qr-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .filter-panel-body .filter-form-grid {
        grid-template-columns: repeat(3, minmax(160px, 1fr));
    }
}

/* =====================================================
   LAPTOP KECIL DAN TABLET LANDSCAPE
===================================================== */

@media (max-width: 1100px) {
    .content {
        padding: 18px 20px;
    }

    .content-grid {
        gap: 16px;
    }

    .content-grid > .col-8,
    .content-grid > .col-6,
    .content-grid > .col-4,
    .content-grid > .col-3 {
        grid-column: span 12;
    }

    .content-grid > .col-4 .attendance-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .registration-hero,
    .scan-page {
        grid-template-columns: 1fr;
    }

    .scan-side {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: auto;
    }

    .scan-log-list {
        grid-column: 1 / -1;
    }

    .form-grid-3,
    .form-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .qr-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .seat-map-header,
    .kursi-tabs-header,
    .ui-tabs-header {
        flex-wrap: wrap;
    }
}

/* =====================================================
   TABLET
===================================================== */

@media (max-width: 992px) {
    .topbar {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .topbar-left {
        flex: 1 1 420px;
    }

    .topbar-actions {
        flex: 1 1 100%;
        justify-content: flex-start;
    }

    .event-chip {
        max-width: 100%;
    }

    .page-actions-between {
        align-items: stretch;
        flex-direction: column;
    }

    .page-actions-between > *,
    .page-actions-between .page-actions,
    .page-actions-between .filter-actions {
        width: 100%;
    }

    .filter-panel-body .filter-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-panel-body .filter-form-grid .filter-field-wide {
        grid-column: span 2;
    }

    .scan-toolbar,
    .scan-form-grid {
        grid-template-columns: 1fr;
    }

    .scan-actions.simple {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .scan-frame,
    .scan-frame.simple {
        min-height: 300px;
    }

    .attendance-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .invoice-box {
        max-width: 100%;
    }
}

/* =====================================================
   MOBILE DAN TABLET PORTRAIT
===================================================== */

@media (max-width: 768px) {
    body {
        font-size: 14px;
    }

    body.no-scroll,
    body.modal-open {
        overflow: hidden;
    }

    /* Layout */
    .content {
        width: 100%;
        margin-left: 0 !important;
        padding: 14px;
    }

    .content-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .content-grid > [class*="col-"] {
        grid-column: 1 / -1 !important;
    }

    /* Sidebar off-canvas */
    .sidebar {
        width: 270px !important;
        max-width: 84vw !important;
        transform: translateX(-105%) !important;
        visibility: hidden;
        box-shadow: none;
    }

    .sidebar.active {
        transform: translateX(0) !important;
        visibility: visible;
        box-shadow: 14px 0 36px rgba(15, 23, 42, .28);
    }

    .sidebar-overlay {
        display: block;
    }

    .menu-toggle {
        display: inline-flex !important;
    }

    /* Topbar */
    .topbar {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
        margin-bottom: 16px;
        padding-bottom: 14px;
    }

    .topbar-left {
        width: 100%;
        align-items: flex-start;
        flex-basis: auto;
    }

    .topbar-copy {
        min-width: 0;
    }

    .topbar h1 {
        font-size: 1.18rem;
        line-height: 1.35;
    }

    .topbar p {
        font-size: .82rem;
        line-height: 1.5;
    }

    .topbar-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
    }

    .topbar-actions .event-chip {
        width: 100%;
        max-width: 100%;
        justify-content: flex-start;
        white-space: normal;
        border-radius: 12px;
    }

    /* Card */
    .card {
        padding: 16px;
        border-radius: 16px;
    }

    .card-header {
        align-items: stretch;
        flex-direction: column;
        margin: -16px -16px 16px;
        padding: 15px 16px;
    }

    .card-header > .btn,
    .card-header > button,
    .card-header > a.btn {
        width: 100%;
        justify-content: center;
    }

    .card-footer {
        margin: 16px -16px -16px;
        padding: 14px 16px;
    }

    /* KPI */
    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .kpi-card {
        min-height: 96px;
        padding: 15px;
    }

    .kpi-icon {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
    }

    .kpi-value {
        font-size: 24px;
    }

    /* Form */
    .form-grid,
    .form-grid-1,
    .form-grid-2,
    .form-grid-3,
    .form-grid-4 {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .form-group-full {
        grid-column: auto;
    }

    .form-section {
        padding: 15px;
    }

    .form-control,
    .form-select,
    textarea.form-control,
    input[type="file"].form-control {
        font-size: 16px;
    }

    /*
     * Font 16px mencegah browser mobile melakukan zoom otomatis
     * ketika input disentuh.
     */

    /* Filter */
    .filter-panel-summary {
        min-height: 62px;
        align-items: flex-start;
        padding: 13px 14px;
    }

    .filter-panel-icon {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }

    .filter-panel-title > span {
        display: none;
    }

    .filter-panel-toggle {
        width: 36px;
        min-width: 36px;
        height: 36px;
        padding: 0;
        border-radius: 11px;
    }

    .filter-panel-toggle span {
        display: none !important;
    }

    .filter-panel-body {
        padding: 14px;
    }

    .filter-panel-body .filter-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-panel-body .filter-form-grid .filter-field-wide {
        grid-column: span 2;
    }

    .filter-actions,
    .form-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .filter-actions .btn,
    .form-actions .btn {
        width: 100%;
        min-width: 0;
    }

    /* Tabel */
    .table-wrapper {
        width: 100%;
        border-radius: 14px;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
    }

    .table-wrapper table,
    table.data-table {
        min-width: 720px;
    }

    .table-wrapper thead th,
    .data-table thead th {
        padding: 11px 12px;
        font-size: 10px;
    }

    .table-wrapper tbody td,
    .data-table tbody td {
        padding: 11px 12px;
        font-size: 12px;
    }

    .table-actions {
        min-width: max-content;
    }

    .pagination-container,
    .pagination {
        justify-content: center;
    }

    /* Tabs */
    .ui-tabs-header,
    .kursi-tabs-header,
    .ui-tab-panel-header,
    .kursi-tab-panel-header {
        align-items: stretch;
        flex-direction: column;
    }

    .ui-tabs-nav,
    .kursi-tabs-nav {
        display: flex;
        overflow-x: auto;
        gap: 6px;
        padding: 6px;
    }

    .ui-tab-button,
    .kursi-tab-button {
        min-width: max-content;
        min-height: 38px;
        padding: 8px 12px;
    }

    /* Scanner */
    .scan-page {
        gap: 14px;
    }

    .scan-side {
        grid-template-columns: 1fr;
    }

    .scan-actions.simple {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .scan-input-row,
    .scan-input-row.simple {
        grid-template-columns: 1fr;
    }

    .scan-frame,
    .scan-frame.simple {
        min-height: 260px;
    }

    .scan-result,
    .scan-result.simple {
        min-height: 190px;
    }

    /* QR dan tamu */
    .qr-grid,
    .guest-grid,
    .attendance-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* Modal */
    .custom-modal,
    .custom-modal.show {
        align-items: flex-end !important;
        padding: 10px !important;
    }

    .custom-modal-dialog,
    .custom-modal-box,
    .custom-modal-content,
    .modal-dialog-custom,
    .custom-modal-lg {
        width: 100%;
        max-width: 100%;
        max-height: calc(100dvh - 20px);
        border-radius: 18px 18px 0 0;
    }

    /* Peta kursi */
    .seat-map-header {
        align-items: stretch;
        flex-direction: column;
    }

    .seat-layout-scroll {
        margin-right: -4px;
        margin-left: -4px;
        padding-right: 4px;
        padding-left: 4px;
    }

    .seat-layout-flex {
        gap: 20px;
    }

    .seat-map-block {
        min-width: 240px;
        padding: 12px;
    }

    .seat-box {
        min-width: 62px;
        height: 46px;
    }

    /* Login */
    .login-card {
        width: 100%;
        max-width: 540px;
        grid-template-columns: 1fr;
    }

    .login-info,
    .login-form {
        padding: 24px;
    }
}

/* =====================================================
   MOBILE KECIL
===================================================== */

@media (max-width: 576px) {
    .content {
        padding: 10px;
    }

    .content-grid {
        gap: 12px;
    }

    .card {
        padding: 14px;
        border-radius: 14px;
    }

    .card-header {
        margin: -14px -14px 14px;
        padding: 14px;
    }

    .card-footer {
        margin: 14px -14px -14px;
        padding: 13px 14px;
    }

    /* KPI satu kolom */
    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .kpi-card {
        min-height: 88px;
        padding: 14px;
    }

    /* Filter satu kolom */
    .filter-panel-body .filter-form-grid {
        grid-template-columns: 1fr;
    }

    .filter-panel-body .filter-form-grid .filter-field-wide {
        grid-column: auto;
    }

    .filter-actions,
    .form-actions {
        grid-template-columns: 1fr;
    }

    /* QR dan ringkasan satu kolom */
    .qr-grid,
    .guest-grid,
    .attendance-summary,
    .content-grid > .col-4 .attendance-summary {
        grid-template-columns: 1fr;
    }

    .qr-placeholder {
        width: 132px;
        height: 132px;
    }

    /* Scanner */
    .scan-panel,
    .scan-result,
    .scan-person-card,
    .scan-log-list,
    .scan-result-card {
        padding: 14px;
        border-radius: 15px;
    }

    .scan-actions.simple {
        grid-template-columns: 1fr;
    }

    .scan-frame,
    .scan-frame.simple {
        min-height: 240px;
    }

    #qr-reader__scan_region,
    #qr-reader video {
        min-height: 240px !important;
    }

    /* Invoice */
    .invoice-header,
    .invoice-body {
        padding: 16px;
    }

    .invoice-row,
    .invoice-total {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }

    .invoice-row strong {
        text-align: left;
    }

    /* Pagination */
    .pagination {
        gap: 4px;
    }

    .page-link {
        min-width: 32px;
        height: 32px;
        padding: 0 8px;
    }

    /* Peta kursi */
    .seat-zone {
        padding: 10px;
    }

    .seat-zone-title {
        align-items: stretch;
        flex-direction: column;
    }

    .seat-zone-title small {
        width: fit-content;
    }
}

/* =====================================================
   MOBILE SANGAT KECIL
===================================================== */

@media (max-width: 420px) {
    .topbar-left {
        gap: 9px;
    }

    .menu-toggle {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }

    .topbar h1 {
        font-size: 1.08rem;
    }

    .kpi-card {
        gap: 11px;
    }

    .kpi-icon {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
    }

    .kpi-value {
        font-size: 22px;
    }

    .filter-panel-heading {
        gap: 9px;
    }

    .filter-panel-title strong {
        font-size: 13px;
    }

    .table-wrapper table,
    table.data-table {
        min-width: 660px;
    }

    .custom-modal-header,
    .custom-modal-body,
    .custom-modal-footer {
        padding-right: 13px;
        padding-left: 13px;
    }
}

/* =====================================================
   LAYAR PENDEK
===================================================== */

@media (max-height: 680px) and (min-width: 769px) {
    .content {
        padding-top: 14px;
        padding-bottom: 14px;
    }

    .topbar {
        margin-bottom: 14px;
        padding-bottom: 12px;
    }

    .custom-modal,
    .custom-modal.show {
        align-items: flex-start !important;
        padding-top: 10px !important;
        padding-bottom: 10px !important;
    }

    .custom-modal-dialog,
    .custom-modal-box,
    .custom-modal-content,
    .modal-dialog-custom {
        max-height: calc(100dvh - 20px);
    }

    .scan-frame,
    .scan-frame.simple {
        min-height: 280px;
    }
}

/* =====================================================
   ORIENTASI LANDSCAPE MOBILE
===================================================== */

@media (max-height: 520px) and (max-width: 900px) {
    .sidebar {
        overflow-y: auto;
    }

    .custom-modal,
    .custom-modal.show {
        align-items: flex-start !important;
    }

    .custom-modal-dialog,
    .custom-modal-box,
    .custom-modal-content,
    .modal-dialog-custom {
        max-height: calc(100dvh - 16px);
    }

    .scan-frame,
    .scan-frame.simple {
        min-height: 220px;
    }
}

/* =====================================================
   REDUCED MOTION
===================================================== */

@media (prefers-reduced-motion: reduce) {
    .sidebar,
    .sidebar-overlay,
    .kpi-card,
    .ui-tab-button,
    .kursi-tab-button,
    .filter-panel-toggle svg {
        transition: none !important;
    }
}

/* =====================================================
   FIX UI 10 — AKSESIBILITAS DASAR GLOBAL
   Diletakkan setelah Fix UI 9.
===================================================== */

/* =====================================================
   SKIP LINK
===================================================== */

.skip-link {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 100000;

    padding: 10px 14px;
    border: 2px solid #ffffff;
    border-radius: 10px;

    background: var(--primary-deep);
    color: #ffffff;

    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 800;

    box-shadow: 0 8px 24px rgba(15, 23, 42, .28);

    transform: translateY(-160%);
    transition: transform .16s ease;
}

.skip-link:focus {
    color: #ffffff;
    transform: translateY(0);
}

/* =====================================================
   SCREEN READER ONLY
===================================================== */

.sr-only,
.visually-hidden-accessible {
    position: absolute !important;

    width: 1px !important;
    height: 1px !important;

    padding: 0 !important;
    margin: -1px !important;

    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;

    border: 0 !important;
}

.sr-only-focusable:focus {
    position: static !important;

    width: auto !important;
    height: auto !important;

    margin: 0 !important;

    overflow: visible !important;
    clip: auto !important;
    white-space: normal !important;
}

/* =====================================================
   FOCUS GLOBAL
===================================================== */

:focus {
    outline: none;
}

:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .42);
    outline-offset: 3px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[role="button"]:focus-visible,
[role="tab"]:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .42);
    outline-offset: 3px;
}

/* Konten utama tidak menampilkan outline setelah skip link */
#mainContent:focus {
    outline: none;
}

/* Fokus khusus tombol berwarna */
.btn-primary:focus-visible,
.btn-success:focus-visible,
.btn-danger:focus-visible,
.btn-warning:focus-visible,
.btn-info:focus-visible {
    outline-color: rgba(15, 23, 42, .42);
    box-shadow:
        0 0 0 3px #ffffff,
        0 0 0 6px rgba(37, 99, 235, .42);
}

/* =====================================================
   TARGET SENTUH
===================================================== */

.menu-toggle,
.modal-close,
.ui-tab-button,
.kursi-tab-button,
.filter-panel-summary,
.page-link {
    touch-action: manipulation;
}

.menu-toggle,
.modal-close {
    min-width: 40px;
    min-height: 40px;
}

.sidebar .menu a,
.sidebar .menu button,
.menu-logout {
    min-height: 42px;
}

@media (max-width: 768px) {
    .sidebar .menu a,
    .sidebar .menu button,
    .menu-logout,
    .btn,
    .ui-tab-button,
    .kursi-tab-button {
        min-height: 44px;
    }
}

/* =====================================================
   BUTTON DAN LINK DISABLED
===================================================== */

button:disabled,
.btn.disabled,
.btn[aria-disabled="true"],
a[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: .58;
}

a[aria-disabled="true"] {
    pointer-events: none;
}

/* =====================================================
   FORM ACCESSIBILITY
===================================================== */

.form-label {
    cursor: pointer;
}

.form-control[aria-invalid="true"],
.form-select[aria-invalid="true"],
textarea[aria-invalid="true"] {
    border-color: var(--danger) !important;
    background-color: #fffafa;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .10);
}

.form-control[aria-invalid="true"]:focus,
.form-select[aria-invalid="true"]:focus,
textarea[aria-invalid="true"]:focus {
    box-shadow:
        0 0 0 3px rgba(220, 38, 38, .12),
        0 0 0 6px rgba(220, 38, 38, .06);
}

.form-error,
.invalid-feedback {
    position: relative;
    padding-left: 17px;
}

.form-error::before,
.invalid-feedback::before {
    content: "!";
    position: absolute;
    top: 0;
    left: 0;

    width: 13px;
    height: 13px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 999px;

    background: var(--danger);
    color: #ffffff;

    font-size: 9px;
    font-weight: 900;
    line-height: 1;
}

/* Checkbox dan radio tetap terlihat saat fokus */
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .35);
    outline-offset: 3px;
}

/* =====================================================
   ALERT DAN STATUS
===================================================== */

.alert,
.alert-card,
.scan-camera-feedback,
.scan-result {
    position: relative;
}

.alert[role="alert"],
.alert-card[role="alert"] {
    scroll-margin-top: 20px;
}

/* Warna bukan satu-satunya penanda status */
.status-badge::before,
.badge::before {
    width: 6px;
    height: 6px;

    display: inline-block;
    flex: 0 0 6px;

    border-radius: 999px;

    background: currentColor;

    content: "";
}

.badge:has(svg)::before,
.status-badge:has(svg)::before {
    display: none;
}

/* =====================================================
   TABEL ACCESSIBILITY
===================================================== */

.table-wrapper {
    scroll-margin-top: 16px;
}

.table-wrapper table caption {
    padding: 10px 12px;

    color: var(--text-muted);
    background: #f8fafc;

    font-size: 12px;
    font-weight: 600;
    text-align: left;
}

.table-wrapper th[scope="col"] {
    vertical-align: bottom;
}

.table-wrapper tbody tr:focus-within td {
    background: #eff6ff;
}

.table-wrapper a:focus-visible,
.table-wrapper button:focus-visible {
    position: relative;
    z-index: 5;
}

/* Informasi bahwa tabel dapat digeser pada mobile */
.table-scroll-hint {
    display: none;
    align-items: center;
    gap: 6px;

    margin-bottom: 8px;

    color: var(--text-muted);

    font-size: 11px;
    font-weight: 600;
}

.table-scroll-hint svg {
    width: 15px;
    height: 15px;
}

@media (max-width: 768px) {
    .table-scroll-hint {
        display: flex;
    }
}

/* =====================================================
   TAB ACCESSIBILITY
===================================================== */

.ui-tab-button[aria-selected="false"],
.kursi-tab-button[aria-selected="false"] {
    color: #475569;
}

.ui-tab-button[aria-selected="true"],
.kursi-tab-button[aria-selected="true"] {
    color: #ffffff;
}

.ui-tab-button[aria-disabled="true"],
.kursi-tab-button[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: .55;
}

.ui-tab-panel:focus,
.kursi-tab-panel:focus {
    outline: none;
}

.ui-tab-panel:focus-visible,
.kursi-tab-panel:focus-visible {
    border-radius: 10px;
    outline: 3px solid rgba(37, 99, 235, .30);
    outline-offset: 4px;
}

/* =====================================================
   FILTER DETAILS
===================================================== */

.filter-panel-summary {
    outline: none;
}

.filter-panel-summary:focus-visible {
    position: relative;
    z-index: 2;

    outline: 3px solid rgba(37, 99, 235, .35);
    outline-offset: -3px;
}

.filter-panel-summary::after {
    content: "";
}

/* =====================================================
   MODAL ACCESSIBILITY
===================================================== */

.custom-modal[aria-hidden="true"] {
    visibility: hidden;
}

.custom-modal[aria-hidden="false"] {
    visibility: visible;
}

.custom-modal-dialog[role="dialog"] {
    outline: none;
}

.custom-modal-dialog:focus-visible {
    outline: 3px solid rgba(255, 255, 255, .70);
    outline-offset: 4px;
}

.modal-close {
    position: relative;
}

.modal-close::after {
    content: "";
    position: absolute;
    inset: -4px;
}

/* =====================================================
   SIDEBAR ACCESSIBILITY
===================================================== */

.sidebar a.active,
.sidebar a[aria-current="page"] {
    background: rgba(37, 99, 235, .24);
    color: #ffffff;
    box-shadow: inset 3px 0 0 #38bdf8;
}

.sidebar a[aria-current="page"]::after {
    width: 6px;
    height: 6px;

    margin-left: auto;

    border-radius: 999px;

    background: #ffffff;

    content: "";
}

/* =====================================================
   KONTRAS TEKS
===================================================== */

.text-muted {
    color: #64748b !important;
}

.form-help,
.table-secondary-text,
.card-subtitle {
    color: #64748b;
}

/* =====================================================
   HIGH CONTRAST MODE
===================================================== */

@media (forced-colors: active) {
    .btn,
    .card,
    .filter-panel,
    .kpi-card,
    .status-badge,
    .badge,
    .ui-tab-button,
    .kursi-tab-button {
        border: 1px solid CanvasText;
    }

    .status-badge::before,
    .badge::before {
        background: CanvasText;
    }

    .sidebar a.active,
    .sidebar a[aria-current="page"] {
        outline: 2px solid Highlight;
    }
}

/* =====================================================
   REDUCED MOTION
===================================================== */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* =====================================================
   FIX UI 11 — FEEDBACK, ALERT & EMPTY STATE GLOBAL
   Diletakkan setelah Fix UI 10 sebagai override final.
===================================================== */

/* =====================================================
   STACK PESAN
===================================================== */

.feedback-stack {
    width: 100%;
    min-width: 0;
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
}

.feedback-stack:empty {
    display: none;
}

/* =====================================================
   ALERT GLOBAL
===================================================== */

.alert {
    position: relative;
    width: 100%;
    min-width: 0;

    display: flex;
    align-items: flex-start;
    gap: 11px;

    margin: 0;
    padding: 13px 44px 13px 14px;

    border: 1px solid transparent;
    border-radius: 13px;

    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;

    box-shadow: 0 4px 14px rgba(15, 23, 42, .05);
}

.alert-icon {
    width: 22px;
    height: 22px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 22px;

    margin-top: 1px;
}

.alert-icon svg {
    width: 20px;
    height: 20px;
}

.alert-content {
    min-width: 0;
    flex: 1 1 auto;
}

.alert-title {
    display: block;
    margin: 0 0 2px;

    color: inherit;

    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.4;
}

.alert-message {
    margin: 0;
    color: inherit;
}

.alert-message + .alert-message {
    margin-top: 4px;
}

.alert-list {
    margin: 7px 0 0;
    padding-left: 18px;
}

.alert-list li + li {
    margin-top: 3px;
}

.alert-close {
    position: absolute;
    top: 9px;
    right: 9px;

    width: 30px;
    height: 30px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0;
    border: 0;
    border-radius: 9px;

    background: transparent;
    color: currentColor;

    opacity: .65;
    cursor: pointer;

    transition:
        opacity .16s ease,
        background-color .16s ease;
}

.alert-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, .48);
}

.alert-close svg {
    width: 16px;
    height: 16px;
}

/* =====================================================
   ALERT VARIANTS
===================================================== */

.alert-success {
    border-color: rgba(22, 163, 74, .22);
    background: rgba(22, 163, 74, .09);
    color: var(--success-dark);
}

.alert-danger {
    border-color: rgba(220, 38, 38, .22);
    background: rgba(220, 38, 38, .08);
    color: var(--danger-dark);
}

.alert-warning {
    border-color: rgba(245, 158, 11, .28);
    background: rgba(245, 158, 11, .11);
    color: #92400e;
}

.alert-info {
    border-color: rgba(37, 99, 235, .22);
    background: rgba(37, 99, 235, .08);
    color: var(--secondary-dark);
}

/* Alert validasi */
.alert-validation {
    border-left-width: 4px;
}

.alert-validation .alert-title {
    font-size: 14px;
}

/* Alert compact */
.alert-compact {
    padding-top: 10px;
    padding-bottom: 10px;
}

.alert-compact .alert-icon {
    width: 19px;
    height: 19px;
    flex-basis: 19px;
}

.alert-compact .alert-icon svg {
    width: 17px;
    height: 17px;
}

/* =====================================================
   INLINE MESSAGE
===================================================== */

.inline-message {
    display: flex;
    align-items: flex-start;
    gap: 7px;

    margin-top: 7px;
    padding: 8px 10px;

    border-radius: 9px;

    font-size: 11px;
    font-weight: 600;
    line-height: 1.45;
}

.inline-message svg {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    margin-top: 1px;
}

.inline-message.info {
    background: rgba(37, 99, 235, .07);
    color: var(--secondary-dark);
}

.inline-message.success {
    background: rgba(22, 163, 74, .08);
    color: var(--success-dark);
}

.inline-message.warning {
    background: rgba(245, 158, 11, .10);
    color: #92400e;
}

.inline-message.danger {
    background: rgba(220, 38, 38, .07);
    color: var(--danger-dark);
}

/* =====================================================
   EMPTY STATE GLOBAL
===================================================== */

.empty-state,
.table-empty,
.state-panel {
    width: 100%;
    min-width: 0;
    min-height: 190px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 30px 20px;

    border: 1px dashed rgba(148, 163, 184, .42);
    border-radius: 15px;

    background: linear-gradient(
        135deg,
        #ffffff,
        #f8fafc
    );

    color: var(--text-muted);
    text-align: center;
}

.empty-state-icon,
.state-panel-icon {
    width: 52px;
    height: 52px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 12px;

    border-radius: 16px;

    background: #eef2f7;
    color: #64748b;
}

.empty-state-icon svg,
.state-panel-icon svg {
    width: 27px;
    height: 27px;
}

.empty-state-title,
.state-panel-title {
    margin: 0;

    color: var(--text-main);

    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 800;
    line-height: 1.4;
}

.empty-state-text,
.state-panel-text {
    max-width: 430px;
    margin: 5px 0 0;

    color: var(--text-muted);

    font-size: 12px;
    line-height: 1.55;
}

.empty-state-actions,
.state-panel-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;

    margin-top: 15px;
}

/* =====================================================
   STATE VARIANTS
===================================================== */

.state-panel.info .state-panel-icon {
    background: rgba(37, 99, 235, .10);
    color: var(--secondary-dark);
}

.state-panel.success .state-panel-icon {
    background: rgba(22, 163, 74, .10);
    color: var(--success-dark);
}

.state-panel.warning .state-panel-icon {
    background: rgba(245, 158, 11, .13);
    color: #b45309;
}

.state-panel.danger .state-panel-icon {
    background: rgba(220, 38, 38, .10);
    color: var(--danger-dark);
}

/* =====================================================
   LOADING STATE
===================================================== */

.loading-state {
    min-height: 150px;
}

.loading-spinner {
    width: 34px;
    height: 34px;

    margin-bottom: 12px;

    border: 4px solid rgba(148, 163, 184, .24);
    border-top-color: var(--secondary);
    border-radius: 999px;

    animation: uiLoadingSpin .75s linear infinite;
}

@keyframes uiLoadingSpin {
    to {
        transform: rotate(360deg);
    }
}

/* =====================================================
   SKELETON
===================================================== */

.skeleton {
    position: relative;
    overflow: hidden;

    border-radius: 8px;
    background: #e2e8f0;
}

.skeleton::after {
    content: "";

    position: absolute;
    inset: 0;

    transform: translateX(-100%);

    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, .55),
        transparent
    );

    animation: uiSkeletonMove 1.3s infinite;
}

.skeleton-text {
    width: 100%;
    height: 12px;
}

.skeleton-text + .skeleton-text {
    margin-top: 8px;
}

.skeleton-text.short {
    width: 55%;
}

.skeleton-card {
    height: 90px;
}

@keyframes uiSkeletonMove {
    to {
        transform: translateX(100%);
    }
}

/* =====================================================
   ERROR PAGE
===================================================== */

.error-page {
    min-height: calc(100vh - 170px);

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px;
}

.error-page-card {
    width: min(620px, 100%);

    padding: 34px;

    border: 1px solid rgba(148, 163, 184, .28);
    border-radius: 20px;

    background: #ffffff;
    box-shadow: var(--shadow-md);

    text-align: center;
}

.error-page-code {
    display: block;

    margin-bottom: 8px;

    color: var(--secondary);

    font-family: var(--font-heading);
    font-size: clamp(40px, 8vw, 72px);
    font-weight: 900;
    line-height: 1;
}

.error-page-title {
    margin: 0;

    color: var(--text-main);

    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
}

.error-page-text {
    max-width: 470px;
    margin: 8px auto 0;

    color: var(--text-muted);

    font-size: 13px;
    line-height: 1.6;
}

.error-page-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    flex-wrap: wrap;

    margin-top: 20px;
}

/* =====================================================
   RESPONSIVE
===================================================== */

@media (max-width: 768px) {
    .alert {
        padding: 12px 40px 12px 12px;
    }

    .empty-state,
    .table-empty,
    .state-panel {
        min-height: 170px;
        padding: 24px 16px;
    }

    .empty-state-actions,
    .state-panel-actions,
    .error-page-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .empty-state-actions .btn,
    .state-panel-actions .btn,
    .error-page-actions .btn {
        width: 100%;
    }

    .error-page {
        padding: 14px;
    }

    .error-page-card {
        padding: 26px 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .loading-spinner,
    .skeleton::after {
        animation: none;
    }
}

/* =====================================================
   BATCH 4 FINAL — BLADE/CSS SYNCHRONIZATION
   Helper yang masih digunakan Blade aktif.
===================================================== */

.alert-card-spaced {
    margin-bottom: 16px;
}

.small {
    font-size: .875em;
}

.feedback-detail {
    margin-top: 10px;
}

.form-help-spaced {
    margin-top: 8px;
}

.page-actions-spaced-bottom {
    margin-bottom: 14px;
}

.table-actions-center {
    justify-content: center;
    margin-right: auto;
    margin-left: auto;
}

.form-check-stack {
    display: grid;
    gap: 9px;
    margin-top: 8px;
}

.permission-check {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--secondary);
    cursor: pointer;
}

.custom-modal-dialog.custom-modal-xl,
.custom-modal-xl {
    width: min(1180px, 100%);
    max-width: 1180px;
}

.filter-panel + .table-scroll-hint,
.filter-panel + .table-wrapper {
    margin-top: 16px;
}

@media (max-width: 768px) {
    .custom-modal-dialog.custom-modal-xl,
    .custom-modal-xl {
        width: 100%;
        max-width: 100%;
    }
}

.manual-drawer-handle {
    position: fixed;
    top: 50%;
    right: 0;
    z-index: 8998;

    min-height: 118px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;

    padding: 13px 9px;

    border: 0;
    border-radius: 16px 0 0 16px;

    background: linear-gradient(
        180deg,
        var(--primary),
        var(--secondary)
    );

    color: #ffffff;
    box-shadow: -8px 8px 24px rgba(15, 23, 42, .20);

    transform: translateY(-50%);
    cursor: pointer;
}

.manual-drawer-handle span {
    writing-mode: vertical-rl;
    transform: rotate(180deg);

    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.manual-drawer-handle svg {
    width: 20px;
    height: 20px;
}

/* MANUAL DRAWER GLOBAL — START */

/* =====================================================
   MANUAL BOOK — PEGANGAN LACI
===================================================== */

.manual-drawer-handle {
    position: fixed;
    top: 50%;
    right: 0;
    z-index: 8990;

    width: 48px;
    min-height: 128px;

    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 9px;

    padding: 13px 8px;

    border: 1px solid rgba(255, 255, 255, .22);
    border-right: 0;
    border-radius: 17px 0 0 17px;

    background:
        linear-gradient(
            180deg,
            var(--primary),
            var(--secondary)
        );

    color: #ffffff;

    box-shadow:
        -8px 10px 28px rgba(15, 23, 42, .22);

    transform: translateY(-50%);

    cursor: pointer;
    touch-action: manipulation;

    transition:
        width .18s ease,
        right .26s ease,
        transform .18s ease,
        opacity .18s ease,
        box-shadow .18s ease;
}

.manual-drawer-handle:hover {
    width: 54px;

    color: #ffffff;

    box-shadow:
        -10px 12px 32px rgba(15, 23, 42, .28);
}

.manual-drawer-handle:active {
    transform:
        translateY(-50%)
        translateX(2px);
}

.manual-drawer-handle:focus-visible {
    outline: 3px solid rgba(245, 158, 11, .68);
    outline-offset: 3px;
}

.manual-drawer-handle svg {
    width: 21px;
    height: 21px;
    flex: 0 0 21px;
}

.manual-drawer-handle span {
    writing-mode: vertical-rl;

    transform: rotate(180deg);

    font-family: var(--font-heading);
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: .11em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Saat drawer terbuka, pegangan menghilang agar tidak menutupi panel. */
body.manual-drawer-open .manual-drawer-handle {
    right: 460px;

    opacity: 0;
    pointer-events: none;
}

/* =====================================================
   WRAPPER DAN OVERLAY
===================================================== */

.manual-drawer {
    position: fixed;
    inset: 0;
    z-index: 9000;

    visibility: hidden;
    pointer-events: none;
}

.manual-drawer[aria-hidden="false"],
.manual-drawer.show {
    visibility: visible;
    pointer-events: auto;
}

.manual-drawer-overlay {
    position: absolute;
    inset: 0;

    background: rgba(15, 23, 42, .46);
    backdrop-filter: blur(2px);

    opacity: 0;

    transition: opacity .26s ease;
}

.manual-drawer[aria-hidden="false"] .manual-drawer-overlay,
.manual-drawer.show .manual-drawer-overlay {
    opacity: 1;
}

/* =====================================================
   PANEL DRAWER
===================================================== */

.manual-drawer-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;

    width: min(460px, 100vw);
    max-width: 100%;

    display: flex;
    flex-direction: column;

    overflow: hidden;

    border-left: 1px solid rgba(148, 163, 184, .30);

    background: #ffffff;

    box-shadow:
        -20px 0 55px rgba(15, 23, 42, .24);

    transform: translateX(102%);

    transition: transform .28s ease;
}

.manual-drawer[aria-hidden="false"] .manual-drawer-panel,
.manual-drawer.show .manual-drawer-panel {
    transform: translateX(0);
}

body.manual-drawer-open {
    overflow: hidden;
}

/* =====================================================
   HEADER DRAWER
===================================================== */

.manual-drawer-header {
    position: relative;
    z-index: 3;

    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;

    flex: 0 0 auto;

    padding: 20px;

    border-bottom: 1px solid rgba(148, 163, 184, .22);

    background:
        linear-gradient(
            135deg,
            var(--primary-deep),
            var(--primary),
            var(--secondary)
        );

    color: #ffffff;

    box-shadow:
        0 8px 20px rgba(15, 23, 42, .10);
}

.manual-drawer-heading {
    min-width: 0;
    flex: 1 1 auto;
}

.manual-drawer-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    margin-bottom: 7px;

    color: rgba(255, 255, 255, .78);

    font-family: var(--font-heading);
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: .10em;
    text-transform: uppercase;
}

.manual-drawer-label svg {
    width: 15px;
    height: 15px;
}

.manual-drawer-header h2 {
    margin: 0;

    color: #ffffff;

    font-family: var(--font-heading);
    font-size: 19px;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: -.02em;
}

.manual-drawer-header p {
    margin: 5px 0 0;

    color: rgba(255, 255, 255, .76);

    font-size: 12px;
    line-height: 1.5;
}

.manual-drawer-close {
    width: 40px;
    height: 40px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;

    padding: 0;

    border: 1px solid rgba(255, 255, 255, .20);
    border-radius: 12px;

    background: rgba(255, 255, 255, .12);
    color: #ffffff;

    cursor: pointer;

    transition:
        background-color .16s ease,
        transform .16s ease;
}

.manual-drawer-close:hover {
    background: rgba(255, 255, 255, .22);
    color: #ffffff;
}

.manual-drawer-close:active {
    transform: scale(.96);
}

.manual-drawer-close svg {
    width: 20px;
    height: 20px;
}

/* =====================================================
   BODY DRAWER
===================================================== */

.manual-drawer-body {
    flex: 1 1 auto;
    min-height: 0;

    overflow-x: hidden;
    overflow-y: auto;

    padding: 18px;

    background: #f8fafc;

    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
}

.manual-drawer-body::-webkit-scrollbar {
    width: 9px;
}

.manual-drawer-body::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;

    background: rgba(100, 116, 139, .42);
    background-clip: padding-box;
}

.manual-drawer-body::-webkit-scrollbar-track {
    background: transparent;
}

/* =====================================================
   FOOTER DRAWER
===================================================== */

.manual-drawer-footer {
    position: relative;
    z-index: 3;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    flex: 0 0 auto;

    padding: 13px 18px;

    border-top: 1px solid rgba(148, 163, 184, .24);

    background: #ffffff;

    box-shadow:
        0 -8px 18px rgba(15, 23, 42, .05);
}

.manual-drawer-footer > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    color: var(--text-muted);

    font-size: 11px;
    font-weight: 600;
}

.manual-drawer-footer svg {
    width: 15px;
    height: 15px;
}

.manual-drawer-footer kbd {
    min-width: 28px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 3px 6px;

    border: 1px solid var(--border-dark);
    border-bottom-width: 2px;
    border-radius: 6px;

    background: #f8fafc;
    color: #334155;

    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        monospace;

    font-size: 10px;
    font-weight: 800;
}

/* =====================================================
   ISI MANUAL
===================================================== */

.manual-content {
    display: grid;
    gap: 16px;
}

/* Kartu pengantar */
.manual-intro-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;

    padding: 15px;

    border: 1px solid rgba(37, 99, 235, .18);
    border-radius: 15px;

    background:
        linear-gradient(
            135deg,
            rgba(37, 99, 235, .09),
            rgba(15, 118, 110, .06)
        );
}

.manual-intro-icon {
    width: 42px;
    height: 42px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;

    border-radius: 13px;

    background:
        linear-gradient(
            135deg,
            var(--primary),
            var(--secondary)
        );

    color: #ffffff;
}

.manual-intro-icon svg {
    width: 21px;
    height: 21px;
}

.manual-intro-card strong {
    display: block;

    margin-bottom: 3px;

    color: var(--text-main);

    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 800;
}

.manual-intro-card p {
    margin: 0;

    color: #475569;

    font-size: 12px;
    line-height: 1.55;
}

/* Daftar isi ringkas */
.manual-toc {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;

    padding: 11px;

    border: 1px solid rgba(148, 163, 184, .24);
    border-radius: 13px;

    background: #ffffff;
}

.manual-toc a {
    display: inline-flex;
    align-items: center;

    min-height: 30px;

    padding: 6px 9px;

    border: 1px solid rgba(37, 99, 235, .15);
    border-radius: 999px;

    background: rgba(37, 99, 235, .06);
    color: var(--secondary-dark);

    font-size: 10px;
    font-weight: 800;
    line-height: 1;
}

.manual-toc a:hover {
    border-color: rgba(37, 99, 235, .30);
    background: rgba(37, 99, 235, .12);
}

/* Bagian manual */
.manual-section {
    scroll-margin-top: 16px;

    padding: 16px;

    border: 1px solid rgba(148, 163, 184, .26);
    border-radius: 16px;

    background: #ffffff;

    box-shadow:
        0 4px 14px rgba(15, 23, 42, .04);
}

.manual-section-heading {
    display: flex;
    align-items: flex-start;
    gap: 11px;

    margin-bottom: 14px;
}

.manual-section-heading > span {
    width: 31px;
    height: 31px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 31px;

    border-radius: 10px;

    background:
        linear-gradient(
            135deg,
            var(--primary),
            var(--secondary)
        );

    color: #ffffff;

    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 800;
}

.manual-section-heading > div {
    min-width: 0;
}

.manual-section-heading h3 {
    margin: 0;

    color: var(--text-main);

    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.4;
}

.manual-section-heading p {
    margin: 3px 0 0;

    color: var(--text-muted);

    font-size: 11px;
    line-height: 1.5;
}

.manual-subheading {
    margin: 16px 0 9px;
    padding-bottom: 7px;

    border-bottom: 1px dashed rgba(148, 163, 184, .35);

    color: #334155;

    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 800;
}

/* Langkah penggunaan */
.manual-step-list {
    display: grid;
    gap: 10px;

    margin: 0;
    padding-left: 21px;
}

.manual-step-list li {
    padding-left: 3px;

    color: #475569;

    font-size: 12px;
    line-height: 1.6;
}

.manual-step-list li::marker {
    color: var(--secondary);
    font-weight: 800;
}

.manual-step-list strong {
    color: var(--text-main);
}

/* Catatan */
.manual-note {
    display: flex;
    align-items: flex-start;
    gap: 9px;

    margin-top: 14px;
    padding: 11px 12px;

    border: 1px solid transparent;
    border-radius: 12px;
}

.manual-note > svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    margin-top: 1px;
}

.manual-note > div {
    min-width: 0;
}

.manual-note strong {
    display: block;

    color: inherit;

    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 800;
}

.manual-note p {
    margin: 2px 0 0;

    color: inherit;

    font-size: 11px;
    line-height: 1.5;
}

.manual-note.info {
    border-color: rgba(37, 99, 235, .20);
    background: rgba(37, 99, 235, .07);
    color: var(--secondary-dark);
}

.manual-note.success {
    border-color: rgba(22, 163, 74, .20);
    background: rgba(22, 163, 74, .07);
    color: var(--success-dark);
}

.manual-note.warning {
    border-color: rgba(245, 158, 11, .26);
    background: rgba(245, 158, 11, .10);
    color: #92400e;
}

.manual-note.danger {
    border-color: rgba(220, 38, 38, .20);
    background: rgba(220, 38, 38, .07);
    color: var(--danger-dark);
}

/* Status mode */
.manual-status-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.manual-status-card {
    display: flex;
    align-items: flex-start;
    gap: 9px;

    padding: 12px;

    border: 1px solid rgba(148, 163, 184, .26);
    border-radius: 12px;

    background: #f8fafc;
}

.manual-status-card > svg {
    width: 19px;
    height: 19px;
    flex: 0 0 19px;
    margin-top: 1px;
}

.manual-status-card strong {
    display: block;

    color: var(--text-main);

    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 800;
}

.manual-status-card p {
    margin: 3px 0 0;

    color: var(--text-muted);

    font-size: 10px;
    line-height: 1.5;
}

.manual-status-card.success {
    border-color: rgba(22, 163, 74, .20);
    background: rgba(22, 163, 74, .06);
    color: var(--success-dark);
}

.manual-status-card.warning {
    border-color: rgba(245, 158, 11, .24);
    background: rgba(245, 158, 11, .08);
    color: #b45309;
}

/* Daftar hasil scanner */
.manual-result-list {
    display: grid;
    gap: 9px;
}

.manual-result-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;

    padding: 12px;

    border: 1px solid rgba(148, 163, 184, .26);
    border-radius: 12px;
}

.manual-result-item > svg {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    margin-top: 1px;
}

.manual-result-item strong {
    display: block;

    color: var(--text-main);

    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 800;
}

.manual-result-item p {
    margin: 3px 0 0;

    color: #475569;

    font-size: 11px;
    line-height: 1.5;
}

.manual-result-item.success {
    border-color: rgba(22, 163, 74, .20);
    background: rgba(22, 163, 74, .05);
    color: var(--success-dark);
}

.manual-result-item.warning {
    border-color: rgba(245, 158, 11, .24);
    background: rgba(245, 158, 11, .07);
    color: #b45309;
}

.manual-result-item.danger {
    border-color: rgba(220, 38, 38, .20);
    background: rgba(220, 38, 38, .05);
    color: var(--danger-dark);
}

/* Troubleshooting */
.manual-troubleshoot-list {
    display: grid;
    gap: 8px;
}

.manual-troubleshoot-list details {
    overflow: hidden;

    border: 1px solid rgba(148, 163, 184, .28);
    border-radius: 11px;

    background: #f8fafc;
}

.manual-troubleshoot-list summary {
    position: relative;

    padding: 11px 34px 11px 12px;

    color: #334155;

    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.4;

    cursor: pointer;
    list-style: none;
}

.manual-troubleshoot-list summary::-webkit-details-marker {
    display: none;
}

.manual-troubleshoot-list summary::after {
    content: "+";

    position: absolute;
    top: 50%;
    right: 12px;

    color: var(--secondary);

    font-size: 18px;
    font-weight: 700;
    line-height: 1;

    transform: translateY(-50%);
}

.manual-troubleshoot-list details[open] summary::after {
    content: "−";
}

.manual-troubleshoot-list details > div {
    padding: 0 12px 12px;

    color: var(--text-muted);

    font-size: 11px;
    line-height: 1.55;
}

/* Checklist Hari-H */
.manual-day-card {
    border-color: rgba(15, 118, 110, .24);

    background:
        linear-gradient(
            135deg,
            #ffffff,
            rgba(15, 118, 110, .05)
        );
}

.manual-check-list {
    display: grid;
    gap: 9px;

    margin: 0;
    padding: 0;

    list-style: none;
}

.manual-check-list li {
    position: relative;

    padding-left: 27px;

    color: #475569;

    font-size: 12px;
    line-height: 1.5;
}

.manual-check-list li::before {
    content: "✓";

    position: absolute;
    top: 1px;
    left: 0;

    width: 19px;
    height: 19px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 6px;

    background: rgba(15, 118, 110, .12);
    color: var(--accent-dark);

    font-size: 11px;
    font-weight: 900;
}

/* =====================================================
   RESPONSIVE
===================================================== */

@media (max-width: 768px) {
    .manual-drawer-handle {
        top: auto;
        right: 0;
        bottom: 88px;

        width: 44px;
        min-height: 102px;

        padding: 11px 7px;

        border-radius: 15px 0 0 15px;

        transform: none;
    }

    .manual-drawer-handle:active {
        transform: translateX(2px);
    }

    .manual-drawer-handle span {
        font-size: 9px;
    }

    body.manual-drawer-open .manual-drawer-handle {
        right: 100vw;
    }

    .manual-drawer-panel {
        width: min(420px, 100vw);
    }

    .manual-drawer-header {
        padding: 17px 16px;
    }

    .manual-drawer-header h2 {
        font-size: 17px;
    }

    .manual-drawer-body {
        padding: 14px;
    }

    .manual-drawer-footer {
        padding: 12px 14px;
    }

    .manual-status-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .manual-drawer-panel {
        width: 100vw;
        border-left: 0;
    }

    .manual-drawer-handle {
        bottom: 72px;
    }

    .manual-drawer-footer > span {
        display: none;
    }

    .manual-drawer-footer .btn {
        width: 100%;
        justify-content: center;
    }

    .manual-section {
        padding: 14px;
    }

    .manual-toc {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 9px;
    }

    .manual-toc a {
        flex: 0 0 auto;
    }
}

/* =====================================================
   REDUCED MOTION
===================================================== */

@media (prefers-reduced-motion: reduce) {
    .manual-drawer-handle,
    .manual-drawer-overlay,
    .manual-drawer-panel {
        transition: none !important;
    }
}

/* MANUAL DRAWER GLOBAL — END */
