/*LOGIN RECAPTCHA*/

.login-recaptcha {
  margin-top: 12px;
  margin-bottom: 12px;
}

.login-recaptcha .g-recaptcha {
  display: flex;
  justify-content: center;
  transform: scale(.94);
  filter: drop-shadow(0 1px 2px rgba(23, 35, 52, .08));
}

.login-recaptcha .auth-field-error {
  display: block;
  margin-top: 8px;
}

@media (max-width: 480px) {
  .login-recaptcha {
    overflow-x: auto;
  }
}

/* =========================================================
   SKELETON LOADER
   ========================================================= */

@keyframes sk-shimmer {
  0% {
    background-position: -600px 0;
  }

  100% {
    background-position: 600px 0;
  }
}

.skeleton {
  display: inline-block;
  border-radius: 6px;
  background: linear-gradient(90deg,
      #e2e8f0 25%,
      #f1f5f9 50%,
      #e2e8f0 75%);
  background-size: 600px 100%;
  animation: sk-shimmer 1.4s ease-in-out infinite;
  height: 14px;
  vertical-align: middle;
}

/* Full-width cell shimmer inside a <td> */
.sk-cell {
  display: block;
  width: 100%;
  height: 13px;
  border-radius: 5px;
}

/* Skeleton row: remove normal cell padding visual noise */
tr.sk-row td {
  padding: 10px 12px;
  border: none;
}

/* KPI / stat-card value shimmer — applied by Skeleton.setLoading() */
.is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
  border-radius: 6px;
  overflow: hidden;
}

.is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg,
      #e2e8f0 25%,
      #f1f5f9 50%,
      #e2e8f0 75%);
  background-size: 600px 100%;
  animation: sk-shimmer 1.4s ease-in-out infinite;
}

/* First-paint placeholder, removed once each page finishes its initial setup. */
body.skeleton-page-loading {
  overflow: hidden;
}

body.skeleton-page-loading::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
}

body.skeleton-page-loading::after {
  content: '';
  position: fixed;
  z-index: 100001;
  top: 50%;
  left: 50%;
  width: min(440px, calc(100vw - 40px));
  height: 184px;
  transform: translate(-50%, -50%);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background-color: #fff;
  background-image:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72), transparent),
    linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%),
    linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%),
    linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%),
    linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%),
    linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-repeat: no-repeat;
  background-size: 600px 100%, 52% 16px, calc(100% - 48px) 12px, 78% 12px, 92% 12px, calc(100% - 48px) 38px;
  background-position: -600px 0, 24px 24px, 24px 60px, 24px 88px, 24px 112px, 24px 146px;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.12);
  animation: page-skeleton-shimmer 1.4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes page-skeleton-shimmer {
  100% {
    background-position: 600px 0, 24px 24px, 24px 60px, 24px 88px, 24px 112px, 24px 146px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.skeleton-page-loading::after {
    animation: none;
  }
}

/* RESET */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  overflow-x: hidden
}

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden
}

.app-shell {
  overflow-x: hidden
}

a {
  text-decoration: none;
  color: inherit
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none
}

button:not(:disabled):focus-visible {
  outline: 2.5px solid var(--primary);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px var(--primary-glass);
}

ul {
  list-style: none
}

input,
select,
textarea {
  font-family: inherit
}

table {
  border-collapse: collapse
}

/* DESIGN TOKENS */
:root {
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --primary-light: #3B82F6;
  --primary-muted: #DBEAFE;
  --primary-glass: rgba(37, 99, 235, 0.06);
  --primary-border: rgba(37, 99, 235, 0.15);

  --accent: #5C51E0;
  --accent-bg: #EEEEFF;

  --success: #059669;
  --success-bg: #D1FAE5;
  --success-dark: #065F46;
  --warning: #D97706;
  --warning-bg: #FEF3C7;
  --warning-dark: #92400E;
  --danger: #E11D48;
  --danger-bg: #FFE4E6;
  --danger-dark: #9F1239;
  --info: #2563EB;
  --info-bg: #DBEAFE;
  --purple: #6B5BD1;
  --purple-bg: #EDEBFE;
  --purple-dark: #4C3FA8;
  --rose: #E11D48;
  --rose-bg: #FFE4E6;
  --teal: #0D8C8C;
  --teal-bg: #CDFAFA;

  --surface: #FFFFFF;
  --bg: #F8FAFC;
  --bg-alt: #F1F5F9;
  --bg-deep: #E2E8F0;

  --border: #E2E8F0;
  --border-subtle: rgba(226, 232, 240, 0.7);
  --border-strong: #CBD5E1;

  --text-primary: #0F172A;
  --text-secondary: #334155;
  --text-muted: #64748B;
  --text-placeholder: #94A3B8;

  --shadow-xs: 0 1px 3px rgba(13, 27, 62, 0.06);
  --shadow-sm: 0 4px 14px rgba(13, 27, 62, 0.08);
  --shadow-card: 0 2px 8px rgba(13, 27, 62, 0.04), 0 8px 28px rgba(13, 27, 62, 0.07);
  --shadow-blue: 0 8px 32px rgba(37, 99, 235, 0.18);
  --shadow-lift: 0 4px 16px rgba(13, 27, 62, 0.06), 0 24px 48px rgba(13, 27, 62, 0.12);
  --shadow-glow: 0 0 0 3px rgba(37, 99, 235, 0.14);

  --r-xs: 5px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-2xl: 28px;
  --r-pill: 9999px;

  --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-data: 'Space Grotesk', system-ui, sans-serif;

  --nav-w: 268px;

  --tf: 140ms cubic-bezier(0.4, 0, 0.2, 1);
  --tb: 240ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Theme overrides are opt-in; the light tokens above remain the default. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --primary: #60A5FA;
  --primary-hover: #3B82F6;
  --primary-light: #93C5FD;
  --primary-border: rgba(96, 165, 250, .3);
  --success: #34D399;
  --success-dark: #6EE7B7;
  --warning: #FBBF24;
  --warning-dark: #FCD34D;
  --danger: #FB7185;
  --danger-dark: #FDA4AF;
  --info: #60A5FA;
  --purple: #A78BFA;
  --purple-dark: #C4B5FD;
  --rose: #FB7185;
  --teal: #2DD4BF;
  --surface: #172033;
  --bg: #0B1220;
  --bg-alt: #111B2D;
  --bg-deep: #1E293B;
  --border: #334155;
  --border-subtle: rgba(71, 85, 105, .58);
  --border-strong: #475569;
  --text-primary: #F1F5F9;
  --text-secondary: #CBD5E1;
  --text-muted: #94A3B8;
  --text-placeholder: #64748B;
  --primary-muted: rgba(37, 99, 235, .22);
  --accent-bg: rgba(92, 81, 224, .2);
  --success-bg: rgba(5, 150, 105, .2);
  --warning-bg: rgba(217, 119, 6, .2);
  --danger-bg: rgba(225, 29, 72, .2);
  --info-bg: rgba(37, 99, 235, .2);
  --purple-bg: rgba(107, 91, 209, .2);
  --rose-bg: rgba(225, 29, 72, .2);
  --teal-bg: rgba(13, 140, 140, .2);
  --shadow-xs: 0 1px 3px rgba(0, 0, 0, .25);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, .25);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, .2), 0 8px 28px rgba(0, 0, 0, .2);
  --shadow-lift: 0 4px 16px rgba(0, 0, 0, .25), 0 24px 48px rgba(0, 0, 0, .35);
}

/* LAYOUT */
.app-shell {
  display: flex;
  min-height: 100vh
}

.main-content {
  margin-left: var(--nav-w);
  padding: 22px 24px 64px;
  min-height: 100vh;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px
}

/* SIDEBAR */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 18px 10px;
  position: fixed;
  top: 0;
  left: 0;
  width: var(--nav-w);
  height: 100dvh;
  z-index: 200;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(58, 75, 114, .35) transparent;
  -ms-overflow-style: scrollbar;
  background: var(--surface);
  border-right: 1px solid var(--border);
  box-shadow: 4px 0 28px rgba(13, 27, 62, 0.05);
  backdrop-filter: blur(12px);
  will-change: transform;
}

.sidebar::-webkit-scrollbar {
  width: 8px
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(58, 75, 114, .35);
  border-radius: var(--r-pill)
}

.sidebar::-webkit-scrollbar-track {
  background: transparent
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 10px;
  border-radius: var(--r-lg);
  transition: background var(--tf);
  cursor: pointer
}

.sidebar__brand:hover {
  background: var(--primary-glass)
}

.sidebar__brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  color: #fff;
  overflow: hidden;
}

.sidebar__brand-icon svg,
.sidebar__brand-icon img {
  width: 42px;
  height: 42px
}

.sidebar__brand-icon img {
  object-fit: contain;
  background: transparent !important;
  filter: none;
  image-rendering: -webkit-optimize-contrast;
  mix-blend-mode: normal;
  display: block
}

.sidebar__brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0
}

.sidebar__brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  color: var(--text-primary);
  letter-spacing: -.4px
}

.sidebar__brand-subtitle {
  font-weight: 500;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: .1px
}

.sidebar__section {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1
}

.sidebar__section-label {
  font-family: var(--font-data);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-placeholder);
  padding: 0 12px;
  margin-bottom: 3px;
  margin-top: 4px
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r-md);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: background-color var(--tf), color var(--tf);
  will-change: transform;
  border: none;
  width: 100%;
  text-align: left;
  background: transparent;
}

.nav-link:hover {
  background: var(--bg);
  transform: translateX(2px)
}

.nav-link.active {
  background: var(--primary-muted);
  box-shadow: inset 0 0 0 1px var(--primary-border)
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 18%;
  height: 64%;
  width: 3px;
  background: var(--primary);
  border-radius: 0 var(--r-pill) var(--r-pill) 0
}

.nav-link.admin-hidden {
  display: none;
}

.nav-link__icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--primary);
  transition: background var(--tf)
}

.nav-link.active .nav-link__icon-wrap {
  background: rgba(26, 79, 186, 0.12)
}

.nav-link:hover .nav-link__icon-wrap {
  background: var(--border)
}

.nav-link__icon {
  width: 15px;
  height: 15px;
  color: var(--primary);
  flex-shrink: 0
}

.nav-link.active .nav-link__icon {
  color: var(--primary)
}

.nav-link:hover .nav-link__icon {
  color: var(--primary)
}

/* Flaticon uicons in sidebar */
.nav-link__icon-wrap i[class^="fi-"] {
  font-size: 16px;
  color: var(--primary);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-link.active .nav-link__icon-wrap i[class^="fi-"] {
  color: var(--primary)
}

.nav-link:hover .nav-link__icon-wrap i[class^="fi-"] {
  color: var(--primary)
}

.nav-link__label {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14.5px;
  color: var(--text-muted);
  transition: color var(--tf);
  flex: 1
}

.nav-link.active .nav-link__label {
  color: var(--primary);
  font-weight: 700
}

.nav-link:hover .nav-link__label {
  color: var(--text-secondary)
}

.nav-link__badge {
  font-family: var(--font-data);
  font-weight: 700;
  font-size: 11px;
  color: var(--primary);
  background: var(--primary-muted);
  padding: 2px 8px;
  border-radius: var(--r-pill);
  flex-shrink: 0
}

.nav-link__badge.danger {
  color: var(--danger);
  background: var(--danger-bg)
}


.sidebar__footer {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px
}

.theme-toggle {
  width: 36px;
  height: 36px;
  align-self: flex-end;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--tf);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.theme-toggle:hover {
  background: var(--bg-alt);
  color: var(--text-primary);
  border-color: var(--border-strong);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 2px;
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.theme-toggle [hidden] {
  display: none !important;
}

.theme-toggle--header {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 12px;
  align-self: auto;
}

.theme-toggle--header svg {
  width: 18px;
  height: 18px;
}

.sidebar__user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background var(--tf)
}

.sidebar__user:hover {
  background: var(--bg)
}

.sidebar__avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--r-pill);
  flex-shrink: 0;
  border: 2px solid var(--primary-muted);
  background: linear-gradient(135deg, #E0E9FF, #C7D6FF);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden
}

.sidebar__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block
}

.sidebar__avatar-initials {
  font-family: var(--font-data);
  font-weight: 800;
  font-size: 12.5px;
  letter-spacing: .4px;
  color: var(--primary);
  text-transform: uppercase;
  line-height: 1
}

.sidebar__user-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px
}

.sidebar__user-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.sidebar__user-role {
  font-weight: 400;
  font-size: 12px;
  color: var(--text-muted)
}

.sidebar__user-action {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: background var(--tf), color var(--tf)
}

.sidebar__user-action:hover {
  background: var(--border);
  color: var(--text-secondary)
}

.sidebar__user-action svg {
  width: 13px;
  height: 13px
}

.sidebar__logout-btn {
  width: 100%;
  padding: 0 12px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--text-secondary);
  border-radius: var(--r-md);
  border: 1.5px solid var(--border);
  background: var(--bg);
  transition: background var(--tf), box-shadow var(--tf)
}

.sidebar__logout-btn svg {
  width: 14px;
  height: 14px;
  color: var(--text-muted)
}

.sidebar__logout-btn:hover {
  background: var(--surface);
  box-shadow: var(--shadow-xs)
}

/* MODULES */
.module {
  display: none;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
  animation: fadeInUp .32s cubic-bezier(0.4, 0, 0.2, 1) both
}

.module.active {
  display: flex
}

/* PAGE HEADER */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap
}

.page-header__left {
  display: flex;
  flex-direction: column;
  gap: 5px
}

.page-header__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px
}

.page-header__title {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 800;
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: -.6px;
  color: var(--text-primary)
}

.page-header__badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 11px;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-data);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .9px;
  text-transform: uppercase;
  border-radius: var(--r-pill);
  align-self: center
}

.page-header__badge.green {
  background: var(--success-dark)
}

.page-header__badge.purple {
  background: var(--purple-dark)
}

.page-header__badge.slate {
  background: #2D3E6B
}

.page-header__badge.amber {
  background: #926008
}

.page-header__sub {
  font-weight: 400;
  font-size: 14.5px;
  color: var(--text-muted)
}

.page-header__controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  position: relative
}

.date-filter-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 10px;
  width: 280px;
  padding: 16px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-card);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: opacity .2s ease, transform .2s ease;
  z-index: 25
}

.date-filter-menu.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0)
}

.calendar {
  display: flex;
  flex-direction: column;
  gap: 12px
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  color: var(--text-primary)
}

.calendar-nav {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background .2s, border-color .2s
}

