/* ===================================================================
   job_match custom theme
   Purple SaaS look on top of Bootstrap 5.3. Bootstrap already ships a
   native [data-bs-theme="dark"] mode built on CSS variables; we hook
   into that same attribute instead of inventing a second mechanism,
   then layer our own brand tokens (--brand-*, --surface-*, --shadow-*)
   on top for the parts Bootstrap's variables don't reach (navbar,
   card elevation, table wrappers, focus rings, etc).
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* ---- Brand ---- */
  --brand-50:  #F5F3FF;
  --brand-100: #EDE9FE;
  --brand-200: #DDD6FE;
  --brand-400: #A78BFA;
  --brand-500: #8B5CF6;
  --brand-600: #7C3AED;
  --brand-700: #6D28D9;
  --brand-rgb: 124, 58, 237;

  /* ---- Surfaces / text (light) ---- */
  --page-bg: #F7F7FB;
  --surface: #FFFFFF;
  --surface-raised: #FFFFFF;
  --surface-muted: #F3F1FA;
  --text-strong: #16121F;
  --text-body: #3F3B4A;
  --text-muted: #6E6A7C;
  --border-color: #E6E3EF;
  --border-color-soft: #EEEBF6;

  --shadow-sm: 0 1px 2px rgba(23, 15, 46, 0.06);
  --shadow-md: 0 6px 20px rgba(23, 15, 46, 0.08);
  --shadow-lg: 0 16px 40px rgba(23, 15, 46, 0.12);

  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;

  color-scheme: light;

  /* ---- Bootstrap variable overrides (component CSS already consumes these) ---- */
  --bs-font-sans-serif: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-body-font-family: var(--bs-font-sans-serif);
  --bs-body-bg: var(--page-bg);
  --bs-body-color: var(--text-body);
  --bs-emphasis-color: var(--text-strong);
  --bs-secondary-color: var(--text-muted);
  --bs-border-color: var(--border-color);
  --bs-border-color-translucent: var(--border-color);
  --bs-border-radius: var(--radius-sm);
  --bs-border-radius-lg: var(--radius-md);
  --bs-border-radius-sm: 0.4rem;
  --bs-primary: var(--brand-600);
  --bs-primary-rgb: var(--brand-rgb);
  --bs-link-color: var(--brand-600);
  --bs-link-color-rgb: var(--brand-rgb);
  --bs-link-hover-color: var(--brand-700);
  --bs-focus-ring-color: rgba(var(--brand-rgb), 0.25);
}

[data-bs-theme="dark"] {
  color-scheme: dark;

  --page-bg: #121016;
  --surface: #1A1720;
  --surface-raised: #201C29;
  --surface-muted: #251F30;
  --text-strong: #F4F2F9;
  --text-body: #D9D5E3;
  --text-muted: #A29DB4;
  --border-color: #322C3D;
  --border-color-soft: #2A2533;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 24px rgba(0, 0, 0, 0.38);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.5);

  --brand-600: #8B5CF6;
  --brand-700: #A78BFA;
  --brand-rgb: 139, 92, 246;

  --bs-body-bg: var(--page-bg);
  --bs-body-color: var(--text-body);
  --bs-emphasis-color: var(--text-strong);
  --bs-secondary-color: var(--text-muted);
  --bs-border-color: var(--border-color);
  --bs-border-color-translucent: var(--border-color);
  --bs-primary: var(--brand-600);
  --bs-primary-rgb: var(--brand-rgb);
  --bs-link-color: var(--brand-400);
  --bs-link-color-rgb: 167, 139, 250;
  --bs-link-hover-color: #C4B5FD;
  --bs-focus-ring-color: rgba(var(--brand-rgb), 0.35);
}

/* ===================== Base / typography ===================== */

* {
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

html, body {
  min-height: 100%;
}

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-strong);
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1, .h1 { font-size: 2rem; }
h1.display-4 { font-weight: 800; }

p { color: var(--text-body); }

a { text-decoration: none; }
a:hover { text-decoration: none; }

code {
  background: var(--surface-muted);
  color: var(--brand-700);
  padding: 0.15rem 0.4rem;
  border-radius: 0.35rem;
  font-size: 0.85em;
}

::selection {
  background: var(--brand-200);
}

/* Scrollbar polish (non-essential, harmless where unsupported) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===================== App shell / sidebar layout ===================== */

