/* ── Design tokens ─────────────────────────────────────────────────────────── */
:root {
  --bg-base:       #f0f2f5;
  --bg-surface:    #ffffff;
  --bg-elevated:   #f7f8fa;
  --bg-hover:      #eef0f5;
  --bg-active:     #e0e7ff;

  --border:        #e2e5ec;
  --border-light:  #d0d5e0;

  --text-primary:  #111827;
  --text-secondary:#4b5563;
  --text-muted:    #9ca3af;
  --text-inverse:  #ffffff;

  --accent:        #4f7cff;
  --accent-hover:  #3b6aee;
  --accent-dim:    rgba(79,124,255,.12);

  --success:       #16a34a;
  --success-dim:   rgba(22,163,74,.12);
  --warning:       #d97706;
  --warning-dim:   rgba(217,119,6,.12);
  --danger:        #dc2626;
  --danger-dim:    rgba(220,38,38,.12);
  --info:          #0891b2;
  --info-dim:      rgba(8,145,178,.12);

  --sidebar-w:     240px;
  --sidebar-w-collapsed: 64px;
  --topbar-h:      56px;
  --radius:        8px;
  --radius-lg:     12px;
  --shadow:        0 4px 24px rgba(0,0,0,.10);
  --transition:    .18s ease;

  --font:          ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";
}