.calendar-nav:hover {
  background: var(--primary-muted);
  border-color: var(--primary)
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase
}

.calendar-day-header {
  padding: 6px 0
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px
}

.calendar-day {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--r-lg);
  transition: background .2s, color .2s
}

.calendar-day:hover {
  background: var(--primary-muted);
  color: var(--primary)
}

.calendar-day.today {
  background: var(--primary);
  color: #fff
}

.calendar-day.selected {
  background: var(--success);
  color: #fff
}

.calendar-day.disabled {
  color: var(--text-placeholder);
  cursor: not-allowed
}

/* Controls */
.search-field,
.table-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  background: rgba(148, 164, 194, 0.12);
  border: 1.5px solid transparent;
  border-radius: var(--r-pill);
  transition: all var(--tf);
  min-width: 200px
}

.search-field:focus-within,
.table-search:focus-within {
  background: var(--surface);
  border-color: var(--primary-light);
  box-shadow: var(--shadow-glow)
}

.search-field svg,
.table-search svg {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  flex-shrink: 0
}

.search-field input,
.table-search input {
  border: none;
  background: transparent;
  outline: none;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-primary);
  width: 100%
}

.search-field input::placeholder,
.table-search input::placeholder {
  color: var(--text-placeholder)
}

.date-pill {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  height: 44px;
  padding: 0 22px 0 18px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-pill);
  font-family: var(--font-display), var(--font-body), system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color var(--tf), box-shadow var(--tf), background-color var(--tf);
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  user-select: none;
}

.page-header__controls .date-pill {
  height: 38px;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid #DCE4EC;
  background: #F1F4F7;
  font-size: 14px;
  font-weight: 700;
  color: #52677F;
  box-shadow: none;
}

.page-header__controls .date-pill svg {
  width: 16px;
  height: 16px;
  color: #087A55;
}

.date-pill--static {
  cursor: default;
}

.date-pill--static:hover {
  border-color: var(--border);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.date-pill:hover {
  border-color: var(--border-strong);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.date-pill svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  stroke-width: 2;
  color: var(--text-primary);
  flex-shrink: 0;
}

.icon-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--tf)
}

.icon-btn:hover {
  background: var(--bg);
  box-shadow: var(--shadow-xs);
  border-color: var(--border-strong);
  transform: translateY(-1px)
}

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

.icon-btn__dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  background: var(--danger);
  border: 2px solid var(--surface);
  border-radius: var(--r-pill)
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 18px;
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--tf)
}

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

.btn--primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 10px rgba(26, 79, 186, .28)
}

.btn--primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 5px 18px rgba(26, 79, 186, .38)
}

.btn.is-sending,
.btn.is-sending:hover {
  cursor: wait;
  opacity: .88;
  transform: none;
  box-shadow: 0 2px 10px rgba(26, 79, 186, .2);
}

.btn__spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: auth-spin .7s linear infinite;
}

.btn--secondary {
  background: var(--primary-glass);
  border: 1.5px solid var(--primary-border);
  color: var(--primary)
}

.btn--secondary:hover {
  background: var(--primary-muted);
  box-shadow: 0 2px 10px rgba(26, 79, 186, .12)
}

/* Document verification checkmark toggle */
.doc-card .verify-toggle {
  height: 34px;
  padding: 0 12px;
  font-size: 12px;
  background: var(--surface);
  border: 1.5px dashed var(--primary-border);
  color: var(--text-muted)
}

.doc-card .verify-toggle:hover {
  border-color: var(--primary);
  color: var(--primary)
}

.doc-card .verify-toggle.is-verified {
  background: #0B9E6C;
  border: 1.5px solid #0B9E6C;
  color: #fff;
  box-shadow: 0 2px 8px rgba(11, 158, 108, .25)
}

/* Compact doc card action buttons */
.doc-card .btn {
  height: 28px;
  padding: 0 10px;
  font-size: 11px;
  gap: 4px;
  border-radius: var(--r-sm)
}

.doc-card .btn svg {
  width: 12px;
  height: 12px
}

.doc-card .doc-actions .btn--secondary {
  border: 1px solid var(--border);
  background: var(--surface)
}

.doc-card .doc-actions .btn--ghost {
  border: 1px solid transparent;
  background: transparent
}

.doc-card .doc-actions .btn--ghost:hover {
  background: var(--bg-alt);
  border-color: var(--border)
}

.btn--danger {
  background: var(--danger-bg);
  border: 1.5px solid rgba(217, 35, 58, .15);
  color: var(--danger)
}

.btn--danger:hover {
  background: #FFCCD3
}

.btn--ghost {
  color: var(--text-secondary);
  border: 1.5px solid var(--border)
}

.btn--ghost:hover {
  background: var(--bg);
  border-color: var(--border-strong)
}

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

/* Stat cards */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px
}

.cards-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px
}

/* Admin dashboard 5-card horizontal strip (larger for less crowding) */
.admin-kpi-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px
}

.admin-kpi-strip .stat-card {
  padding: 12px 14px;
  gap: 8px
}

.admin-kpi-strip .stat-card__value {
  font-size: 26px
}

.stat-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: none;
  position: relative;
  overflow: hidden;
  transition: border-color var(--tf);
  animation: fadeInUp .4s cubic-bezier(0.4, 0, 0.2, 1) both;
  cursor: pointer
}

.stat-card::before {
  content: none
}

.stat-card:hover,
.stat-card.active {
  border-color: var(--border-strong)
}

.stat-card.active {
  border-color: var(--primary-border)
}

.stat-card--success,
.stat-card--danger,
.stat-card--warn,
.stat-card--purple {
  border-top: 1px solid var(--border)
}

.stat-card:nth-child(1) {
  animation-delay: .04s
}

.stat-card:nth-child(2) {
  animation-delay: .09s
}

.stat-card:nth-child(3) {
  animation-delay: .14s
}

.stat-card:nth-child(4) {
  animation-delay: .19s
}

.stat-card:nth-child(5) {
  animation-delay: .24s
}

.stat-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px
}

.stat-card__icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  flex-shrink: 0
}

.iwrap-blue {
  background: var(--primary-muted)
}

.iwrap-green {
  background: var(--success-bg)
}

.iwrap-red {
  background: var(--danger-bg)
}

.iwrap-purple {
  background: var(--purple-bg)
}

.iwrap-warn {
  background: var(--warning-bg)
}

.iwrap-teal {
  background: var(--teal-bg)
}

.iwrap-indigo {
  background: #DDD9FF
}

.iwrap-rose {
  background: var(--rose-bg)
}

.iwrap-slate {
  background: var(--bg-deep)
}

/* Admin KPI strip: transparent icon backgrounds (user request) */
.admin-kpi-strip .stat-card__icon-wrap[class*="iwrap-"] {
  background: transparent !important;
}

.stat-card__icon {
  width: 16px;
  height: 16px
}

.ic-blue {
  color: var(--primary)
}

.ic-green {
  color: var(--success)
}

.ic-red {
  color: var(--danger)
}

.ic-purple {
  color: var(--purple)
}

.ic-warn {
  color: var(--warning)
}

.ic-teal {
  color: var(--teal)
}

.ic-indigo {
  color: var(--accent)
}

.ic-rose {
  color: var(--rose)
}

.ic-slate {
  color: #4A5A8A
}

.stat-card__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px
}

.stat-card__trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-data);
  font-weight: 600;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: var(--r-sm)
}

.stat-card__trend svg {
  width: 8px;
  height: 8px
}

.trend-up {
  color: var(--warning-dark);
  background: var(--warning-bg)
}

.trend-good {
  color: var(--success-dark);
  background: var(--success-bg)
}

.trend-down {
  color: var(--danger-dark);
  background: var(--danger-bg)
}

.trend-neutral {
  color: var(--primary);
  background: var(--primary-muted)
}

.stat-card__period {
  font-family: var(--font-data);
  font-weight: 600;
  font-size: 11px;
  color: var(--text-placeholder);
  letter-spacing: .5px;
  text-transform: uppercase;
  text-align: right
}

.stat-card__body {
  display: flex;
  flex-direction: column;
  gap: 2px
}

.stat-card__label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .2px;
  text-transform: none;
  color: var(--text-secondary)
}

.stat-card__value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  line-height: 1.05;
  letter-spacing: -1.5px;
  color: var(--text-primary)
}

.stat-card__sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px
}

/* Dashboard charts */
.dash-charts-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
  flex-wrap: wrap
}

.chart-card {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-width: 280px;
  height: 100%;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: none;
  overflow: hidden;
  transition: border-color var(--tf)
}

.chart-card:hover {
  border-color: var(--border-strong)
}

.chart-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px
}

.donut-card {
  display: flex;
  flex-direction: column;
  flex: 0 0 280px;
  height: 100%;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: none;
  gap: 12px;
  transition: border-color var(--tf)
}

.donut-card:hover {
  border-color: var(--border-strong)
}

.chart-card__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1.2;
  color: var(--text-primary)
}

.chart-card__subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px
}

.chart-card__chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-data);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .6px;
  text-transform: uppercase;
  border-radius: var(--r-pill);
  white-space: nowrap;
  flex-shrink: 0
}

.bar-chart-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 200px
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 170px;
  padding: 0 4px
}

.bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  height: 100%;
  justify-content: flex-end;
  position: relative
}

.bar-col__bar {
  width: 100%;
  border-radius: var(--r-md) var(--r-md) 0 0;
  background: rgba(26, 79, 186, 0.18);
  cursor: pointer;
  transition: background var(--tf), transform var(--tf);
  transform-origin: bottom
}

.bar-col__bar:hover {
  background: rgba(26, 79, 186, 0.38);
  transform: scaleX(1.04)
}

.bar-col__bar--peak {
  background: rgba(26, 79, 186, 0.55)
}

.bar-col__bar--peak:hover {
  background: rgba(26, 79, 186, 0.75)
}

.bar-col__tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(13, 27, 62, .92);
  backdrop-filter: blur(8px);
  color: #fff;
  font-family: var(--font-data);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--r-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--tf)
}

.bar-col__tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: rgba(13, 27, 62, .92)
}

.bar-col:hover .bar-col__tooltip {
  opacity: 1
}

.bar-col__peak-label {
  position: absolute;
  bottom: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(13, 27, 62, .84);
  backdrop-filter: blur(4px);
  color: #fff;
  font-family: var(--font-data);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--r-sm);
  white-space: nowrap;
  text-align: center;
  line-height: 1.4;
  pointer-events: none
}

.bar-col__peak-label::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: rgba(13, 27, 62, .84)
}

.bar-chart__axis {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 0 4px
}

.bar-chart__axis-label {
  flex: 1;
  font-family: var(--font-data);
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.3
}

.donut-card__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  color: var(--text-primary)
}

.donut-wrap {
  position: relative;
  width: 150px;
  height: 150px;
  margin: 0 auto 16px
}

.donut-svg {
  display: block;
  width: 150px;
  height: 150px;
  transform: rotate(-90deg)
}

.donut-svg .track {
  fill: none;
  stroke: rgba(26, 79, 186, 0.12);
  stroke-width: 12
}

.donut-svg .fill {
  fill: none;
  stroke: var(--primary);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 270;
  stroke-dashoffset: 86;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1)
}

.donut-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center
}

.donut-inner__pct {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 24px;
  line-height: 1;
  color: var(--text-primary)
}

.donut-inner__tag {
  font-family: var(--font-data);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .9px;
  text-transform: uppercase;
  color: var(--text-muted)
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 7px
}

.donut-legend__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px
}

.donut-legend__left {
  display: flex;
  align-items: center;
  gap: 8px
}

.donut-legend__dot {
  width: 8px;
  height: 8px;
  border-radius: var(--r-pill);
  flex-shrink: 0
}

.donut-legend__key {
  font-size: 13.5px;
  color: var(--text-secondary)
}

.donut-legend__val {
  font-family: var(--font-data);
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary)
}

/* Data table */
.data-table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: none;
  overflow: visible;
  overflow-x: auto
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: 1px solid var(--bg-alt)
}

.table-header__title {
  font-family: var(--font-data);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-primary)
}

.table-header__desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px
}

.table-header__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body);
}

.data-table thead tr {
  background: var(--bg)
}

.data-table th {
  padding: 7px 12px;
  font-family: var(--font-data);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--bg-alt);
  user-select: none;
  cursor: pointer;
  transition: color var(--tf)
}

.data-table th:hover {
  color: var(--text-secondary)
}

.data-table th:last-child {
  text-align: right
}

.data-table th .sort-icon {
  margin-left: 4px;
  opacity: .35;
  transition: opacity .2s
}

.data-table th .sort-icon {
  opacity: .35
}

.data-table th[style*='color'] .sort-icon,
.data-table th.sorted .sort-icon {
  opacity: 1
}

.data-table th:hover .sort-icon {
  opacity: .8
}

.data-table tbody tr {
  border-bottom: 1px solid var(--bg-alt);
  transition: background var(--tf)
}

.data-table tbody tr:last-child {
  border-bottom: none
}

.data-table tbody tr:hover {
  background: rgba(244, 246, 253, 0.8)
}

.data-table tbody tr:hover .row-action {
  opacity: 1;
  transform: translateX(0)
}

.data-table td {
  padding: 8px 12px;
  vertical-align: middle;
  font-family: var(--font-body);
}

.applicant-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.applicant-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--r-pill);
  flex-shrink: 0;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12.5px;
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.applicant-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  text-align: left;
}

.applicant-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.applicant-id {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 12px;
  color: #64748b;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

:root[data-theme="dark"] .applicant-id {
  color: #94a3b8;
}

.cell-text {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 13px;
  color: var(--text-secondary)
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--r-xs);
  font-family: var(--font-data);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .3px;
  text-transform: uppercase;
  white-space: nowrap
}

.badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: var(--r-pill);
  background: currentColor;
  flex-shrink: 0
}

.badge-pending {
  color: var(--warning-dark);
  background: var(--warning-bg)
}

.badge-approved {
  color: var(--success-dark);
  background: var(--success-bg)
}

.badge-review {
  color: #3050AA;
  background: #DDE8FF
}

.badge-rejected {
  color: var(--danger-dark);
  background: var(--danger-bg)
}

.badge-issued {
  color: var(--purple-dark);
  background: var(--purple-bg)
}

.badge-processing {
  color: #086585;
  background: #CFF0FA
}

.badge-active {
  color: var(--success-dark);
  background: var(--success-bg)
}

.badge-inactive {
  color: var(--text-muted);
  background: var(--bg-alt)
}