:root {
  --sidebar-width: 264px;
  --sidebar-collapsed-width: 76px;
  --topbar-height: 60px;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 800;
  font-size: 1.28rem;
  color: var(--text-strong) !important;
  letter-spacing: -0.03em;
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.app-brand-text {
  white-space: nowrap;
}

.app-brand-accent {
  color: var(--brand-600);
}

.app-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 0.6rem;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: 0 4px 12px rgba(var(--brand-rgb), 0.35);
}

/* ---- Sidebar ---- */

.app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  max-width: 86vw;
  background: var(--surface);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transform: translateX(-100%);
  transition: transform 0.25s ease, width 0.25s ease;
}

.app-sidebar.open {
  transform: translateX(0);
  box-shadow: var(--shadow-lg);
}

.sidebar-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.35rem 1.25rem 1.1rem;
  flex-shrink: 0;
}

.sidebar-nav {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0.5rem 0.9rem 1rem;
}

.sidebar-group + .sidebar-group {
  margin-top: 1.4rem;
}

.sidebar-group-label {
  padding: 0 0.6rem;
  margin-bottom: 0.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0.75;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.7rem;
  margin-bottom: 0.15rem;
  border-radius: var(--radius-sm);
  color: var(--text-body);
  font-weight: 500;
  font-size: 0.9rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.sidebar-link .sidebar-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.sidebar-link span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-link:hover {
  background: var(--brand-50);
  color: var(--brand-700);
}
.sidebar-link:hover .sidebar-icon { color: var(--brand-700); }

[data-bs-theme="dark"] .sidebar-link:hover {
  background: rgba(var(--brand-rgb), 0.14);
}

.sidebar-link.active {
  background: var(--brand-100);
  color: var(--brand-700);
  font-weight: 700;
}
.sidebar-link.active .sidebar-icon { color: var(--brand-700); }

[data-bs-theme="dark"] .sidebar-link.active {
  background: rgba(var(--brand-rgb), 0.22);
  color: var(--brand-400);
}
[data-bs-theme="dark"] .sidebar-link.active .sidebar-icon { color: var(--brand-400); }

.sidebar-link:focus-visible,
.icon-btn:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
}

/* ---- Sidebar footer (user chip / theme toggle / logout) ---- */

.sidebar-footer {
  border-top: 1px solid var(--border-color);
  padding: 1rem 1.1rem 1.15rem;
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.9rem;
}

.sidebar-user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
}

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

.sidebar-user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-role-badge {
  display: inline-block;
  width: fit-content;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--brand-100);
  color: var(--brand-700);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 0.25rem;
}

[data-bs-theme="dark"] .app-role-badge {
  background: rgba(var(--brand-rgb), 0.2);
  color: var(--brand-400);
}

.sidebar-footer-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-footer-actions form,
.sidebar-footer-actions .btn {
  flex: 1 1 auto;
  margin: 0;
}

.sidebar-footer-actions .theme-toggle-btn {
  flex: 0 0 auto;
}

.sidebar-footer-actions.stacked {
  flex-direction: column;
  align-items: stretch;
}

.sidebar-footer-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.sidebar-footer-btn .sidebar-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

#sidebarCollapseToggle svg {
  transition: transform 0.2s ease;
}

html[data-sidebar="collapsed"] #sidebarCollapseToggle svg {
  transform: rotate(180deg);
}

/* Theme toggle switch */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--surface-muted);
  color: var(--text-body);
  cursor: pointer;
}

.theme-toggle-btn:hover {
  background: var(--brand-50);
  color: var(--brand-700);
  border-color: var(--brand-200);
}

[data-bs-theme="dark"] .theme-toggle-btn:hover {
  background: rgba(var(--brand-rgb), 0.16);
}

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

.theme-toggle-btn .icon-moon { display: none; }
[data-bs-theme="dark"] .theme-toggle-btn .icon-sun { display: none; }
[data-bs-theme="dark"] .theme-toggle-btn .icon-moon { display: inline-block; }

/* ---- Mobile top bar ---- */

.mobile-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1rem;
  z-index: 1030;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-body);
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--surface-muted);
  color: var(--brand-700);
}

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

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 8, 16, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 1035;
}

.sidebar-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

body.sidebar-open-lock {
  overflow: hidden;
}

/* ---- Content area ---- */

.app-content-area {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.25s ease;
}

