:root {
  --bg-gradient: radial-gradient(circle at 0% 0%, #eff6ff 0%, #f9fafb 40%, #ffffff 100%);
  --surface: #ffffffcc;
  --surface-strong: #ffffff;
  --border: rgba(15, 23, 42, 0.08);
  --brand: #1d4ed8;
  --brand-soft: rgba(29, 78, 216, 0.1);
  --accent: #0891b2;
  --text: #0f172a;
  --text-muted: #64748b;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-md: 12px;
  --shadow: 0 24px 48px -24px rgba(15, 23, 42, 0.35);
  --shadow-soft: 0 16px 32px -24px rgba(15, 23, 42, 0.25);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  font-family: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-gradient);
  color: var(--text);
  font-size: 15px;
}

body.sidebar-open {
  overflow: hidden;
}

body.admin-menu-open {
  overflow: hidden;
}

a {
  color: inherit;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  width: 100%;
}

.app-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 10% 10%, rgba(29, 78, 216, 0.08) 0%, transparent 55%),
    radial-gradient(circle at 90% 20%, rgba(8, 145, 178, 0.08) 0%, transparent 45%);
  pointer-events: none;
  z-index: -1;
}

.sidebar-backdrop {
  display: none;
}

.admin-menu-backdrop {
  display: none;
}

.app-sidebar {
  width: clamp(260px, 24vw, 320px);
  background: var(--surface);
  backdrop-filter: blur(14px);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  border-right: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.sidebar-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.sidebar-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}

.sidebar-title--glow {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.9), rgba(14, 165, 233, 0.9));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 10px rgba(59, 130, 246, 0.6), 0 0 22px rgba(14, 165, 233, 0.5),
    0 0 36px rgba(59, 130, 246, 0.35);
}

.sidebar-subtitle {
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

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

.nav button {
  border: none;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
  background: transparent;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav button:hover {
  background: rgba(15, 23, 42, 0.06);
  color: var(--text);
  transform: translateX(4px);
}

.nav button.active {
  background: var(--brand);
  color: #fff;
  box-shadow: var(--shadow-soft);
}

.filter-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 26px 24px 24px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(29, 78, 216, 0.14), rgba(8, 145, 178, 0.08))
      border-box,
    var(--surface-strong);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 22px 38px -28px rgba(15, 23, 42, 0.35);
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}

.filter-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at -10% -10%, rgba(255, 255, 255, 0.65) 0%, transparent 65%);
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.6;
}

.filter-panel__header {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
}

.filter-panel__icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 22px;
  color: var(--brand);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 18px 34px -20px rgba(15, 23, 42, 0.45);
}

.filter-panel__eyebrow {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--brand);
}

.filter-panel__header h2 {
  margin: 4px 0 0;
  font-size: 18px;
  font-weight: 600;
}

.filter-panel__description {
  position: relative;
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
}

.filter-panel__fields {
  position: relative;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-field--full {
  grid-column: 1 / -1;
}

.filter-field label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

.filter-input {
  position: relative;
}

.filter-input::before {
  content: attr(data-icon);
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  opacity: 0.7;
  pointer-events: none;
}

.filter-input input,
.filter-input select {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.9);
  padding: 12px 14px 12px 46px;
  transition: border 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.filter-input input:focus,
.filter-input select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.15);
  background: #fff;
}

.filter-input--select select {
  appearance: none;
  -moz-appearance: none;
  -webkit-appearance: none;
  padding-right: 44px;
}

.filter-input--select::after {
  content: "▾";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.filter-panel__actions {
  position: relative;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.filter-panel__actions .btn {
  flex: 1 1 auto;
}

.filter-panel__toggle {
  border: 1px solid rgba(29, 78, 216, 0.18);
  background: rgba(29, 78, 216, 0.08);
  border-radius: 999px;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  cursor: pointer;
  margin-left: auto;
  transition: background 0.2s ease, color 0.2s ease, border 0.2s ease, box-shadow 0.2s ease;
}

@media (min-width: 1025px) {
  .filter-panel__toggle {
    display: none;
  }
}

.filter-panel__toggle:hover {
  background: rgba(29, 78, 216, 0.14);
  border-color: rgba(29, 78, 216, 0.3);
  box-shadow: 0 10px 24px -16px rgba(29, 78, 216, 0.5);
}

.filter-panel__toggle-icon {
  transition: transform 0.2s ease;
}

.filter-panel[data-collapsed="true"] .filter-panel__toggle {
  background: var(--brand);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 14px 28px -20px rgba(15, 23, 42, 0.45);
}

.filter-panel[data-collapsed="true"] .filter-panel__toggle-icon {
  transform: rotate(180deg);
}

.filter-panel[data-collapsed="true"] .filter-panel__content {
  display: none;
}

.filter-panel[data-collapsed="true"] {
  padding-bottom: 18px;
}

.filter-panel[data-collapsed="true"] .filter-panel__toggle-label,
.filter-panel[data-collapsed="true"] .filter-panel__toggle-icon {
  color: #fff;
}

.filter-panel__footnote {
  position: relative;
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-muted);
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  backdrop-filter: blur(6px);
  min-width: 0;
  width: 100%;
}

.app-header {
  padding: 28px 36px 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  width: 100%;
  box-sizing: border-box;
}

.app-header h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
}

.app-header__title {
  flex: 1 1 360px;
  min-width: 260px;
}

.app-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 14px;
  flex-wrap: wrap;
  row-gap: 6px;
}

.user-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.badge-alert {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--warning);
  color: #fff;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.sidebar-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--brand);
  color: #fff;
  padding: 10px 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.sidebar-toggle:hover {
  background: #1a46c2;
  transform: translateY(-1px);
}

.sidebar-toggle:active {
  transform: translateY(0);
  box-shadow: 0 10px 18px -12px rgba(15, 23, 42, 0.45);
}

.sidebar-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sidebar-toggle-icon {
  font-size: 18px;
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  background: var(--bg-gradient);
}

.auth-card {
  width: min(420px, 100%);
  background: var(--surface);
  backdrop-filter: blur(14px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.auth-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.auth-logo {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-soft);
}

.auth-card h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
}

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

.auth-alert {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--danger);
  padding: 12px 16px;
  border-radius: var(--radius-md);
}

.auth-alert ul {
  margin: 0;
  padding-left: 18px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-submit {
  width: 100%;
  justify-content: center;
}

.auth-footnote {
  margin: 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

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

.user-dropdown {
  position: relative;
  min-width: 0;
}

.user-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  padding: 10px 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  min-width: 0;
}

.user-dropdown-toggle:hover {
  background: rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}

.user-dropdown-toggle:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.user-dropdown-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid;
  place-items: center;
  font-weight: 700;
  flex-shrink: 0;
}