/* ── Reset & base ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body { font-family: var(--font); background: var(--bg-base); color: var(--text-primary); line-height: 1.5; -webkit-font-smoothing: antialiased; font-size: 14px; }
a { color: var(--accent); text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }
.hidden { display: none !important; }

/* ── Login ────────────────────────────────────────────────────────────────── */
/* ── Login screen ────────────────────────────────────────────────────────── */
.login-screen {
  position: relative;
  min-height: 100vh;
  background: url('../css/login-bg.png') no-repeat center center / cover;
  color: #fff;
  font-family: ui-sans-serif, system-ui, sans-serif;
}
.login-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}
.login-wrapper {
  position: relative;
  min-height: 100vh;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 2rem;
}
.login-box {
  width: 100%;
  max-width: 380px;
  padding: 2rem;
  border-left: 3px solid #FF2E00;
  background: rgba(20, 20, 20, 0.90);
  backdrop-filter: blur(10px);
  box-shadow: 0 0 30px rgba(255, 46, 0, 0.2);
}
.login-box-header { margin-bottom: 1.5rem; }
.login-box-header h1 { font-size: 1.8rem; font-weight: 700; color: #fff; }
.login-box-header p  { font-size: 0.8rem; color: #aaa; margin-top: 2px; }

.login-input-group { margin-bottom: 1rem; }
.login-input-group label {
  font-size: 0.7rem; color: #aaa;
  display: block; margin-bottom: 5px; font-weight: 500;
}
.login-input-group input {
  width: 100%; padding: 0.75rem;
  background: transparent;
  border: 1px solid #444;
  color: #fff;
  border-radius: 0;
  transition: 0.25s;
}
.login-input-group input:focus {
  border-color: #FF2E00;
  box-shadow: 0 0 8px #FF2E00;
  outline: none;
}
.login-input-group input::placeholder { color: #666; }
.login-password-wrap { position: relative; }
.login-password-wrap input { padding-right: 44px; }
.login-password-wrap .toggle-pwd {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  color: #aaa; font-size: 1rem; padding: 4px;
  background: none; border: none; cursor: pointer; width: auto;
}
.login-password-wrap .toggle-pwd:hover { color: #fff; box-shadow: none; transform: translateY(-50%) scale(1); }

.login-error {
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.4);
  color: #fca5a5;
  padding: 10px 14px;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  border-radius: 0;
}
.login-btn {
  width: 100%; height: 48px;
  margin-top: 0.5rem; border: none; cursor: pointer;
  background: linear-gradient(90deg, #FF2E00, #CC934C);
  color: #fff; font-weight: 600;
  letter-spacing: 1px; font-size: 0.95rem;
  transition: 0.2s; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.login-btn:hover:not(:disabled) { transform: scale(1.02); box-shadow: 0 0 15px #FF2E00; }
.login-btn:disabled { opacity: 0.7; cursor: default; }

.login-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 4px 0; color: rgba(255,255,255,.35); font-size: .78rem;
}
.login-divider::before,.login-divider::after {
  content: ''; flex: 1; height: 1px; background: rgba(255,255,255,.12);
}

.btn-uae-pass {
  /* Fixed height matching .login-btn exactly, so the two buttons are always
     the same size regardless of container width — previously this used
     aspect-ratio (253:50) to derive height from width, which only matched
     .login-btn's height at one specific container width and looked
     mismatched everywhere else. background-size was `contain`, which
     preserves the UAE PASS artwork's own aspect ratio (253:50) inside the
     box — but the login card's actual content width (~316px) is much wider
     relative to 48px than that ratio, so `contain` letterboxed the artwork
     down to ~243px wide, centered with empty space on both sides, making it
     visibly narrower than .login-btn even though the box itself was full
     width. `100% 100%` stretches the artwork to fill the box exactly, so
     both buttons are always identically sized. */
  width: 100%; height: 55px; cursor: pointer;
  background-color: transparent; border: none; padding: 0;
  background-image: url('../images/uae-pass/login-with/Active.svg');
  background-size: 100% 100%; background-repeat: no-repeat; background-position: center;
  transition: transform .1s;
}
/*.btn-uae-pass:hover:not(:disabled)  { background-image: url('../images/uae-pass/login-with/Focus.svg'); transform: scale(1.01); }*/
.btn-uae-pass:active:not(:disabled) { background-image: url('../images/uae-pass/login-with/Pressed.svg'); transform: scale(0.99); }
.btn-uae-pass:disabled {
  background-image: url('../images/uae-pass/login-with/Disabled.svg');
  cursor: default;
}

/* Registration screen uses the "Sign up with" variant of the same button */
#btn-uae-pass-signup { background-image: url('../images/uae-pass/sign-up-with/Active.svg'); }
#btn-uae-pass-signup:hover:not(:disabled)  { background-image: url('../images/uae-pass/sign-up-with/Focus.svg'); }
#btn-uae-pass-signup:active:not(:disabled) { background-image: url('../images/uae-pass/sign-up-with/Pressed.svg'); }
#btn-uae-pass-signup:disabled { background-image: url('../images/uae-pass/sign-up-with/Disabled.svg'); }

/* ── Registration captcha ───────────────────────────────────────────────── */
.register-captcha-row { display: flex; align-items: center; gap: 10px; }
.register-captcha-img {
  height: 50px; flex: 1; border-radius: 6px; border: 1px solid rgba(255,255,255,.12);
  object-fit: cover;
}
.register-captcha-refresh {
  width: 40px; height: 40px; flex-shrink: 0; cursor: pointer;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  border-radius: 6px; color: #ccc; font-size: .9rem;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.register-captcha-refresh:hover { background: rgba(255,255,255,.12); }

/* ── "We will be requesting…" UAE PASS widget (public wizard first step) ──── */
.pub-uaepass-widget {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.pub-uaepass-icon {
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: 10px;
  background: var(--accent-10, rgba(59,130,246,.12));
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.pub-uaepass-text { flex: 1; min-width: 220px; }
.pub-uaepass-title { font-size: .88rem; font-weight: 700; color: var(--text-primary); }
.pub-uaepass-sub   { font-size: .8rem; color: var(--text-muted); margin-top: 2px; }
.btn-uae-pass-continue {
  width: 230px; aspect-ratio: 285 / 50; cursor: pointer; flex-shrink: 0;
  background-color: transparent; border: none; padding: 0;
  background-image: url('../images/uae-pass/continue-with/Active.svg');
  background-size: contain; background-repeat: no-repeat; background-position: center;
  transition: transform .1s;
}
.btn-uae-pass-continue:hover:not(:disabled)  { background-image: url('../images/uae-pass/continue-with/Focus.svg'); transform: scale(1.01); }
.btn-uae-pass-continue:active:not(:disabled) { background-image: url('../images/uae-pass/continue-with/Pressed.svg'); transform: scale(0.99); }
.btn-uae-pass-continue:disabled {
  background-image: url('../images/uae-pass/continue-with/Disabled.svg');
  cursor: default;
}
@media (max-width: 560px) {
  .pub-uaepass-widget { flex-direction: column; align-items: stretch; text-align: center; }
  .btn-uae-pass-continue { width: 100%; }
}

/* ── UAE PASS fake-retrieval full-page loader (demo only) ──────────────────── */
.pub-uaepass-loader {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(15, 17, 21, .72);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
}
.pub-uaepass-loader-box {
  background: var(--bg-elevated);
  border-radius: var(--radius);
  padding: 36px 44px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
}
.pub-uaepass-loader-spinner { font-size: 2rem; color: var(--accent); margin-bottom: 16px; }
.pub-uaepass-loader-title { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); }
.pub-uaepass-loader-sub   { font-size: .88rem; color: var(--text-muted); margin-top: 6px; }
.pub-uaepass-loader-cancel { margin-top: 20px; }

@media (max-width: 768px) {
  .login-wrapper { justify-content: center; padding: 1.5rem; }
  .login-box { border-left: none; border-top: 3px solid #FF2E00; max-width: 100%; }
}
@media (max-width: 480px) {
  .login-box { padding: 1.5rem; }
  .login-box-header h1 { font-size: 1.5rem; }
}


/* ── Form elements ───────────────────────────────────────────────────────── */
.field { margin-bottom: 0; }
.field label { display: block; font-size: 1rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--text-primary);
  transition: border-color var(--transition);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.field input::placeholder { color: var(--text-muted); }
.field select option { background: var(--bg-elevated); }

.password-wrap { position: relative; }
.toggle-pwd {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 1rem; padding: 4px;
}
.toggle-pwd:hover { color: var(--text-primary); }

.form-error {
  background: var(--danger-dim);
  border: 1px solid rgba(239,68,68,.3);
  border-radius: var(--radius);
  color: #e90000;
  padding: 10px 14px;
  font-size: 1rem;
  margin-bottom: 16px;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius);
  font-size: 1rem; font-weight: 500;
  transition: background var(--transition), opacity var(--transition);
  white-space: nowrap;
}
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-primary  { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost    { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-danger   { background: var(--danger-dim); color: #fca5a5; border: 1px solid rgba(239,68,68,.3); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-success  { background: var(--success-dim); color: #86efac; border: 1px solid rgba(34,197,94,.3); }
.btn-success:hover { background: var(--success); color: #fff; }
.btn-full  { width: 100%; justify-content: center; padding: 12px; }
.btn-sm    { padding: 5px 10px; font-size: 1rem; }
.btn-icon  { padding: 7px; border-radius: var(--radius); }
.btn-spinner { display: inline-block; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── App shell ───────────────────────────────────────────────────────────── */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: width var(--transition), min-width var(--transition);
  overflow: hidden;
  z-index: 40;
}
.sidebar.collapsed {
  width: var(--sidebar-w-collapsed);
  min-width: var(--sidebar-w-collapsed);
}
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  height: var(--topbar-h);
  flex-shrink: 0;
}
.sidebar-logo {
  width: 80px; height: auto;
  border-radius: 0;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  background: transparent;
}
.sidebar-logo-img {
  width: 80px; height: auto;
  object-fit: contain;
  border-radius: 0;
  display: block;
}
.sidebar-title { font-weight: 600; font-size: 1rem; white-space: nowrap; flex: 1; overflow: hidden; }
.sidebar.collapsed .sidebar-title { display: none; }
.sidebar.collapsed .sidebar-logo  { display: none; }
.sidebar-toggle {
  margin-left: auto; color: var(--text-muted);
  font-size: 1.1rem; padding: 4px 6px; border-radius: 4px;
  transition: transform var(--transition), color var(--transition);
  flex-shrink: 0;
}
.sidebar-toggle:hover { color: var(--text-primary); background: var(--bg-hover); }
.sidebar.collapsed .sidebar-toggle {
  transform: scaleX(-1);
  margin: 0 auto;
}

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 8px; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.nav-section { margin-bottom: 20px; }
.nav-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted); padding: 0 8px; margin-bottom: 4px;
  white-space: nowrap; overflow: hidden;
  transition: opacity var(--transition);
}
.sidebar.collapsed .nav-label { opacity: 0; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 8px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
  position: relative;
}
.nav-item:hover  { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active { background: var(--accent-dim); color: var(--accent); }
.nav-icon  { font-size: 1rem; flex-shrink: 0; width: 20px; text-align: center; }
.nav-text  { font-size: 12px; font-weight: 500; }
.nav-badge {
  margin-left: auto; background: var(--danger);
  color: #fff; font-size: 1rem; font-weight: 700;
  padding: 1px 6px; border-radius: 10px; line-height: 1.4;
}
.nav-subitem .nav-badge {
  font-size: 10px; font-weight: 600;
  background: #2654dc;
  padding: 1px 5px; border-radius: 8px;
}
.sidebar.collapsed .nav-text, .sidebar.collapsed .nav-badge, .sidebar.collapsed .nav-label { display: none; }

/* ── Sidebar info sections (public portal) ───────────────────────────────── */
.nav-info-section {
  margin: 4px 8px 0;
  padding: 10px 8px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.nav-info-section, .nav-info-section * {
  font-size: 11px;
}
.sidebar.collapsed .nav-info-section { display: none; }
.nav-contact-us-wrap {
  padding: 10px 8px 4px;
}
.sidebar.collapsed .nav-contact-us-wrap { display: none; }
.nav-contact-us-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #4f7cff;
  border-radius: var(--radius);
  background: transparent;
  color: #4f7cff;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.nav-contact-us-btn:hover {
  background: #4362ff;
  color: #ffffff;
}
.nav-info-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 2px;
}
.nav-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  gap: 6px;
}
.nav-info-label { color: var(--text-secondary); flex-shrink: 0; font-size: 11px; font-weight: 500; }
.nav-info-fee   { color: var(--accent); font-weight: 500; font-size: 11px; }
.nav-branch-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 15px;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.user-pill { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-dim); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 700; flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; overflow: hidden; }
.user-name  { display: block; font-size: 1rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role  { display: block; font-size: 1rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar.collapsed .user-info { display: none; }
.btn-logout { color: var(--text-muted); font-size: 1.1rem; padding: 6px; border-radius: 6px; }
.btn-logout:hover { color: var(--danger); background: var(--danger-dim); }

/* ── Main wrapper ─────────────────────────────────────────────────────────── */
.main-wrapper { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* ── Topbar ──────────────────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  background: var(--bg-surface);
  flex-shrink: 0;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.mobile-menu-btn { display: none; color: var(--text-secondary); font-size: 1.25rem; padding: 4px; }

.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 1rem; color: var(--text-muted); }
.breadcrumb .crumb       { color: var(--text-muted); }
.breadcrumb .crumb.active { color: var(--text-primary); font-weight: 500; }
.breadcrumb .sep         { color: var(--border-light); }

.topbar-clock { font-size: 1rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* ── Page content ─────────────────────────────────────────────────────────── */
.page-content { flex: 1; overflow-y: auto; padding: 24px; }
.page-content::-webkit-scrollbar { width: 6px; }
.page-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.page-loading { display: flex; align-items: center; justify-content: center; min-height: 200px; }
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* ── Page header ─────────────────────────────────────────────────────────── */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.page-title-block { }
.page-title { font-size: 1.375rem; font-weight: 700; }
.page-subtitle { color: var(--text-muted); font-size: 1rem; margin-top: 2px; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ── Stat cards ──────────────────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition);
}
.stat-card:hover { border-color: var(--border-light); }
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--card-accent, var(--accent));
}
.stat-card.success { --card-accent: var(--success); }
.stat-card.warning { --card-accent: var(--warning); }
.stat-card.danger  { --card-accent: var(--danger); }
.stat-card.info    { --card-accent: var(--info); }

.stat-label { font-size: 1rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 8px; }
.stat-value { font-size: 2rem; font-weight: 700; line-height: 1; margin-bottom: 4px; }
.stat-sub   { font-size: 1rem; color: var(--text-muted); }
.stat-icon  { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 2rem; opacity: .12; }

/* ── Data table ──────────────────────────────────────────────────────────── */
.table-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.table-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  gap: 12px; flex-wrap: wrap;
}
.table-toolbar-left, .table-toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.table-title { font-size: 1rem; font-weight: 600; }

.search-input-wrap { position: relative; display: flex; align-items: center; }
.search-input-wrap .search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 1rem; pointer-events: none; }
.search-input {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px 12px 8px 32px;
  color: var(--text-primary); width: 240px;
  transition: border-color var(--transition);
}
.search-input:focus { outline: none; border-color: var(--accent); }
.search-input::placeholder { color: var(--text-muted); }
.search-btn {
  height: 34px; padding: 0 12px; flex-shrink: 0;
  background: var(--accent); color: #fff; border: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  cursor: pointer; font-size: .82rem; font-weight: 500;
  transition: background var(--transition);
  display: flex; align-items: center; gap: 5px;
  margin-left: -1px;
}
.search-btn:hover { background: var(--accent-hover, #cc2500); }
/* when search button is present, square off the right edge of the input */
.search-input-wrap:has(.search-btn) .search-input {
  border-radius: var(--radius) 0 0 var(--radius);
  border-right: none;
}

.filter-select {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px 12px;
  color: var(--text-primary);
}
.filter-select:focus { outline: none; border-color: var(--accent); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--bg-elevated);
  padding: 10px 16px;
  text-align: left;
  font-size: 1rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  cursor: pointer; user-select: none;
}
thead th:hover { color: var(--text-primary); }
thead th.sorted-asc::after  { content: ' ↑'; color: var(--accent); }
thead th.sorted-desc::after { content: ' ↓'; color: var(--accent); }
tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-hover); }
tbody td { padding: 12px 16px; font-size: 1rem; }

.table-empty {
  text-align: center; padding: 60px 20px; color: var(--text-muted);
}
.table-empty .empty-icon { font-size: 2.5rem; margin-bottom: 12px; opacity: .4; }
.table-empty p { font-size: 1rem; }

/* ── Badges / pills ──────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 20px;
  font-size: 1rem; font-weight: 600; white-space: nowrap;
}
.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef9c3; color: #a16207; }
.badge-danger  { background: #fee2e2; color: #dc2626; }
.badge-info    { background: #e0f2fe; color: #0369a1; }
.badge-default { background: #f3f4f6; color: #4b5563; }
.badge-accent  { background: var(--accent-dim); color: var(--accent); }

/* ── Pagination ──────────────────────────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; gap: 4px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  justify-content: space-between;
}
.pagination-info { font-size: 1rem; color: var(--text-muted); }
.pagination-btns { display: flex; gap: 4px; }
.pg-btn {
  min-width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; font-size: 1rem; font-weight: 500;
  color: var(--text-secondary); background: var(--bg-elevated);
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.pg-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.pg-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.pg-btn:disabled { opacity: .4; pointer-events: none; }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 16px;
  animation: fadeIn .15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 560px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow);
  animation: slideUp .2s ease;
}
@keyframes slideUp { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal.modal-lg { max-width: 800px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-title { font-size: 1rem; font-weight: 600; }
.modal-close { color: var(--text-muted); font-size: 1rem; padding: 4px; border-radius: 4px; }
.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }
.modal-body   { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex; gap: 8px; justify-content: flex-end;
  flex-shrink: 0;
}

/* ── Detail view ─────────────────────────────────────────────────────────── */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.detail-item label { font-size: 1rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); display: block; margin-bottom: 4px; }
.detail-item .detail-val { font-size: 1rem; color: var(--text-primary); }
.detail-item .detail-label {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.detail-item .detail-value {
  display: block;
  font-size: .97rem;
  font-weight: 500;
  color: var(--text-primary);
}

.section-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
}
.section-card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 1rem; font-weight: 600; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: .06em;
}
.section-card-body { padding: 18px; }

/* ── Form grid ───────────────────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pub-additional-grid { row-gap: 0px; }
.form-grid .field-full { grid-column: 1 / -1; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }

/* ── Toast ───────────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 20px; right: 20px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 200; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 1rem; font-weight: 500;
  min-width: 280px; max-width: 400px;
  box-shadow: var(--shadow);
  animation: toastIn .25s ease;
  pointer-events: all;
}
@keyframes toastIn { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast.fade-out { animation: toastOut .25s ease forwards; }
@keyframes toastOut { to { transform: translateX(24px); opacity: 0; } }
.toast-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.toast-error   { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; }
.toast-info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8; }
.toast-icon    { font-size: 1rem; flex-shrink: 0; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 50; transform: translateX(-100%); transition: transform var(--transition); }
  .sidebar.mobile-open { transform: none; }
  .mobile-menu-btn { display: flex; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .search-input { width: 180px; }
}
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .page-content { padding: 16px; }
  .modal { max-height: 100vh; border-radius: 0; }
}

/* ── Report tabs ─────────────────────────────────────────────────────────── */
.report-tab {
  padding: 10px 20px;
  font-size: 1rem; font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  border-radius: var(--radius) var(--radius) 0 0;
  transition: color var(--transition), border-color var(--transition);
  background: transparent;
}
.report-tab:hover  { color: var(--text-primary); }
.report-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── History timeline ────────────────────────────────────────────────────── */
.history-list { list-style: none; position: relative; padding-left: 20px; }
.history-list::before { content:''; position:absolute; left:7px; top:0; bottom:0; width:2px; background:var(--border); }
.history-item { position:relative; padding: 0 0 16px 16px; }
.history-item::before { content:''; position:absolute; left:-5px; top:4px; width:10px; height:10px; border-radius:50%; background:var(--accent); border:2px solid var(--bg-surface); }
.history-action { font-size:1rem; font-weight:500; }
.history-meta   { font-size:.75rem; color:var(--text-muted); margin-top:2px; }

/* ── Scrollable modal body ───────────────────────────────────────────────── */
.modal-body { max-height: calc(90vh - 120px); overflow-y: auto; }

/* ── Form helper text ────────────────────────────────────────────────────── */
.field-hint { font-size:.75rem; color:var(--text-muted); margin-top:4px; }

/* ── Action row ──────────────────────────────────────────────────────────── */
.action-row { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }

/* ── Empty state ─────────────────────────────────────────────────────────── */
.empty-state {
  text-align:center; padding: 80px 20px;
  color:var(--text-muted);
}
.empty-state .empty-icon { font-size:3rem; margin-bottom:16px; opacity:.3; }
.empty-state h3  { font-size:1.125rem; font-weight:600; margin-bottom:8px; color:var(--text-secondary); }
.empty-state p   { font-size:1rem; max-width:320px; margin:0 auto 20px; }

/* ── Chip/tag row ────────────────────────────────────────────────────────── */
.chip-row { display:flex; flex-wrap:wrap; gap:6px; }

/* ── Section divider ─────────────────────────────────────────────────────── */
.section-divider { border:none; border-top:1px solid var(--border); margin:20px 0; }

/* ── Scrollable table for print ──────────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .page-actions, .btn { display:none !important; }
  .page-content { padding:0; overflow:visible; }
  .section-card { border:1px solid #ccc; break-inside:avoid; }
}

/* ── Sidebar submenu ─────────────────────────────────────────────────────── */
.nav-item-parent {
  position: relative;
}
.nav-item-parent .nav-arrow {
  margin-left: auto;
  font-size: .75rem;
  color: var(--text-muted);
  transition: transform var(--transition);
  flex-shrink: 0;
}
.nav-item-parent.open .nav-arrow i {
  transform: rotate(180deg);
}
.nav-submenu {
  overflow: hidden;
  max-height: 0;
  transition: max-height .25s ease;
}
.nav-submenu.open {
  max-height: 400px;
}
.nav-subitem {
  padding-left: 28px;
  font-size: .875rem;
}
.nav-subitem .nav-icon {
  font-size: .8rem;
  width: 16px;
  color: var(--text-muted);
}
.nav-subitem.active .nav-icon {
  color: var(--accent);
}
.sidebar.collapsed .nav-submenu { display: none; }
.sidebar.collapsed .nav-arrow   { display: none; }

/* ── Long nav label size override ───────────────────────────────────────── */
#nav-idl .nav-label {
  font-size: 10px;
}