/* Direct flex child of .app-content-area: grows to fill any leftover viewport
   height so .app-footer is pushed to (and stays at) the bottom on short pages,
   while still expanding naturally when content is taller than the viewport. */
.app-content-wrapper {
  flex: 1 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
}

main.app-main {
  flex: 1 0 auto;
  padding-top: 2.5rem;
  padding-bottom: 3rem;
}

.container {
  max-width: 1200px;
}

@media (max-width: 991.98px) {
  .app-content-area {
    padding-top: var(--topbar-height);
  }
}

@media (min-width: 992px) {
  .mobile-topbar,
  .sidebar-overlay {
    display: none;
  }

  .app-sidebar {
    transform: none;
  }

  .app-content-area {
    margin-left: var(--sidebar-width);
  }

  /* ---- Collapsed rail mode (desktop only) ---- */

  html[data-sidebar="collapsed"] .app-sidebar {
    width: var(--sidebar-collapsed-width);
  }

  html[data-sidebar="collapsed"] .app-content-area {
    margin-left: var(--sidebar-collapsed-width);
  }

  html[data-sidebar="collapsed"] .sidebar-brand-row {
    flex-direction: column;
    gap: 0.6rem;
    padding: 1.1rem 0.5rem 0.9rem;
  }

  html[data-sidebar="collapsed"] .sidebar-brand-row .app-brand-text {
    display: none;
  }

  html[data-sidebar="collapsed"] .sidebar-nav {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  html[data-sidebar="collapsed"] .sidebar-group-label {
    display: none;
  }

  html[data-sidebar="collapsed"] .sidebar-link {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
  }

  html[data-sidebar="collapsed"] .sidebar-link span {
    display: none;
  }

  html[data-sidebar="collapsed"] .sidebar-footer {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  html[data-sidebar="collapsed"] .sidebar-user {
    justify-content: center;
  }

  html[data-sidebar="collapsed"] .sidebar-user-info {
    display: none;
  }

  html[data-sidebar="collapsed"] .sidebar-footer-actions {
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
  }

  html[data-sidebar="collapsed"] .sidebar-footer-actions .btn,
  html[data-sidebar="collapsed"] .sidebar-footer-actions form {
    flex: 0 0 auto;
    width: 38px;
  }

  html[data-sidebar="collapsed"] .sidebar-footer-actions .btn {
    height: 38px;
    padding: 0;
    border-radius: 999px;
  }

  html[data-sidebar="collapsed"] .sidebar-footer-btn span {
    display: none;
  }
}

/* ===================== Notification bell ===================== */

.notification-bell {
  position: relative;
}

.notification-bell-toggle {
  position: relative;
}

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

.notification-bell-toggle::after {
  display: none;
}

.notification-bell-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: 999px;
  background: var(--brand-600);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--surface);
}

.notification-bell-menu {
  width: 320px;
  max-width: 90vw;
  padding: 0;
  overflow: hidden;
  border-color: var(--border-color-soft);
  box-shadow: var(--shadow-lg);
}

.notification-bell-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color-soft);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-strong);
}

.notification-bell-mark-all {
  border: none;
  background: none;
  color: var(--brand-600);
  font-weight: 600;
  font-size: 0.78rem;
  padding: 0;
  cursor: pointer;
}

.notification-bell-mark-all:hover {
  color: var(--brand-700);
  text-decoration: underline;
}

.notification-bell-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border-color-soft);
  color: var(--text-body);
  white-space: normal;
}

.notification-bell-item:last-child {
  border-bottom: none;
}

.notification-bell-item:hover {
  background: var(--surface-muted);
  color: var(--text-body);
}

.notification-bell-item.unread {
  background: var(--brand-50);
}

[data-bs-theme="dark"] .notification-bell-item.unread {
  background: rgba(var(--brand-rgb), 0.12);
}

.notification-bell-item.unread:hover {
  background: var(--brand-100);
}

[data-bs-theme="dark"] .notification-bell-item.unread:hover {
  background: rgba(var(--brand-rgb), 0.2);
}

.notification-bell-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  margin-top: 0.35rem;
  border-radius: 999px;
  background: var(--brand-500);
  visibility: hidden;
}

.notification-bell-item.unread .notification-bell-dot {
  visibility: visible;
}

.notification-bell-message {
  display: block;
  font-size: 0.85rem;
  line-height: 1.4;
}