/* Row action */
.row-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 13px;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-family: var(--font-data);
  font-weight: 600;
  font-size: 13px;
  color: var(--primary);
  cursor: pointer;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(4px);
  transition: all var(--tf)
}

.row-action:hover {
  background: var(--primary-glass);
  border-color: var(--primary-border)
}

.row-action.always-visible {
  opacity: 1;
  transform: none
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-top: 1px solid var(--bg-alt);
  flex-wrap: wrap;
  gap: 6px
}

.table-footer__info {
  font-family: var(--font-data);
  font-size: 12px;
  color: var(--text-muted)
}

.view-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-data);
  font-weight: 600;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 5px 10px;
  border-radius: var(--r-sm);
  transition: all var(--tf);
  border: 1px solid var(--border);
  background: var(--surface)
}

.view-all-btn:hover {
  color: var(--primary);
  border-color: var(--primary-border)
}

.view-all-btn svg {
  width: 11px;
  height: 11px;
  transition: transform var(--tf)
}

.view-all-btn:hover svg {
  transform: translateX(2px)
}

/* Filter bar */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 8px 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--border)
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--r-sm);
  font-family: var(--font-data);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  transition: all var(--tf)
}

.filter-chip:hover {
  border-color: var(--primary);
  color: var(--primary)
}

.filter-chip.active {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: #fff
}

.filter-spacer {
  flex: 1
}

/* Segmented Control Tab Bar */
.status-tabs {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 3px;
  border-radius: 12px;
  background: var(--bg-alt);
  border: 1.5px solid var(--border)
}

.status-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: none;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  color: var(--text-secondary);
  transition: all .18s ease;
  white-space: nowrap
}

.status-tab:hover:not(.active) {
  background: rgba(37, 99, 235, .06);
  color: var(--text-primary)
}

.status-tab.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 4px rgba(37, 99, 235, .25)
}

.status-tab.active .tab-count {
  background: rgba(255, 255, 255, .25);
  color: #fff
}

.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  background: var(--bg-alt);
  color: var(--text-secondary);
  transition: all .18s ease
}

.status-tab[data-count="0"]:not([data-key="all"]) {
  display: none
}

.status-tab .tab-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0
}

select.filter-select {
  height: 36px;
  padding: 0 30px 0 11px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-family: var(--font-body);
  font-size: 12.5px;
  color: var(--text-secondary);
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7BA4' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: border-color var(--tf)
}

select.filter-select:hover {
  border-color: var(--primary-light)
}

/* Barangay filter — outline map-pin inside the select (shared Staff / ID Maker).
   Compact trigger (max 200px) so short barangay names don't stretch the bar;
   the option list itself is browser-rendered, so it always shows full labels. */
.barangay-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  min-width: 0;
  max-width: 200px
}

.barangay-select-wrap__pin {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 13px;
  height: 13px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color var(--tf);
}

.barangay-select-wrap select.filter-select {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  padding: 0 28px 0 28px;
  text-overflow: ellipsis;
}

.barangay-select-wrap:hover .barangay-select-wrap__pin,
.barangay-select-wrap:focus-within .barangay-select-wrap__pin {
  color: var(--primary)
}

.barangay-select-wrap select.filter-select:focus {
  border-color: var(--primary-light)
}

.status-select {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 140px;
}

.status-select__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-width: 120px;
  padding: 4px 7px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color var(--tf), background var(--tf);
}

.status-select__trigger:hover {
  border-color: var(--primary-light);
  background: var(--bg-alt);
}

.status-select__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.status-select__label {
  font-family: var(--font-body);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
  text-align: left;
}

.status-select__arrow {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.status-select__menu {
  position: fixed;
  max-height: 200px;
  overflow-y: auto;
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 2px 0;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: 0 6px 18px rgba(13, 27, 62, 0.08);
  z-index: 999;
  min-width: 140px;
}

.status-select__menu.show {
  display: flex;
}

.status-select__option {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 5px 7px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  transition: background var(--tf), color var(--tf);
}

.status-select__option:hover {
  background: var(--bg-alt);
  color: var(--text-primary);
}

.status-select__option.active {
  background: var(--primary-muted);
  color: var(--text-primary);
}

.status-select__option-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

/* Content card */
.content-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: none;
  overflow: hidden
}

.content-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--bg-alt);
  flex-wrap: wrap
}

.content-card__title {
  font-family: var(--font-data);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-primary)
}

.content-card__desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px
}

.content-card__body {
  padding: 14px
}

/* Form elements */
.form-grid {
  display: grid;
  gap: 16px
}

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

.form-grid-3 {
  grid-template-columns: 1fr 1fr auto
}

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

.form-label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12.5px;
  color: var(--text-secondary)
}

.form-label span {
  color: var(--danger);
  margin-left: 2px
}

.form-input {
  height: 40px;
  padding: 0 13px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--text-primary);
  outline: none;
  transition: all var(--tf)
}

.form-input:focus {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-glow)
}

.form-input:hover:not(:focus) {
  border-color: var(--border-strong)
}

.form-select {
  height: 40px;
  padding: 0 30px 0 13px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--text-primary);
  outline: none;
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7BA4' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  transition: all var(--tf)
}

.form-select:focus {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-glow)
}

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

/* Small form preview (white printable layout) */
.small-form-preview {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1.5px solid #222;
  padding: 14px;
  color: #111;
  box-shadow: var(--shadow-card);
  font-family: 'Arial', sans-serif;
}

.small-form-head {
  text-align: center;
  line-height: 1.25;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700
}

.small-form-photo {
  width: 104px;
  height: 104px;
  margin: 0 auto 12px;
  border: 1.5px solid #222;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden
}

.small-form-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block
}

.small-form-photo-fallback {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .8px
}

.small-form-lines {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px
}

.small-form-line {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  font-size: 12px;
  line-height: 1.2
}

.small-form-line strong {
  min-width: 95px;
  font-weight: 700
}

.small-form-line span {
  border-bottom: 1px solid #777;
  flex: 1;
  min-height: 15px;
  padding-bottom: 2px
}

.small-form-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 68px
}

.small-form-mayor {
  font-size: 12px;
  line-height: 1.2
}

.small-form-sign-wrap {
  text-align: center
}

.small-form-sign-box {
  width: 128px;
  height: 62px;
  border: 1.5px solid #222;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden
}

.small-form-sign-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block
}

.small-form-sign-fallback {
  font-size: 11px;
  color: #333
}

.small-form-sign-label {
  font-size: 12px;
  margin-top: 4px
}


/* Alerts */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--r-md)
}

.alert svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px
}

.alert-content {
  flex: 1
}

.alert-title {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13.5px
}

.alert-desc {
  font-size: 12.5px;
  margin-top: 2px;
  line-height: 1.5
}

.alert-warn {
  background: var(--warning-bg);
  border: 1.5px solid rgba(192, 122, 10, .18);
  color: var(--warning-dark)
}

.alert-success {
  background: var(--success-bg);
  border: 1.5px solid rgba(11, 158, 108, .18);
  color: var(--success-dark)
}

.alert-info {
  background: var(--info-bg);
  border: 1.5px solid rgba(26, 79, 186, .18);
  color: var(--primary)
}

/* Toggle */
.toggle-group {
  display: flex;
  flex-direction: column;
  gap: 0
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 0;
  border-bottom: 1.5px solid var(--bg-alt)
}

.toggle-row:last-child {
  border-bottom: none
}

.toggle-info {
  display: flex;
  flex-direction: column;
  gap: 2px
}

.toggle-info__label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14.5px;
  color: var(--text-primary)
}

.toggle-info__desc {
  font-size: 13px;
  color: var(--text-muted)
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0
}

.switch__track {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background var(--tf)
}

.switch input:checked+.switch__track {
  background: var(--primary)
}

.switch__track::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-xs);
  transition: transform var(--tf)
}

.switch input:checked+.switch__track::before {
  transform: translateX(20px)
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 340px
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  animation: slideInRight .28s cubic-bezier(0.4, 0, 0.2, 1) both
}

.toast.removing {
  animation: slideOutRight .28s cubic-bezier(0.4, 0, 0.2, 1) both
}

.toast svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0
}

.toast-body {
  flex: 1
}

.toast-title {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px
}

.toast-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px
}

.toast-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0;
  line-height: 1
}

.toast-close:hover {
  color: var(--text-primary)
}

.toast-close svg {
  width: 14px;
  height: 14px
}

.toast-success .toast-title {
  color: var(--success)
}

.toast-success svg {
  color: var(--success)
}

.toast-error .toast-title {
  color: var(--danger)
}

.toast-error svg {
  color: var(--danger)
}

.toast-info .toast-title {
  color: var(--primary)
}

.toast-info svg {
  color: var(--primary)
}

/* SKELETON DARK MODE OVERRIDES */
[data-theme="dark"] .is-loading td {
  background: linear-gradient(90deg, rgba(200, 211, 240, 0.3) 25%, rgba(228, 235, 250, 0.5) 50%, rgba(200, 211, 240, 0.3) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
}

[data-theme="dark"] .is-loading .stat-card__value,
[data-theme="dark"] .is-loading .stat-card__label,
[data-theme="dark"] .is-loading .stat-card__sub,
[data-theme="dark"] .is-loading .kpi-card__value,
[data-theme="dark"] .is-loading .kpi-card__label,
[data-theme="dark"] .is-loading .kpi-card__sub,
[data-theme="dark"] .is-loading .stat-card__icon-wrap {
  background: linear-gradient(90deg, rgba(200, 211, 240, 0.4) 25%, rgba(228, 235, 250, 0.6) 50%, rgba(200, 211, 240, 0.4) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
  min-width: 60px;
}

[data-theme="dark"] .is-loading .chart-card__title,
[data-theme="dark"] .is-loading .chart-card__subtitle,
[data-theme="dark"] .is-loading .chart-card__chip {
  background: linear-gradient(90deg, rgba(200, 211, 240, 0.4) 25%, rgba(228, 235, 250, 0.6) 50%, rgba(200, 211, 240, 0.4) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
  min-width: 80px;
}

[data-theme="dark"] .is-loading .form-input,
[data-theme="dark"] .is-loading .form-select {
  background: linear-gradient(90deg, rgba(200, 211, 240, 0.3) 25%, rgba(228, 235, 250, 0.5) 50%, rgba(200, 211, 240, 0.3) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
}

[data-theme="dark"] .is-loading .search-field input {
  background: linear-gradient(90deg, rgba(200, 211, 240, 0.3) 25%, rgba(228, 235, 250, 0.5) 50%, rgba(200, 211, 240, 0.3) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
  min-width: 100px;
}

[data-theme="dark"] .is-loading .date-pill {
  background: linear-gradient(90deg, rgba(200, 211, 240, 0.3) 25%, rgba(228, 235, 250, 0.5) 50%, rgba(200, 211, 240, 0.3) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
}

/* Layout helpers */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start
}

.two-col-70 {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 14px;
  align-items: start
}

/* Analytics module minimal styles (existing) */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px
}

.kpi-card {
  background: var(--surface);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--r-2xl);
  padding: 20px 22px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
  transition: transform var(--tb), box-shadow var(--tb);
  animation: fadeInUp .4s cubic-bezier(0.4, 0, 0.2, 1) both
}

.kpi-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift)
}

.kpi-card__accent-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--r-2xl) var(--r-2xl) 0 0
}

.kpi-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between
}

.kpi-card__icon {
  width: 42px;
  height: 42px;
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center
}

.kpi-card__icon svg {
  width: 18px;
  height: 18px
}

.kpi-card__pill {
  font-family: var(--font-data);
  font-weight: 700;
  font-size: 12px;
  padding: 3px 9px;
  border-radius: var(--r-pill)
}

.kpi-card__value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 30px;
  letter-spacing: -1.4px;
  color: var(--text-primary)
}

.kpi-card__label {
  font-family: var(--font-data);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted)
}

.kpi-card__sub {
  font-size: 13px;
  color: var(--text-muted)
}

.an-grid-wide {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
  align-items: stretch
}

.an-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: stretch
}

.an-grid-main {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px
}

@media (min-width:1024px) {
  .an-grid-main {
    grid-template-columns: repeat(3, minmax(0, 1fr))
  }
}

.an-grid-wide-col {
  grid-column: 1/-1
}

@media (min-width:1024px) {
  .an-grid-wide-col {
    grid-column: span 2
  }
}

.an-card {
  background: var(--surface);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--tb)
}

.an-card:hover {
  box-shadow: var(--shadow-blue)
}

.an-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 16px;
  border-bottom: 1.5px solid var(--bg-alt)
}

.an-card__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  color: var(--text-primary)
}

.an-card__sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px
}

.an-card__body {
  padding: 20px 22px;
  flex: 1;
  display: flex;
  flex-direction: column
}

.an-card__body--nop {
  flex: 1;
  display: flex;
  flex-direction: column
}

.chart-wrap {
  position: relative;
  width: 100%;
  min-height: 0
}

.tab-group {
  display: flex;
  gap: 2px;
  background: var(--bg-alt);
  border-radius: var(--r-sm);
  padding: 3px
}

.tab-btn {
  padding: 4px 13px;
  border-radius: var(--r-xs);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: transparent;
  transition: all var(--tf)
}

.tab-btn.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-xs)
}

.tab-btn:hover:not(.active) {
  color: var(--text-secondary)
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 0 22px 14px
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-secondary)
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0
}

.legend-dash {
  width: 18px;
  height: 3px;
  border-radius: var(--r-pill);
  flex-shrink: 0
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px)
  }

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

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(22px)
  }

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

@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0)
  }

  to {
    opacity: 0;
    transform: translateX(22px)
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: .45
  }
}

.pulse {
  animation: pulse 2s infinite
}

:focus-visible {
  outline: 2.5px solid var(--primary-light);
  outline-offset: 2px;
  border-radius: var(--r-xs)
}

/* ── SKELETON LOADING ── */
.skeleton-loader {
  display: inline-block;
  height: 1em;
  min-width: 60px;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(200, 211, 240, 0.5) 25%, rgba(228, 235, 250, 0.9) 50%, rgba(200, 211, 240, 0.5) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 200% 0
  }

  100% {
    background-position: -200% 0
  }
}

/* Table row skeletons */
.sk-row {
  transition: background var(--tf),
}

.sk-cell {
  display: inline-block;
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(200, 211, 240, 0.4) 25%, rgba(228, 235, 250, 0.7) 50%, rgba(200, 211, 240, 0.4) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
}