/* ── Collapsible nav section ─────────────────────────────────────────────── */
.nav-label-toggle {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; background: none; border: none; cursor: pointer;
  padding: 0 8px; margin-bottom: 4px;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted);
  transition: color var(--transition);
}
.nav-label-toggle:hover { color: var(--text-primary); }
.nav-label-chevron {
  font-size: 9px; transition: transform .2s ease; flex-shrink: 0;
}
.nav-section.nav-collapsed .nav-item { display: none; }
.nav-section.nav-collapsed .nav-label-chevron { transform: rotate(180deg); }
.sidebar.collapsed .nav-label-toggle { opacity: 0; pointer-events: none; }

/* ── Detail page footer action bar ──────────────────────────────────────── */
.detail-footer {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 20px 0 8px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
  flex-wrap: wrap;
}

/* ── Document upload ─────────────────────────────────────────────────── */
.doc-upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.doc-upload-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.doc-upload-label {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.doc-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.doc-upload-zone:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.doc-upload-zone-invalid {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 2px var(--danger-dim);
}
.doc-upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  padding: 16px;
  text-align: center;
}
.doc-upload-placeholder i { font-size: 1.75rem; color: var(--accent); opacity: .6; }
.doc-upload-placeholder span { font-size: 1rem; font-weight: 500; }
.doc-upload-placeholder small { font-size: 1rem; }
.doc-upload-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px;
  width: 100%;
}
.doc-preview-img {
  max-width: 100%;
  max-height: 100px;
  border-radius: 6px;
  object-fit: contain;
  border: 1px solid var(--border);
}
.doc-preview-name {
  font-size: 1rem;
  color: var(--text-secondary);
  word-break: break-all;
  text-align: center;
}
.doc-remove-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--danger-dim);
  color: var(--danger);
  font-size: .75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  z-index: 1;
}
.doc-remove-btn:hover { background: var(--danger); color: #fff; }

/* ── Form field validation ───────────────────────────────────────────────── */
.field-error {
  font-size: 0.8rem;
  color: var(--danger);
  margin-top: 4px;
  min-height: 1em;
  min-width: 0;
  overflow-wrap: break-word;
}
.field-invalid input,
.field-invalid select,
.field-invalid textarea {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 2px var(--danger-dim);
}
.field-invalid label {
  color: var(--danger);
}

/* Invalid doc upload zone */
.doc-zone-invalid {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 2px var(--danger-dim);
}
.doc-zone-invalid .doc-upload-placeholder i {
  color: var(--danger);
}

/* ── Multi-select dropdown ───────────────────────────────────────────────── */
.multi-select {
  position: relative;
}
.multi-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  cursor: pointer;
  user-select: none;
  font-size: 1rem;
  color: var(--text-primary);
  transition: border-color var(--transition);
  min-height: 38px;
}
.multi-select-trigger:hover  { border-color: var(--accent); }
.multi-select-trigger.open   { border-color: var(--accent); border-radius: var(--radius) var(--radius) 0 0; }
.multi-select-trigger i      { font-size: .75rem; color: var(--text-muted); transition: transform .2s; }
.multi-select-trigger.open i { transform: rotate(180deg); }
.multi-select-dropdown {
  position: absolute;
  z-index: 200;
  left: 0; right: 0;
  top: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--accent);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  max-height: 220px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.multi-select-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-primary);
  transition: background var(--transition);
  margin: 0;
}
.multi-select-option:hover { background: var(--bg-elevated); }
.multi-select-option input[type="checkbox"] {
  width: 15px; height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}