.user-dropdown-name {
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown-caret {
  font-size: 12px;
  margin-left: 4px;
  color: var(--text-muted);
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 220px;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 10;
}

.user-dropdown.open .user-dropdown-menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.admin-menu-mobile-header {
  display: none;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text);
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.user-dropdown-item:hover,
.user-dropdown-item:focus {
  background: rgba(15, 23, 42, 0.06);
  color: var(--text);
}

.user-dropdown-item:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.user-dropdown-divider {
  height: 1px;
  background: rgba(15, 23, 42, 0.08);
  margin: 4px 0;
}

.btn {
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.btn-compact {
  padding: 8px 14px;
  font-size: 14px;
  box-shadow: none;
}

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

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: var(--shadow-soft);
}

.btn-ghost {
  background: rgba(15, 23, 42, 0.06);
  color: var(--text);
}

.btn-ghost:hover {
  background: rgba(15, 23, 42, 0.12);
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(15, 23, 42, 0.12);
  color: var(--text);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.16);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.28);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.24);
}

.btn[disabled],
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.input-with-prefix {
  display: flex;
  align-items: center;
  border-radius: var(--radius-md);
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: var(--surface-strong);
  overflow: hidden;
}

.input-with-prefix::before {
  content: attr(data-prefix);
  padding: 10px 12px;
  background: rgba(15, 23, 42, 0.05);
  color: var(--text-muted);
  font-weight: 600;
}

.input-with-prefix input {
  border: none;
  background: transparent;
  padding: 10px 12px;
  flex: 1;
}

.input-with-prefix input:focus {
  outline: none;
}

.main-content {
  position: relative;
  padding: 24px 36px 40px;
  display: grid;
  gap: 24px;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

.main-content::before {
  content: 'LMS';
  position: absolute;
  top: 50%;
  right: 6%;
  transform: translateY(-50%) rotate(-12deg);
  font-size: clamp(80px, 18vw, 180px);
  font-weight: 700;
  letter-spacing: 0.35em;
  color: rgba(15, 23, 42, 0.05);
  pointer-events: none;
  text-transform: uppercase;
  z-index: 0;
}

.main-content > * {
  position: relative;
  z-index: 1;
}

.card {
  background: var(--surface);
  backdrop-filter: blur(10px);
  padding: 24px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  position: relative;
  max-width: 100%;
}

.card h2 {
  margin-top: 0;
  font-size: 20px;
  font-weight: 600;
}

.card h3 {
  margin-top: 0;
  font-size: 16px;
  color: var(--text-muted);
  font-weight: 600;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-field label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.form-field input,
.form-field select,
.form-field textarea {
  border-radius: var(--radius-md);
  border: 1px solid rgba(15, 23, 42, 0.1);
  padding: 10px 12px;
  background: var(--surface-strong);
  transition: border 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
  max-width: 100%;
}

.page-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.page-section-header h2 {
  margin: 0;
}

.page-section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.page-section-actions .btn {
  white-space: nowrap;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.15);
}

.divider {
  height: 1px;
  background: rgba(15, 23, 42, 0.08);
  margin: 24px 0;
}

.table-wrapper {
  margin-top: 18px;
  overflow: auto;
  border-radius: var(--radius-md);
  border: 1px solid rgba(15, 23, 42, 0.08);
  width: 100%;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

.table-wrapper .btn {
  padding: 6px 12px;
  font-size: 12px;
  box-shadow: none;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 16px;
  overflow-y: auto;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  z-index: 2000;
  scroll-behavior: smooth;
}

.modal.open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.modal-dialog {
  position: relative;
  background: var(--surface-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  width: min(780px, 100%);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  z-index: 1;
  max-height: min(780px, calc(100vh - 64px));
  overflow: hidden;
  box-sizing: border-box;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.modal-subtitle {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
}

.modal-close {
  border: none;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-close:hover {
  color: var(--text);
}

@media (max-width: 640px) {
  .modal {
    padding: 24px 12px;
  }

  .modal-dialog {
    width: 100%;
    max-height: min(720px, calc(100vh - 48px));
  }
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  scrollbar-gutter: stable both-edges;
}

.modal-body.course-manager {
  gap: 24px;
  overflow-y: auto;
  padding-right: 6px;
}

#notificationModal .modal-dialog {
  padding: 0;
  overflow: hidden;
  max-width: min(840px, 100%);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.95) 0%, rgba(255, 255, 255, 0.98) 100%);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 32px 78px -24px rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(14px);
  gap: 0;
}

#notificationModal .modal-header {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 28px 32px 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(248, 250, 252, 0.92) 100%);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(12px);
}

.notification-modal__header {
  align-items: flex-start;
  gap: 20px;
}

#notificationModal .modal-close {
  margin-top: -4px;
}

.modal-body.notification-modal {
  gap: 32px;
  padding: 32px;
  scroll-padding-block: 32px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.6) 0%, rgba(255, 255, 255, 0.82) 100%);
}

.modal-body.import-modal {
  gap: 28px;
  overflow-y: auto;
  padding-right: 6px;
}

.import-section {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.import-section h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}

.import-section p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.import-section .btn {
  align-self: flex-start;
}

.import-section form,
.import-section .import-form-grid {
  display: grid;
  gap: 14px;
}

.import-section label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.import-section input[type="file"] {
  border: 1px dashed rgba(15, 23, 42, 0.25);
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.04);
  padding: 12px;
  cursor: pointer;
}

.import-section input[type="file"]:focus {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.import-section .modal-actions {
  margin-top: 4px;
}

.notification-modal__heading {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 560px;
}

.notification-stack {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.notification-stack-divider {
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(15, 23, 42, 0) 0%,
    rgba(15, 23, 42, 0.12) 22%,
    rgba(15, 23, 42, 0.18) 50%,
    rgba(15, 23, 42, 0.12) 78%,
    rgba(15, 23, 42, 0) 100%
  );
  margin: -12px 48px;
  flex-shrink: 0;
}

.notification-section {
  position: relative;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.94) 0%, rgba(241, 245, 249, 0.88) 100%);
  box-shadow: 0 24px 54px -32px rgba(15, 23, 42, 0.52);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.28s ease, background 0.3s ease;
  overflow: hidden;
  scroll-margin-top: 32px;
}

.notification-section:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.32);
  box-shadow: 0 30px 72px -28px rgba(37, 99, 235, 0.28);
}

.notification-section.is-open {
  transform: translateY(-4px);
  border-color: rgba(37, 99, 235, 0.45);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.97) 0%, rgba(226, 232, 240, 0.92) 100%);
  box-shadow: 0 38px 80px -26px rgba(37, 99, 235, 0.38);
}