/* Card and KPI skeleton states */
.is-loading .stat-card__value,
.is-loading .stat-card__label,
.is-loading .stat-card__sub,
.is-loading .kpi-card__value,
.is-loading .kpi-card__label,
.is-loading .kpi-card__sub,
.is-loading .stat-card__icon-wrap {
  background: linear-gradient(90deg, rgba(200, 211, 240, 0.3) 25%, rgba(228, 235, 250, 0.5) 50%, rgba(200, 211, 240, 0.3) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
  min-width: 60px;
}

/* KPI strip skeleton when loading */
#staff-kpi-strip.is-loading .stat-card__value {
  background: linear-gradient(90deg, rgba(200, 211, 240, 0.3) 25%, rgba(228, 235, 250, 0.5) 50%, rgba(200, 211, 240, 0.3) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
}

/* Chart card skeletons */
.is-loading .chart-card__title,
.is-loading .chart-card__subtitle,
.is-loading .chart-card__chip {
  background: linear-gradient(90deg, rgba(200, 211, 240, 0.3) 25%, rgba(228, 235, 250, 0.5) 50%, rgba(200, 211, 240, 0.3) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
  min-width: 80px;
}

/* Table cell skeletons */
.is-loading td {
  background: linear-gradient(90deg, rgba(200, 211, 240, 0.2) 25%, rgba(228, 235, 250, 0.4) 50%, rgba(200, 211, 240, 0.2) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
  min-width: 40px;
}

/* Content card body skeletons */
.is-loading .content-card__body {
  background: linear-gradient(90deg, rgba(200, 211, 240, 0.15) 25%, rgba(228, 235, 250, 0.3) 50%, rgba(200, 211, 240, 0.15) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
}

/* Input skeleton states */
.is-loading .form-input,
.is-loading .form-select {
  background: linear-gradient(90deg, rgba(200, 211, 240, 0.2) 25%, rgba(228, 235, 250, 0.4) 50%, rgba(200, 211, 240, 0.2) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
}

/* Tab skeletons */
.is-loading .tab-btn {
  background: linear-gradient(90deg, rgba(200, 211, 240, 0.2) 25%, rgba(228, 235, 250, 0.4) 50%, rgba(200, 211, 240, 0.2) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
  min-width: 60px;
}

/* Filter skeleton */
.is-loading .filter-select,
.is-loading .filter-chip,
.is-loading .filter-bar {
  background: linear-gradient(90deg, rgba(200, 211, 240, 0.2) 25%, rgba(228, 235, 250, 0.4) 50%, rgba(200, 211, 240, 0.2) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
}

/* Button skeletons */
.is-loading .btn {
  background: linear-gradient(90deg, rgba(200, 211, 240, 0.25) 25%, rgba(228, 235, 250, 0.45) 50%, rgba(200, 211, 240, 0.25) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
}

/* KPI grid skeleton */
.kpi-card.is-loading .kpi-card__icon {
  background: linear-gradient(90deg, rgba(200, 211, 240, 0.3) 25%, rgba(228, 235, 250, 0.5) 50%, rgba(200, 211, 240, 0.3) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
  min-width: 42px;
  height: 42px;
}

/* Donut chart skeleton */
.is-loading .donut-wrap {
  background: linear-gradient(90deg, rgba(200, 211, 240, 0.3) 25%, rgba(228, 235, 250, 0.5) 50%, rgba(200, 211, 240, 0.3) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
  min-width: 150px;
  height: 150px;
}

/* Search field skeleton */
.is-loading .search-field input {
  background: linear-gradient(90deg, rgba(200, 211, 240, 0.2) 25%, rgba(228, 235, 250, 0.4) 50%, rgba(200, 211, 240, 0.2) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
  min-width: 100px;
}

/* Date pill skeleton */
.is-loading .date-pill {
  background: linear-gradient(90deg, rgba(200, 211, 240, 0.2) 25%, rgba(228, 235, 250, 0.4) 50%, rgba(200, 211, 240, 0.2) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
}

/* Stat card tooltip skeleton */
.is-loading .bar-col__tooltip {
  background: linear-gradient(90deg, rgba(200, 211, 240, 0.85) 25%, rgba(228, 235, 250, 0.9) 50%, rgba(200, 211, 240, 0.85) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
}

/* Admin operations table skeleton */
[data-theme="dark"] .is-loading td {
  background: linear-gradient(90deg, rgba(200, 211, 240, 0.3) 25%, rgba(228, 235, 250, 0.5) 50%, rgba(200, 211, 240, 0.3) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
}

[data-theme="dark"] .is-loading .stat-card__value,
[data-theme="dark"] .is-loading .kpi-card__value {
  background: linear-gradient(90deg, rgba(200, 211, 240, 0.4) 25%, rgba(228, 235, 250, 0.6) 50%, rgba(200, 211, 240, 0.4) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
}

/* ───────────────────────────────────────────────────────────
   MODERN POLISH — global refinements
─────────────────────────────────────────────────────────── */

/* Sidebar: subtle gradient & glass effect */
.sidebar {
  background: linear-gradient(180deg, #FFFFFF 0%, #F6F9FF 100%);
  border-right: 1px solid rgba(26, 79, 186, 0.09);
  box-shadow: 4px 0 32px rgba(13, 27, 62, 0.07);
}

/* Page header title: sharper display weight */
.page-header__title {
  font-size: 26px;
  letter-spacing: -.6px
}

/* Stat cards: subtle glass shimmer on hover */
.stat-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0) 40%, rgba(255, 255, 255, 0.45) 100%);
  pointer-events: none;
  border-radius: inherit;
  opacity: 0;
  transition: opacity var(--tf);
}

.stat-card:hover::after {
  opacity: 1
}

/* Admin KPI strip responsive */
@media(max-width:1200px) {
  .admin-kpi-strip {
    grid-template-columns: repeat(3, 1fr)
  }

  .doc-grid {
    grid-template-columns: repeat(2, 1fr)
  }
}

@media(max-width:780px) {
  .admin-kpi-strip {
    grid-template-columns: repeat(2, 1fr)
  }
}

@media(max-width:480px) {
  .admin-kpi-strip {
    grid-template-columns: 1fr
  }
}

/* Chart cards: elevated look */
.chart-card,
.donut-card {
  background: linear-gradient(145deg, #FFFFFF 0%, #F8FBFF 100%);
  border: 1.5px solid rgba(26, 79, 186, 0.08);
  box-shadow: 0 2px 12px rgba(13, 27, 62, 0.04), 0 8px 32px rgba(26, 79, 186, 0.06);
}

/* Table: even row subtle tint */
.data-table tbody tr:nth-child(even) {
  background: rgba(238, 241, 250, 0.38)
}

/* Buttons: stronger shadow on primary */
.btn--primary {
  box-shadow: 0 2px 12px rgba(26, 79, 186, .32), 0 1px 3px rgba(26, 79, 186, .2);
  letter-spacing: .1px;
}

.btn--primary:hover {
  box-shadow: 0 6px 22px rgba(26, 79, 186, .42)
}

/* Badge polish */
.badge {
  font-size: 10.5px;
  letter-spacing: .3px
}

/* Nav links: sharper active indicator */
.nav-link.active {
  background: linear-gradient(90deg, var(--primary-muted) 0%, rgba(224, 233, 255, 0.5) 100%)
}


/* Log card: subtle header gradient */
.log-card__header {
  background: linear-gradient(90deg, #F6F9FF, #FFFFFF)
}

/* AI panel: more vivid gradient */
.ai-panel {
  background: linear-gradient(135deg, #EEF4FF 0%, #FFFFFF 50%, #FDF0F9 100%)
}

/* ADDED STYLES (new features only, does not affect existing) */

/* AI Insights panel */
.ai-panel {
  background: linear-gradient(135deg, #F0F5FF 0%, #FFFFFF 55%, #FCEEF5 140%);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.ai-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1.5px solid var(--bg-alt)
}

.ai-panel__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  color: var(--text-primary)
}

.ai-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-family: var(--font-data);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .7px;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.ai-panel__body {
  padding: 18px 22px
}

.ai-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px
}

.ai-box {
  background: var(--surface);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xs);
  padding: 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-box__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px
}

.ai-box__label {
  font-family: var(--font-data);
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700
}

.ai-sev {
  font-family: var(--font-data);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .8px;
  text-transform: uppercase;
  border-radius: var(--r-pill);
  padding: 3px 8px
}

.ai-sev.red {
  color: var(--danger-dark);
  background: var(--danger-bg)
}

.ai-sev.amber {
  color: var(--warning-dark);
  background: var(--warning-bg)
}

.ai-sev.blue {
  color: var(--primary);
  background: var(--primary-muted)
}

.ai-list {
  display: flex;
  flex-direction: column;
  gap: 10px
}

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

.ai-item__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--primary);
  margin-top: 4px;
  flex-shrink: 0
}

.ai-item__dot.red {
  background: var(--danger)
}

.ai-item__dot.amber {
  background: var(--warning)
}

.ai-item__dot.green {
  background: var(--success)
}

.ai-item__text {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.45
}

.ai-item__sub {
  font-family: var(--font-data);
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 2px
}

.ai-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px
}

/* Workflow steps */
.workflow {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: var(--bg);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--r-xl);
}

.step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.step .bubble {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-data);
  font-weight: 900;
  font-size: 11px;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  background: var(--surface)
}

.step.completed {
  border-color: rgba(11, 158, 108, .25);
  background: var(--success-bg);
  color: var(--success-dark)
}

.step.completed .bubble {
  background: var(--success);
  color: #fff;
  border-color: var(--success)
}

.step.active {
  border-color: rgba(26, 79, 186, .25);
  background: var(--primary-muted);
  color: var(--primary)
}

.step.active .bubble {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary)
}

.step.rejected {
  border-color: rgba(217, 35, 58, .25);
  background: var(--danger-bg);
  color: var(--danger-dark)
}

.step.rejected .bubble {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger)
}

/* =====================================================
   ANALYTICS INSIGHTS
   ===================================================== */

.analytics-insight {
  margin: 0 18px 18px;
  padding: 12px 14px;

  display: flex;
  align-items: flex-start;
  gap: 10px;

  border-radius: 10px;

  background: #F1F5F9;
  border: 1px solid var(--border);

  min-height: 62px;
}

.analytics-insight__icon {
  width: 28px;
  height: 28px;

  flex-shrink: 0;

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

  border-radius: 8px;

  background: var(--primary-soft);
  color: var(--primary);

  font-size: 13px;
}

.analytics-insight__content {
  min-width: 0;
}

.analytics-insight__label {
  margin-bottom: 3px;

  font-size: 10px;
  font-weight: 700;

  text-transform: uppercase;
  letter-spacing: .7px;

  color: var(--primary);
}

.analytics-insight__text {
  font-size: 12px;
  line-height: 1.5;

  color: var(--text-muted);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(13, 27, 62, 0.48);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 18px;
}

.modal-backdrop.show {
  display: flex
}

.modal {
  width: min(940px, 100%);
  max-height: calc(100dvh - 36px);
  min-height: min(560px, calc(100dvh - 60px));
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-2xl);
  box-shadow: 0 30px 80px rgba(13, 27, 62, 0.28);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1.5px solid var(--bg-alt)
}

.modal__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  color: var(--text-primary)
}

.modal__sub {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 3px
}

.modal__body {
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1 1 0;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(58, 75, 114, .42) transparent;
}

.modal__body::-webkit-scrollbar {
  width: 10px
}

.modal__body::-webkit-scrollbar-thumb {
  background: rgba(58, 75, 114, .42);
  border-radius: var(--r-pill)
}

.modal__body::-webkit-scrollbar-track {
  background: transparent
}

/* Guarantee the Application Detail modal body scrolls and is never clipped.
   Mirrors the proven #digital-issuance-modal pattern (own max-height, block flow)
   so the flex `.modal` overflow:hidden can never cut off the content. */
#app-modal .modal__body {
  overflow-y: auto;
  max-height: calc(100dvh - 180px);
  flex: none;
  min-height: auto;
  display: block;
  gap: 0;
  padding: 18px 22px;
}

#app-modal .modal__body>* {
  margin-bottom: 14px
}

#app-modal .modal__body>*:last-child {
  margin-bottom: 0
}

#app-modal .modal__body>.content-card {
  display: block
}

.modal-applicant-head {
  margin-bottom: 2px
}

.modal-app-head-avatar {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: var(--r-xl);
  background: var(--bg-alt);
  border: 1.5px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#detail-status.badge-approved {
  color: var(--success-dark);
  background: var(--success-bg)
}

#detail-status.badge-pending {
  color: var(--warning-dark);
  background: var(--warning-bg)
}

#detail-status.badge-review {
  color: #3050AA;
  background: #DDE8FF
}

#detail-status.badge-processing {
  color: #086585;
  background: #CFF0FA;
}

#detail-status.badge-issued {
  color: var(--purple-dark);
  background: var(--purple-bg)
}

#detail-status.badge-rejected {
  color: var(--danger-dark, #B33);
  background: var(--danger-bg, #FDE)
}

.modal__footer {
  padding: 16px 22px;
  border-top: 1.5px solid var(--bg-alt);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap
}

.modal__close {
  width: 36px;
  height: 36px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: var(--bg);
  transition: all var(--tf);
}

.modal__close:hover {
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-xs)
}

.modal__close svg {
  width: 14px;
  height: 14px
}

/* User profile modal (shared by all portals) */
.modal.profile-modal {
  width: min(560px, 100%);
  min-height: auto;
  max-height: calc(100dvh - 36px)
}

/* The shared modal body uses a zero flex-basis, which collapses inside an
   auto-height modal. Let the profile body size to its content and only
   shrink when it exceeds the viewport. */
.modal.profile-modal .modal__body {
  flex: 0 1 auto;
  min-height: 0;
  max-height: calc(100dvh - 140px)
}

.profile-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--r-xl);
  background: var(--bg)
}

.profile-hero__avatar {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: var(--r-pill);
  border: 2px solid var(--primary-muted);
  background: linear-gradient(135deg, #E0E9FF, #C7D6FF);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-data);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: .4px;
  color: var(--primary);
  text-transform: uppercase;
  line-height: 1
}

.profile-hero__meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px
}

.profile-hero__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.profile-hero__role {
  font-size: 12.5px;
  color: var(--text-muted)
}

.profile-tabs {
  display: flex;
  gap: 5px;
  padding: 4px;
  border-radius: var(--r-md);
  background: var(--bg-alt)
}

.profile-tab {
  flex: 1;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12.5px;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all var(--tf)
}

.profile-tab:hover {
  color: var(--text-primary)
}