.field-invalid .multi-select-trigger {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 2px var(--danger-dim);
}

/* ── Disclaimer checkboxes ───────────────────────────────────────────────── */
.disclaimer-check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.5;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  transition: border-color var(--transition);
}
.disclaimer-check:hover { border-color: var(--accent); }
.disclaimer-check input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
}
.disclaimer-invalid {
  border-color: var(--danger) !important;
  background: var(--danger-dim);
}

/* ── Emirates ID search feedback ────────────────────────────────────────── */
.eid-search-msg {
  font-size: 0.82rem;
  margin-top: 5px;
  min-height: 1em;
}
.eid-searching  { color: var(--text-muted); font-style: italic; }
.eid-found      { color: var(--success); font-weight: 500; }
.eid-not-found  { color: var(--danger);  font-weight: 500; }

/* ── Detail view subtitle items ─────────────────────────────────────────── */
.page-subtitle { display:flex; align-items:center; gap:16px; flex-wrap:wrap; }
.subtitle-item  { display:flex; align-items:center; gap:6px; font-size:.85rem; color:var(--text-muted); }
.subtitle-item .badge { font-size:.8rem; }

/* ── Dashboard charts ────────────────────────────────────────────────────── */
.dashboard-charts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 24px;
}
.chart-card--wide { grid-column: span 2; }
.chart-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.chart-card-header {
  padding: 14px 20px;
  font-weight: 600;
  font-size: .95rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}
.chart-card-body {
  padding: 20px;
  position: relative;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chart-card-body canvas {
  max-height: 240px !important;
}
@media (max-width: 900px) {
  .dashboard-charts { grid-template-columns: 1fr; }
  .chart-card--wide { grid-column: span 1; }
}

/* ── Public user tabs ────────────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 0;
  margin-top: 4px;
}
.tab-btn {
  padding: 10px 20px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: .95rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color var(--transition), border-color var(--transition);
  border-radius: var(--radius) var(--radius) 0 0;
}
.tab-btn:hover  { color: var(--accent); background: var(--bg-elevated); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); background: none; }

/* ── Info pills (Apply pages) ────────────────────────────────────────────── */
.info-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: .85rem;
  color: var(--text-secondary);
}
.info-pill i { color: var(--accent); }