.notification-section-toggle {
  width: 100%;
  border: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 32px 32px 26px;
  font: inherit;
  text-align: left;
  cursor: pointer;
  background: radial-gradient(140% 150% at 50% -30%, rgba(37, 99, 235, 0.09) 0%, rgba(255, 255, 255, 0) 60%);
  transition: background 0.3s ease, padding-bottom 0.3s ease;
}

.notification-section:hover .notification-section-toggle {
  background: radial-gradient(150% 160% at 50% -40%, rgba(37, 99, 235, 0.14) 0%, rgba(255, 255, 255, 0) 65%);
}

.notification-section.is-open .notification-section-toggle {
  padding-bottom: 20px;
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.1) 0%, rgba(37, 99, 235, 0.03) 100%);
}

.notification-section-toggle:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.55);
  outline-offset: -4px;
  border-radius: 18px;
}

.notification-section-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 auto;
  align-items: flex-start;
}

.notification-section-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.notification-section-header .small-muted {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
}

.notification-section-body {
  padding: 0 32px;
  height: 0;
  opacity: 0;
  overflow: hidden;
  transition: height 0.36s ease, opacity 0.28s ease, padding-top 0.36s ease, padding-bottom 0.36s ease;
}

.notification-section-body[data-open='true'] {
  opacity: 1;
  padding-bottom: 32px;
}

.notification-section-content {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-top: 16px;
}

.notification-footer {
  padding: 20px 32px 28px;
  background: linear-gradient(180deg, rgba(241, 245, 249, 0.82) 0%, rgba(255, 255, 255, 0.95) 100%);
  border-top: 1px solid rgba(148, 163, 184, 0.24);
  box-shadow: 0 -12px 32px -20px rgba(15, 23, 42, 0.28);
  display: flex;
  align-items: center;
  gap: 16px;
}

.notification-footer__spacer {
  flex: 1 1 auto;
}

.notification-footer__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.notification-footer .btn {
  min-width: 108px;
}

#notificationModal .modal-actions {
  justify-content: flex-end;
  gap: 12px;
}

.notification-section-chevron {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  background: rgba(37, 99, 235, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.notification-section-chevron::before {
  content: '';
  border-style: solid;
  border-width: 6px 4px 0 4px;
  border-color: rgba(37, 99, 235, 0.6) transparent transparent transparent;
  transform: translateY(1px);
  transition: transform 0.3s ease;
}

.notification-section.is-open .notification-section-chevron {
  background: rgba(37, 99, 235, 0.14);
  border-color: rgba(37, 99, 235, 0.35);
}

.notification-section.is-open .notification-section-chevron::before {
  transform: rotate(180deg) translateY(-1px);
}

@media (max-width: 640px) {
  #notificationModal .modal-dialog {
    width: 100%;
    max-height: min(720px, calc(100vh - 48px));
  }

  #notificationModal .modal-header {
    padding: 22px 20px 18px;
  }

  .modal-body.notification-modal {
    padding: 24px 20px;
    gap: 28px;
  }

  .notification-stack-divider {
    margin: -8px 24px;
  }

  .notification-section-toggle {
    padding: 24px 20px 18px;
  }

  .notification-section-body {
    padding: 0 20px;
  }

  .notification-section-body[data-open='true'] {
    padding-bottom: 24px;
  }

  .notification-section-content {
    gap: 24px;
    padding-top: 12px;
  }

  .notification-section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .notification-section-header .notification-badge {
    align-self: flex-start;
  }

  .notification-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 18px 20px 24px;
  }

  .notification-footer__actions {
    width: 100%;
    justify-content: space-between;
  }

  .notification-footer__actions .btn {
    flex: 1 1 auto;
  }

  .notification-footer__spacer {
    display: none;
  }

  .notification-routes,
  .notification-rules-table {
    padding: 18px;
    gap: 18px;
  }

  .notification-rules-table {
    display: none;
  }

  .notification-route-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .notification-route-details {
    min-width: 0;
    width: 100%;
  }

  .notification-route-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .notification-route-actions .btn {
    flex: 1 1 120px;
    justify-content: center;
  }

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

  .notification-rule-inline {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .notification-rule-inline input[type='number'] {
    max-width: 100%;
  }

  .notification-rule-inline span {
    font-size: 13px;
    color: var(--text-muted);
  }

  .modal-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .modal-actions .btn {
    width: 100%;
  }

  .notification-rules-table table {
    display: block;
    border-radius: 16px;
  }

  .notification-rules-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .notification-rules-table tbody {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .notification-rules-table tr {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 18px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  }

  .notification-rules-table tr + tr {
    border-top: none;
  }

  .notification-rules-table td {
    display: grid;
    grid-template-columns: max-content 1fr;
    align-items: start;
    gap: 8px;
    padding: 0;
    border: none;
  }

  .notification-rules-table td::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
  }

  .notification-rules-table td strong {
    font-size: 15px;
  }

  .notification-rules-table .notification-rule-routes-list {
    gap: 4px;
  }

  .notification-rules-table .notification-empty-row {
    padding: 16px 18px;
  }

  .notification-rules-table .notification-empty-row td {
    padding: 0;
  }

  .notification-rules-table .notification-empty-row td::before {
    display: none;
  }
}

.notification-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.14) 0%, rgba(37, 99, 235, 0.06) 100%);
  color: var(--brand);
  white-space: nowrap;
}

.notification-badge.is-empty {
  background: rgba(15, 23, 42, 0.08);
  color: var(--text-muted);
}

.notification-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.notification-form-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

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

.notification-rule-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.notification-rule-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notification-rule-inline input[type='number'] {
  max-width: 90px;
}

.notification-rule-routes {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notification-rule-routes .route-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.route-chip {
  --chip-border: rgba(15, 23, 42, 0.12);
  --chip-background: rgba(248, 250, 252, 0.88);
  --chip-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  min-width: 180px;
  flex: 1 1 220px;
  border-radius: 14px;
  border: 1px solid var(--chip-border);
  background: var(--chip-background);
  color: inherit;
  cursor: pointer;
  position: relative;
  text-align: left;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
  box-shadow: var(--chip-shadow);
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
}

.route-chip:hover,
.route-chip:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px -18px rgba(15, 23, 42, 0.55), 0 4px 12px -10px rgba(15, 23, 42, 0.24);
  border-color: rgba(59, 130, 246, 0.5);
}

.route-chip:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.35);
  outline-offset: 2px;
}