.profile-tab.active {
  background: var(--surface);
  color: var(--primary);
  font-weight: 700;
  box-shadow: var(--shadow-xs)
}

.profile-panel {
  display: none;
  flex-direction: column;
  gap: 14px
}

.profile-panel.active {
  display: flex
}

.profile-hint {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-muted)
}

.profile-email-notice {
  padding: 10px 12px;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--r-md);
  background: var(--bg);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-secondary)
}

.profile-email-notice strong {
  color: var(--text-primary);
  word-break: break-all
}

#profile-password-status:empty {
  display: none
}

.form-input[readonly] {
  background: var(--bg-alt);
  color: var(--text-muted);
  cursor: not-allowed
}

:root[data-theme="dark"] .profile-hero__avatar {
  background: linear-gradient(135deg, #1E3A8A, #1D4ED8);
  color: #DBEAFE
}

.modal .data-table th,
.modal .data-table td {
  padding: 9px 10px
}

/* Document verification cards */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px
}

.doc-card {
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.doc-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 10px;
  border-bottom: 1.5px solid var(--bg-alt);
  background: var(--bg)
}

.doc-card__name {
  font-family: var(--font-data);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted)
}

.doc-card__status {
  font-family: var(--font-data);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .8px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--r-pill)
}

.doc-card__status.ok {
  color: var(--success-dark);
  background: var(--success-bg)
}

.doc-card__status.warn {
  color: var(--warning-dark);
  background: var(--warning-bg)
}

.doc-card__status.bad {
  color: var(--danger-dark);
  background: var(--danger-bg)
}

.doc-card__status.pending {
  color: var(--text-muted);
  background: var(--bg)
}

.doc-card__body {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px
}

.doc-preview {
  height: 140px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--primary-muted), var(--bg));
  border: 1.5px dashed rgba(26, 79, 186, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  color: var(--text-muted);
  font-family: var(--font-data);
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
  transition: all .2s;
  overflow: hidden;
  position: relative;
}

.doc-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--r-md)
}

.doc-preview:hover {
  border-color: var(--primary);
  background: rgba(26, 79, 186, 0.06)
}

.doc-preview__icon {
  width: 28px;
  height: 28px;
  opacity: .4
}

.doc-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap
}

/* Document Viewer Lightbox */
.doc-viewer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.doc-viewer-backdrop.show {
  display: flex
}

.doc-viewer {
  background: var(--surface);
  border-radius: var(--r-2xl);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
  width: min(600px, 88vw);
  max-height: 95vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: viewerSlideIn .25s ease-out;
}

@keyframes viewerSlideIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(12px)
  }

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

.doc-viewer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--bg-alt);
  gap: 12px;
}

.doc-viewer__title {
  font-family: var(--font-data);
  font-weight: 800;
  font-size: 14px;
  color: var(--text-primary);
  letter-spacing: .3px;
}

.doc-viewer__counter {
  font-family: var(--font-data);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 44px;
  text-align: center;
}

.doc-viewer__nav {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--border-subtle);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all .15s;
}

.doc-viewer__nav:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-muted)
}

.doc-viewer__nav:disabled {
  opacity: .35;
  cursor: not-allowed
}

.doc-viewer__body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  max-height: 72vh;
  overflow: auto;
  padding: 16px;
  background: linear-gradient(135deg, var(--bg-alt), var(--surface));
}

.doc-viewer__img {
  width: 100%;
  height: 100%;
  max-height: 68vh;
  border-radius: var(--r-md);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  object-fit: contain;
  display: none;
}

.doc-viewer__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted);
  font-family: var(--font-data);
  font-size: 13px;
  font-weight: 600;
}

.doc-viewer__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border-top: 1px solid var(--bg-alt);
  gap: 12px;
}

.doc-viewer__docname {
  font-family: var(--font-data);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: .3px;
}

.doc-viewer__applicant {
  font-size: 12.5px;
  color: var(--text-muted);
}

/* Doc viewer responsive */
@media(max-width:640px) {
  .doc-viewer {
    width: 100%;
    max-height: 100vh;
    border-radius: 0
  }

  .doc-viewer__body {
    min-height: 250px;
    padding: 12px
  }

  .doc-viewer__img {
    max-height: 50vh
  }

  .doc-viewer__header,
  .doc-viewer__footer {
    padding: 12px 14px
  }
}

/* Export/scheduling controls */
.report-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 12px;
  background: var(--bg);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--r-xl);
}

.report-controls .mini-btn {
  height: 34px;
  padding: 0 12px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12.5px;
  color: var(--text-secondary);
  transition: all var(--tf);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.report-controls .mini-btn:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-xs);
  transform: translateY(-1px)
}

.report-controls .mini-btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff
}

.report-controls .mini-btn.primary:hover {
  background: var(--primary-hover)
}

.report-controls .mini-btn svg {
  width: 14px;
  height: 14px
}

.report-controls .range {
  min-width: 180px
}

/* Notifications log */
.log-card {
  background: var(--surface);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.log-card__header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap
}

.log-card__title {
  font-family: var(--font-data);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-primary)
}

.log-card__sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px
}

.log-card__body {
  padding: 0
}

.small-pill {
  font-family: var(--font-data);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .6px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--r-sm);
  background: var(--primary-muted);
  color: var(--primary);
  border: 1px solid var(--primary-border);
}

.small-pill--success {
  background: rgba(16, 185, 129, .1);
  color: #059669;
  border-color: rgba(16, 185, 129, .2)
}

.small-pill--warning {
  background: rgba(245, 158, 11, .1);
  color: #D97706;
  border-color: rgba(245, 158, 11, .22)
}

.small-pill--danger {
  background: rgba(244, 63, 94, .1);
  color: #E11D48;
  border-color: rgba(244, 63, 94, .22)
}

/* Audit action pills */
.action-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: var(--r-sm);
  font-family: var(--font-data);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .3px;
  white-space: nowrap;
  border: 1px solid transparent
}

.action-pill::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: var(--r-pill);
  background: currentColor;
  flex-shrink: 0
}

.action-pill--blue {
  background: rgba(37, 99, 235, .08);
  color: #2563EB;
  border-color: rgba(37, 99, 235, .15)
}

.action-pill--orange {
  background: rgba(217, 119, 6, .08);
  color: #D97706;
  border-color: rgba(217, 119, 6, .15)
}

.action-pill--green {
  background: rgba(5, 150, 105, .08);
  color: #059669;
  border-color: rgba(5, 150, 105, .15)
}

.action-pill--purple {
  background: rgba(107, 91, 209, .08);
  color: #6B5BD1;
  border-color: rgba(107, 91, 209, .15)
}

.action-pill--teal {
  background: rgba(13, 140, 140, .08);
  color: #0D8C8C;
  border-color: rgba(13, 140, 140, .15)
}

/* Admin operations */

.activity-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--bg-alt);
  transition: background var(--tf)
}

.activity-row:hover {
  background: var(--bg-alt)
}

.activity-row:last-child {
  border-bottom: none
}

.activity-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--primary);
  margin-top: 4px;
  flex-shrink: 0
}

.activity-dot.green {
  background: #10B981
}

.activity-dot.amber {
  background: #F59E0B
}

.activity-dot.red {
  background: #E11D48
}

.activity-main {
  flex: 1;
  min-width: 0
}

.activity-title {
  font-weight: 600;
  font-size: 11px;
  color: var(--text-primary);
  line-height: 1.3
}

.activity-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
  line-height: 1.35
}

.activity-time {
  font-family: var(--font-data);
  font-size: 9.5px;
  font-weight: 600;
  color: var(--text-placeholder);
  white-space: nowrap;
  margin-left: auto;
  flex-shrink: 0
}

.confirm-modal {
  width: min(430px, 100%)
}

.modal.confirm-modal {
  min-height: auto;
  height: auto
}

.modal.confirm-modal .confirm-hero {
  padding: 18px 20px
}

.modal.confirm-modal .confirm-body {
  padding: 18px 20px
}

.modal.confirm-modal .confirm-actions {
  padding: 16px 20px
}

.confirm-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1.5px solid var(--bg-alt);
}

.confirm-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--r-lg);
  background: var(--primary-muted);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.confirm-icon i {
  font-size: 20px;
  line-height: 1
}

.confirm-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  color: var(--text-primary)
}

.confirm-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 3px
}

.confirm-body {
  padding: 18px 20px
}

.confirm-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--r-lg);
  background: var(--bg)
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  padding: 16px 20px;
  border-top: 1.5px solid var(--bg-alt)
}

/* AI “flag” badge for table row */
.flag-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-family: var(--font-data);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: .8px;
  text-transform: uppercase;
  background: var(--danger-bg);
  color: var(--danger-dark);
}

.flag-badge svg {
  width: 12px;
  height: 12px
}

/* Minor: keep modal tables readable */
.modal .data-table th,
.modal .data-table td {
  padding: 11px 14px
}

/* Responsive for new grids */
@media (max-width: 980px) {
  .ai-grid {
    grid-template-columns: 1fr
  }

  .admin-ops-grid {
    grid-template-columns: 1fr 1fr
  }

  .doc-grid {
    grid-template-columns: 1fr
  }

  .kpi-grid {
    grid-template-columns: 1fr 1fr
  }

  .cards-grid {
    grid-template-columns: 1fr 1fr
  }

  .cards-grid-3 {
    grid-template-columns: 1fr
  }

  .dash-charts-row {
    flex-direction: column
  }

  .dash-charts-row .chart-card,
  .dash-charts-row .donut-card {
    flex: 1 1 100%;
    min-width: 0
  }

  .an-grid-wide {
    grid-template-columns: 1fr
  }

  .an-grid-2 {
    grid-template-columns: 1fr
  }

  .two-col,
  .two-col-70 {
    grid-template-columns: 1fr
  }
}

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

  .cards-grid {
    grid-template-columns: 1fr
  }

  .admin-ops-grid {
    grid-template-columns: 1fr
  }
}

/* AUTH PAGES — MODERN REDESIGN */
.screen {
  min-height: 100vh;
  display: none
}

.screen.active {
  display: flex
}

/* Sliding split-panel login */
.auth-shell {
  width: 100%;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 54% 46%;
  background: #fff;
  overflow: hidden;
  position: relative;
  isolation: isolate;
}

.auth-shell::before {
  content: '';
  position: absolute;
  inset: 28px;
  border: 1px solid rgba(221, 227, 240, .8);
  border-radius: 34px;
  pointer-events: none;
  z-index: 0;
}

.auth-hero {
  grid-column: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  background: linear-gradient(150deg, #143E9C 0%, #1A4FBA 44%, #4C55D9 100%);
  position: relative;
  overflow: hidden;
  z-index: 2;
  clip-path: ellipse(98% 118% at 0% 50%);
  transform: translateX(0);
  transition: transform 720ms cubic-bezier(.22, 1, .36, 1), clip-path 720ms cubic-bezier(.22, 1, .36, 1);
}

.auth-hero::before {
  display: none;
}

.auth-hero::after {
  display: none;
}

.auth-hero-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  padding: 40px clamp(36px, 5vw, 78px) 0
}

.auth-hero-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0
}

.auth-hero-logo-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: transparent;
  backdrop-filter: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.auth-hero-logo-icon i {
  font-size: 20px;
  color: #fff
}

.auth-hero-logo-icon img {
  width: 46px;
  height: 46px;
  object-fit: cover;
  display: block;
  border-radius: 50%
}

.auth-hero-logo-text {
  display: flex;
  flex-direction: column;
  gap: 1px
}

.auth-hero-logo-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  color: #fff;
  letter-spacing: -.3px
}

.auth-hero-logo-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.65);
  font-weight: 500
}

.auth-hero-mid {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center
}

.auth-hero-mid::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(180deg, rgba(20, 62, 156, 0.85) 0%, rgba(26, 79, 186, 0.45) 40%, rgba(76, 85, 217, 0) 100%);
  pointer-events: none;
}

.auth-hero-illustration {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  border-radius: 0;
  box-shadow: none;
}

.auth-hero-title {
  display: none;
}

.auth-hero-desc {
  display: none
}

.auth-hero-clock {
  display: none
}

.auth-hero-title span {
  color: rgba(255, 255, 255, 0.55)
}

.auth-hero-desc {
  display: block;
  font-size: clamp(12px, 1vw, 15px);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.5;
  max-width: 520px
}

.auth-hero-action {
  margin: 20px auto 0;
  height: 40px;
  padding: 0 22px;
  border: 2px solid rgba(255, 255, 255, .9);
  border-radius: var(--r-pill);
  color: #fff;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .3px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  transition: background var(--tf), color var(--tf), transform var(--tf);
}

.auth-hero-action:hover {
  background: #fff;
  color: var(--primary);
  transform: translateY(-1px)
}

.auth-hero-action i {
  font-size: 14px
}

.auth-hero-stats {
  display: flex;
  gap: 28px;
  position: relative;
  z-index: 1
}

.auth-stat {
  display: flex;
  flex-direction: column;
  gap: 2px
}

.auth-stat-val {
  font-family: var(--font-data);
  font-weight: 800;
  font-size: 24px;
  color: #fff
}

.auth-stat-lbl {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.58);
  font-weight: 500
}

.auth-form-panel {
  grid-column: 2;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 42px clamp(34px, 5vw, 78px);
  background: #fff;
  position: relative;
  z-index: 1;
  transition: transform 720ms cubic-bezier(.22, 1, .36, 1);
}

.auth-shell.staff-mode .auth-form-panel {
  transform: translateX(-117.4%)
}

.auth-form-panel::before {
  display: none
}

.auth-form-brand {
  position: absolute;
  top: 34px;
  left: clamp(28px, 4vw, 56px);
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
}

.auth-form-brand img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.auth-form-brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px
}

.auth-form-brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15.5px;
  color: var(--text-primary);
  letter-spacing: -.2px;
}

.auth-form-brand-sub {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600
}

.auth-card {
  width: min(100%, 480px);
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  z-index: 1;
  text-align: center;
}

.auth-card-header {
  margin-bottom: 18px;
  padding-top: 8px
}

.auth-card-eyebrow {
  width: 44px;
  height: 44px;
  margin: 0 auto 14px;
  padding: 0;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  box-shadow: none;
}

.auth-card-eyebrow i {
  display: flex;
  font-size: 44px;
  color: var(--primary);
  line-height: 1
}

.auth-card-eyebrow span {
  display: none
}

.auth-card-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(23px, 1.9vw, 29px);
  color: #172334;
  letter-spacing: -.4px;
  line-height: 1.08;
  margin-bottom: 14px
}