/* ── Wizard ───────────────────────────────────────────────────────────────── */
.wizard-progress {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
  padding: 20px 0;
}
.wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
  position: relative;
}
.wizard-step-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem;
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  color: var(--text-muted);
  transition: all .25s;
  flex-shrink: 0;
}
.wizard-step.active .wizard-step-icon {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.wizard-step.done .wizard-step-icon {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
.wizard-step-label {
  font-size: .78rem;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
}
.wizard-step.active .wizard-step-label { color: var(--accent); font-weight: 600; }
.wizard-step.done  .wizard-step-label  { color: var(--success); }
.wizard-connector {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin-bottom: 22px;
  transition: background .25s;
}
.wizard-connector.done { background: var(--success); }
.wizard-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding-top: 4px;
}
@media (max-width: 600px) {
  .wizard-step-label { display: none; }
}

/* ── CPD country checkboxes ──────────────────────────────────────────────── */
.cpd-country-check {
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 6px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .85rem;
  transition: border-color var(--transition);
}
.cpd-country-check.checked,
.cpd-country-check:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-dim);
}

/* ═══════════════════════════════════════════════════════════════════════════
   jQuery DataTable — themed to match the app
   ═══════════════════════════════════════════════════════════════════════════ */

/* Wrapper */
.dataTables_wrapper {
  font-family: var(--font);
  font-size: .875rem;
  color: var(--text-primary);
}

/* Top controls bar: search + length */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
  margin-bottom: 12px;
}
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: .85rem;
  font-family: var(--font);
  padding: 6px 10px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.dataTables_wrapper .dataTables_filter label,
.dataTables_wrapper .dataTables_length label {
  color: var(--text-muted);
  font-size: .82rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Table */
table.dataTable {
  width: 100% !important;
  border-collapse: collapse;
  border-spacing: 0;
}
table.dataTable thead th {
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 10px 14px;
  border-bottom: 2px solid var(--border);
  border-top: none;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
table.dataTable thead th:hover { color: var(--text-primary); }

/* Sort indicators */
table.dataTable thead th.sorting::after,
table.dataTable thead th.sorting_asc::after,
table.dataTable thead th.sorting_desc::after {
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  margin-left: 6px;
  font-size: .65rem;
  opacity: .45;
}
table.dataTable thead th.sorting::after       { content: '\f0dc'; }
table.dataTable thead th.sorting_asc::after   { content: '\f0de'; opacity: 1; color: var(--accent); }
table.dataTable thead th.sorting_desc::after  { content: '\f0dd'; opacity: 1; color: var(--accent); }

/* Rows */
table.dataTable tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  cursor: pointer;
}
table.dataTable tbody tr:last-child { border-bottom: none; }
table.dataTable tbody tr:hover { background: var(--accent-dim); }
table.dataTable tbody tr.odd  { background: var(--bg-base); }
table.dataTable tbody tr.even { background: var(--bg-elevated); }
table.dataTable tbody tr.odd:hover,
table.dataTable tbody tr.even:hover { background: var(--accent-dim); }
table.dataTable tbody td {
  padding: 12px 14px;
  vertical-align: middle;
  font-size: .875rem;
  color: var(--text-primary);
  border-top: none;
}

/* Empty state */
table.dataTable tbody td.dataTables_empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
  font-size: .9rem;
}

/* Bottom: info + pagination */
.dataTables_wrapper .dataTables_info {
  color: var(--text-muted);
  font-size: .8rem;
  padding-top: 14px;
}
.dataTables_wrapper .dataTables_paginate {
  padding-top: 10px;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  margin: 0 2px;
  border-radius: 6px;
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  color: var(--text-secondary) !important;
  border: 1px solid transparent;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--bg-elevated);
  border-color: var(--border);
  color: var(--text-primary) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: var(--accent);
  color: #fff !important;
  border-color: var(--accent);
}
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
  opacity: .35;
  cursor: default;
  background: transparent;
  border-color: transparent;
}

/* Status badge colours in table */
table.dataTable .badge {
  font-size: .72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
}

/* Responsive: hide less-important cols on small screens */
@media (max-width: 640px) {
  table.dataTable thead th:nth-child(3),
  table.dataTable tbody td:nth-child(3),
  table.dataTable thead th:nth-child(6),
  table.dataTable tbody td:nth-child(6) { display: none; }
}

/* DataTable top/bottom layout wrappers */
.dt-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 8px;
  gap: 12px;
  flex-wrap: wrap;
}
.dt-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 14px;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid var(--border);
}