.route-chip.is-selected {
  --chip-border: rgba(59, 130, 246, 0.45);
  --chip-background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(59, 130, 246, 0.05));
  --chip-shadow: 0 10px 24px -18px rgba(37, 99, 235, 0.55), inset 0 0 0 1px rgba(59, 130, 246, 0.35);
  color: var(--text);
}

.route-chip-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.route-chip.is-selected .route-chip-icon {
  background: rgba(59, 130, 246, 0.24);
}

.route-chip-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.route-chip-label {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.route-chip-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.3;
}

.route-chip-check {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(59, 130, 246, 0.9);
  color: white;
  font-size: 12px;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.route-chip.is-selected .route-chip-check {
  opacity: 1;
  transform: scale(1);
}

.notification-subtitle {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.notification-routes,
.notification-rules-table {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 18px;
  padding: 22px 24px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.notification-route-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notification-route-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  transition: border-color 0.24s ease, box-shadow 0.24s ease, transform 0.24s ease;
}

.notification-route-item:hover {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 12px 24px -16px rgba(37, 99, 235, 0.32);
  transform: translateY(-1px);
}

.notification-route-details {
  flex: 1;
  min-width: 220px;
}

.notification-route-name {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
}

.notification-route-meta {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  word-break: break-word;
}

.notification-route-actions {
  display: flex;
  gap: 8px;
}

.notification-route-actions .btn {
  white-space: nowrap;
}

.notification-empty {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.03);
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
}

.notification-rules-table table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.notification-rules-table thead {
  background: rgba(15, 23, 42, 0.05);
}

.notification-rules-table th,
.notification-rules-table td {
  padding: 12px 14px;
  text-align: left;
  font-size: 13px;
  vertical-align: top;
}

.notification-rules-table th:nth-child(1),
.notification-rules-table td:nth-child(1) {
  width: 28%;
}

.notification-rules-table th:nth-child(2),
.notification-rules-table td:nth-child(2) {
  width: 24%;
}

.notification-rules-table th:nth-child(3),
.notification-rules-table td:nth-child(3) {
  width: 24%;
}

.notification-rules-table th:nth-child(4),
.notification-rules-table td:nth-child(4) {
  width: 24%;
}

.notification-rules-table tbody tr + tr {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.notification-rule-routes-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.notification-rule-routes-list span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

.notification-empty-row td {
  text-align: center;
  font-style: italic;
  color: var(--text-muted);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.modal-status {
  min-height: 18px;
  font-size: 13px;
  color: var(--text-muted);
}

.modal-status.error {
  color: var(--danger);
}

.modal-status.success {
  color: var(--success);
}

.modal-section {
  margin-bottom: 28px;
}

.modal-section:last-of-type {
  margin-bottom: 0;
}

.modal-section h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.modal-section form {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.modal-section .modal-actions {
  justify-content: flex-start;
}

.manage-admin-modal {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.admin-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-user-list {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: var(--radius-md);
  max-height: 260px;
  overflow-y: auto;
}

.admin-user-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.admin-user-item:last-child {
  border-bottom: none;
}

.admin-user-info {
  flex: 1;
  min-width: 0;
}

.admin-user-name {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.admin-user-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.admin-user-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(29, 78, 216, 0.12);
  color: #1d4ed8;
}

.admin-user-badge--muted {
  background: rgba(15, 23, 42, 0.08);
  color: var(--text-muted);
}

.admin-user-meta {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.admin-user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.admin-user-action {
  border: none;
  background: none;
  color: var(--brand);
  font-size: 13px;
  font-weight: 600;
  padding: 0;
  cursor: pointer;
}

.admin-user-action:hover:not(:disabled) {
  text-decoration: underline;
}

.admin-user-action:disabled {
  cursor: default;
  color: var(--text-muted);
  text-decoration: none;
}

.admin-user-action--danger {
  color: var(--danger);
}

.admin-user-note {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  align-self: center;
}

.admin-user-empty {
  padding: 18px;
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
}

.option-toolbar {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.option-search-field {
  margin: 0;
  flex: 1;
}

.option-list {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: var(--radius-md);
}

.option-list li {
  display: flex;
  align-items: center;
  column-gap: 12px;
  padding: 10px 14px;
  font-size: 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.option-list li:last-child {
  border-bottom: none;
}

.option-list li.empty {
  display: block;
  font-style: italic;
  color: var(--text-muted);
  text-align: center;
}

.option-name {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.option-actions {
  display: flex;
  align-items: center;
  margin-left: auto;
  gap: 8px;
  flex-shrink: 0;
}

.option-remove {
  border: none;
  background: none;
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: color 0.2s ease, background-color 0.2s ease;
  white-space: nowrap;
}

.option-remove:hover,
.option-remove:focus {
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.12);
  outline: none;
}

.course-manager-summary {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.course-summary-card {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 18px;
  background: linear-gradient(135deg, rgba(29, 78, 216, 0.12), rgba(8, 145, 178, 0.08));
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.course-summary-card::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(255, 255, 255, 0.35);
  pointer-events: none;
}

.course-summary-label {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(15, 23, 42, 0.65);
  font-weight: 600;
}

.course-summary-value {
  margin: 10px 0 4px;
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}

.course-summary-caption {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.course-manager-dialog {
  width: min(1180px, calc(100% - 32px));
}

.course-manager-content {
  display: grid;
  gap: 20px;
  align-items: stretch;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.course-manager-content .option-panel {
  min-width: 0;
}

.course-manager-dialog .course-manager-content {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1100px) {
  .course-manager-dialog .course-manager-content {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }
}

.option-panel {
  background: rgba(15, 23, 42, 0.02);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

.option-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.option-panel-header h3 {
  margin-bottom: 4px;
}

.option-badge {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.option-badge.is-empty {
  background: rgba(15, 23, 42, 0.06);
  color: var(--text-muted);
  box-shadow: none;
}

.option-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-with-action {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.input-with-action input {
  flex: 1;
}

.option-panel-scroll {
  flex: 1;
  min-height: 200px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: var(--surface-strong);
  overflow-y: auto;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
  max-height: calc(48px * 10);
}

.option-panel-scroll .option-list {
  margin: 0;
  max-height: none;
  border: none;
  overflow: visible;
}

.option-panel-scroll .option-list li {
  padding: 12px 16px;
}

.option-panel-scroll .option-list li.empty {
  padding: 20px;
}

@media (max-width: 640px) {
  .modal-body.course-manager {
    padding-right: 0;
  }

  .option-panel {
    min-height: auto;
  }
}

.notification-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
  z-index: 3000;
}

.notification-overlay.visible {
  opacity: 1;
}

.notification-content {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 22px;
  border-radius: var(--radius-lg);
  background: #ffffff;
  box-shadow: 0 18px 45px -18px rgba(15, 23, 42, 0.35);
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.notification-spinner {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(15, 23, 42, 0.15);
  border-top-color: var(--primary);
  animation: notification-spin 720ms linear infinite;
}

@keyframes notification-spin {
  to {
    transform: rotate(1turn);
  }
}

table {
  width: 100%;
  border-collapse: collapse;
}

@media (min-width: 641px) {
  table {
    min-width: 720px;
  }
}

thead {
  background: rgba(15, 23, 42, 0.04);
  backdrop-filter: blur(8px);
}

thead th {
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

th,
td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  text-align: left;
  background: rgba(255, 255, 255, 0.75);
}

tbody tr:hover td {
  background: rgba(29, 78, 216, 0.05);
}

tbody tr.valid td {
  background: rgba(16, 185, 129, 0.08);
}

tbody tr.expiring td {
  background: rgba(245, 158, 11, 0.1);
}

tbody tr.expired td {
  background: rgba(239, 68, 68, 0.1);
}

tbody tr.employee-terminated td {
  opacity: 0.65;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
}

.status-valid {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
}

.status-expiring {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.status-expired {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.profile-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.employment-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  letter-spacing: 0.01em;
  background: rgba(15, 23, 42, 0.05);
  border-color: rgba(15, 23, 42, 0.08);
  color: var(--text-muted);
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.employment-badge__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4);
}

.employment-badge--terminated {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

.employment-badge--active {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.18);
  color: var(--success);
}

.status-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  padding: 8px 14px;
  background: var(--surface-strong);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.status-toggle:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.status-toggle:hover:not(:disabled) {
  border-color: rgba(29, 78, 216, 0.35);
  box-shadow: 0 8px 20px -16px rgba(29, 78, 216, 0.6);
  transform: translateY(-1px);
}

.status-toggle__indicator {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.status-toggle__indicator[data-status='terminated'] {
  background: var(--danger);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25);
}

.status-toggle--terminated {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--danger);
}

.status-toggle--terminated .status-toggle__indicator {
  background: var(--danger);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25);
}

.status-toggle:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.status-toggle--busy {
  cursor: progress;
  opacity: 0.7;
}

.name-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.name-cell__primary {
  font-weight: 600;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.summary-card {
  padding: 20px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(29, 78, 216, 0.12), rgba(8, 145, 178, 0.1));
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.summary-card h4 {
  margin: 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(15, 23, 42, 0.7);
}

.summary-card strong {
  font-size: 28px;
  font-weight: 700;
}

.list-search-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.list-search-row input,
.list-search-row select {
  border-radius: var(--radius-md);
  border: 1px solid rgba(15, 23, 42, 0.1);
  padding: 10px 12px;
  min-width: 200px;
  flex: 1;
  background: var(--surface-strong);
}

.badge {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.badge.valid {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.25);
  color: var(--success);
}

.badge.expiring {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.25);
  color: var(--warning);
}

.badge.expired {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.25);
  color: var(--danger);
}

.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.profile-meta {
  display: grid;
  gap: 4px;
  color: var(--text-muted);
}

.avatar {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  object-fit: cover;
  border: 3px solid rgba(29, 78, 216, 0.15);
}

.profile-content {
  display: grid;
  gap: 24px;
  margin-top: 24px;
}

.profile-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.profile-forms {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: stretch;
}

.profile-form-card {
  padding: 24px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 18px 32px -24px rgba(15, 23, 42, 0.35);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.profile-tables {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  align-items: stretch;
}

.record-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 28px 24px;
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 26px 42px -32px rgba(15, 23, 42, 0.35);
  min-height: 100%;
  position: relative;
  overflow: hidden;
}

.record-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(29, 78, 216, 0.07), rgba(8, 145, 178, 0.05));
  opacity: 0.35;
  mix-blend-mode: lighten;
}

.record-panel__header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  position: relative;
  z-index: 1;
  flex-wrap: wrap;
}

.record-panel__title h3 {
  margin: 0;
  font-size: 20px;
}

.record-panel__title p {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.record-panel__summary {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: stretch;
}

.record-stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(15, 23, 42, 0.08);
  min-width: 120px;
}

.record-stat__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.record-stat__value {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
}

.record-stat--warning {
  border-color: rgba(245, 158, 11, 0.28);
  background: rgba(245, 158, 11, 0.12);
}

.record-stat--danger {
  border-color: rgba(239, 68, 68, 0.28);
  background: rgba(239, 68, 68, 0.12);
}

.record-panel__list {
  display: grid;
  gap: 18px;
  position: relative;
  z-index: 1;
}

.record-panel__empty {
  display: none;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  text-align: center;
  padding: 36px 24px;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(15, 23, 42, 0.14);
  background: rgba(255, 255, 255, 0.7);
  color: var(--text-muted);
  position: relative;
  z-index: 1;
}

.record-panel__empty.is-visible {
  display: flex;
}

.record-panel__empty h4 {
  margin: 0;
  font-size: 18px;
  color: var(--text);
}

.record-panel__empty p {
  margin: 4px 0 0;
  max-width: 320px;
}

.record-panel__empty-icon {
  font-size: 36px;
}

.record-card {
  position: relative;
  padding: 22px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 24px 48px -32px rgba(15, 23, 42, 0.4);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.record-card--valid {
  border-color: rgba(16, 185, 129, 0.22);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(255, 255, 255, 0.9));
}

.record-card--expiring {
  border-color: rgba(245, 158, 11, 0.32);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(255, 255, 255, 0.9));
}

.record-card--expired {
  border-color: rgba(239, 68, 68, 0.32);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.16), rgba(255, 255, 255, 0.92));
}

.record-card__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.record-card__eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  font-weight: 600;
}

.record-card__title {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
}

.record-card__meta {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.record-card__meta-item {
  display: grid;
  gap: 6px;
}

.record-card__meta-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.record-card__meta-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  word-break: break-word;
}

.record-card__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.record-card__actions .btn {
  flex: 0 1 auto;
  min-width: 120px;
}

.record-panel .badge {
  font-size: 12px;
}

@media (max-width: 720px) {
  .record-panel {
    padding: 24px 20px;
  }

  .record-card {
    padding: 20px 18px;
  }

  .record-card__actions {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .record-panel__summary {
    width: 100%;
  }

  .record-card__actions .btn {
    min-width: 100%;
  }
}

.searchable-select {
  position: relative;
  width: 100%;
}

.searchable-select__source {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.searchable-select__button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  transition: border 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.searchable-select__button:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.15);
  background: #fff;
}

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

.searchable-select__dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: var(--radius-md);
  box-shadow: 0 18px 32px -24px rgba(15, 23, 42, 0.35);
  padding: 8px;
  display: none;
  z-index: 20;
}

.searchable-select.open .searchable-select__dropdown {
  display: block;
}

.searchable-select__search {
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(15, 23, 42, 0.12);
  margin-bottom: 6px;
}

.searchable-select__options {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 220px;
  overflow-y: auto;
  display: grid;
  gap: 4px;
}

.searchable-select__option,
.searchable-select__empty {
  padding: 8px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.searchable-select__option:hover {
  background: rgba(29, 78, 216, 0.1);
}

.searchable-select__option.is-selected {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

.searchable-select__option.is-placeholder {
  font-style: italic;
  color: var(--text-muted);
}

.searchable-select__option.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.searchable-select__empty {
  color: var(--text-muted);
  cursor: default;
}

.filter-input--select.has-searchable::after {
  display: none;
}

.filter-input--select.has-searchable .searchable-select__button {
  padding-left: 46px;
}

.form-field .searchable-select__button {
  background: var(--surface-strong);
}

.form-field .searchable-select__button:focus {
  background: #fff;
}

.form-field .searchable-select.open .searchable-select__dropdown {
  border-color: rgba(29, 78, 216, 0.2);
}

.training-actions,
.pto-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 12px;
  margin-bottom: 4px;
}

.training-actions .btn,
.pto-actions .btn {
  flex: 1 1 140px;
  min-height: 44px;
}

@media (max-width: 900px) {
  .profile-forms {
    grid-template-columns: 1fr;
  }

  .profile-form-card {
    max-width: 100%;
  }
}

@media (max-width: 520px) {
  .training-actions .btn,
  .pto-actions .btn {
    flex-basis: 100%;
  }
}

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

.footer-note {
  font-size: 12px;
  color: var(--text-muted);
}

.page {
  display: none;
}

.page.active {
  display: block;
}

@media (max-width: 1024px) {
  .app-shell {
    flex-direction: column;
  }

  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(360px, 88vw);
    border-right: none;
    border-bottom: none;
    transform: translateX(-100%);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: none;
    padding: 32px 24px 40px;
    overflow-y: auto;
    z-index: 950;
    -webkit-overflow-scrolling: touch;
  }

  .filter-panel {
    flex: 1 1 auto;
    min-height: 0;
  }

  .filter-panel__content {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-right: 6px;
    margin-right: -6px;
    min-height: 0;
  }

  body.sidebar-open .app-sidebar {
    transform: translateX(0);
    box-shadow: 0 32px 48px -24px rgba(15, 23, 42, 0.55);
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 900;
  }

  body.sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar-toggle {
    display: inline-flex;
  }

  .app-header {
    padding: 24px 24px 0;
  }

  .app-header__title {
    flex: 1 1 100%;
  }

  .header-actions {
    flex: 1 1 100%;
    justify-content: flex-start;
  }

  .user-dropdown {
    width: 100%;
  }

  .user-dropdown-toggle {
    width: 100%;
    justify-content: space-between;
  }

  .filter-panel {
    margin-bottom: 16px;
  }

  .filter-panel__fields {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

  .filter-panel__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-panel__actions .btn {
    width: 100%;
  }

  .main-content {
    padding: 20px 24px 32px;
  }

  .main-content::before {
    display: none;
  }

  .user-dropdown-menu {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(320px, 88vw);
    border-radius: 0;
    box-shadow: none;
    padding: 32px 24px 32px;
    background: var(--surface-strong);
    gap: 10px;
    overflow-y: auto;
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 2000;
  }

  body.admin-menu-open .user-dropdown-menu {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
    box-shadow: -32px 0 48px -24px rgba(15, 23, 42, 0.55);
  }

  .admin-menu-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1500;
  }

  body.admin-menu-open .admin-menu-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .admin-menu-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
  }

  .admin-menu-mobile-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
  }

  .admin-menu-mobile-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
  }

  .admin-menu-mobile-subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
  }

  .admin-menu-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    display: grid;
    place-items: center;
    padding: 0;
    transition: background 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
  }

  .admin-menu-close:hover,
  .admin-menu-close:focus-visible {
    background: rgba(15, 23, 42, 0.08);
    color: var(--text);
  }

  .admin-menu-close:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
  }
}