.notification-bell-time {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.notification-bell-empty {
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ===================== Buttons ===================== */

.btn {
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 0.5rem 1.1rem;
  letter-spacing: 0.01em;
}

.btn-sm { padding: 0.32rem 0.75rem; border-radius: 0.45rem; }

.btn-primary {
  --bs-btn-bg: var(--brand-600);
  --bs-btn-border-color: var(--brand-600);
  --bs-btn-hover-bg: var(--brand-700);
  --bs-btn-hover-border-color: var(--brand-700);
  --bs-btn-active-bg: var(--brand-700);
  --bs-btn-active-border-color: var(--brand-700);
  --bs-btn-disabled-bg: var(--brand-600);
  --bs-btn-disabled-border-color: var(--brand-600);
  --bs-btn-focus-shadow-rgb: var(--brand-rgb);
  box-shadow: 0 2px 8px rgba(var(--brand-rgb), 0.28);
}

.btn-primary {
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.btn-primary:hover {
  box-shadow: 0 4px 14px rgba(var(--brand-rgb), 0.36);
  transform: translateY(-1px);
}

.btn-outline-primary {
  --bs-btn-color: var(--brand-600);
  --bs-btn-border-color: var(--brand-600);
  --bs-btn-hover-bg: var(--brand-600);
  --bs-btn-hover-border-color: var(--brand-600);
  --bs-btn-active-bg: var(--brand-700);
  --bs-btn-active-border-color: var(--brand-700);
}

.btn-outline-secondary {
  --bs-btn-color: var(--text-body);
  --bs-btn-border-color: var(--border-color);
  --bs-btn-hover-bg: var(--surface-muted);
  --bs-btn-hover-color: var(--text-strong);
  --bs-btn-hover-border-color: var(--border-color);
}

.btn-outline-success,
.btn-outline-danger {
  font-weight: 600;
}

.btn-link {
  color: var(--brand-600);
  font-weight: 600;
}
.btn-link:hover { color: var(--brand-700); }

.btn:focus-visible,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.2rem rgba(var(--brand-rgb), 0.22);
}

/* ===================== Cards ===================== */

.card {
  --bs-card-bg: var(--surface);
  --bs-card-border-color: var(--border-color-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.card.h-100:hover,
a.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-title {
  color: var(--text-strong);
  font-weight: 700;
}

.card-subtitle {
  color: var(--text-muted) !important;
}

/* ===================== Forms ===================== */

.form-label {
  font-weight: 600;
  color: var(--text-strong);
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.form-control,
.form-select {
  background-color: var(--surface);
  color: var(--text-body);
  border-color: var(--border-color);
  padding: 0.55rem 0.85rem;
}

.form-control::placeholder {
  color: var(--text-muted);
  opacity: 0.8;
}

.form-control:disabled,
.form-select:disabled {
  background-color: var(--surface-muted);
  opacity: 0.75;
}

/* ---- Password visibility toggle ---- */

.password-field {
  position: relative;
}

.password-field .form-control {
  padding-right: 2.75rem;
}

.password-toggle-btn {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.password-toggle-btn:hover {
  color: var(--brand-700);
  background: var(--surface-muted);
}

[data-bs-theme="dark"] .password-toggle-btn:hover {
  background: rgba(var(--brand-rgb), 0.16);
}

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

.password-toggle-btn svg {
  width: 18px;
  height: 18px;
}

.password-toggle-btn .icon-eye-off { display: none; }
.password-toggle-btn.is-visible .icon-eye { display: none; }
.password-toggle-btn.is-visible .icon-eye-off { display: inline-block; }

.form-check-input {
  border-color: var(--border-color);
}

.form-check-input:checked {
  background-color: var(--brand-600);
  border-color: var(--brand-600);
}

.form-text {
  color: var(--text-muted);
}

.input-group-text {
  background: var(--surface-muted);
  border-color: var(--border-color);
  color: var(--text-muted);
}

/* ===================== Validation ===================== */

.input-validation-error {
  border-color: #DC2626 !important;
}

.input-validation-error:focus {
  box-shadow: 0 0 0 0.2rem rgba(220, 38, 38, 0.2) !important;
}

.field-validation-error {
  display: block;
  color: #DC2626;
  font-size: 0.82rem;
  margin-top: 0.35rem;
}

.validation-summary-errors {
  color: #DC2626;
  font-size: 0.85rem;
}

.validation-summary-errors ul {
  margin: 0;
  padding-left: 1.1rem;
}

/* ===================== Table toolbar (search / sort) ===================== */

.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}

.table-search {
  max-width: 280px;
  width: 100%;
}

.sortable-th {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.sortable-th:hover {
  color: var(--brand-600);
}

.sortable-th::after {
  content: '\2195';
  display: inline-block;
  margin-left: 0.35rem;
  opacity: 0.35;
  font-size: 0.7rem;
}

.sortable-th.sort-asc::after {
  content: '\2191';
  opacity: 1;
  color: var(--brand-600);
}

.sortable-th.sort-desc::after {
  content: '\2193';
  opacity: 1;
  color: var(--brand-600);
}

/* ===================== Tables ===================== */

.table-responsive {
  background: var(--surface);
  border: 1px solid var(--border-color-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 0.25rem;
}

.table {
  --bs-table-bg: transparent;
  margin-bottom: 0;
}

.table > thead {
  --bs-table-color: var(--text-muted);
}

.table > thead th {
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom-width: 1px;
  padding: 0.85rem 1rem;
}

.table > tbody td {
  padding: 0.85rem 1rem;
  vertical-align: middle;
  color: var(--text-body);
}

.table-hover > tbody > tr:hover > * {
  --bs-table-bg-state: var(--surface-muted);
}

.table a {
  color: var(--text-strong);
  font-weight: 600;
}
.table a:hover { color: var(--brand-600); }

/* ===================== Badges ===================== */

.badge {
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  padding: 0.4em 0.7em;
  border-radius: 999px;
}

/* ===================== Alerts ===================== */

.alert {
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  border-left-width: 4px;
}

.alert-success { border-left-color: #16A34A; }
.alert-danger  { border-left-color: #DC2626; }
.alert-warning { border-left-color: #D97706; }
.alert-info    { border-left-color: #0891B2; }

/* ===================== List group ===================== */

.list-group-item {
  background: var(--surface);
  border-color: var(--border-color-soft);
  color: var(--text-body);
  padding: 1rem 1.1rem;
}

.list-group {
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.list-group-item-action:hover {
  background: var(--surface-muted);
  color: var(--text-strong);
}

.list-group-item.list-group-item-success {
  background: rgba(22, 163, 74, 0.08);
  color: var(--text-body);
}
.list-group-item.list-group-item-danger {
  background: rgba(220, 38, 38, 0.08);
  color: var(--text-body);
}

/* ===================== Progress bars ===================== */

.progress {
  background-color: var(--surface-muted);
  border-radius: 999px;
}
.progress-bar {
  background-color: var(--brand-600);
}

/* ===================== Auth pages ===================== */

.auth-shell {
  display: flex;
  justify-content: center;
  padding: 1.5rem 0 3rem;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border-color-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.25rem 2rem;
}

.auth-card h1 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.75rem;
}

.auth-card .btn-primary {
  width: 100%;
  padding: 0.65rem;
}

.auth-footer-link {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ===================== Landing / hero ===================== */

.hero {
  padding: 3.5rem 0 3rem;
  text-align: center;
}

.hero-eyebrow {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: var(--brand-100);
  color: var(--brand-700);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

[data-bs-theme="dark"] .hero-eyebrow {
  background: rgba(var(--brand-rgb), 0.18);
  color: var(--brand-400);
}

.hero h1 {
  font-size: clamp(2.1rem, 4vw, 3.1rem);
  font-weight: 800;
  max-width: 820px;
  margin: 0 auto 1.1rem;
  letter-spacing: -0.02em;
}

.hero .accent {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  max-width: 640px;
  margin: 0 auto 2rem;
  font-size: 1.1rem;
  color: var(--text-muted);
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.hero-actions .btn {
  padding: 0.7rem 1.5rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
  max-width: 1000px;
  margin: 0 auto;
  text-align: left;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border-color-soft);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--brand-100);
  color: var(--brand-700);
  font-weight: 800;
  margin-bottom: 0.9rem;
}

[data-bs-theme="dark"] .feature-icon {
  background: rgba(var(--brand-rgb), 0.18);
  color: var(--brand-400);
}

.feature-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0;
}

/* ===================== Page shell / content cards ===================== */

.page-header {
  margin-bottom: 1.75rem;
}

.page-header h1 {
  margin-bottom: 0.35rem;
}

.page-header p {
  margin-bottom: 0;
  color: var(--text-muted);
  max-width: 680px;
}

.content-card {
  background: var(--surface);
  border: 1px solid var(--border-color-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}

.content-card:last-child { margin-bottom: 0; }

.content-card > h2,
.content-card > h3,
.content-card > h4,
.content-card > h5 {
  margin-bottom: 1rem;
}

.content-card > .table-responsive,
.content-card > form:last-child,
.content-card > .table-responsive:last-child {
  margin-bottom: 0;
}

.content-card .table-responsive {
  box-shadow: none;
  border: none;
  padding: 0;
  margin: 0 -0.25rem;
}

.content-card-narrow {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.content-card-section + .content-card-section {
  margin-top: 1.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border-color-soft);
}

@media (max-width: 575.98px) {
  .content-card { padding: 1.25rem; }
}

/* ===================== Empty states ===================== */

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}

.empty-state-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--brand-600);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.empty-state strong {
  display: block;
  color: var(--text-strong);
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}

.empty-state p {
  margin-bottom: 0;
  color: var(--text-muted);
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

/* ===================== Formatted text lists (e.g. interview questions) ===================== */

.prose-list {
  padding-left: 1.25rem;
  margin-bottom: 0;
}

.prose-list li {
  margin-bottom: 0.75rem;
  color: var(--text-body);
  line-height: 1.6;
}

.prose-list li:last-child { margin-bottom: 0; }

.prose-text {
  color: var(--text-body);
  line-height: 1.7;
  white-space: pre-line;
  margin-bottom: 0;
}

/* ===================== Detail rows (key/value pairs) ===================== */

.detail-list {
  margin: 0;
}

.detail-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border-color-soft);
}
.detail-row:first-child { padding-top: 0; }
.detail-row:last-child { border-bottom: none; padding-bottom: 0; }
.detail-row dt {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  flex: 0 0 auto;
}
.detail-row dd {
  margin: 0;
  color: var(--text-strong);
  font-weight: 500;
  text-align: right;
}

/* ===================== Option panel (checkbox/radio groups) ===================== */

.option-panel {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  padding: 1rem 1.1rem;
}

.option-panel .form-check {
  padding-top: 0.15rem;
  padding-bottom: 0.15rem;
}

/* ===================== Stat tiles ===================== */

.stat-tile {
  background: var(--surface);
  border: 1px solid var(--border-color-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem 1.4rem;
  height: 100%;
}

.stat-tile .stat-value {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--text-strong);
  line-height: 1.1;
}

.stat-tile .stat-label {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.stat-tile .stat-sublabel {
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-top: 0.15rem;
}

/* ===================== Status tabs ===================== */

.status-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.status-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--surface);
  color: var(--text-body);
  font-weight: 600;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
}

.status-tab:hover {
  background: var(--brand-50);
  color: var(--brand-700);
  border-color: var(--brand-200);
}

.status-tab .badge {
  background: var(--surface-muted);
  color: var(--text-muted);
}

.status-tab.active {
  background: var(--brand-100);
  color: var(--brand-700);
  border-color: var(--brand-200);
}

.status-tab.active .badge {
  background: var(--brand-600);
  color: #fff;
}

[data-bs-theme="dark"] .status-tab:hover {
  background: rgba(var(--brand-rgb), 0.14);
}

[data-bs-theme="dark"] .status-tab.active {
  background: rgba(var(--brand-rgb), 0.22);
  color: var(--brand-400);
  border-color: transparent;
}

[data-bs-theme="dark"] .status-tab.active .badge {
  background: var(--brand-500);
}

/* ===================== Footer ===================== */

.app-footer {
  border-top: 1px solid var(--border-color);
  background: var(--surface);
  color: var(--text-muted);
  padding: 1.25rem 0;
  font-size: 0.875rem;
}

.app-footer a {
  color: var(--text-muted);
}
.app-footer a:hover {
  color: var(--brand-600);
}

/* ===================== Responsive ===================== */

@media (max-width: 575.98px) {
  main.app-main {
    padding-top: 1.25rem;
  }

  .auth-card {
    padding: 1.5rem 1.25rem;
    box-shadow: none;
    border: none;
  }

  .hero {
    padding: 2rem 0 1.5rem;
  }
}