/* ── IDL Application Status Panel ───────────────────────────────────────── */
.status-panel-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: sticky;
  top: 16px;
}
.status-panel-header {
  background: #1a2c54;
  padding: 14px 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.status-panel-icon {
  width: 34px; height: 34px;
  background: rgba(255,255,255,.15);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1rem; flex-shrink: 0;
}
.status-panel-title {
  color: #fff;
  font-size: .9rem;
  font-weight: 600;
}
.status-panel-ref {
  color: rgba(255,255,255,.6);
  font-size: .75rem;
  margin-top: 2px;
}
.status-panel-body {
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.status-panel-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  font-size: .82rem;
}
.status-panel-label { color: var(--text-muted); flex-shrink: 0; }
.status-panel-value { font-weight: 500; color: var(--text-primary); text-align: right; }
.status-panel-divider { height: 1px; background: var(--border); }
.status-panel-footer {
  background: var(--bg-base);
  border-top: 1px solid var(--border);
  padding: 9px 18px;
  font-size: .75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Status timeline inside panel */
.status-panel-timeline { display: flex; flex-direction: column; }
.spt-item { display: flex; gap: 10px; align-items: flex-start; }
.spt-dot-wrap { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; padding-top: 3px; }
.spt-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.spt-dot-done    { background: #15803d; }
.spt-dot-active  { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.spt-dot-pending { background: var(--border); }
.spt-line { width: 1px; flex: 1; min-height: 20px; background: var(--border); margin: 3px 0; }
.spt-label { font-size: .8rem; color: var(--text-muted); padding-bottom: 10px; }
.spt-label-done   { color: var(--text-secondary); }
.spt-label-active { color: var(--accent); font-weight: 600; }

@media (max-width: 860px) {
  .status-panel-card { display: none; }
}

/* ── Instructions Panel ──────────────────────────────────────────────────── */
.instr-section { display:flex; flex-direction:column; gap:4px; }
.instr-heading {
  font-size:.78rem; font-weight:600; color:var(--text-primary);
  margin-bottom:4px;
}
.instr-row {
  display:flex; justify-content:space-between; align-items:center;
  gap:8px; font-size:.78rem;
}
.instr-label { color:var(--text-muted); flex-shrink:0; }
.instr-value { color:var(--text-secondary); text-align:right; }
.instr-list {
  margin:4px 0 0 14px; display:flex; flex-direction:column; gap:3px;
}
.instr-list li { font-size:.78rem; color:var(--text-secondary); line-height:1.45; }
.instr-fee-table { display:flex; flex-direction:column; gap:2px; }
.instr-fee-row {
  display:flex; justify-content:space-between;
  font-size:.77rem; color:var(--text-secondary);
  padding:3px 6px; background:var(--bg-base); border-radius:4px;
}
.instr-badge {
  display:inline-block; padding:2px 8px; border-radius:12px;
  font-size:.72rem; background:var(--bg-base);
  color:var(--text-secondary); border:1px solid var(--border);
}
.status-panel-header { cursor:pointer; user-select:none; }

/* ── Instructions panel scroll wrapper ───────────────────────────────────── */
.panels-wrap-scroll {
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#instructions-panel-body {
  max-height: calc(100vh - 220px);
  overflow-y: scroll;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
#instructions-panel-body::-webkit-scrollbar        { width: 4px; }
#instructions-panel-body::-webkit-scrollbar-track  { background: transparent; }
#instructions-panel-body::-webkit-scrollbar-thumb  { background: var(--border); border-radius: 4px; }

/* ── Document upload placeholder image ───────────────────────────────────── */
.doc-placeholder-img {
  width: 100%;
  max-height: 90px;
  object-fit: cover;
  border-radius: 4px;
  opacity: 0.75;
  margin-bottom: 4px;
}

/* ── Public Customer Portal Layout ──────────────────────────────────────── */
.pub-portal-layout {
  display: block;
}

/* ── Left Nav ────────────────────────────────────────────────────────────── */
.pub-service-nav {
  position: sticky;
  top: 16px;
  align-self: start;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pub-service-nav-label {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 4px 8px 8px;
}
.pub-service-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: calc(var(--radius) - 2px);
  font-size: .85rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background .15s, color .15s;
  text-decoration: none;
}
.pub-service-nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.pub-service-nav-item.active {
  background: var(--accent-10, rgba(59,130,246,.12));
  color: var(--accent);
  font-weight: 600;
}
.pub-service-nav-item i { width: 16px; text-align: center; font-size: .9rem; }

.pub-info-section {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* When nested inside pub-service-nav: no extra card border/background */
.pub-info-section.pub-info-section-inset {
  background: transparent;
  border: none;
  border-top: 1px solid var(--border);
  border-radius: 0;
  padding: 12px 12px 4px;
  margin: 0;
}
.pub-info-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .8rem;
  font-weight: 700;
  color: var(--text-primary);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.pub-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .8rem;
  gap: 8px;
  color: var(--text-secondary);
}
.pub-info-label { color: var(--text-muted); flex-shrink: 0; }
.pub-info-fee   { color: var(--accent); font-weight: 700; }

.pub-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.pub-dot-green { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.2); }

.pub-branch-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin-top: 4px;
}
.pub-closed { color: var(--text-muted) !important; font-style: italic; }

.pub-contact-link {
  color: var(--accent);
  text-decoration: none;
  font-size: .8rem;
}
.pub-contact-link:hover { text-decoration: underline; }

.pub-contact-us-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: opacity .15s;
}
.pub-contact-us-btn:hover { opacity: .88; }

/* ── Right Main Wizard Area ──────────────────────────────────────────────── */
.pub-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.pub-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .8rem;
}
.pub-crumb { color: var(--text-muted); }
.pub-crumb-sep { color: var(--text-muted); font-size: .65rem; }
.pub-crumb-active { color: var(--text-primary); font-weight: 600; }

.pub-renew-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--accent-dim);
  color: var(--accent);
  font-size: .88rem;
  font-weight: 600;
}
.pub-renew-banner i { font-size: 1rem; }

/* ── Step Progress Bar ───────────────────────────────────────────────────── */
.pub-step-bar {
  display: flex;
  align-items: flex-start;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  gap: 0;
}
.pub-step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  /* Fixed, equal width per step — labels vary a lot in length ("Delivery" vs.
     "Driving Licence & Documents"), and letting item width track content made
     the connector lines between steps stretch unevenly. Equal-width items keep
     the connectors (flex:1 below) visually identical regardless of label length. */
  flex: 1 1 0;
  min-width: 0;
}
.pub-step-circle {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-base);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: border-color .2s, background .2s, color .2s;
}
.pub-step-label {
  font-size: .72rem;
  color: var(--text-muted);
  white-space: normal;
  text-align: center;
  line-height: 1.3;
  font-weight: 500;
  transition: color .2s;
}
.pub-step-connector {
  flex: 1 1 0;
  height: 2px;
  min-width: 12px;
  background: var(--border);
  margin-top: 15px; /* align with circle center (16px circle radius - 1px half of 2px line height) */
  transition: background .2s;
}
.pub-step-connector-done { background: var(--accent); }