@media (max-width: 640px) {
  .app-header {
    padding: 20px 18px 0;
  }

  .app-header h1 {
    font-size: 22px;
  }

  .sidebar-toggle {
    width: 100%;
    justify-content: center;
  }

  .app-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .filter-panel__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .filter-panel__toggle {
    width: 100%;
    justify-content: center;
  }

  .filter-panel__fields {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 20px;
  }

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

  .header-actions {
    width: 100%;
  }

  .header-actions .btn {
    flex: 1 1 auto;
  }

  .page-section-header {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 12px;
  }

  .page-section-actions {
    width: 100%;
    justify-content: flex-start;
    gap: 10px;
  }

  .page-section-actions .btn {
    width: 100%;
  }

  .user-dropdown-menu {
    left: auto;
    right: 0;
    width: min(360px, 92vw);
    max-width: 100%;
    transform: translateX(100%);
    padding: 28px 20px 32px;
  }

  .user-dropdown.open .user-dropdown-menu,
  body.admin-menu-open .user-dropdown-menu {
    transform: translateX(0);
  }

  .summary-grid,
  .course-manager-summary {
    grid-template-columns: 1fr;
  }

  .profile-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .main-content {
    padding: 18px 18px 28px;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
  }

  .main-content > .card {
    width: 100%;
    max-width: 520px;
    margin-inline: auto;
  }

  .auth-shell {
    padding: 40px 18px;
  }

  .auth-card {
    padding: 24px;
  }

  .list-search-row {
    flex-direction: column;
  }

  .table-wrapper {
    border-radius: var(--radius-lg);
    overflow: visible;
  }

  table {
    min-width: 100%;
    table-layout: fixed;
  }

  th,
  td {
    padding: 12px 10px;
    white-space: normal;
    word-break: break-word;
  }

  thead th {
    font-size: 12px;
  }

  .responsive-table {
    border-collapse: separate;
    border-spacing: 0;
  }

  .responsive-table thead {
    display: none;
  }

  .responsive-table tbody {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
  }

  .responsive-table tr {
    display: block;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
  }

  .responsive-table tr.valid {
    border-left: 4px solid var(--success);
  }

  .responsive-table tr.expiring {
    border-left: 4px solid var(--warning);
  }

  .responsive-table tr.expired {
    border-left: 4px solid var(--danger);
  }

  .responsive-table tr.valid td,
  .responsive-table tr.expiring td,
  .responsive-table tr.expired td {
    background: transparent;
  }

  .responsive-table td {
    display: grid;
    grid-template-columns: max-content 1fr;
    align-items: start;
    gap: 10px;
    padding: 12px 16px;
    border: 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    background: transparent;
  }

  .responsive-table td:last-child {
    border-bottom: none;
  }

  .responsive-table td::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
  }

  .responsive-table td.cell-photo {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .responsive-table td.cell-photo::before {
    margin-bottom: 6px;
  }

  .responsive-table td.cell-photo img {
    width: 64px;
    height: 64px;
    border-radius: 12px;
  }

  .responsive-table td.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .responsive-table td.actions::before {
    flex-basis: 100%;
    margin-bottom: 4px;
  }

  .responsive-table td.actions .btn {
    flex: 1 1 120px;
    justify-content: center;
    min-width: 120px;
  }

}
@media (max-width: 640px) {
  .notification-rules-table {
    display: none !important;
  }
}
/* Notification rules table refinements */
.notification-rules-table table {
  min-width: 0;
  width: 100%;
}