.auth-card-sub {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45
}

.login-role-grid {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 auto 24px;
  padding: 5px;
  border: 1.5px solid #E1E7F1;
  border-radius: var(--r-pill);
  background: #F2F5FA;
  box-shadow: inset 0 1px 4px rgba(13, 27, 62, 0.04);
  width: min(100%, 390px);
}

.login-role-card {
  min-height: 48px;
  padding: 7px 12px;
  border: none;
  border-radius: var(--r-pill);
  background: transparent;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: left;
  transition: background var(--tf), box-shadow var(--tf), color var(--tf), transform var(--tf);
  position: relative;
  overflow: hidden;
  color: var(--text-muted);
}

.login-role-card:hover {
  background: rgba(26, 79, 186, 0.06);
  color: var(--text-secondary)
}

.login-role-card.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 8px 24px rgba(13, 27, 62, 0.1)
}

.login-role-head {
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  gap: 8px;
  position: relative;
  z-index: 1
}

.login-role-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--r-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
  background: transparent;
  flex-shrink: 0;
  box-shadow: none;
}

.login-role-card.active .login-role-icon {
  background: rgba(255, 255, 255, 0.18);
  color: #fff
}

.login-role-icon i {
  font-size: 15px;
  line-height: 1
}

.login-role-chip {
  display: none;
}

.login-role-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  z-index: 1;
  padding-right: 0
}

.login-role-title {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 11.5px;
  color: currentColor;
  letter-spacing: 0
}

.login-role-sub {
  display: none
}

/* Input groups */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: min(100%, 390px)
}

.auth-field-label {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  text-align: left;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 10.5px;
  color: var(--text-muted);
  padding-left: 16px;
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 50px
}

.auth-input-wrap i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  color: var(--primary);
  pointer-events: none;
  transition: color var(--tf);
}

.auth-input {
  width: 100%;
  height: 50px;
  padding: 0 16px 0 52px;
  border-radius: var(--r-pill);
  border: 1.5px solid #DCE3EE;
  background: #fff;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  transition: all var(--tf);
  outline: none;
}

.auth-input::placeholder {
  color: #91A0B8;
  font-weight: 700
}

.auth-input.has-right-icon {
  padding-right: 50px
}

.auth-input:focus {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow)
}

.auth-input:focus+i,
.auth-input-wrap:focus-within i {
  color: var(--primary)
}

/* icon before input trick — use sibling after */
.auth-input-wrap .auth-input:focus~i {
  color: var(--primary)
}

.auth-input-icon-right {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  border-radius: 8px;
  color: var(--text-muted);
  transition: color var(--tf), background var(--tf);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-input-icon-right:hover {
  color: var(--primary);
  background: var(--primary-glass)
}

.auth-input-icon-right i {
  position: static;
  top: auto;
  transform: none;
  font-size: 15px;
  pointer-events: none
}

.auth-check-label {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary)
}

.auth-check-label input[type=checkbox] {
  accent-color: var(--primary);
  width: 15px;
  height: 15px
}

.auth-submit {
  width: min(100%, 390px);
  height: 50px;
  border-radius: var(--r-pill);
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -.2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  box-shadow: 0 4px 18px rgba(26, 79, 186, .32);
  transition: all var(--tf);
  margin-top: 4px;
  text-transform: uppercase;
}

.auth-submit:hover {
  box-shadow: 0 8px 28px rgba(26, 79, 186, .42);
  transform: translateY(-1px)
}

.auth-submit:active {
  transform: translateY(0)
}

.auth-submit i {
  font-size: 16px
}

/*  Sign-in button: spinner state  */
.auth-submit-content {
  display: flex;
  align-items: center;
  gap: 9px;
  transition: opacity .2s
}

.auth-submit-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-spin .7s linear infinite;
}

@keyframes auth-spin {
  to {
    transform: rotate(360deg)
  }
}

.auth-submit.loading .auth-submit-content {
  opacity: 0;
  position: absolute
}

.auth-submit.loading .auth-submit-spinner {
  display: block
}

.auth-submit.loading {
  position: relative;
  justify-content: center;
  pointer-events: none
}

/*  Decorative hero blobs  */
.auth-hero-blob {
  display: none;
  position: absolute;
  pointer-events: none;
  border-radius: 50%
}

.auth-hero-blob--1 {
  width: 420px;
  height: 420px;
  bottom: -120px;
  right: -80px;
  animation: blob-drift 12s ease-in-out infinite alternate
}

.auth-hero-blob--2 {
  width: 260px;
  height: 260px;
  top: 30px;
  right: -40px;
  animation: blob-drift 9s ease-in-out infinite alternate-reverse
}

.auth-hero-blob--3 {
  width: 180px;
  height: 180px;
  top: 55%;
  left: -50px;
  animation: blob-drift 15s ease-in-out infinite alternate
}

@keyframes blob-drift {
  0% {
    transform: translate(0, 0) scale(1)
  }

  100% {
    transform: translate(12px, -18px) scale(1.06)
  }
}

/*  Hero entrance animation  */
.auth-card-header {
  animation: auth-fade-up .55s cubic-bezier(.22, 1, .36, 1) both
}

.auth-form {
  animation: auth-fade-up .65s .08s cubic-bezier(.22, 1, .36, 1) both
}

@keyframes auth-fade-up {
  from {
    opacity: 0;
    transform: translateY(18px)
  }

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

/*  Lock icon entrance animation  */
.auth-card-eyebrow i {
  animation: lock-pop .5s cubic-bezier(.34, 1.56, .64, 1) both
}

@keyframes lock-pop {
  from {
    opacity: 0;
    transform: scale(.6) rotate(-12deg)
  }

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

/*  Live clock on hero  */
.auth-hero-clock {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: var(--r-pill);
  padding: 7px 16px;
  font-family: var(--font-data);
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, .9);
  letter-spacing: .3px;
  backdrop-filter: blur(6px);
}

.auth-hero-clock::before {
  content: '🕐';
  font-size: 13px
}

/*  Caps Lock warning  */
.auth-caps-warn {
  display: none;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: #E87A18;
  padding: 4px 12px;
  background: #FFF5E6;
  border: 1px solid #FDDCAB;
  border-radius: var(--r-pill);
  margin-top: 2px;
  width: fit-content;
}

.auth-caps-warn.visible {
  display: flex
}

.auth-caps-warn i {
  font-size: 11px
}

/*  Inline field error  */
.auth-field-error {
  display: block;
  min-height: 0;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--danger);
  padding-left: 14px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height .2s, opacity .2s, margin .2s;
}

.auth-field-error.visible {
  max-height: 30px;
  opacity: 1;
  margin-top: 3px
}

.auth-input.field-invalid {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .12) !important
}

/*  Standard checkbox (Remember me)  */
.auth-checkbox-label {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  user-select: none
}

.auth-checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: #fff;
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--tf), background var(--tf);
  flex-shrink: 0;
  cursor: pointer;
}

.auth-checkbox::after {
  content: '';
  width: 5px;
  height: 10px;
  border: solid var(--primary);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transform-origin: center;
  transition: transform .15s ease-out;
  margin-bottom: 1px;
}

.auth-checkbox:checked {
  border-color: var(--primary);
  background: var(--primary-bg)
}

.auth-checkbox:checked::after {
  transform: rotate(45deg) scale(1)
}

.auth-checkbox:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-fade)
}

.auth-checkbox-text {
  font-size: 13px;
  color: var(--text-secondary)
}

/* Security notice under the Sign In button — muted, official, unobtrusive */
.auth-security-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 10px auto 0;
  width: min(100%, 390px);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.4;
}

.auth-security-notice i {
  font-size: 12px;
  color: var(--success);
  flex-shrink: 0
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border)
}

.auth-divider span {
  font-size: 11.5px;
  color: var(--text-placeholder);
  white-space: nowrap
}

.auth-note {
  background: linear-gradient(135deg, #f0f5ff, #f8f9ff);
  border: 1px solid var(--primary-border);
  border-radius: var(--r-md);
  padding: 13px 15px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-note-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-data);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--primary)
}

.auth-note-title i {
  font-size: 12px
}

.auth-note-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-secondary)
}

.auth-note-row code {
  background: rgba(26, 79, 186, 0.1);
  color: var(--primary);
  font-family: var(--font-data);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 5px;
  letter-spacing: .3px;
}

.auth-note-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-size: 10.5px;
  font-weight: 700
}

.auth-note-badge.admin {
  background: var(--primary-muted);
  color: var(--primary)
}

.auth-note-badge.staff {
  background: var(--success-bg);
  color: var(--success-dark)
}

/* Logout page */
.auth-top {
  display: flex;
  align-items: center;
  gap: 12px
}

.auth-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-blue);
  flex-shrink: 0;
}

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

.auth-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 24px;
  color: var(--text-primary);
  line-height: 1.12
}

.auth-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px
}

.auth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px
}

.auth-label {
  display: flex;
  flex-direction: column;
  gap: 6px
}

.auth-label span {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary)
}

.auth-hint {
  font-family: var(--font-data);
  font-size: 10.5px;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--text-placeholder)
}

#portal-shell {
  display: none
}

body.portal-mode #portal-shell {
  display: flex
}

body.portal-mode #toast-container {
  display: flex
}

/* Dark theme finishes after the legacy polish rules so they cannot restore
   light gradients over token-based portal surfaces. Printable previews keep
   their paper colors intentionally. */
:root[data-theme="dark"] .sidebar {
  background: linear-gradient(180deg, #111B2D 0%, #0B1220 100%);
  border-right-color: var(--border);
  box-shadow: 4px 0 32px rgba(0, 0, 0, .28);
}

:root[data-theme="dark"] .chart-card,
:root[data-theme="dark"] .donut-card,
:root[data-theme="dark"] .ai-panel,
:root[data-theme="dark"] .ai-box,
:root[data-theme="dark"] .log-card__header {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: var(--shadow-card);
}

:root[data-theme="dark"] .data-table tbody tr:nth-child(even) {
  background: rgba(148, 163, 184, .045)
}

:root[data-theme="dark"] .nav-link.active {
  background: linear-gradient(90deg, rgba(37, 99, 235, .25), rgba(37, 99, 235, .12))
}

:root[data-theme="dark"] .sidebar__avatar {
  background: linear-gradient(135deg, #1E3A8A, #1E293B)
}

:root[data-theme="dark"] .sidebar__avatar-initials {
  color: #BFDBFE
}

:root[data-theme="dark"] .badge-review {
  color: #BFDBFE;
  background: rgba(59, 130, 246, .16)
}

:root[data-theme="dark"] .badge-processing {
  color: #67E8F9;
  background: rgba(6, 182, 212, .14)
}

:root[data-theme="dark"] #detail-status.badge-review {
  color: #BFDBFE;
  background: rgba(59, 130, 246, .16)
}

:root[data-theme="dark"] #detail-status.badge-processing {
  color: #67E8F9;
  background: rgba(6, 182, 212, .14)
}

:root[data-theme="dark"] .badge-pending,
:root[data-theme="dark"] .badge-approved,
:root[data-theme="dark"] .badge-rejected,
:root[data-theme="dark"] .badge-issued,
:root[data-theme="dark"] .badge-active {
  border: 1px solid currentColor
}

:root[data-theme="dark"] .small-pill--success,
:root[data-theme="dark"] .action-pill--green {
  color: #6EE7B7;
  background: rgba(16, 185, 129, .14);
  border-color: rgba(16, 185, 129, .28)
}

:root[data-theme="dark"] .small-pill--warning,
:root[data-theme="dark"] .action-pill--orange {
  color: #FCD34D;
  background: rgba(245, 158, 11, .14);
  border-color: rgba(245, 158, 11, .28)
}

:root[data-theme="dark"] .small-pill--danger {
  color: #FDA4AF;
  background: rgba(244, 63, 94, .14);
  border-color: rgba(244, 63, 94, .28)
}

:root[data-theme="dark"] .action-pill--blue {
  color: #93C5FD;
  background: rgba(59, 130, 246, .14);
  border-color: rgba(59, 130, 246, .28)
}

:root[data-theme="dark"] .action-pill--purple {
  color: #C4B5FD;
  background: rgba(139, 92, 246, .14);
  border-color: rgba(139, 92, 246, .28)
}

:root[data-theme="dark"] .action-pill--teal {
  color: #5EEAD4;
  background: rgba(20, 184, 166, .14);
  border-color: rgba(20, 184, 166, .28)
}