.pub-step-active .pub-step-circle {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.pub-step-active .pub-step-label { color: var(--accent); font-weight: 700; }

.pub-step-done .pub-step-circle {
  border-color: var(--accent);
  background: var(--accent-10, rgba(59,130,246,.12));
  color: var(--accent);
}
.pub-step-done .pub-step-label { color: var(--text-secondary); }

/* ── Step Header ─────────────────────────────────────────────────────────── */
.pub-step-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.pub-step-icon-wrap {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--accent-10, rgba(59,130,246,.12));
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.pub-step-title { font-size: 1rem; font-weight: 700; color: var(--text-primary); }
.pub-step-sub   { font-size: .82rem; color: var(--text-muted); margin-top: 2px; }

/* ── UAE PASS Verified Banner ────────────────────────────────────────────── */
.pub-verified-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(34,197,94,.08);
  border: 1px solid rgba(34,197,94,.3);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
}
.pub-verified-icon { color: #22c55e; font-size: 1.3rem; flex-shrink: 0; margin-top: 1px; }
.pub-verified-title { font-size: .88rem; font-weight: 700; color: var(--text-primary); }
.pub-verified-sub   { font-size: .8rem; color: var(--text-muted); margin-top: 1px; }

.pub-uaepass-rejected-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(245,158,11,.08);
  border: 1px solid rgba(245,158,11,.35);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: .84rem;
  color: var(--text-secondary);
}
.pub-uaepass-rejected-banner i { color: #f59e0b; font-size: 1.2rem; flex-shrink: 0; margin-top: 1px; }

/* ── Identity Card ───────────────────────────────────────────────────────── */
.pub-identity-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}
.pub-identity-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-base);
  border-bottom: 1px solid var(--border);
  font-size: .82rem;
  font-weight: 700;
  color: var(--text-primary);
}
.pub-verified-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .72rem;
  font-weight: 600;
  color: #22c55e;
  background: rgba(34,197,94,.1);
  border: 1px solid rgba(34,197,94,.25);
  border-radius: 12px;
  padding: 2px 9px;
}
.pub-identity-rows { display: flex; flex-direction: column; }
.pub-identity-row {
  display: grid;
  /* The 4th (error-message) track is `auto` (sizes to content, so it collapses
     to ~0 when empty — the normal case). `.field-error`'s own max-width:180px
     caps it once there IS a message, forcing long text to wrap instead of
     stealing the input's space — using minmax(0,180px) here instead reserves
     the full 180px even when the message is empty, which is fine in the
     single-column layout but starves the input column in the 2-col/bycol
     layouts below (each row gets roughly half the width). */
  grid-template-columns: 28px 160px minmax(60px, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: .84rem;
}
.pub-identity-row:last-child { border-bottom: none; }
/* Caps a long validation message (e.g. the Emirates ID format hint) from
   stealing the input column's width — scoped here rather than on the base
   .field-error rule so other, non-grid uses of that class are unaffected. */
.pub-identity-row .field-error { max-width: 180px; }

/* Side-by-side (2-column) row layout, used by CPD's Identity/Vehicle steps */
.pub-identity-rows-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.pub-identity-rows-2col .pub-identity-row {
  grid-template-columns: 24px 130px minmax(60px, 1fr) auto;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
.pub-identity-rows-2col .pub-identity-row:nth-child(2n) { border-right: none; }
.pub-identity-rows-2col .pub-identity-row:last-child,
.pub-identity-rows-2col .pub-identity-row:nth-last-child(2):nth-child(odd) {
  border-bottom: none;
}
@media (max-width: 720px) {
  .pub-identity-rows-2col { grid-template-columns: 1fr; }
  .pub-identity-rows-2col .pub-identity-row { border-right: none; border-bottom: 1px solid var(--border); }
  .pub-identity-rows-2col .pub-identity-row:last-child { border-bottom: none; }
}

/* Grouped column layout: first N rows fill the left column, next N fill the
   right column (e.g. Extra Driver 1 vs Extra Driver 2, Reference 1 vs Reference 2) */
.pub-identity-rows-bycol-3,
.pub-identity-rows-bycol-4 {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.pub-identity-rows-bycol-3 { grid-auto-flow: column; grid-template-rows: repeat(3, auto); }
.pub-identity-rows-bycol-4 { grid-auto-flow: column; grid-template-rows: repeat(4, auto); }
.pub-identity-rows-bycol-3 .pub-identity-row,
.pub-identity-rows-bycol-4 .pub-identity-row {
  /* Firmer input floor than the base .pub-identity-row rule (60px) — this layout's
     narrower columns meant an error message (e.g. the Emirates ID format hint)
     could shrink the input to near-unusable width once the error track grew. */
  grid-template-columns: 24px 130px minmax(150px, 1fr) auto;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
.pub-identity-rows-bycol-3 .pub-identity-row:nth-child(3),
.pub-identity-rows-bycol-3 .pub-identity-row:nth-child(6) { border-bottom: none; }
.pub-identity-rows-bycol-3 .pub-identity-row:nth-child(n+4) { border-right: none; }
.pub-identity-rows-bycol-4 .pub-identity-row:nth-child(4),
.pub-identity-rows-bycol-4 .pub-identity-row:nth-child(8) { border-bottom: none; }
.pub-identity-rows-bycol-4 .pub-identity-row:nth-child(n+5) { border-right: none; }
@media (max-width: 720px) {
  .pub-identity-rows-bycol-3, .pub-identity-rows-bycol-4 { grid-template-columns: 1fr; grid-auto-flow: row; grid-template-rows: none; }
  .pub-identity-rows-bycol-3 .pub-identity-row, .pub-identity-rows-bycol-4 .pub-identity-row { border-right: none; border-bottom: 1px solid var(--border); }
  .pub-identity-rows-bycol-3 .pub-identity-row:last-child, .pub-identity-rows-bycol-4 .pub-identity-row:last-child { border-bottom: none; }
}

.pub-id-icon { color: var(--text-muted); font-size: .9rem; text-align: center; }
.pub-id-label { color: var(--text-muted); font-size: .8rem; }
.pub-id-value { color: var(--text-primary); font-weight: 600; }

.pub-id-inline-input {
  width: 100%;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: .84rem;
  color: var(--text-primary);
  transition: border-color .15s;
}

/* CPD officer forms (New/Renew) — match the font sizing of the .field-based
   sections on the same screen instead of the smaller public-wizard sizing. */
.cpd-officer-form-card .pub-id-label { font-size: 1rem; font-weight: 500; color: var(--text-secondary); }
.cpd-officer-form-card .pub-id-inline-input,
.cpd-officer-form-card .pub-id-inline-select { font-size: 1rem; }
.pub-id-inline-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-10, rgba(59,130,246,.12));
}
.pub-id-inline-select {
  width: 100%;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: .84rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color .15s;
}
.pub-id-inline-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-10, rgba(59,130,246,.12));
}

/* ── Additional Info Card ────────────────────────────────────────────────── */
.pub-additional-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px 20px;
}
.pub-additional-title {
  font-size: .88rem;
  font-weight: 700;
  color: var(--text-primary);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

/* Apply IDL wizard — match every section's field font/size to the
   "Your Identity Information" card (.pub-id-label / .pub-id-inline-input). */
#idl-wizard-form .field label {
  font-size: .8rem;
  font-weight: 400;
  color: var(--text-muted);
}
#idl-wizard-form .field input,
#idl-wizard-form .field select,
#idl-wizard-form .field textarea {
  font-size: .84rem;
}

/* ── Input icon wrapper ──────────────────────────────────────────────────── */
.pub-input-icon-wrap { position: relative; }
.pub-input-icon-wrap input,
.pub-input-icon-wrap select {
  padding-right: 34px;
  width: 100%;
}
.pub-input-icon-wrap select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}
.pub-input-icon-right {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: .8rem;
  pointer-events: none;
}
.pub-field-hint {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Vehicle Category Tiles ──────────────────────────────────────────────── */
.vc-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.vc-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 0 0 120px;
  width: 120px;
  padding: 12px 10px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-base);
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
  user-select: none;
  color: var(--text-muted);
  text-align: center;
}
.vc-tile:hover { border-color: var(--accent); color: var(--accent); }
.vc-tile-active {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
}
.vc-tile-icon { font-size: 1.4rem; }
.vc-tile-code { font-size: .78rem; font-weight: 700; line-height: 1.3; }

/* ── Selected-category description (shown below the tile grid) ──────────── */
.vc-selected-desc {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .8rem;
  color: var(--text-muted);
}
.vc-selected-desc-row { color: var(--text-secondary); }
.vc-selected-desc-row + .vc-selected-desc-row { margin-top: 6px; }
.vc-selected-desc-row strong { color: var(--text-primary); }

/* ── Vehicle Category Info Panel ─────────────────────────────────────────── */
.vc-info-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color .15s;
}
.vc-info-btn:hover { color: var(--accent); }
.vc-info-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow);
}
.vc-info-panel-title {
  font-size: .82rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.vc-info-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: .82rem;
  color: var(--text-secondary);
  line-height: 1.45;
}
.vc-info-code {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 700;
  font-size: .75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

/* ── Draw Signature Button ───────────────────────────────────────────────── */
.sig-draw-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin-top: 8px;
  padding: 9px 14px;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  background: transparent;
  color: var(--accent);
  font-size: .88rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
}
.sig-draw-btn:hover { background: var(--accent-dim); }

/* ── Signature Draw Modal ────────────────────────────────────────────────── */
.sig-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.sig-modal-box {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: min(600px, 95vw);
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow);
}
.sig-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}
.sig-modal-header button {
  color: var(--text-muted);
  font-size: 1.1rem;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color .15s;
}
.sig-modal-header button:hover { color: var(--text-primary); }
.sig-canvas {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  cursor: crosshair;
  touch-action: none;
}
.sig-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ── Wizard nav buttons ──────────────────────────────────────────────────── */
.pub-wizard-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  margin-top: 8px;
  border-top: 1px solid var(--border);
}
.pub-btn-next {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  padding: 10px 28px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-size: .9rem;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: opacity .15s;
}
.pub-btn-next:hover:not(:disabled) { opacity: .88; }
.pub-btn-next:disabled { opacity: .5; cursor: not-allowed; }