.notification-rules-table table th,
.notification-rules-table table td {
  padding: 14px 16px;
  vertical-align: middle;
}

.notification-rules-table table thead th {
  background: rgba(15, 23, 42, 0.05);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(15, 23, 42, 0.58);
}

.notification-rules-table table tbody td {
  color: var(--text);
}

.notification-rules-table table tbody tr + tr td {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.notification-rules-table table .notification-empty-row td {
  padding: 26px 18px;
  text-align: center;
  font-style: italic;
  color: rgba(15, 23, 42, 0.52);
  background: rgba(15, 23, 42, 0.02);
}

.dashboard-modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 9999;
  padding: 16px;
}

.dashboard-modal-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.dashboard-modal-container {
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.dashboard-modal-overlay.visible .dashboard-modal-container {
  pointer-events: auto;
}

.dashboard-modal {
  width: min(440px, 100%);
  max-height: 90vh;
  background: var(--surface-strong);
  color: var(--text);
  border-radius: 18px;
  box-shadow: 0 28px 64px -20px rgba(15, 23, 42, 0.45);
  padding: 28px 28px 24px;
  display: grid;
  gap: 18px;
  transform: translateY(20px);
  transition: transform 0.22s ease;
  overflow: hidden;
}

.dashboard-modal-overlay.visible .dashboard-modal {
  transform: translateY(0);
}

.dashboard-modal-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(29, 78, 216, 0.14);
  color: var(--brand);
}