:root[data-theme="dark"] .skeleton,
:root[data-theme="dark"] .skeleton-loader,
:root[data-theme="dark"] .sk-cell {
  background-color: transparent;
  background-image: linear-gradient(90deg, #263449 25%, #334155 50%, #263449 75%);
  background-size: 600px 100%;
}

:root[data-theme="dark"] .is-loading::after,
:root[data-theme="dark"] .is-loading .stat-card__value,
:root[data-theme="dark"] .is-loading .stat-card__label,
:root[data-theme="dark"] .is-loading .stat-card__sub,
:root[data-theme="dark"] .is-loading .kpi-card__value,
:root[data-theme="dark"] .is-loading .kpi-card__label,
:root[data-theme="dark"] .is-loading .kpi-card__sub,
:root[data-theme="dark"] .is-loading .stat-card__icon-wrap,
:root[data-theme="dark"] .is-loading .chart-card__title,
:root[data-theme="dark"] .is-loading .chart-card__subtitle,
:root[data-theme="dark"] .is-loading .chart-card__chip,
:root[data-theme="dark"] .is-loading .form-input,
:root[data-theme="dark"] .is-loading .form-select,
:root[data-theme="dark"] .is-loading .search-field input,
:root[data-theme="dark"] .is-loading .date-pill,
:root[data-theme="dark"] .is-loading .content-card__body,
:root[data-theme="dark"] .is-loading .tab-btn,
:root[data-theme="dark"] .is-loading .filter-select,
:root[data-theme="dark"] .is-loading .filter-chip,
:root[data-theme="dark"] .is-loading .filter-bar,
:root[data-theme="dark"] .is-loading .btn,
:root[data-theme="dark"] .is-loading .donut-wrap,
:root[data-theme="dark"] .is-loading .bar-col__tooltip {
  background-color: transparent;
  background-image: linear-gradient(90deg, rgba(38, 52, 73, .72) 25%, rgba(51, 65, 85, .9) 50%, rgba(38, 52, 73, .72) 75%);
  background-size: 600px 100%;
}

:root[data-theme="dark"] .is-loading td,
:root[data-theme="dark"] .is-loading .content-card__body {
  background-image: linear-gradient(90deg, rgba(38, 52, 73, .52) 25%, rgba(51, 65, 85, .76) 50%, rgba(38, 52, 73, .52) 75%);
  background-size: 600px 100%;
}

:root[data-theme="dark"] body.skeleton-page-loading::before {
  background: rgba(5, 10, 20, .94);
}

:root[data-theme="dark"] body.skeleton-page-loading::after {
  background-color: #172033;
  background-image:
    linear-gradient(90deg, transparent, rgba(148, 163, 184, .1), transparent),
    linear-gradient(90deg, #263449 25%, #334155 50%, #263449 75%),
    linear-gradient(90deg, #263449 25%, #334155 50%, #263449 75%),
    linear-gradient(90deg, #263449 25%, #334155 50%, #263449 75%),
    linear-gradient(90deg, #263449 25%, #334155 50%, #263449 75%),
    linear-gradient(90deg, #263449 25%, #334155 50%, #263449 75%);
  border-color: #334155;
  box-shadow: 0 12px 36px rgba(0, 0, 0, .45);
}

/* LOGIN PAGE */

/*  Tablet / phablet: collapse split panel  */
@media (max-width: 860px) {
  .auth-shell {
    display: flex;
    flex-direction: column;
  }

  .auth-shell::before {
    display: none;
  }

  /* Hero becomes a compact header banner with 16:9 aspect ratio */
  .auth-hero,
  .auth-shell.staff-mode .auth-hero {
    min-height: auto;
    transform: none;
    clip-path: none;
    padding: 0;
    border-radius: 0;
    gap: 0;
    aspect-ratio: 16 / 9;
    overflow: hidden;
  }

  /* Show the top logo on mobile (hidden on desktop where form panel has its own) */
  .auth-hero-top {
    display: flex;
    position: absolute;
    top: 16px;
    left: 16px;
    right: 16px;
    z-index: 3;
    padding: 0;
  }

  .auth-hero-mid {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0 0 28px 28px;
    overflow: hidden;
  }

  .auth-hero-mid::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(180deg, rgba(20, 62, 156, 0.85) 0%, rgba(26, 79, 186, 0.45) 40%, rgba(76, 85, 217, 0) 100%);
    pointer-events: none;
  }

  .auth-hero-illustration {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0 0 28px 28px;
  }

  /* Suppress the animated blobs on tablets — they look oversized when stacked */
  .auth-hero-blob {
    display: none;
  }

  /* Clock pill - positioned absolutely over the image */
  .auth-hero-clock {
    position: absolute;
    bottom: 16px;
    left: 16px;
    z-index: 3;
    font-size: 11.5px;
    padding: 6px 13px;
    margin: 0;
  }

  /* Form panel: no side-by-side anymore */
  .auth-form-panel,
  .auth-shell.staff-mode .auth-form-panel {
    min-height: auto;
    transform: none;
    width: 100%;
    padding: 24px 16px 32px;
  }

  .auth-form-panel::before {
    display: none;
  }

  /* Brand block goes static (was absolute-positioned for desktop) */
  .auth-form-brand {
    position: static;
    margin: 0 0 20px;
    width: 100%;
    justify-content: flex-start;
    display: none;
    /* hidden on mobile — hero banner already shows the logo */
  }

  /* Full-width form fields */
  .auth-field {
    width: 100%;
  }

  .auth-input-wrap,
  .auth-input {
    width: 100%;
  }

  .auth-field-error {
    width: 100%;
  }

  /* Submit button fills the width on mobile */
  .auth-submit {
    width: 100%;
  }

  /* Center the card and ensure consistent width */
  .auth-card {
    width: 100%;
    max-width: 100%;
  }

  .auth-form {
    align-items: stretch;
  }
}

/*  Phone landscape / small tablets  */
@media (max-width: 640px) {
  .auth-hero-logo img {
    width: 40px;
    height: 40px;
  }

  .auth-hero-logo-icon {
    width: 40px;
    height: 40px;
  }

  .auth-hero-logo-name {
    font-size: 13.5px;
  }

  .auth-hero-logo-sub {
    font-size: 10.5px;
  }

  .auth-hero-title {
    font-size: clamp(20px, 5vw, 26px);
  }

  .auth-hero-desc {
    font-size: 13px;
  }

  /* Clock hides on phones — saves vertical space */
  .auth-hero-clock {
    display: none;
  }

  .auth-hero-top {
    top: 12px;
    left: 12px;
    right: 12px;
  }

  .auth-hero-mid {
    border-radius: 0 0 20px 20px;
  }

  .auth-hero-illustration {
    border-radius: 0 0 20px 20px;
  }

  /* Auth card centres nicely */
  .auth-card {
    width: 100%;
  }

  .auth-card-header {
    margin-bottom: 18px;
  }

  .auth-card-eyebrow i {
    font-size: 36px;
  }

  .auth-card-title {
    font-size: clamp(22px, 6vw, 28px);
  }

  /* Form inputs: taller tap targets on touch screens */
  .auth-input {
    height: 52px;
    font-size: 15px;
  }

  .auth-form {
    gap: 13px;
  }

  .auth-field {
    gap: 5px;
  }

  .login-role-grid {
    margin-bottom: 18px;
  }

  /* Caps-lock warning — full width pill */
  .auth-caps-warn {
    width: 100%;
    justify-content: center;
  }

  /* Field error text slightly larger for readability */
  .auth-field-error {
    font-size: 12px;
  }
}

/*  Portrait phone (≤ 480px)  */
@media (max-width: 480px) {
  .auth-form-panel {
    padding: 20px 14px 28px;
  }

  .login-role-grid {
    grid-template-columns: 1fr 1fr;
  }

  .auth-form-brand img {
    width: 44px;
    height: 44px;
  }

  .auth-form-brand-name {
    font-size: 14px;
  }

  /* Input icon slightly smaller so text doesn't clip */
  .auth-input {
    padding-left: 46px;
  }

  .auth-input-wrap i {
    left: 13px;
    font-size: 14px;
  }

  /* Submit button: ensure full-width with healthy height */
  .auth-submit {
    width: 100%;
    height: 50px;
    font-size: 13px;
  }
}

/*  Small phones (≤ 400px)  */
@media (max-width: 400px) {
  .login-role-grid {
    grid-template-columns: 1fr;
  }

  .login-role-card {
    min-height: 44px;
    justify-content: flex-start;
  }

  .login-role-card .login-role-copy {
    flex: 1;
  }

  .auth-hero-title {
    font-size: 20px;
  }

  .auth-hero-desc {
    font-size: 12.5px;
  }

  .auth-form-brand {
    margin-bottom: 20px;
  }

  .auth-form-brand img {
    width: 42px;
    height: 42px;
  }

  .auth-card-title {
    font-size: 22px;
  }

  .auth-card-sub {
    font-size: 12px;
  }

  /* Ensure comfortable touch targets */
  .auth-input {
    height: 48px;
    font-size: 14px;
  }

  .auth-submit {
    height: 48px;
  }
}

/*  Very small phones (≤ 340px)  */
@media (max-width: 340px) {
  .auth-card-title {
    font-size: 20px;
  }

  .auth-hero-logo-name {
    font-size: 12.5px;
    max-width: 160px;
  }

  .auth-form-brand-name {
    font-size: 13px;
  }

  .auth-checkbox-text {
    font-size: 12px;
  }

  .auth-input {
    height: 44px;
    font-size: 13px;
  }

  .auth-submit {
    height: 44px;
    font-size: 12px;
  }
}

/*  Landscape mode on phones: keep form visible without scrolling  */
@media (max-width: 860px) and (max-height: 500px) and (orientation: landscape) {
  .auth-hero {
    aspect-ratio: 16 / 9;
    padding: 0;
    border-radius: 0;
    gap: 0;
    overflow: hidden;
  }

  .auth-hero-mid {
    display: flex;
    border-radius: 0 0 14px 14px;
  }

  .auth-hero-illustration {
    border-radius: 0 0 14px 14px;
  }

  .auth-hero-top {
    top: 10px;
    left: 10px;
    right: 10px;
  }

  .auth-hero-clock {
    display: none;
  }

  .auth-form-panel {
    padding: 16px 16px 20px;
  }

  .auth-card-header {
    margin-bottom: 12px;
  }

  .auth-card-eyebrow {
    display: none;
  }

  .auth-form {
    gap: 10px;
  }

  .auth-input {
    height: 44px;
  }

  .auth-submit {
    height: 44px;
    margin-top: 4px;
  }
}


/* DIGITAL ISSUANCE FORM (Small Form Modal) */
#digital-issuance-modal .modal__body {
  overflow-y: auto;
  max-height: calc(100dvh - 80px);
  padding: 24px 28px;
  flex: none;
  min-height: auto;
  display: block;
  gap: 0
}

#digital-issuance-modal .small-form-preview {
  padding: 18px 20px;
  min-height: auto
}

#digital-issuance-modal .small-form-photo {
  width: 104px;
  height: 104px
}

#digital-issuance-modal .small-form-lines {
  gap: 10px;
  margin-bottom: 24px
}

#digital-issuance-modal .small-form-line {
  font-size: 13px;
  line-height: 1.3
}

#digital-issuance-modal .small-form-line strong {
  min-width: 110px
}

#digital-issuance-modal .small-form-line span {
  min-height: 17px
}

#digital-issuance-modal .small-form-foot {
  margin-top: 72px;
  justify-content: center
}

#digital-issuance-modal .small-form-head {
  margin-bottom: 14px;
  font-size: 13px
}

#digital-issuance-modal .small-form-line span[contenteditable="true"] {
  background: rgba(26, 79, 186, .04);
  border-radius: 3px;
  padding: 1px 4px;
  border-bottom: 1.5px dashed var(--primary);
  outline: none;
  transition: background .15s
}

#digital-issuance-modal .small-form-line span[contenteditable="true"]:focus {
  background: rgba(26, 79, 186, .09);
  border-bottom-color: #153d9e
}

.queue-status-radios {
  display: flex;
  flex-direction: column;
  gap: 4px
}

.queue-radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 11.5px;
  color: var(--text-secondary);
  transition: color .15s
}

.queue-radio:hover {
  color: var(--text-primary)
}

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

.queue-radio-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
  position: relative;
  transition: all .15s
}

.queue-radio input:checked+.queue-radio-dot[data-status="Queued"] {
  border-color: var(--warning);
  background: var(--warning)
}

.queue-radio input:checked+.queue-radio-dot[data-status="In Production"] {
  border-color: var(--primary);
  background: var(--primary)
}

.queue-radio input:checked+.queue-radio-dot[data-status="Printed"] {
  border-color: var(--purple);
  background: var(--purple)
}

.queue-radio input:checked+.queue-radio-dot[data-status="In Transit"] {
  border-color: var(--success);
  background: var(--success)
}

.queue-radio input:checked+.queue-radio-dot::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: #fff
}

.queue-radio input:checked~.queue-radio-text {
  font-weight: 700;
  color: var(--text-primary)
}

.queue-radio-text {
  white-space: nowrap
}


.di-header {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  background: var(--bg-alt);
  border-radius: var(--r-lg);
  border: 1px solid var(--border-subtle);
  margin-bottom: 16px
}

.di-photo-wrap {
  width: 64px;
  height: 64px;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface)
}

.di-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block
}

.di-photo-fb {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-muted);
  display: flex
}

.di-header-info {
  min-width: 0
}

.di-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  color: var(--text-primary)
}

.di-app-id {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
  font-family: var(--font-data);
  letter-spacing: .3px
}

.di-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px
}

.di-detail-item {
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--r-md);
  border: 1px solid var(--border-subtle)
}

.di-detail-item--full {
  grid-column: 1/-1
}

.di-detail-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px
}

.di-detail-value {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-word
}

#digital-issuance-modal .modal__header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle)
}

/* SHARED MOBILE RESPONSIVENESS */

/* Mobile header hamburger (hidden on desktop) */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--tf);
}

.mobile-menu-btn:hover {
  border-color: var(--primary-border);
  color: var(--primary)
}

.mobile-menu-btn svg {
  width: 18px;
  height: 18px
}

/* Off-canvas drawer overlay */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 190;
  background: rgba(13, 27, 62, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}

.sidebar-backdrop.show {
  opacity: 1;
  pointer-events: auto
}

@media (max-width:768px) {
  .mobile-menu-btn {
    display: inline-flex
  }

  .mobile-topbar {
    display: flex !important
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform .3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 32px rgba(13, 27, 62, 0.25);
  }

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

  body.sidebar-open .sidebar-backdrop {
    display: block;
    opacity: 1;
    pointer-events: auto
  }

  .main-content {
    margin-left: 0;
    padding: 16px 14px 56px
  }

  /* Responsive stacked data tables */
  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%
  }

  .data-table thead {
    display: none
  }

  .data-table tbody tr {
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 10px 12px;
    margin-bottom: 10px;
    background: var(--surface);
  }

  .data-table tbody tr:nth-child(even) {
    background: var(--surface)
  }

  .data-table td {
    position: relative;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    padding: 6px 0 6px 40%;
    border-bottom: 1px dashed var(--bg-alt);
    text-align: right;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }

  .data-table td::before {
    content: attr(data-label);
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 38%;
    flex-shrink: 0;
    text-align: left;
    font-family: var(--font-data);
    font-weight: 700;
    font-size: 10.5px;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--text-placeholder);
  }

  .data-table td[data-label=""]::before,
  .data-table td:not([data-label])::before {
    content: '';
    display: none
  }

  .data-table td:not([data-label]) {
    padding-left: 0;
    justify-content: flex-start;
    text-align: left
  }

  .data-table td:last-child {
    border-bottom: none
  }

  /* Stacked empty-state row centers cleanly */
  .data-table .table-empty {
    justify-content: center !important;
    text-align: center !important;
    padding: 24px 12px !important;
    border-bottom: none;
  }

  .data-table .table-empty::before {
    display: none
  }

  /* Table toolbar inputs take full width on phones */
  .table-header__actions .table-search {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0
  }

  .barangay-select-wrap {
    width: 100%;
    max-width: none
  }

  .barangay-select-wrap select.filter-select {
    width: 100%;
    max-width: none
  }

  .filter-bar .table-search {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    margin-right: 0
  }

  .filter-bar .filter-select,
  .filter-bar select {
    flex: 1 1 100%;
    min-width: 0
  }

  /* Status tabs scroll horizontally instead of overflowing */
  .status-tabs {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch
  }

  .status-tab {
    flex-shrink: 0
  }

  .status-select,
  .status-select__trigger {
    min-width: 0;
    width: 100%
  }

  /* Notifications/log card header wraps */
  .log-card__header {
    flex-wrap: wrap
  }

  .log-card__header .filter-bar {
    flex: 1 1 100%
  }
}