/* ── Delivery Step ───────────────────────────────────────────────────────── */
.del-method-label {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.del-method-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.del-method-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
  position: relative;
}
.del-method-card:hover { border-color: var(--accent); }
.del-method-card-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.del-method-radio { font-size: 1.1rem; margin-top: 2px; color: var(--text-muted); flex-shrink: 0; }
.del-method-icon-wrap {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}
.del-method-card-active .del-method-icon-wrap { background: var(--accent); color: #fff; }
.del-method-title { font-size: .95rem; font-weight: 700; color: var(--text-primary); }
.del-method-fee   { font-size: .9rem; font-weight: 700; color: var(--accent); margin: 2px 0; }
.del-method-fee-free { color: var(--success); }
.del-method-desc  { font-size: .8rem; color: var(--text-muted); }

.del-body-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.del-section-label {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
}
.del-address-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}
.del-addr-full  { grid-column: 1 / -1; }
.del-addr-half  { grid-column: span 2; }
.del-addr-third { grid-column: span 1; }
/* Labels in the narrower third-width columns (e.g. "Building / Villa / Floor #")
   wrap to 2 lines while short labels next to them (e.g. "Street / Road") stay on
   1 line — reserving 2 lines' height for every label keeps the inputs below them
   aligned regardless of which fields end up side by side. */
.del-address-grid .field label { min-height: 2.6em; }

.del-info-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--accent-dim);
  border: 1px solid rgba(79,124,255,.2);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: .83rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: 16px;
}

.del-map-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: block;
  margin-bottom: 16px;
}
.del-offices-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.del-office-card {
  background: var(--bg-elevated);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.del-office-card:hover { border-color: var(--accent); }
.del-office-card-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.del-office-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.del-office-name { font-size: .88rem; font-weight: 700; color: var(--text-primary); }
.del-office-radio { margin-left: auto; font-size: 1rem; color: var(--text-muted); flex-shrink: 0; }
.del-office-addr { font-size: .78rem; color: var(--text-muted); line-height: 1.45; }
.del-office-hours { display: flex; flex-direction: column; gap: 3px; }
.del-hours-row {
  display: flex;
  justify-content: space-between;
  font-size: .78rem;
  color: var(--text-secondary);
}

@media (max-width: 860px) {
  .del-method-grid { grid-template-columns: 1fr; }
  .del-body-grid   { grid-template-columns: 1fr; }
  .del-offices-grid { grid-template-columns: 1fr; }
  .del-address-grid { grid-template-columns: 1fr 1fr; }
  .del-addr-third { grid-column: span 1; }
}

/* ── Step 4: Review & Pay ─────────────────────────────────────────────────── */
.rv-info-banner {
  display: flex;
  gap: 12px;
  background: #eff3ff;
  border: 1px solid #c7d6ff;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 20px;
  align-items: flex-start;
}
.rv-info-icon {
  color: var(--accent);
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 2px;
}
.rv-info-lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: .83rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.rv-section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}
.rv-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}
.rv-section-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text-primary);
}
.rv-section-sub {
  font-size: .82rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.rv-next-steps-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.rv-next-steps-icon { color: #4f7cff; font-size: 1.05rem; }
.rv-next-steps-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rv-next-step-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: .84rem;
  color: var(--text-secondary);
}
.rv-next-step-num {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #4f7cff;
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.rv-identity-rows {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.rv-identity-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--bg-base);
}
.rv-identity-row:last-child { border-bottom: none; }
.rv-id-icon {
  width: 28px;
  text-align: center;
  color: var(--accent);
  font-size: .95rem;
  flex-shrink: 0;
}
.rv-id-label {
  /* Matches .rv-extra-label's width so the VALUE columns of both row types
     line up too, not just the labels — .rv-identity-row has a 28px icon +
     12px gap before its label that .rv-extra-row's 40px left padding
     replaces, so equal label widths here is what makes the two line up. */
  flex: 0 0 260px;
  font-size: .85rem;
  color: var(--text-muted);
  font-weight: 500;
}
.rv-id-value {
  font-size: .9rem;
  color: var(--text-primary);
  font-weight: 500;
}
.rv-extra-rows { display: flex; flex-direction: column; gap: 0; }
.rv-extra-row {
  display: flex;
  align-items: center;
  gap: 12px;
  /* Left-align with .rv-identity-row's label column (28px icon + 12px gap) —
     .rv-extra-row has no icon of its own, so without this its labels sit
     ~40px to the left of the identity rows shown right above it. */
  padding: 10px 0 10px 40px;
  border-bottom: 1px solid var(--bg-base);
}
.rv-extra-row:last-child { border-bottom: none; }
.rv-extra-label {
  flex: 0 0 260px;
  font-size: .85rem;
  color: var(--text-muted);
  font-weight: 500;
}
.rv-extra-value {
  font-size: .9rem;
  color: var(--text-primary);
  font-weight: 700;
}
/* Document thumbnails */
.rv-docs-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-top: 14px;
}
.rv-doc-item { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.rv-doc-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.rv-doc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rv-doc-thumb-empty { border-style: dashed; color: var(--text-muted); font-size: 1.5rem; }
.rv-doc-thumb-clickable { cursor: pointer; transition: border-color .15s; }
.rv-doc-thumb-clickable:hover { border-color: var(--accent); }
.rv-doc-check {
  position: absolute;
  top: 5px;
  right: 5px;
  background: var(--success);
  color: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
}
.rv-cats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.rv-cat-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: .82rem;
  color: var(--text-primary);
  font-weight: 500;
}
.rv-cat-badge i { color: var(--accent); font-size: .85rem; }
.rv-doc-loading {
  font-size: 1.2rem;
  color: var(--text-muted);
}
.rv-doc-label {
  font-size: .75rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.3;
}
/* Delivery summary grid */
.rv-delivery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.rv-delivery-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
}
.rv-delivery-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}
.rv-delivery-method {
  font-size: .95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.rv-delivery-desc {
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.rv-delivery-rows { display: flex; flex-direction: column; gap: 0; }
.rv-delivery-row {
  display: flex;
  gap: 8px;
  padding: 7px 0;
  border-top: 1px solid var(--bg-base);
  font-size: .82rem;
  line-height: 1.4;
}
.rv-delivery-label {
  flex: 0 0 90px;
  color: var(--text-muted);
  font-weight: 500;
}

@media (max-width: 700px) {
  .rv-docs-grid { grid-template-columns: repeat(3, 1fr); }
  .rv-delivery-grid { grid-template-columns: 1fr; }
  .rv-id-label { flex: 0 0 150px; }
  .rv-extra-label { flex: 0 0 150px; }
}

/* ── Responsive: collapse sidebar on small screens ───────────────────────── */
@media (max-width: 900px) {
  .pub-portal-layout {
    grid-template-columns: 1fr;
  }
  .pub-service-nav {
    position: static;
  }
}

/* ── Public IDP verification page (QR code target, no login) ────────────── */
.public-display-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-base);
  padding: 24px;
}
.pdv-card {
  width: 100%;
  max-width: 700px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.pdv-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}
.pdv-logo { height: 32px; width: auto; }
.pdv-header-title { font-size: .95rem; font-weight: 700; color: var(--text-primary); }
.pdv-body { padding: 24px; }
.pdv-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 14px;
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.pdv-status-valid   { background: rgba(34,197,94,.1);  color: #16a34a; }
.pdv-status-expired { background: rgba(239,68,68,.1);  color: #dc2626; }
.pdv-rows { display: flex; flex-direction: column; gap: 12px; }
.pdv-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--bg-base);
  font-size: .88rem;
}
.pdv-row:last-child { border-bottom: none; padding-bottom: 0; }
.pdv-label { color: var(--text-muted); }
.pdv-value { color: var(--text-primary); font-weight: 600; text-align: right; }
.pdv-card-image { display: block; width: 100%; height: auto; border-radius: var(--radius); }