.dashboard-modal-icon svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.dashboard-modal-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dashboard-modal-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.dashboard-modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 55vh;
  overflow: auto;
}

.dashboard-modal-message {
  margin: 0;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
}

.dashboard-modal-prompt {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dashboard-modal-input {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  padding: 10px 12px;
  font-size: 15px;
}

.dashboard-modal-input:focus {
  outline: 2px solid rgba(29, 78, 216, 0.35);
  outline-offset: 2px;
}

.dashboard-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.dashboard-modal-actions .btn {
  min-width: 108px;
}

.dashboard-modal[data-type="success"] .dashboard-modal-icon {
  background: rgba(16, 185, 129, 0.18);
  color: var(--success);
}

.dashboard-modal[data-type="warning"] .dashboard-modal-icon {
  background: rgba(245, 158, 11, 0.18);
  color: var(--warning);
}

.dashboard-modal[data-type="danger"] .dashboard-modal-icon,
.dashboard-modal[data-type="error"] .dashboard-modal-icon {
  background: rgba(239, 68, 68, 0.18);
  color: var(--danger);
}

.dashboard-modal[data-type="success"] .dashboard-modal-title {
  color: #0f9d74;
}

.dashboard-modal[data-type="warning"] .dashboard-modal-title {
  color: #c27803;
}

.dashboard-modal[data-type="danger"] .dashboard-modal-title,
.dashboard-modal[data-type="error"] .dashboard-modal-title {
  color: #dc2626;
}

.dashboard-modal[data-type="danger"] .btn-primary,
.dashboard-modal[data-type="danger"] .btn.btn-primary,
.dashboard-modal[data-type="danger"] .btn.btn-danger {
  background: rgba(239, 68, 68, 0.18);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.dashboard-modal[data-type="danger"] .btn-primary:hover,
.dashboard-modal[data-type="danger"] .btn.btn-primary:hover,
.dashboard-modal[data-type="danger"] .btn.btn-danger:hover {
  background: rgba(239, 68, 68, 0.26);
}

@media (max-width: 520px) {
  .dashboard-modal {
    padding: 24px 20px 20px;
    border-radius: 16px;
  }

  .dashboard-modal-actions {
    flex-direction: column;
    align-items: stretch;
  }

.dashboard-modal-actions .btn {
    width: 100%;
  }
}

/* Access card editor */
.card-editor {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
}

.card-editor__preview {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.04), rgba(15, 23, 42, 0.02));
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  padding: 16px;
}

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

.card-preview-face {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 14px 35px rgba(15, 23, 42, 0.14);
  border: 1px solid rgba(15, 23, 42, 0.08);
  padding: 10px;
  position: relative;
  overflow: hidden;
}

.card-preview-face .badge {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 12px;
}