@media (max-width:640px) {

  /* Page header controls stack below the title */
  .page-header__controls {
    width: 100%;
    gap: 6px
  }

  .page-header__controls .search-field {
    min-width: 0;
    flex: 1 1 100%;
    width: 100%
  }

  .page-header__controls .date-pill,
  .page-header__controls .icon-btn {
    flex-shrink: 0
  }

  .page-header__controls .filter-select {
    flex: 1 1 100%;
    min-width: 0
  }

  /* Chart & analytics card headers collapse */
  .chart-card__header {
    flex-direction: column;
    align-items: stretch
  }

  .chart-card__header>div {
    flex-wrap: wrap
  }

  .an-card__header {
    flex-direction: column;
    align-items: stretch
  }

  .an-card__header .tab-group {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch
  }

  .an-card__body .chart-wrap[style] {
    width: 100% !important;
    max-width: 200px;
    margin-inline: auto;
    min-width: 0
  }

  .batch-export {
    flex-wrap: wrap;
    row-gap: 8px;
    padding: 10px 14px
  }

  .batch-export__spacer {
    flex: 1 1 100%;
    height: 0;
    order: 10
  }

  /* CR80 ID card scrolls inside the modal instead of clipping */
  .idcard-wrapper {
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 18px 0
  }

  /* Date filter menu stays on screen via centered fixed panel */
  .date-filter-menu {
    position: fixed;
    left: 50%;
    right: auto;
    top: 64px;
    transform: translateX(-50%);
    width: min(280px, calc(100vw - 32px));
    margin: 0;
  }

  .date-filter-menu.show {
    transform: translateX(-50%) translateY(0)
  }
}

@media (max-width:560px) {

  /* Batch ops menu drops below the trigger */
  .batch-ops-wrap {
    position: static
  }

  .batch-ops__menu {
    position: fixed;
    top: auto;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    min-width: min(210px, calc(100vw - 32px))
  }

  .queue-filter-menu {
    min-width: 0;
    width: 200px;
    max-width: calc(100vw - 32px)
  }

  .qsd-menu {
    min-width: 0;
    width: 170px;
    max-width: 70vw
  }
}

@media (max-width:400px) {

  /* Queue header controls pack together with a full-width search */
  .main-queue-header__controls {
    width: 100%;
    justify-content: space-between
  }

  .main-queue-header__controls .table-search {
    flex: 1 1 auto;
    min-width: 0
  }

  .queue-filter-trigger {
    flex: 0 0 auto
  }

  .toast-container {
    left: 12px;
    right: 12px;
    max-width: none
  }
}

@media (max-height:600px) {
  .modal {
    min-height: auto !important;
    max-height: calc(100dvh - 20px);
    height: auto
  }

  #app-modal .modal__body {
    max-height: calc(100dvh - 160px)
  }
}

/* COMPREHENSIVE MOBILE RESPONSIVENESS — All Portals */

/*  Tablet (≤ 1024px)  */
@media (max-width:1024px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr)
  }

  .cards-grid-3 {
    grid-template-columns: repeat(2, 1fr)
  }

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

  .an-grid-wide {
    grid-template-columns: 1fr
  }

  .an-grid-2 {
    grid-template-columns: 1fr
  }

  .two-col,
  .two-col-70 {
    grid-template-columns: 1fr
  }

  .dash-charts-row {
    flex-direction: column
  }

  .dash-charts-row .chart-card,
  .dash-charts-row .donut-card {
    flex: 1 1 100%;
    min-width: 0
  }

  .doc-grid {
    grid-template-columns: repeat(2, 1fr)
  }

  .ai-grid {
    grid-template-columns: repeat(2, 1fr)
  }
}

/*  Mobile (≤ 768px)  */
@media (max-width:768px) {

  /* Reduce padding on main content */
  .main-content {
    padding: 12px 12px 56px
  }

  /* Page header stacks */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px
  }

  .page-header__title {
    font-size: 20px
  }

  .page-header__controls {
    width: 100%
  }

  /* Stat cards — generous 2-column grid, no squeeze */
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px
  }

  .cards-grid-3 {
    grid-template-columns: 1fr
  }

  .cards-grid .stat-card {
    min-width: 0;
    padding: 14px 14px
  }

  .cards-grid .stat-card__value {
    font-size: 24px;
    letter-spacing: -1px
  }

  .cards-grid .stat-card__label {
    font-size: 12px
  }

  .cards-grid .stat-card__sub {
    font-size: 11px
  }

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

  .kpi-card {
    min-width: 0;
    padding: 16px 18px
  }

  .kpi-card__value {
    font-size: 26px
  }

  .admin-kpi-strip {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px
  }

  .admin-kpi-strip .stat-card {
    min-width: 0;
    padding: 14px
  }

  .admin-kpi-strip .stat-card__value {
    font-size: 24px
  }

  /* Chart cards full width */
  .dash-charts-row {
    flex-direction: column
  }

  .dash-charts-row .chart-card,
  .dash-charts-row .donut-card {
    min-width: 0
  }

  .donut-card {
    flex: 1 1 100%
  }

  /* AI grid single column */
  .ai-grid {
    grid-template-columns: 1fr
  }

  /* Document grid single column */
  .doc-grid {
    grid-template-columns: 1fr
  }

  /* Analytics grids single column */
  .an-grid-wide,
  .an-grid-2 {
    grid-template-columns: 1fr
  }

  .two-col,
  .two-col-70 {
    grid-template-columns: 1fr
  }

  /* Modal mobile optimization */
  .modal {
    width: min(100%, 100%);
    border-radius: var(--r-xl);
    max-height: calc(100dvh - 24px)
  }

  .modal__header {
    padding: 14px 16px
  }

  .modal__title {
    font-size: 15px
  }

  .modal__body {
    padding: 14px 16px
  }

  .modal__footer {
    padding: 12px 16px
  }

  .modal__close {
    width: 32px;
    height: 32px
  }

  .modal__close svg {
    width: 12px;
    height: 12px
  }

  #app-modal .modal__body {
    padding: 14px 16px
  }

  /* Content card mobile */
  .content-card__header {
    padding: 10px 12px
  }

  .content-card__body {
    padding: 12px
  }

  /* Form grids single column on mobile */
  .form-grid-2,
  .form-grid-3 {
    grid-template-columns: 1fr
  }

  /* Table header stacks */
  .table-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px
  }

  .table-header__actions {
    width: 100%
  }

  .table-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px
  }

  /* Filter bar stacks */
  .filter-bar {
    flex-wrap: wrap
  }

  /* Status tabs — horizontally scrollable, no page push */
  .filter-bar {
    overflow: hidden
  }

  .status-tabs {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    flex: 1 1 0;
    min-width: 0;
    gap: 0;
    padding: 3px
  }

  .status-tab {
    flex-shrink: 0;
    padding: 6px 10px;
    font-size: 11.5px;
    white-space: nowrap
  }

  .status-tab .tab-icon {
    width: 12px;
    height: 12px
  }

  .filter-spacer {
    display: none
  }

  .filter-bar .table-search {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0
  }

  .filter-bar .filter-select,
  .filter-bar select {
    flex: 1 1 100%;
    min-width: 0
  }

  /* Report controls */
  .report-controls {
    flex-wrap: wrap
  }

  .report-controls .mini-btn {
    flex: 1 1 auto;
    justify-content: center
  }

  /* Workflow steps scrollable */
  .workflow {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch
  }

  .step {
    flex-shrink: 0
  }

  /* Alert mobile */
  .alert {
    flex-wrap: wrap
  }

  /* Toggle rows */
  .toggle-row {
    flex-wrap: wrap;
    gap: 8px
  }

  .toggle-info {
    flex: 1 1 100%
  }

  /* Di-details grid */
  .di-details-grid {
    grid-template-columns: 1fr
  }

  .di-detail-item--full {
    grid-column: auto
  }

  /* Donut chart cards — stack vertically on mobile */
  .an-card__body[style*="flex-wrap"] {
    flex-direction: column !important;
    align-items: center !important;
    gap: 14px !important;
    padding: 14px !important;
  }

  .an-card__body[style*="flex-wrap"] .chart-wrap {
    width: 100% !important;
    max-width: 180px;
    height: 180px !important;
  }

  .an-card__body[style*="flex-wrap"]>div[style*="display:flex"] {
    width: 100% !important;
    justify-content: center;
    flex-wrap: wrap;
  }

  .an-card__body[style*="flex-wrap"]>div[style*="display:flex"]>div {
    min-width: 0;
  }

  /* Barangay & Age grid — stack on mobile (demographics under barangay) */
  .an-grid-2 {
    grid-template-columns: 1fr !important;
    gap: 14px !important
  }

  /* Wide grid (Trends + Status donut) — also stack on mobile */
  .an-grid-wide {
    grid-template-columns: 1fr !important
  }

  /* ID Maker status donut — stack vertically */
  .an-card__body[style*="flex-direction:row"] {
    flex-direction: column !important;
    align-items: center !important;
    gap: 14px !important;
    padding: 14px !important;
  }

  .an-card__body[style*="flex-direction:row"] .chart-wrap {
    width: 100% !important;
    max-width: 160px;
    height: 160px !important;
  }

  .an-card__body[style*="flex-direction:row"]>div[style*="flex-direction:column"] {
    width: 100%;
    align-items: center;
  }

  /* ID Maker 2-col charts stack */
  .an-charts-2col {
    grid-template-columns: 1fr !important
  }
}

/*  Small mobile (≤ 560px)  */
@media (max-width:560px) {
  .main-content {
    padding: 10px 10px 56px
  }

  .page-header__title {
    font-size: 19px
  }

  /* Stat cards — single column, comfortable sizing */
  .cards-grid {
    grid-template-columns: 1fr;
    gap: 8px
  }

  .cards-grid .stat-card {
    padding: 14px 16px
  }

  .cards-grid .stat-card__value {
    font-size: 26px
  }

  .cards-grid .stat-card__label {
    font-size: 13px
  }

  .kpi-grid {
    grid-template-columns: 1fr;
    gap: 8px
  }

  .kpi-card {
    padding: 16px 18px
  }

  .kpi-card__value {
    font-size: 28px
  }

  .admin-kpi-strip {
    grid-template-columns: 1fr;
    gap: 8px
  }

  .admin-kpi-strip .stat-card {
    padding: 14px 16px
  }

  .admin-kpi-strip .stat-card__value {
    font-size: 26px
  }

  .an-card__title {
    font-size: 15px
  }

  .an-card__header {
    padding: 14px 16px 12px
  }

  .an-card__body {
    padding: 14px 16px
  }

  .chart-card {
    padding: 12px
  }

  .donut-card {
    padding: 12px
  }

  .ai-grid {
    grid-template-columns: 1fr
  }

  .admin-ops-grid {
    grid-template-columns: 1fr
  }

  .an-grid-2 {
    grid-template-columns: 1fr !important
  }

  .an-grid-wide {
    grid-template-columns: 1fr !important
  }

  .an-charts-2col {
    grid-template-columns: 1fr !important
  }
}

/*  Very small mobile (≤ 400px)  */
@media (max-width:400px) {
  .main-content {
    padding: 8px 8px 56px
  }

  .page-header__title {
    font-size: 17px
  }

  .stat-card {
    padding: 12px
  }

  .stat-card__value {
    font-size: 20px
  }

  .an-card__header {
    padding: 12px 12px 10px
  }

  .an-card__body {
    padding: 12px
  }

  .auth-card-title {
    font-size: 22px
  }
}

/*  Digital issuance form mobile  */
@media (max-width:640px) {
  #digital-issuance-modal .modal__body {
    padding: 14px
  }

  #digital-issuance-modal .small-form-preview {
    padding: 14px
  }

  #digital-issuance-modal .small-form-line {
    font-size: 12px
  }

  #digital-issuance-modal .small-form-line strong {
    min-width: 90px
  }

  .di-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px
  }

  .di-photo-wrap {
    width: 48px;
    height: 48px
  }

  .di-name {
    font-size: 14px
  }
}


/* User account add/edit modal: compact, content-sized layout */
#user-modal .modal.user-account-modal {
  width: min(680px, 100%);
  min-height: 0;
  max-height: calc(100dvh - 36px);
}
#user-modal .user-account-modal .modal__body {
  flex: 0 1 auto;
  min-height: 0;
  max-height: calc(100dvh - 150px);
  padding: 16px 22px;
  gap: 12px;
}
#user-modal .user-account-modal .form-grid {
  gap: 14px 16px;
}
#user-modal .user-account-modal .form-group {
  min-width: 0;
}
@media (max-width: 600px) {
  #user-modal .user-account-modal {
    width: 100%;
  }
  #user-modal .user-account-modal .modal__body {
    padding: 14px 16px;
  }
}
/* Login page input cleanup: native dropdown indicators must not appear on text inputs. */
#login-page input.auth-input {
  -webkit-appearance: none;
  appearance: none;
  background-image: none;
}
#login-page input.auth-input::-ms-expand {
  display: none;
}


/* Compact application filters: render one custom chevron per native select. */
.filter-select-wrap select.filter-select,
.barangay-select-wrap select.filter-select {
  appearance: none !important;
  -webkit-appearance: none !important;
  background-image: none !important;
}
.filter-select-wrap .select-chevron {
  pointer-events: none;
}

:root[data-theme="dark"] .data-table tbody tr:hover,
:root[data-theme="dark"] .data-table tbody tr:hover > td {
  background-color: #263449 !important;
}

:root[data-theme="dark"] .data-table th:hover {
  background-color: #263449;
  color: #F8FAFC;
}

:root[data-theme="dark"] .data-table tbody tr:focus-within > td {
  background-color: #263449;
}

/* Keep KPI spacing consistent across every portal and module. */
.stat-card,
.kpi-card {
  padding: 16px 18px !important;
}

.stat-card {
  gap: 12px !important;
}

.stat-card__top,
.kpi-card__top {
  gap: 8px;
}

.stat-card__body {
  gap: 10px !important;
}

.stat-card:not(.is-loading) .stat-card__label,
.stat-card:not(.is-loading) .stat-card__value,
.stat-card:not(.is-loading) .stat-card__sub,
.kpi-card__label,
.kpi-card__value,
.kpi-card__sub {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.kpi-card {
  gap: 14px !important;
}
