:root {
  --navy: var(--khadc-navy, #102a4e);
  --navy-light: var(--khadc-navy-light, #1e3f6f);
  --blue: var(--khadc-blue, #1e40af);
  --gold: #b45309;
  --gold-accent: var(--khadc-gold, #d97706);
  --gold-bg: var(--khadc-gold-light, #fef3c7);
  --green: var(--khadc-green, #15803d);
  --green-bg: var(--khadc-green-bg, #dcfce7);
  --red: var(--khadc-red, #b91c1c);
  --red-bg: var(--khadc-red-bg, #fee2e2);
  --bg: var(--khadc-bg, #f1f5f9);
  --card-bg: var(--khadc-surface, #ffffff);
  --border: var(--khadc-border-strong, #cbd5e1);
  --border-subtle: rgba(15, 23, 42, 0.1);
  --text: var(--khadc-text, #0f172a);
  --muted: var(--khadc-muted, #475569);
  --tap-target: 48px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[x-cloak] {
  display: none !important;
}

html {
  scrollbar-gutter: stable;
}

body {
  font-family: var(--khadc-font-sans, "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Container Layout (aligns with .khadc-header-inner 1280px) */
.container {
  max-width: 1280px;
  margin: 22px auto 0;
  padding: 0 20px 84px;
}

/* Ensure 5-letter KHADC crest fits cleanly inside circular badge */
.khadc-crest {
  font-size: 10.5px;
  letter-spacing: 0.02em;
}

/* Auth Shell (Login & Registration) */
.auth-shell {
  max-width: 480px;
  margin: 28px auto 36px;
}

.auth-card {
  border-top: 4px solid var(--navy);
  padding: 28px;
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.04);
}

.auth-footer-box {
  margin-top: 20px;
  padding: 16px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  text-align: center;
}

.auth-demo-box {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
  text-align: center;
}

.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrap .form-control {
  padding-right: 48px;
}

.password-toggle-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 140ms ease, color 140ms ease;
}

.password-toggle-btn:hover {
  background: #f1f5f9;
  color: var(--navy);
}

/* Desktop Navigation Bar (khadc-ui.css handles base .nav-bar / .nav-item) */
.nav-bar.desktop-nav-bar {
  margin-bottom: 22px;
}

/* Card System */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.03);
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 12px;
  line-height: 1.3;
}

.card-title-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* Action Banners (Dashboard Form 'N' & Legacy Claim) */
.khadc-action-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.khadc-action-banner--fresh {
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
  border-left: 4px solid var(--navy);
}

.khadc-action-banner--claim {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-left: 4px solid var(--gold-accent);
}

.khadc-action-banner-copy {
  flex: 1 1 320px;
  min-width: 0;
}

.khadc-action-banner-title {
  font-weight: 700;
  color: var(--navy);
  font-size: 15.5px;
  line-height: 1.35;
}

.khadc-action-banner-desc {
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.45;
}

.khadc-banner-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.kpi-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 16px 18px;
  border-left: 4px solid var(--blue);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.kpi-card.gold { border-left-color: var(--gold-accent); }
.kpi-card.green { border-left-color: var(--green); }
.kpi-card.red { border-left-color: var(--red); }

.kpi-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.kpi-val {
  font-size: 28px;
  font-weight: 800;
  color: var(--navy);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.kpi-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* Buttons — High-Contrast Civic Tactile Controls */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 9px;
  cursor: pointer;
  border: 1px solid transparent;
  min-height: var(--tap-target);
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  line-height: 1.25;
}

.btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-primary {
  background: linear-gradient(180deg, #1b3d6b 0%, var(--navy) 100%);
  color: #ffffff;
  border-color: var(--navy);
}

.btn-primary:not(:disabled):hover {
  background: linear-gradient(180deg, #244d85 0%, #153560 100%);
}

.btn-gold {
  background: linear-gradient(180deg, #c25e0a 0%, #9a3412 100%);
  color: #ffffff;
  border-color: #9a3412;
}

.btn-gold:not(:disabled):hover {
  background: linear-gradient(180deg, #d97706 0%, #b45309 100%);
}

.btn-outline {
  background: #ffffff;
  border: 1px solid var(--border);
  color: #1e293b;
}

.btn-outline:not(:disabled):hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: var(--navy);
}

.btn-ghost {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  box-shadow: none;
}

.btn-ghost:not(:disabled):hover {
  background: #f1f5f9;
  color: var(--navy);
}

.btn-danger {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: var(--red);
}

.btn-danger:not(:disabled):hover {
  background: #fee2e2;
  border-color: #f87171;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  min-height: 44px;
  border-radius: 8px;
}

/* Action bar in stepper/wizard */
.wizard-actions {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.wizard-actions-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.25;
}

.badge-green { background: var(--green-bg); color: #166534; }
.badge-gold { background: var(--gold-bg); color: #92400e; }
.badge-red { background: var(--red-bg); color: #991b1b; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-gray { background: #f1f5f9; color: #334155; }

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-dot--green { background: #16a34a; }
.status-dot--gold { background: #d97706; }
.status-dot--red { background: #dc2626; }
.status-dot--blue { background: #2563eb; }

/* Licence Cards Grid */
.license-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 16px;
}

.license-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: box-shadow 180ms ease, border-color 180ms ease;
}

@media (hover: hover) {
  .license-card:hover {
    border-color: #94a3b8;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  }
}

.license-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* Form & Input Groups */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.form-control {
  width: 100%;
  min-height: var(--tap-target);
  height: var(--tap-target);
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14.5px;
  background: #ffffff;
  color: var(--text);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

input[type="file"].form-control {
  padding: 10px 12px;
  height: auto;
  min-height: var(--tap-target);
  line-height: 1.4;
}

.form-control:focus {
  border-color: var(--blue);
  outline: none;
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.16);
}

.form-control:disabled {
  background: #f8fafc;
  color: #475569;
  cursor: not-allowed;
}

.form-control.is-invalid {
  border-color: var(--red);
  background-color: #fef2f2;
}

.form-control.is-invalid:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.16);
}

.form-control.is-valid {
  border-color: var(--green);
  background-color: #f0fdf4;
}

.form-control.is-valid:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.16);
}

textarea.form-control {
  height: auto;
  padding: 12px 14px;
  min-height: 92px;
  resize: vertical;
}

.field-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.field-feedback {
  font-size: 12px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.field-feedback--valid { color: var(--green); }
.field-feedback--invalid { color: var(--red); }

.password-checklist-box {
  margin-top: 8px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.5;
  max-height: 240px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 380ms cubic-bezier(0.22, 1, 0.36, 1),
              opacity 280ms ease-out,
              margin-top 380ms cubic-bezier(0.22, 1, 0.36, 1),
              padding-top 380ms cubic-bezier(0.22, 1, 0.36, 1),
              padding-bottom 380ms cubic-bezier(0.22, 1, 0.36, 1),
              border-width 380ms ease-out;
}
.password-checklist-box.is-collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-width: 0;
  pointer-events: none;
}

.password-checklist-box ul {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.password-checklist-box li {
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 150ms ease;
}

/* Notice Banners & Inline Alerts */
.notice,
.alert {
  padding: 14px 16px;
  border-radius: 9px;
  font-size: 13.5px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  line-height: 1.48;
}

.notice-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
}

.notice-info {
  background: #eff6ff;
  border-left: 4px solid var(--blue);
  color: #1e3a8a;
}

.notice-warn {
  background: #fffbeb;
  border-left: 4px solid var(--gold-accent);
  color: #78350f;
}

.notice-danger,
.alert-error {
  background: #fef2f2;
  border-left: 4px solid var(--red);
  color: #991b1b;
}

.notice-success,
.alert-success {
  background: #f0fdf4;
  border-left: 4px solid var(--green);
  color: #166534;
}

/* Secondary / Sub-Tab Pill Bar */
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 14px;
}

.filter-pill-btn {
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 90ms ease;
}

.filter-pill-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: var(--navy);
}

.filter-pill-btn:active {
  transform: translateY(1px) scale(0.98);
}

.filter-pill-btn.active {
  background: var(--navy);
  color: #ffffff;
  border-color: var(--navy);
}

.filter-pill-btn.active .badge {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

/* Wizard Step Bar (Supports both .step-item and .wizard-step) */
.wizard-steps {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}

.wizard-steps::-webkit-scrollbar {
  display: none;
}

.step-item,
.wizard-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  user-select: none;
  min-height: 44px;
  flex-shrink: 0;
  transition: color 150ms ease;
}

.step-item {
  cursor: pointer;
}

.step-item:hover {
  color: var(--navy);
}

.step-item.active,
.wizard-step.active {
  color: var(--navy);
}

.step-item.done,
.wizard-step.completed {
  color: var(--green);
}

.step-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #e2e8f0;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 700;
  flex-shrink: 0;
  transition: background-color 150ms ease, color 150ms ease;
}

.step-item:hover .step-num {
  background: #cbd5e1;
  color: var(--navy);
}

.step-item.active .step-num,
.wizard-step.active .step-num {
  background: var(--navy);
  color: #ffffff;
}

.step-item.done .step-num,
.wizard-step.completed .step-num {
  background: var(--green);
  color: #ffffff;
}

.step-label {
  font-size: 13px;
  font-weight: 600;
}

/* Custom Segmented / Radio Controls */
.radio-group {
  display: inline-flex;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.radio-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  min-width: 72px;
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  transition: all 150ms ease;
  user-select: none;
}

.radio-pill:hover {
  border-color: var(--blue);
  color: var(--navy);
}

.radio-pill.active {
  border-color: var(--navy);
  background: var(--navy);
  color: #ffffff;
}

.radio-pill input[type="radio"] {
  display: none;
}

/* Dynamic Tables */
.table-responsive {
  overflow-x: auto;
  width: 100%;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  margin: 10px 0 16px;
}

.data-table th,
.data-table td {
  border: 1px solid #e2e8f0;
  padding: 12px;
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  background: #f8fafc;
  font-weight: 700;
  color: var(--navy);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.data-table tbody tr:hover {
  background: #f8fafc;
}

/* Application Details Grids & Key-Value Rows */
.details-hero-card {
  border-left: 5px solid var(--navy);
  margin-bottom: 20px;
}

.details-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
}

.details-fee-summary {
  text-align: right;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 16px;
}

.details-two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.kv-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 13.5px;
}

.kv-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
}

.kv-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.kv-label {
  color: var(--muted);
  flex-shrink: 0;
}

.kv-val {
  text-align: right;
  word-break: break-word;
}

.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 14px;
  margin-top: 10px;
}

.doc-summary-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  background: #f8fafc;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.emp-ratio-bar {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}

.gapfill-emp-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 120;
  padding: 16px;
}

.modal-box {
  background: #ffffff;
  border-radius: 14px;
  width: 100%;
  max-width: 660px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.24);
  border: 1px solid var(--border-subtle);
}

.modal-close-icon {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Document Upload Cards & Action Controls */
.upload-box {
  border: 2px dashed #94a3b8;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  background: #f8fafc;
  transition: border-color 180ms ease, background-color 180ms ease;
  cursor: pointer;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--navy);
}

.upload-box:hover {
  border-color: var(--blue);
  background: #eff6ff;
}

.doc-file-actions {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.doc-btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.doc-btn-row .btn {
  min-height: 44px;
}

.upload-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 18px;
}

/* Certificate Modal & Printable Box */
.cert-modal-header {
  background: var(--navy);
  color: #ffffff;
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.cert-frame {
  border: 6px double #1e3a8a;
  outline: 2px solid #b45309;
  outline-offset: -10px;
  padding: 24px 28px;
  background: #ffffff;
  position: relative;
}

.cert-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
}

/* Loading Spinner */
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e2e8f0;
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: khadcSpin 0.75s linear infinite;
}

@keyframes khadcSpin {
  to { transform: rotate(360deg); }
}

/* Mobile Menu Button & Slide-Over Drawer (Strictly <= 768px) */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-radius: 9px;
  cursor: pointer;
  flex-shrink: 0;
}

.mobile-menu-btn:hover,
.mobile-menu-btn:focus-visible {
  background: rgba(255, 255, 255, 0.22);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  z-index: 200;
}

.sidebar-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 85%;
  max-width: 330px;
  background: #ffffff;
  z-index: 210;
  box-shadow: -6px 0 28px rgba(15, 23, 42, 0.24);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar-drawer.open {
  transform: translateX(0);
}

.sidebar-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: #ffffff;
  padding: 18px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 3px solid var(--gold-accent);
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.sidebar-user-info .user-name {
  font-size: 14.5px;
  font-weight: 700;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.sidebar-user-meta .user-handle {
  font-size: 12px;
  color: #cbd5e1;
  font-weight: 500;
}

.sidebar-close-btn {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  cursor: pointer;
  flex-shrink: 0;
}

.sidebar-nav {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 14px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--navy);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  min-height: 48px;
}

.sidebar-nav-item:hover {
  background: #f1f5f9;
}

.sidebar-nav-item.active {
  background: #eff6ff;
  color: var(--blue);
  border-color: #bfdbfe;
}

.sidebar-nav-item-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-footer {
  padding: 14px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

.sidebar-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  background: #ffffff;
  color: var(--red);
  border: 1.5px solid var(--red);
  border-radius: 9px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  min-height: 48px;
}

.sidebar-logout-btn:hover {
  background: #fef2f2;
}

@media (min-width: 769px) {
  .sidebar-overlay,
  .sidebar-drawer {
    display: none !important;
  }
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVENESS (<= 768px)
   ========================================================================== */
@media (max-width: 768px) {
  .khadc-crest {
    font-size: 9.5px;
    letter-spacing: 0;
  }

  .khadc-mobile-stack > * {
    flex: 0 0 auto !important;
  }

  .khadc-mobile-stack > .badge {
    width: auto !important;
    align-self: flex-start;
  }

  .container {
    margin-top: 14px;
    padding: 0 14px 72px;
  }

  .auth-shell {
    margin: 14px auto 28px;
  }

  .auth-card {
    padding: 20px 16px;
  }

  .card {
    padding: 16px;
  }

  .header-desktop-auth {
    display: none !important;
  }

  .mobile-menu-btn {
    display: inline-flex !important;
  }

  .desktop-nav-bar {
    display: none !important;
  }

  .form-control {
    font-size: 16px; /* Prevents iOS Safari auto-zoom */
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
  }

  .kpi-card {
    padding: 12px 13px;
  }

  .kpi-label {
    font-size: 11px;
  }

  .kpi-val {
    font-size: 22px;
  }

  .kpi-hint {
    font-size: 11px;
  }

  .khadc-action-banner-copy {
    flex: 1 1 100%;
  }

  .khadc-banner-actions {
    width: 100%;
  }

  .khadc-banner-actions .btn,
  .khadc-action-banner > .btn {
    width: 100%;
  }

  .card-title-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .details-fee-summary {
    text-align: left;
    width: 100%;
  }

  .kv-row {
    flex-direction: column;
    gap: 4px;
  }

  .kv-val {
    text-align: left;
  }

  .wizard-steps {
    gap: 10px;
  }

  .step-item span:last-child,
  .wizard-step .step-label {
    display: none;
  }

  .step-item.active span:last-child,
  .wizard-step.active .step-label {
    display: inline;
    white-space: normal;
    line-height: 1.25;
    font-size: 12px;
  }

  .wizard-actions {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 10px;
  }

  .wizard-actions .btn,
  .wizard-actions-right .btn {
    width: 100%;
  }

  .wizard-actions-right {
    display: flex;
    flex-direction: column-reverse;
    width: 100%;
    gap: 8px;
  }

  .upload-action-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .upload-action-bar .btn {
    width: 100%;
  }

  .gapfill-emp-row {
    grid-template-columns: 1fr;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
  }

  .modal-box {
    padding: 18px 16px;
    max-height: 94vh;
  }

  .cert-frame {
    padding: 16px 14px;
  }

  /* Responsive mobile inputs inside Form 'N' Step 4 Employee table cards */
  .data-table.khadc-mobile-cards td input.form-control,
  .data-table.khadc-mobile-cards td select.form-control {
    flex: 1 1 56%;
    max-width: 58%;
    min-width: 0 !important;
    text-align: left;
  }

  .data-table.khadc-mobile-cards td.action-cell .btn {
    width: 100%;
  }

  .license-card-actions .btn {
    flex: 1 1 calc(50% - 4px);
  }
}

@media (max-width: 420px) {
  .license-card-actions .btn {
    flex: 1 1 100%;
  }
}

@media print {
  .khadc-header,
  .nav-bar,
  .sidebar-overlay,
  .sidebar-drawer,
  .no-print {
    display: none !important;
  }

  .container {
    margin: 0;
    padding: 0;
    max-width: 100%;
  }

  .card {
    box-shadow: none;
    border: 1px solid #cbd5e1;
  }
}