.card-preview-face .ribbon {
  position: absolute;
  right: 12px;
  top: 12px;
  padding: 10px 8px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 12px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.card-preview-inner {
  background: #fff;
  border-radius: 10px;
  padding: 10px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 210px;
}

.card-preview-header {
  display: flex;
  gap: 10px;
  align-items: center;
}

.card-preview-identity {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  padding: 8px;
}

.card-preview-identity .label {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
}

.card-preview-identity .value {
  font-weight: 800;
  font-size: 13px;
  color: #0f172a;
}

.card-preview-photo {
  width: 92px;
  height: 110px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  background: #e2e8f0;
}

.card-preview-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-preview-info {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.card-preview-pill {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  padding: 6px 8px;
  background: #f8fafc;
}

.card-preview-pill .label {
  font-size: 11px;
  color: #475569;
  text-transform: uppercase;
  font-weight: 700;
}

.card-preview-pill .value {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.card-preview-table {
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 12px;
  overflow: hidden;
}

.card-preview-table .head {
  display: grid;
  grid-template-columns: 1fr 0.32fr 0.32fr;
  background: rgba(15, 23, 42, 0.05);
  font-weight: 800;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #475569;
}

.card-preview-table .head div {
  padding: 8px 10px;
}

.card-preview-row {
  display: grid;
  grid-template-columns: 1fr 0.32fr 0.32fr;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.card-preview-row .cell {
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
}

.card-preview-row .cell.label {
  background: rgba(15, 23, 42, 0.02);
}

.card-preview-row.muted .cell {
  color: #6b7280;
}

.card-preview-row.warn .cell.expiry {
  color: #d97706;
}

.card-preview-row.bad .cell.expiry {
  color: #b91c1c;
}

.card-preview-row.good .cell.expiry {
  color: #0f6b3d;
}

.card-preview-legend {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.card-preview-chip {
  border-radius: 8px;
  padding: 6px 8px;
  font-weight: 700;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(15, 23, 42, 0.1);
}

.card-preview-chip .dot {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  border: 1px solid rgba(15, 23, 42, 0.2);
}

.card-preview-tagline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
}

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

.card-editor-panel {
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.06);
}

.card-editor-panel h4 {
  margin: 0 0 8px;
}

.card-editor-subtitle {
  margin: 0 0 8px;
  color: #475569;
  font-weight: 600;
  font-size: 12px;
}

.card-editor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.card-editor-panel label {
  font-weight: 700;
  font-size: 12px;
  color: #475569;
}

.card-editor-panel input[type="text"],
.card-editor-panel input[type="number"],
.card-editor-panel input[type="color"] {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  padding: 8px;
  font-weight: 600;
  color: #0f172a;
  background: #f8fafc;
}

.card-editor-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-editor-row {
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 10px;
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f9fafb;
}

.card-editor-row.dragging {
  opacity: 0.6;
  border-style: dashed;
}

.card-editor-handle {
  width: 20px;
  height: 20px;
  border-radius: 8px;
  background: #e2e8f0;
  border: 1px solid rgba(15, 23, 42, 0.1);
  display: grid;
  place-items: center;
  cursor: grab;
}

.card-editor-row strong {
  display: block;
}

.card-editor-row small {
  color: #475569;
  font-weight: 600;
}

.card-editor-row .badge {
  font-size: 10px;
  padding: 4px 6px;
  border-radius: 8px;
  background: #e2e8f0;
  color: #0f172a;
}

.card-editor-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.card-editor-form .wide {
  grid-column: 1 / -1;
}

.card-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.card-editor-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 0;
}

.card-editor-chip {
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #1d4ed8;
  font-weight: 700;
  font-size: 12px;
  border: 1px solid rgba(37, 99, 235, 0.25);
  cursor: pointer;
}

.card-editor-chip:hover {
  background: #e0e7ff;
}

.card-canvas-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.card-canvas {
  position: relative;
  aspect-ratio: 85.6 / 54;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(37, 99, 235, 0.08), rgba(14, 165, 233, 0.04));
  border: 1px dashed rgba(15, 23, 42, 0.2);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.4), 0 10px 28px rgba(15,23,42,0.08);
}

.card-layer {
  position: absolute;
  border: 1px dashed transparent;
  cursor: move;
  user-select: none;
  border-radius: 12px;
  padding: 8px 10px;
  background: linear-gradient(145deg, rgba(255,255,255,0.98), rgba(248,250,252,0.92));
  box-shadow: 0 12px 28px rgba(15,23,42,0.12);
  font-weight: 700;
  color: #0f172a;
  min-height: 32px;
  min-width: 120px;
  max-width: 240px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  pointer-events: auto;
  touch-action: none;
}

.card-layer.active {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37,99,235,0.18);
}

.card-layer[data-type="photo"] {
  padding: 0;
  background: #e5e7eb;
  overflow: hidden;
}

.card-layer[data-type="photo"] img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-layer {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.card-layer .layer-label {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  display: block;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.card-layer .layer-value {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
}

.card-layer.layer-text {
  border: 1px solid rgba(15, 23, 42, 0.08);
  min-width: 120px;
  max-width: 220px;
}

.card-layer.layer-photo {
  padding: 0;
  background: #e2e8f0;
  border: 1px solid rgba(15,23,42,0.12);
  box-shadow: 0 12px 28px rgba(15,23,42,0.14);
  border-radius: 14px;
  overflow: hidden;
}

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

.card-layer.layer-block {
  background: linear-gradient(145deg, rgba(37,99,235,0.12), rgba(14,165,233,0.1));
  border: 1px solid rgba(15,23,42,0.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5), 0 10px 24px rgba(15,23,42,0.12);
}

.card-layer.layer-line {
  padding: 0;
  background: #0f172a;
  border-radius: 999px;
  box-shadow: none;
  min-height: 2px;
  cursor: grab;
}

.layer-resize {
  position: absolute;
  width: 12px;
  height: 12px;
  right: -6px;
  bottom: -6px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #2563eb;
  box-shadow: 0 4px 8px rgba(0,0,0,0.12);
  cursor: nwse-resize;
  z-index: 2;
}

/* Mirror styling for preview/print layers */
.layer {
  position: absolute;
  border-radius: 12px;
  padding: 8px 10px;
  background: linear-gradient(145deg, rgba(255,255,255,0.98), rgba(248,250,252,0.92));
  box-shadow: 0 12px 28px rgba(15,23,42,0.12);
  font-weight: 700;
  color: #0f172a;
  min-height: 32px;
  min-width: 120px;
  max-width: 240px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  pointer-events: auto;
  touch-action: none;
  cursor: grab;
}

.layer .label {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 2px;
}

.layer .value {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
}

.layer.photo,
.layer-photo {
  padding: 0;
  background: #e2e8f0;
  border: 1px solid rgba(15,23,42,0.12);
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(15,23,42,0.14);
  overflow: hidden;
}

.card-layer.layer-photo .layer-resize,
.layer.photo .layer-resize,
.layer-photo .layer-resize {
  right: 4px;
  bottom: 4px;
  z-index: 3;
}

.layer-block {
  background: linear-gradient(145deg, rgba(37,99,235,0.12), rgba(14,165,233,0.1));
  border: 1px solid rgba(15,23,42,0.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5), 0 10px 24px rgba(15,23,42,0.12);
  border-radius: 12px;
}

.layer-line,
.layer.line {
  padding: 0;
  background: #0f172a;
  border-radius: 999px;
  box-shadow: none;
  min-height: 2px;
}

.layer.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 12px;
}

.layer.block {
  background: linear-gradient(145deg, rgba(37,99,235,0.12), rgba(14,165,233,0.1));
  border: 1px solid rgba(15,23,42,0.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5), 0 10px 24px rgba(15,23,42,0.12);
}

.layer.line {
  padding: 0;
  background: #0f172a;
  border-radius: 999px;
  box-shadow: none;
}

.layer-toolbar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.layer-toolbar button {
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 700;
}

.layer-toolbar button:hover {
  border-color: #2563eb;
  color: #2563eb;
}

@media (max-width: 1100px) {
  .card-editor {
    grid-template-columns: 1fr;
  }
}
