:root,
html[data-theme="light"] {
  --bg-color: #f4f7fb;
  --surface-color: #ffffff;
  --surface-muted: #f8fafc;
  --text-color: #1d2939;
  --muted-text: #667085;
  --border-color: #d9e2ec;
  --primary-color: #3157d5;
  --success-color: #198754;
  --danger-color: #dc3545;
  --warning-color: #f6c343;
  --card-shadow: 0 0.45rem 1.25rem rgba(16, 24, 40, 0.08);
  --app-bg: var(--bg-color);
  --app-surface: var(--surface-color);
  --app-border: var(--border-color);
  --app-text: var(--text-color);
  --app-muted: var(--muted-text);
  --app-heading: #101828;
  --app-primary-soft: #e7efff;
  --app-primary: var(--primary-color);
  --app-table-head: #edf2f7;
  --app-table-hover: #edf4ff;
  --app-table-stripe: #f8fafc;
  --app-shadow: var(--card-shadow);
}

html[data-theme="dark"] {
  --bg-color: #0d1321;
  --surface-color: #151d2f;
  --surface-muted: #1c263b;
  --text-color: #e5edf7;
  --muted-text: #9aa7bd;
  --border-color: #2b3a55;
  --primary-color: #8db2ff;
  --success-color: #45c184;
  --danger-color: #ff6b7a;
  --warning-color: #facc15;
  --card-shadow: 0 0.55rem 1.6rem rgba(0, 0, 0, 0.32);
  --app-bg: var(--bg-color);
  --app-surface: var(--surface-color);
  --app-border: var(--border-color);
  --app-text: var(--text-color);
  --app-muted: var(--muted-text);
  --app-heading: #f7fbff;
  --app-primary-soft: rgba(141, 178, 255, 0.16);
  --app-primary: var(--primary-color);
  --app-table-head: #1f2a40;
  --app-table-hover: #24324b;
  --app-table-stripe: #182238;
  --app-shadow: var(--card-shadow);
}

html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-select:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem var(--surface-color), 0 0 0 0.25rem rgba(49, 87, 213, 0.28);
}

html {
  position: relative;
  min-height: 100%;
}

body {
  --bs-body-bg: var(--bg-color);
  --bs-body-color: var(--text-color);
  margin-bottom: 0;
  background: var(--app-bg);
  color: var(--app-text);
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  transition: background-color 0.18s ease, color 0.18s ease;
}

a {
  color: var(--primary-color);
}

a:hover {
  color: var(--app-primary);
}

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

.bg-white {
  background-color: var(--surface-color) !important;
}

main {
  padding-bottom: 1.5rem;
  padding-top: 1.25rem;
}

.app-shell {
  min-height: 100vh;
}

.app-content {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

.has-auth-shell .app-content {
  margin-left: 280px;
}

.app-main {
  flex: 1 0 auto;
}

.app-container {
  max-width: 1440px;
  padding-left: clamp(1rem, 2vw, 1.75rem);
  padding-right: clamp(1rem, 2vw, 1.75rem);
}

.app-sidebar {
  background: var(--surface-color);
  border-right: 1px solid var(--border-color);
  box-shadow: var(--card-shadow);
  bottom: 0;
  color: var(--text-color);
  flex-direction: column;
  left: 0;
  padding: 1rem;
  position: fixed;
  top: 0;
  width: 280px;
  z-index: 1020;
}

.sidebar-brand {
  align-items: center;
  color: var(--text-color);
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  min-height: 56px;
  text-decoration: none;
}

.sidebar-brand:hover {
  color: var(--text-color);
}

.sidebar-logo {
  align-items: center;
  background: linear-gradient(135deg, var(--primary-color), #6ea8fe);
  border-radius: 0.85rem;
  color: #fff;
  display: inline-flex;
  font-weight: 800;
  height: 44px;
  justify-content: center;
  min-width: 44px;
}

html[data-theme="dark"] .sidebar-logo {
  color: #07111f;
}

.sidebar-brand small {
  color: var(--muted-text);
  display: block;
  font-size: 0.78rem;
  margin-top: 0.08rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sidebar-link {
  align-items: center;
  border-radius: 0.8rem;
  color: var(--text-color);
  display: flex;
  font-weight: 600;
  gap: 0.65rem;
  min-height: 44px;
  padding: 0.65rem 0.75rem;
  text-decoration: none;
  transition: background-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.sidebar-link:hover {
  background: var(--app-primary-soft);
  color: var(--primary-color);
  transform: translateX(2px);
}

.sidebar-link.active {
  background: var(--app-primary-soft);
  color: var(--primary-color);
}

.sidebar-icon {
  align-items: center;
  background: var(--surface-muted);
  border: 1px solid var(--border-color);
  border-radius: 0.6rem;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 800;
  height: 30px;
  justify-content: center;
  min-width: 30px;
}

.sidebar-link.active .sidebar-icon,
.sidebar-link:hover .sidebar-icon {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}

html[data-theme="dark"] .sidebar-link.active .sidebar-icon,
html[data-theme="dark"] .sidebar-link:hover .sidebar-icon {
  color: #07111f;
}

.sidebar-footer {
  border-top: 1px solid var(--border-color);
  margin-top: auto;
  padding-top: 1rem;
}

.sidebar-profile {
  align-items: center;
  background: var(--surface-muted);
  border: 1px solid var(--border-color);
  border-radius: 0.9rem;
  display: flex;
  gap: 0.7rem;
  margin-bottom: 0.75rem;
  padding: 0.7rem;
}

.profile-avatar {
  align-items: center;
  background: var(--app-primary-soft);
  border: 1px solid rgba(49, 87, 213, 0.22);
  border-radius: 999px;
  color: var(--primary-color);
  display: inline-flex;
  font-weight: 800;
  height: 38px;
  justify-content: center;
  min-width: 38px;
}

.app-topbar {
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  min-height: 72px;
  padding: 0.75rem clamp(1rem, 2vw, 1.75rem);
  position: sticky;
  top: 0;
  z-index: 1010;
  backdrop-filter: blur(14px);
}

html[data-theme="dark"] .app-topbar {
  background: rgba(13, 19, 33, 0.92);
}

.topbar-brand {
  color: var(--text-color);
  font-weight: 800;
  text-decoration: none;
}

.topbar-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: flex-end;
}

.btn-icon {
  align-items: center;
  background: var(--surface-muted);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  display: inline-flex;
  height: 42px;
  justify-content: center;
  min-width: 42px;
  padding: 0;
}

.min-w-0 {
  min-width: 0;
}

.navbar {
  min-height: 64px;
  box-shadow: 0 0.25rem 1rem rgba(16, 24, 40, 0.05);
}

.app-navbar {
  background: rgba(255, 255, 255, 0.94);
  border-color: var(--border-color) !important;
  backdrop-filter: blur(12px);
}

html[data-theme="dark"] .app-navbar {
  background: rgba(15, 23, 42, 0.94);
}

.navbar-brand {
  letter-spacing: 0;
}

.app-brand {
  color: var(--app-heading) !important;
}

.nav-link {
  border-radius: 0.5rem;
  color: var(--text-color) !important;
  font-weight: 500;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
  background-color: var(--app-primary-soft);
  color: var(--primary-color) !important;
}

.nav-link.active {
  background-color: var(--app-primary-soft);
  color: var(--app-primary) !important;
  font-weight: 700;
}

.app-user-chip {
  align-items: center;
  background: var(--surface-muted);
  border: 1px solid var(--app-border);
  border-radius: 999px;
  color: var(--text-color);
  display: inline-flex;
  gap: 0.25rem;
  min-height: 32px;
  padding: 0.25rem 0.6rem;
}

.btn-theme-toggle {
  align-items: center;
  background: var(--surface-muted);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  display: inline-flex;
  gap: 0.35rem;
  min-height: 32px;
  padding-left: 0.65rem;
  padding-right: 0.65rem;
}

.btn-theme-toggle:hover {
  background: var(--app-primary-soft);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.btn-theme-toggle-compact {
  justify-content: center;
  min-height: 40px;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.btn-theme-toggle-compact .theme-toggle-icon {
  line-height: 1;
}

.navbar-toggler {
  border-color: var(--border-color);
}

html[data-theme="dark"] .navbar-toggler-icon {
  filter: invert(1) grayscale(1) brightness(1.8);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--app-heading);
  letter-spacing: 0;
}

.dashboard-hero {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 1rem;
  box-shadow: var(--app-shadow);
  padding: 1.25rem;
}

.card {
  background-color: var(--surface-color);
  border-radius: 0.9rem;
  border-color: var(--app-border);
  color: var(--text-color);
  box-shadow: var(--app-shadow);
}

.card-header {
  background-color: var(--surface-muted) !important;
  border-bottom-color: var(--app-border);
  color: var(--text-color);
  border-top-left-radius: 0.9rem !important;
  border-top-right-radius: 0.9rem !important;
}

.dashboard-card {
  overflow: hidden;
  position: relative;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.dashboard-card::before {
  background: linear-gradient(180deg, var(--primary-color), rgba(49, 87, 213, 0.15));
  content: "";
  inset: 0 auto 0 0;
  position: absolute;
  width: 4px;
}

.dashboard-card:hover {
  border-color: rgba(49, 87, 213, 0.36);
  box-shadow: 0 0.75rem 1.75rem rgba(16, 24, 40, 0.13);
  transform: translateY(-2px);
}

.dashboard-card-link {
  color: var(--text-color);
  display: block;
  text-decoration: none;
}

.dashboard-card-link:hover,
.dashboard-card-link:focus {
  color: var(--text-color);
  text-decoration: none;
}

.dashboard-card-link:not([href]) {
  cursor: default;
  pointer-events: none;
}

.dashboard-card-link:focus-visible {
  border-color: var(--primary-color);
  outline: 3px solid var(--app-primary-soft);
  outline-offset: 3px;
}

.dashboard-card .card-body {
  min-height: 112px;
  padding: 1.15rem;
}

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

.dashboard-card-head {
  align-items: center;
  display: flex;
  gap: 0.65rem;
  margin-bottom: 0.7rem;
}

.dashboard-icon {
  align-items: center;
  background: var(--app-primary-soft);
  border: 1px solid rgba(49, 87, 213, 0.22);
  border-radius: 0.75rem;
  color: var(--primary-color);
  display: inline-flex;
  font-size: 0.95rem;
  font-weight: 800;
  height: 36px;
  justify-content: center;
  min-width: 36px;
}

.dashboard-icon-success {
  background: rgba(25, 135, 84, 0.12);
  border-color: rgba(25, 135, 84, 0.24);
  color: var(--success-color);
}

.dashboard-icon-danger {
  background: rgba(220, 53, 69, 0.12);
  border-color: rgba(220, 53, 69, 0.24);
  color: var(--danger-color);
}

.status-row + .status-row {
  margin-top: 1rem;
}

.status-progress {
  background-color: var(--surface-muted);
  border: 1px solid var(--border-color);
  height: 0.58rem;
  margin-top: 0.55rem;
}

.status-progress .progress-bar {
  background: linear-gradient(90deg, var(--primary-color), #6ea8fe);
}

.login-card {
  margin-top: 2rem;
}

.badge {
  font-weight: 600;
  letter-spacing: 0;
  padding: 0.4em 0.6em;
}

.badge.text-bg-primary {
  background-color: #3157d5 !important;
  color: #ffffff !important;
}

.badge.text-bg-success {
  background-color: #198754 !important;
  color: #ffffff !important;
}

.badge.text-bg-danger {
  background-color: #dc3545 !important;
  color: #ffffff !important;
}

.badge.text-bg-secondary {
  background-color: #64748b !important;
  color: #ffffff !important;
}

.badge.text-bg-info {
  background-color: #cff4fc !important;
  color: #0f172a !important;
}

.badge.text-bg-warning {
  background-color: #ffe69c !important;
  color: #1f2937 !important;
}

.badge.text-bg-light {
  background-color: #f8fafc !important;
  color: #1f2937 !important;
}

html[data-theme="dark"] .badge.text-bg-primary {
  background-color: #7ea5ff !important;
  color: #07111f !important;
}

html[data-theme="dark"] .badge.text-bg-success {
  background-color: #45c184 !important;
  color: #04140c !important;
}

html[data-theme="dark"] .badge.text-bg-danger {
  background-color: #ff6b7a !important;
  color: #21050a !important;
}

html[data-theme="dark"] .badge.text-bg-secondary {
  background-color: #94a3b8 !important;
  color: #0f172a !important;
}

html[data-theme="dark"] .badge.text-bg-info {
  background-color: #7dd3fc !important;
  color: #082f49 !important;
}

html[data-theme="dark"] .badge.text-bg-warning {
  background-color: #facc15 !important;
  color: #422006 !important;
}

html[data-theme="dark"] .badge.text-bg-light {
  background-color: #e2e8f0 !important;
  color: #0f172a !important;
}

.table {
  --bs-table-bg: var(--app-surface);
  --bs-table-color: var(--app-text);
  --bs-table-striped-bg: var(--app-table-stripe);
  --bs-table-striped-color: var(--app-text);
  --bs-table-hover-bg: var(--app-table-hover);
  --bs-table-hover-color: var(--app-heading);
  background-color: var(--app-surface);
  color: var(--app-text) !important;
  margin-bottom: 0;
  vertical-align: middle;
}

.table > :not(caption) > * > * {
  background-color: var(--bs-table-bg);
  color: var(--app-text) !important;
  vertical-align: middle;
}

.table th {
  border-bottom-color: var(--border-color);
  color: var(--muted-text) !important;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0;
  padding-bottom: 0.8rem;
  padding-top: 0.8rem;
  white-space: nowrap;
}

.table td {
  color: var(--app-text) !important;
  padding-bottom: 0.8rem;
  padding-top: 0.8rem;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
  --bs-table-bg-type: var(--app-table-stripe);
  color: var(--app-text) !important;
}

.table-hover > tbody > tr:hover > * {
  --bs-table-bg-state: var(--app-table-hover);
  color: var(--app-heading) !important;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:focus-visible > * {
  outline: 2px solid var(--primary-color);
  outline-offset: -2px;
}

.table-light {
  --bs-table-bg: var(--app-table-head);
  --bs-table-color: var(--text-color);
}

.table a {
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: none;
}

.table a:hover {
  text-decoration: underline;
}

.table .btn {
  white-space: nowrap;
}

.table .text-nowrap {
  white-space: nowrap;
}

.table-comment-cell {
  max-width: 260px;
  white-space: normal;
}

.resume-current-file {
  background: var(--surface-muted);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 0.75rem;
}

.interview-calendar {
  display: grid;
  gap: 1rem;
}

.calendar-day {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 0.9rem;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.calendar-day-today {
  border-color: var(--primary-color);
}

.calendar-day-head {
  align-items: center;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 1rem;
}

.calendar-weekday {
  color: var(--muted-text);
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: capitalize;
}

.calendar-events {
  display: grid;
}

.calendar-event {
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  display: grid;
  gap: 1rem;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  padding: 0.9rem 1rem;
}

.calendar-event:last-child {
  border-bottom: 0;
}

.calendar-event-time {
  color: var(--primary-color);
  font-size: 1.15rem;
  font-weight: 800;
}

.calendar-event-body {
  min-width: 0;
}

@media (max-width: 575.98px) {
  .calendar-event {
    align-items: flex-start;
    grid-template-columns: 1fr;
  }
}

.table-responsive {
  border-radius: 0.9rem;
  -webkit-overflow-scrolling: touch;
  overflow-x: auto;
}

.score-badge {
  align-items: center;
  background: var(--app-primary-soft);
  border: 1px solid rgba(49, 87, 213, 0.3);
  border-radius: 999px;
  color: var(--text-color) !important;
  display: inline-flex;
  font-size: 0.9rem;
  font-weight: 700;
  justify-content: center;
  line-height: 1;
  min-height: 2rem;
  min-width: 2.25rem;
  padding: 0.35rem 0.65rem;
}

.score-badge-average {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff !important;
  min-width: 3rem;
}

html[data-theme="dark"] .score-badge-average {
  color: #07111f !important;
}

.empty-state {
  background: linear-gradient(180deg, rgba(49, 87, 213, 0.05), transparent);
  border-radius: 0.9rem;
  color: var(--app-muted);
  padding: 2.5rem;
  text-align: center;
}

main > form.row.g-3 {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 0.9rem;
  box-shadow: var(--app-shadow);
  margin-left: 0;
  margin-right: 0;
  max-width: 1120px;
  padding: 1.15rem;
}

.form-control,
.form-select {
  background-color: var(--surface-color);
  border-color: var(--border-color);
  color: var(--text-color);
}

.form-control:focus,
.form-select:focus {
  background-color: var(--surface-color);
  border-color: var(--primary-color);
  color: var(--text-color);
}

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

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

.btn {
  border-radius: 0.6rem;
  font-weight: 600;
  letter-spacing: 0;
}

.btn [aria-hidden="true"] {
  display: inline-block;
  font-weight: 700;
  margin-right: 0.25rem;
  min-width: 0.75rem;
  text-align: center;
}

textarea {
  resize: vertical;
}

.app-footer {
  background-color: var(--surface-color);
  border-color: var(--border-color) !important;
  color: var(--muted-text) !important;
  font-size: 0.925rem;
}

.app-footer a {
  color: var(--primary-color);
}

.app-offcanvas {
  background: var(--surface-color);
  color: var(--text-color);
}

.app-offcanvas .offcanvas-header {
  border-bottom: 1px solid var(--border-color);
}

html[data-theme="dark"] .btn-close {
  filter: invert(1) grayscale(1) brightness(1.8);
}

.mobile-bottom-nav {
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--border-color);
  bottom: 0;
  box-shadow: 0 -0.35rem 1.25rem rgba(16, 24, 40, 0.08);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 56px;
  left: 0;
  padding: 0.35rem 0.5rem calc(0.35rem + env(safe-area-inset-bottom));
  position: fixed;
  right: 0;
  z-index: 1030;
  backdrop-filter: blur(14px);
}

html[data-theme="dark"] .mobile-bottom-nav {
  background: rgba(15, 23, 42, 0.96);
}

.mobile-bottom-nav a,
.mobile-bottom-nav button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 0.75rem;
  color: var(--muted-text);
  display: inline-flex;
  flex-direction: column;
  font-weight: 700;
  gap: 0.12rem;
  justify-content: center;
  height: 54px;
  max-width: 100%;
  min-height: 54px;
  min-width: 0;
  overflow: hidden;
  padding: 0.25rem 0.15rem;
  text-decoration: none;
  width: 100%;
}

.mobile-bottom-nav a > span,
.mobile-bottom-nav button > span {
  line-height: 1;
}

.mobile-bottom-nav a.active,
.mobile-bottom-nav button.active,
.mobile-bottom-nav a:hover,
.mobile-bottom-nav button:hover {
  background: var(--app-primary-soft);
  color: var(--primary-color);
}

.mobile-bottom-nav small {
  display: block;
  font-size: 0.68rem;
  line-height: 1.1;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

.list-group-item {
  background-color: var(--surface-color);
  border-color: var(--border-color);
  color: var(--text-color);
}

.list-group-item-action:hover,
.list-group-item-action:focus {
  background-color: var(--app-table-hover);
  color: var(--app-heading);
}

dl.row dt {
  color: var(--muted-text);
  font-weight: 700;
}

dl.row dd {
  color: var(--text-color);
}

code {
  background: var(--surface-muted);
  border: 1px solid var(--border-color);
  border-radius: 0.35rem;
  color: var(--primary-color);
  padding: 0.08rem 0.32rem;
}

.alert {
  border-color: var(--border-color);
}

.alert-light {
  background-color: var(--surface-muted);
  color: var(--text-color);
}

.alert-warning {
  background-color: rgba(246, 195, 67, 0.18);
  color: var(--text-color);
}

@media (max-width: 991.98px) {
  .has-auth-shell .app-content {
    margin-left: 0;
  }

  .has-auth-shell .app-main {
    padding-bottom: 5.5rem;
  }

  .app-topbar {
    min-height: 64px;
  }

  .navbar-nav {
    padding-top: 0.75rem;
  }

  .app-user-chip {
    margin-bottom: 0.5rem;
    margin-top: 0.5rem;
  }
}

@media (max-width: 575.98px) {
  .app-container {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .topbar-actions {
    gap: 0.4rem;
  }

  .btn-theme-toggle {
    min-height: 40px;
  }

  .theme-toggle-text {
    display: none;
  }

  .table th,
  .table td {
    padding-left: 0.7rem;
    padding-right: 0.7rem;
  }

  .table .btn {
    min-height: 36px;
  }

  .dashboard-hero {
    padding: 1rem;
  }
}

/* Final SaaS polish: lighter enterprise HR dashboard shell. */
:root,
html[data-theme="light"] {
  --bg-color: #f6f8fb;
  --surface-color: #ffffff;
  --surface-muted: #f3f6fb;
  --sidebar-color: #ffffff;
  --text-color: #172033;
  --muted-text: #64748b;
  --border-color: #e4eaf2;
  --primary-color: #4f46e5;
  --success-color: #15803d;
  --danger-color: #dc2626;
  --warning-color: #d97706;
  --card-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
  --app-table-head: #f8fafc;
  --app-table-hover: #f6f8ff;
  --app-table-stripe: #fbfdff;
}

html[data-theme="dark"] {
  --bg-color: #0f172a;
  --surface-color: #151f32;
  --surface-muted: #1b2740;
  --sidebar-color: #0b1220;
  --text-color: #e5e7eb;
  --muted-text: #94a3b8;
  --border-color: #26344f;
  --primary-color: #818cf8;
  --success-color: #86efac;
  --danger-color: #fca5a5;
  --warning-color: #fbbf24;
  --card-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
  --app-table-head: #18243a;
  --app-table-hover: #1d2b44;
  --app-table-stripe: #172238;
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.has-auth-shell .app-content {
  margin-left: 240px;
}

.app-sidebar {
  background: var(--sidebar-color);
  border-right: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: none;
  padding: 0.85rem;
  width: 240px;
}

.sidebar-brand {
  border-radius: 0.95rem;
  gap: 0.65rem;
  margin-bottom: 1rem;
  min-height: 48px;
  padding: 0.35rem 0.25rem;
}

.sidebar-logo {
  border-radius: 0.75rem;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.22);
  font-size: 0.8rem;
  height: 36px;
  min-width: 36px;
}

.sidebar-brand strong {
  font-size: 0.98rem;
}

.sidebar-brand small {
  font-size: 0.72rem;
}

.sidebar-nav {
  gap: 0.2rem;
}

.sidebar-link {
  border-radius: 0.75rem;
  color: var(--muted-text);
  font-size: 0.93rem;
  font-weight: 600;
  gap: 0.7rem;
  min-height: 46px;
  padding: 0.62rem 0.7rem;
  transform: none;
}

.sidebar-link:hover {
  background: rgba(129, 140, 248, 0.09);
  color: var(--text-color);
  transform: none;
}

.sidebar-link.active {
  background: rgba(79, 70, 229, 0.14);
  color: var(--primary-color);
}

html[data-theme="dark"] .sidebar-link.active {
  background: rgba(129, 140, 248, 0.16);
  color: #c7d2fe;
}

.sidebar-icon {
  background: transparent;
  border: 0;
  border-radius: 0;
  color: currentColor;
  height: 20px;
  min-width: 20px;
}

.sidebar-icon svg,
.topbar-search svg,
.btn-icon svg,
.dashboard-icon svg {
  fill: none;
  height: 18px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 18px;
}

.sidebar-link.active .sidebar-icon,
.sidebar-link:hover .sidebar-icon {
  background: transparent;
  border-color: transparent;
  color: currentColor;
}

.sidebar-footer {
  border-top-color: rgba(148, 163, 184, 0.16);
  padding-top: 0.85rem;
}

.sidebar-profile {
  background: transparent;
  border: 0;
  border-radius: 0.75rem;
  margin-bottom: 0.65rem;
  padding: 0.45rem 0.15rem;
}

.profile-avatar {
  background: rgba(79, 70, 229, 0.12);
  border-color: rgba(79, 70, 229, 0.2);
  height: 34px;
  min-width: 34px;
}

.app-topbar {
  background: rgba(246, 248, 251, 0.86);
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  min-height: 64px;
  padding-bottom: 0.65rem;
  padding-top: 0.65rem;
}

html[data-theme="dark"] .app-topbar {
  background: rgba(15, 23, 42, 0.86);
}

.page-heading .h5 {
  font-size: 1rem;
  font-weight: 700;
}

.topbar-search {
  align-items: center;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  color: var(--muted-text);
  flex: 1 1 420px;
  gap: 0.55rem;
  max-width: 520px;
  min-height: 40px;
  padding: 0 0.85rem;
}

.topbar-search .form-control {
  background: transparent;
  border: 0;
  box-shadow: none;
  min-height: 38px;
  padding: 0;
}

.topbar-search .form-control:focus {
  background: transparent;
  box-shadow: none;
}

.btn-icon {
  border-radius: 999px;
  height: 38px;
  min-width: 38px;
}

.btn-notification {
  position: relative;
}

.notification-dot {
  background: #ef4444;
  border: 2px solid var(--surface-color);
  border-radius: 999px;
  height: 0.62rem;
  position: absolute;
  right: 0.45rem;
  top: 0.45rem;
  width: 0.62rem;
}

.topbar-avatar {
  height: 30px;
  min-width: 30px;
}

.profile-copy {
  display: grid;
  line-height: 1.1;
}

.profile-name {
  color: var(--text-color);
  font-size: 0.86rem;
  font-weight: 750;
}

.profile-role {
  color: var(--muted-text);
  font-size: 0.72rem;
  margin-top: 0.12rem;
}

.profile-caret {
  color: var(--muted-text);
  font-size: 1rem;
  margin-left: 0.15rem;
}

.dashboard-hero {
  background: linear-gradient(135deg, var(--surface-color), var(--surface-muted));
  border-color: rgba(148, 163, 184, 0.14);
  border-radius: 1.25rem;
  box-shadow: var(--card-shadow);
  padding: 1rem 1.15rem;
}

.dashboard-hero .h2 {
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  font-weight: 750;
}

.dashboard-kpi-grid {
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.card {
  border-color: rgba(148, 163, 184, 0.14);
  border-radius: 1.05rem;
  box-shadow: var(--card-shadow);
}

.card-header {
  background: transparent !important;
  border-bottom-color: rgba(148, 163, 184, 0.12);
  padding: 0.95rem 1rem;
}

.card-header .h5 {
  font-size: 0.98rem;
  font-weight: 720;
}

.dashboard-card {
  min-height: 132px;
}

.dashboard-card::before {
  display: none;
}

.dashboard-card:hover {
  border-color: rgba(129, 140, 248, 0.28);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.09);
}

html[data-theme="dark"] .dashboard-card:hover {
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.26);
}

.dashboard-card .card-body {
  min-height: 0;
  padding: 1rem;
}

.dashboard-card .display-6 {
  font-size: 2rem;
  line-height: 1.1;
}

.dashboard-card-head {
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}

.dashboard-icon {
  border-radius: 0.65rem;
  font-size: 0.82rem;
  height: 32px;
  min-width: 32px;
}

.status-progress {
  border: 0;
  height: 0.48rem;
}

.status-progress .progress-bar {
  background: linear-gradient(90deg, #6366f1, #38bdf8);
  border-radius: 999px;
}

.badge {
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.78rem;
  padding: 0.38em 0.68em;
}

.badge.text-bg-primary {
  background-color: rgba(79, 70, 229, 0.13) !important;
  border-color: rgba(79, 70, 229, 0.22);
  color: #4338ca !important;
}

.badge.text-bg-success {
  background-color: rgba(21, 128, 61, 0.13) !important;
  border-color: rgba(21, 128, 61, 0.22);
  color: #166534 !important;
}

.badge.text-bg-danger {
  background-color: rgba(220, 38, 38, 0.13) !important;
  border-color: rgba(220, 38, 38, 0.22);
  color: #b91c1c !important;
}

.badge.text-bg-secondary {
  background-color: rgba(100, 116, 139, 0.13) !important;
  border-color: rgba(100, 116, 139, 0.22);
  color: #475569 !important;
}

.badge.text-bg-info,
.badge.text-bg-info.text-dark {
  background-color: rgba(8, 145, 178, 0.13) !important;
  border-color: rgba(8, 145, 178, 0.22);
  color: #0e7490 !important;
}

.badge.text-bg-warning,
.badge.text-bg-warning.text-dark {
  background-color: rgba(217, 119, 6, 0.15) !important;
  border-color: rgba(217, 119, 6, 0.26);
  color: #92400e !important;
}

.badge.text-bg-light,
.badge.text-bg-light.text-dark {
  background-color: rgba(148, 163, 184, 0.14) !important;
  border-color: rgba(148, 163, 184, 0.24);
  color: #334155 !important;
}

html[data-theme="dark"] .badge.text-bg-primary {
  color: #c7d2fe !important;
}

html[data-theme="dark"] .badge.text-bg-success {
  color: #86efac !important;
}

html[data-theme="dark"] .badge.text-bg-danger {
  color: #fca5a5 !important;
}

html[data-theme="dark"] .badge.text-bg-secondary {
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .badge.text-bg-info,
html[data-theme="dark"] .badge.text-bg-info.text-dark {
  color: #67e8f9 !important;
}

html[data-theme="dark"] .badge.text-bg-warning,
html[data-theme="dark"] .badge.text-bg-warning.text-dark {
  color: #fde68a !important;
}

html[data-theme="dark"] .badge.text-bg-light,
html[data-theme="dark"] .badge.text-bg-light.text-dark {
  color: #e2e8f0 !important;
}

.btn {
  border-radius: 0.7rem;
}

.btn-primary {
  background-color: #4f46e5;
  border-color: #4f46e5;
}

.btn-success {
  background-color: #15803d;
  border-color: #15803d;
}

.btn-warning {
  background-color: rgba(217, 119, 6, 0.14);
  border-color: rgba(217, 119, 6, 0.22);
  color: #92400e;
}

.btn-warning:hover {
  background-color: rgba(217, 119, 6, 0.22);
  border-color: rgba(217, 119, 6, 0.32);
  color: #78350f;
}

.btn-outline-danger {
  background-color: rgba(220, 38, 38, 0.06);
  border-color: rgba(220, 38, 38, 0.28);
  color: var(--danger-color);
}

.table th {
  font-size: 0.78rem;
  padding-bottom: 0.72rem;
  padding-top: 0.72rem;
}

.table td {
  font-size: 0.92rem;
  padding-bottom: 0.72rem;
  padding-top: 0.72rem;
}

.table .btn-sm {
  border-radius: 0.55rem;
  font-size: 0.78rem;
  min-height: 32px;
  padding: 0.32rem 0.55rem;
}

.table-responsive {
  border-radius: 1.05rem;
}

@media (max-width: 991.98px) {
  .has-auth-shell .app-content {
    margin-left: 0;
  }

  .app-topbar {
    min-height: 60px;
  }
}

@media (max-width: 575.98px) {
  .dashboard-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-card {
    min-height: 128px;
  }

  .dashboard-card .display-6 {
    font-size: 1.65rem;
  }
}

/* Reference-inspired dashboard bento layout. */
.dashboard-hero {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.dashboard-hero-copy {
  min-width: 0;
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: flex-end;
}

.dashboard-bento-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(260px, 1.15fr) minmax(240px, 1fr) minmax(280px, 1.05fr) minmax(240px, 1fr);
}

.bento-card {
  min-height: 220px;
}

.bento-card-wide {
  min-width: 0;
}

.bento-card-vacancies {
  grid-column: span 2;
}

.bento-card .card-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.bento-card .card-body {
  padding: 1rem;
}

.bento-chart-body {
  align-items: center;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(112px, 140px) 1fr;
}

.donut-chart {
  align-items: center;
  aspect-ratio: 1;
  background: transparent;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  margin: 0 auto;
  max-width: 140px;
  min-width: 116px;
  overflow: visible;
  position: relative;
}

.donut-chart svg {
  inset: 0;
  overflow: visible;
  position: absolute;
  z-index: 0;
}

.donut-segment {
  fill: none;
  pointer-events: stroke;
  stroke-linecap: butt;
  stroke-width: 24;
  transform-origin: 50px 50px;
  transition: stroke-width 0.16s ease, filter 0.16s ease, opacity 0.16s ease;
}

.donut-segment-link {
  outline: 0;
}

.donut-segment-link:hover .donut-segment,
.donut-segment-link:focus-visible .donut-segment {
  filter: drop-shadow(0 6px 10px rgba(15, 23, 42, 0.22));
  opacity: 0.96;
  stroke-width: 30;
}

.donut-chart::after {
  background: var(--surface-color);
  border-radius: 50%;
  content: "";
  inset: 25%;
  position: absolute;
  z-index: 1;
}

.donut-chart span {
  color: var(--text-color);
  font-size: 1.1rem;
  font-weight: 800;
  position: relative;
  z-index: 2;
}

.donut-chart-small {
  max-width: 124px;
  min-width: 108px;
}

.donut-chart-small .donut-segment {
  stroke-width: 22;
}

.donut-chart-small .donut-segment-link:hover .donut-segment,
.donut-chart-small .donut-segment-link:focus-visible .donut-segment {
  stroke-width: 28;
}

.status-legend {
  display: grid;
  gap: 0.62rem;
  min-width: 0;
}

.status-legend-row {
  align-items: center;
  color: var(--muted-text);
  display: grid;
  font-size: 0.86rem;
  gap: 0.5rem;
  grid-template-columns: auto 1fr auto;
  min-height: 28px;
  text-decoration: none;
  transition: color 0.16s ease, transform 0.16s ease;
}

.status-legend-row:hover,
.status-legend-row:focus-visible {
  color: var(--primary-color);
  transform: translateX(2px);
}

.status-legend-row strong {
  color: var(--text-color);
  font-weight: 700;
  white-space: nowrap;
}

.status-legend-row:hover strong,
.status-legend-row:focus-visible strong {
  color: var(--primary-color);
}

.legend-dot {
  border-radius: 0.22rem;
  display: inline-block;
  height: 0.6rem;
  width: 0.6rem;
}

.stack-list,
.interview-stack {
  display: grid;
  gap: 0.78rem;
}

.stack-list-item,
.interview-item {
  align-items: center;
  background: rgba(148, 163, 184, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 0.9rem;
  color: var(--text-color);
  display: grid;
  gap: 0.72rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 58px;
  padding: 0.65rem;
  text-decoration: none;
  transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.stack-list-item:hover,
.interview-item:hover {
  background: var(--app-primary-soft);
  border-color: rgba(129, 140, 248, 0.22);
  color: var(--text-color);
  transform: translateY(-1px);
}

.stack-list-item strong,
.interview-item strong {
  display: block;
  font-size: 0.9rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stack-list-item small,
.interview-item small {
  color: var(--muted-text);
  display: block;
  font-size: 0.78rem;
  margin-top: 0.15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.candidate-avatar,
.interview-date {
  align-items: center;
  background: rgba(96, 165, 250, 0.14);
  border-radius: 0.75rem;
  color: var(--primary-color);
  display: inline-flex;
  font-weight: 800;
  height: 40px;
  justify-content: center;
  min-width: 40px;
}

.interview-date {
  flex-direction: column;
  gap: 0;
  height: 48px;
  min-width: 48px;
}

.interview-date strong {
  font-size: 1rem;
  line-height: 1;
}

.interview-date small {
  font-size: 0.65rem;
  margin: 0.15rem 0 0;
  text-transform: uppercase;
}

.vacancy-marker {
  background: linear-gradient(135deg, #22c55e, #60a5fa);
  border-radius: 999px;
  height: 0.72rem;
  width: 0.72rem;
}

@media (max-width: 1399.98px) {
  .dashboard-bento-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bento-card-vacancies {
    grid-column: span 1;
  }
}

@media (max-width: 767.98px) {
  .dashboard-hero {
    align-items: flex-start;
    flex-direction: column;
  }

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

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

  .dashboard-bento-grid {
    grid-template-columns: 1fr;
  }

  .bento-chart-body {
    grid-template-columns: 1fr;
  }

  .donut-chart {
    max-width: 132px;
  }
}

/* Interactive shell polish: readable dark theme, sidebar collapse, topbar dropdowns. */
html[data-theme="dark"] {
  --surface-color: #141f33;
  --surface-muted: #1d2a44;
  --muted-text: #b8c4d6;
  --border-color: #334461;
  --app-table-head: #1d2a44;
  --app-table-hover: #243653;
  --app-table-stripe: #17243a;
}

html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .profile-role,
html[data-theme="dark"] .profile-caret,
html[data-theme="dark"] .sidebar-brand small,
html[data-theme="dark"] .stack-list-item small,
html[data-theme="dark"] .interview-item small,
html[data-theme="dark"] .status-legend-row,
html[data-theme="dark"] .metric-delta.text-muted {
  color: var(--muted-text) !important;
}

html[data-theme="dark"] .metric-delta.text-primary,
html[data-theme="dark"] .text-primary {
  color: #a5b4fc !important;
}

html[data-theme="dark"] .metric-delta.text-success,
html[data-theme="dark"] .text-success {
  color: #86efac !important;
}

.has-auth-shell .app-content,
.app-sidebar {
  transition: margin-left 0.18s ease, width 0.18s ease;
}

@media (min-width: 992px) {
  .sidebar-collapsed.has-auth-shell .app-content {
    margin-left: 76px;
  }

  .sidebar-collapsed .app-sidebar {
    padding-left: 0.6rem;
    padding-right: 0.6rem;
    width: 76px;
  }

  .sidebar-collapsed .sidebar-brand {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
  }

  .sidebar-collapsed .sidebar-brand > span:not(.sidebar-logo),
  .sidebar-collapsed .sidebar-link > span:not(.sidebar-icon),
  .sidebar-collapsed .sidebar-profile .min-w-0 {
    display: none !important;
  }

  .sidebar-collapsed .sidebar-link {
    justify-content: center;
    padding-left: 0.45rem;
    padding-right: 0.45rem;
  }

  .sidebar-collapsed .sidebar-footer {
    padding-top: 0.65rem;
  }

  .sidebar-collapsed .sidebar-profile {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
  }

  .sidebar-collapsed .sidebar-footer .btn {
    align-items: center;
    display: inline-flex;
    font-size: 0;
    justify-content: center;
    min-height: 38px;
    padding: 0;
  }

  .sidebar-collapsed .sidebar-footer .btn::before {
    content: "↪";
    font-size: 1rem;
    line-height: 1;
  }
}

.btn-icon,
.btn-theme-toggle,
.app-user-chip {
  color: var(--text-color);
}

.btn-icon:hover,
.btn-icon.is-active,
.btn-theme-toggle:hover,
.profile-button:hover {
  background: var(--app-primary-soft);
  border-color: rgba(129, 140, 248, 0.36);
  color: var(--primary-color);
}

html[data-theme="dark"] .btn-outline-secondary {
  background-color: rgba(148, 163, 184, 0.08);
  border-color: rgba(203, 213, 225, 0.32);
  color: #d7e0ee;
}

html[data-theme="dark"] .btn-outline-secondary:hover {
  background-color: rgba(148, 163, 184, 0.16);
  border-color: rgba(203, 213, 225, 0.48);
  color: #f8fafc;
}

html[data-theme="dark"] .btn-secondary {
  background-color: #334155;
  border-color: #475569;
  color: #f8fafc;
}

html[data-theme="dark"] .btn:disabled,
html[data-theme="dark"] .btn.disabled {
  color: #94a3b8;
  opacity: 0.72;
}

.topbar-search {
  margin: 0;
}

.topbar-search:focus-within {
  border-color: rgba(129, 140, 248, 0.55);
  box-shadow: 0 0 0 0.18rem rgba(129, 140, 248, 0.13);
}

.topbar-search .form-control {
  color: var(--text-color);
}

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

.app-dropdown {
  position: relative;
}

.app-dropdown-menu {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
  color: var(--text-color);
  display: none;
  min-width: 260px;
  padding: 0.55rem;
  position: absolute;
  right: 0;
  top: calc(100% + 0.55rem);
  width: min(340px, calc(100vw - 2rem));
  z-index: 1080;
}

html[data-theme="dark"] .app-dropdown-menu {
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.34);
}

.app-dropdown.is-open .app-dropdown-menu {
  display: block;
}

.dropdown-title {
  color: var(--text-color);
  font-size: 0.88rem;
  font-weight: 800;
  padding: 0.45rem 0.55rem 0.55rem;
}

.notification-list {
  display: grid;
  gap: 0.4rem;
}

.notification-item {
  background: var(--surface-muted);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 0.78rem;
  display: grid;
  gap: 0.12rem;
  padding: 0.65rem 0.7rem;
}

.notification-item strong {
  color: var(--text-color);
  font-size: 0.86rem;
  line-height: 1.25;
}

.notification-item span,
.notification-empty {
  color: var(--muted-text);
  font-size: 0.78rem;
  line-height: 1.35;
}

.notification-empty {
  padding: 0.65rem 0.55rem;
}

.notification-dot[hidden],
.notification-dot.is-hidden {
  display: none;
}

.profile-button {
  border: 1px solid var(--border-color);
  cursor: pointer;
  font: inherit;
  min-height: 40px;
}

.profile-menu {
  width: min(280px, calc(100vw - 2rem));
}

.profile-menu-head {
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  gap: 0.65rem;
  margin-bottom: 0.35rem;
  padding: 0.55rem 0.55rem 0.75rem;
}

.profile-menu-head strong,
.profile-menu-head small {
  display: block;
  line-height: 1.2;
}

.profile-menu-head strong {
  color: var(--text-color);
  font-size: 0.92rem;
}

.profile-menu-head small {
  color: var(--muted-text);
  font-size: 0.78rem;
  margin-top: 0.12rem;
}

.dropdown-item-soft {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 0.7rem;
  color: var(--text-color);
  display: flex;
  font-size: 0.88rem;
  gap: 0.45rem;
  min-height: 38px;
  padding: 0.5rem 0.6rem;
  text-decoration: none;
  width: 100%;
}

.dropdown-item-soft:hover {
  background: var(--app-primary-soft);
  color: var(--primary-color);
}

.dropdown-item-soft:disabled {
  color: var(--muted-text);
  cursor: not-allowed;
  opacity: 0.8;
}

.dropdown-item-danger {
  color: var(--danger-color);
}

.dropdown-item-danger:hover {
  background: rgba(220, 38, 38, 0.1);
  color: var(--danger-color);
}

html[data-theme="dark"] .table,
html[data-theme="dark"] .table td,
html[data-theme="dark"] .table th {
  color: var(--text-color);
}

html[data-theme="dark"] .table thead th {
  color: #dbeafe;
}

html[data-theme="dark"] .table small,
html[data-theme="dark"] .table .text-muted {
  color: var(--muted-text) !important;
}

@media (max-width: 575.98px) {
  .topbar-actions {
    gap: 0.4rem;
  }

  .app-dropdown-menu {
    right: -0.25rem;
    width: min(320px, calc(100vw - 1.25rem));
  }

  .profile-menu {
    right: -0.5rem;
  }
}

/* Dark theme readability pass. Light theme intentionally untouched. */
html[data-theme="dark"] {
  --text-color: #f8fafc;
  --muted-text: #cbd5e1;
  --subtle-text: #94a3b8;
  --surface-color: #172033;
  --surface-muted: #1e293b;
  --border-color: #334155;
  --app-text: var(--text-color);
  --app-muted: var(--muted-text);
  --app-heading: #ffffff;
  --app-surface: var(--surface-color);
  --app-border: var(--border-color);
  --app-table-head: #1e293b;
  --app-table-hover: #25344d;
  --app-table-stripe: #182338;
  --app-primary-soft: rgba(99, 102, 241, 0.2);
}

html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .text-secondary,
html[data-theme="dark"] .small,
html[data-theme="dark"] small,
html[data-theme="dark"] .form-text,
html[data-theme="dark"] .card-subtitle,
html[data-theme="dark"] .kpi-subtitle,
html[data-theme="dark"] .dashboard-card small,
html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .profile-role,
html[data-theme="dark"] .user-role,
html[data-theme="dark"] .metric-delta,
html[data-theme="dark"] .notification-item span,
html[data-theme="dark"] .notification-empty,
html[data-theme="dark"] .profile-menu-head small,
html[data-theme="dark"] .app-footer,
html[data-theme="dark"] .offcanvas .text-muted {
  color: var(--muted-text) !important;
  opacity: 1;
}

html[data-theme="dark"] .text-dark:not(.badge) {
  color: var(--text-color) !important;
}

html[data-theme="dark"] .dashboard-card .text-muted,
html[data-theme="dark"] .dashboard-card .small,
html[data-theme="dark"] .dashboard-card small {
  color: #dbeafe !important;
}

html[data-theme="dark"] .metric-delta.text-success,
html[data-theme="dark"] .text-success {
  color: #86efac !important;
}

html[data-theme="dark"] .metric-delta.text-primary,
html[data-theme="dark"] .text-primary {
  color: #a5b4fc !important;
}

html[data-theme="dark"] .stack-list-item,
html[data-theme="dark"] .interview-item {
  background: rgba(30, 41, 59, 0.78);
  border-color: rgba(148, 163, 184, 0.22);
  color: var(--text-color);
}

html[data-theme="dark"] .stack-list-item:hover,
html[data-theme="dark"] .interview-item:hover {
  background: rgba(51, 65, 85, 0.82);
  border-color: rgba(129, 140, 248, 0.42);
}

html[data-theme="dark"] .stack-list-item strong,
html[data-theme="dark"] .interview-item strong {
  color: #ffffff;
}

html[data-theme="dark"] .stack-list-item small,
html[data-theme="dark"] .interview-item small,
html[data-theme="dark"] .status-legend-row {
  color: var(--muted-text) !important;
}

html[data-theme="dark"] .candidate-avatar,
html[data-theme="dark"] .interview-date {
  background: rgba(96, 165, 250, 0.18);
  border: 1px solid rgba(96, 165, 250, 0.26);
  color: #bfdbfe;
}

html[data-theme="dark"] .topbar-search,
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select {
  background-color: #111827;
  border-color: #475569;
  color: var(--text-color);
}

html[data-theme="dark"] .topbar-search {
  background-color: #111827;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.02);
}

html[data-theme="dark"] .topbar-search svg {
  color: var(--muted-text);
}

html[data-theme="dark"] .topbar-search:focus-within,
html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus {
  background-color: #111827;
  border-color: #818cf8;
  color: var(--text-color);
  box-shadow: 0 0 0 0.18rem rgba(129, 140, 248, 0.2);
}

html[data-theme="dark"] .form-control::placeholder,
html[data-theme="dark"] .topbar-search .form-control::placeholder {
  color: var(--muted-text);
  opacity: 1;
}

html[data-theme="dark"] .form-select option {
  background-color: #111827;
  color: var(--text-color);
}

html[data-theme="dark"] .app-dropdown-menu,
html[data-theme="dark"] .profile-menu {
  background: #111827;
  border-color: #475569;
  color: var(--text-color);
}

html[data-theme="dark"] .notification-item {
  background: #1e293b;
  border-color: rgba(148, 163, 184, 0.24);
}

html[data-theme="dark"] .notification-item strong,
html[data-theme="dark"] .dropdown-title,
html[data-theme="dark"] .profile-menu-head strong,
html[data-theme="dark"] .profile-name {
  color: #ffffff;
}

html[data-theme="dark"] .dropdown-item-soft {
  color: var(--text-color);
}

html[data-theme="dark"] .dropdown-item-soft:hover {
  background: rgba(99, 102, 241, 0.18);
  color: #c7d2fe;
}

html[data-theme="dark"] .dropdown-item-soft:disabled {
  color: var(--muted-text);
  opacity: 1;
}

html[data-theme="dark"] .dropdown-item-danger {
  color: #fca5a5;
}

html[data-theme="dark"] .dropdown-item-danger:hover {
  background: rgba(248, 113, 113, 0.16);
  color: #fecaca;
}

html[data-theme="dark"] .profile-button,
html[data-theme="dark"] .app-user-chip,
html[data-theme="dark"] .btn-icon,
html[data-theme="dark"] .btn-theme-toggle {
  background-color: #111827;
  border-color: #475569;
  color: var(--text-color);
}

html[data-theme="dark"] .btn-outline-secondary,
html[data-theme="dark"] .dashboard-actions .btn-outline-secondary {
  background-color: rgba(148, 163, 184, 0.1);
  border-color: rgba(203, 213, 225, 0.42);
  color: #e2e8f0;
}

html[data-theme="dark"] .btn-outline-primary,
html[data-theme="dark"] .btn-link {
  color: #bfdbfe;
}

html[data-theme="dark"] .btn-outline-primary {
  border-color: rgba(147, 197, 253, 0.55);
  background-color: rgba(59, 130, 246, 0.08);
}

html[data-theme="dark"] .btn-outline-info {
  border-color: rgba(103, 232, 249, 0.5);
  color: #67e8f9;
}

html[data-theme="dark"] .btn-outline-success {
  border-color: rgba(134, 239, 172, 0.5);
  color: #86efac;
}

html[data-theme="dark"] .btn-outline-danger {
  background-color: rgba(248, 113, 113, 0.1);
  border-color: rgba(252, 165, 165, 0.48);
  color: #fca5a5;
}

html[data-theme="dark"] .btn-outline-secondary:hover,
html[data-theme="dark"] .btn-outline-primary:hover,
html[data-theme="dark"] .btn-outline-info:hover,
html[data-theme="dark"] .btn-outline-success:hover,
html[data-theme="dark"] .btn-outline-danger:hover,
html[data-theme="dark"] .btn-link:hover {
  background-color: rgba(129, 140, 248, 0.18);
  border-color: rgba(199, 210, 254, 0.58);
  color: #ffffff;
}

html[data-theme="dark"] .btn-secondary {
  background-color: #334155;
  border-color: #64748b;
  color: #f8fafc;
}

html[data-theme="dark"] .btn:disabled,
html[data-theme="dark"] .btn.disabled,
html[data-theme="dark"] .dropdown-item-soft:disabled {
  color: var(--muted-text);
  opacity: 0.82;
}

html[data-theme="dark"] .badge {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

html[data-theme="dark"] .badge.text-bg-primary,
html[data-theme="dark"] .badge.text-bg-primary.text-dark {
  background-color: rgba(129, 140, 248, 0.22) !important;
  color: #c7d2fe !important;
}

html[data-theme="dark"] .badge.text-bg-success,
html[data-theme="dark"] .badge.text-bg-success.text-dark {
  background-color: rgba(34, 197, 94, 0.2) !important;
  color: #bbf7d0 !important;
}

html[data-theme="dark"] .badge.text-bg-danger,
html[data-theme="dark"] .badge.text-bg-danger.text-dark {
  background-color: rgba(248, 113, 113, 0.2) !important;
  color: #fecaca !important;
}

html[data-theme="dark"] .badge.text-bg-secondary,
html[data-theme="dark"] .badge.text-bg-secondary.text-dark {
  background-color: rgba(148, 163, 184, 0.22) !important;
  color: #e2e8f0 !important;
}

html[data-theme="dark"] .badge.text-bg-info,
html[data-theme="dark"] .badge.text-bg-info.text-dark {
  background-color: rgba(34, 211, 238, 0.2) !important;
  color: #a5f3fc !important;
}

html[data-theme="dark"] .badge.text-bg-warning,
html[data-theme="dark"] .badge.text-bg-warning.text-dark {
  background-color: rgba(251, 191, 36, 0.22) !important;
  color: #fde68a !important;
}

html[data-theme="dark"] .badge.text-bg-light,
html[data-theme="dark"] .badge.text-bg-light.text-dark,
html[data-theme="dark"] .badge.text-bg-dark {
  background-color: rgba(51, 65, 85, 0.88) !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .score-badge {
  background: rgba(129, 140, 248, 0.2);
  border-color: rgba(165, 180, 252, 0.36);
  color: #f8fafc !important;
}

html[data-theme="dark"] .score-badge-average {
  background: rgba(34, 197, 94, 0.24);
  border-color: rgba(134, 239, 172, 0.4);
  color: #bbf7d0 !important;
}

html[data-theme="dark"] .empty-state {
  background: rgba(30, 41, 59, 0.7);
  border: 1px dashed rgba(148, 163, 184, 0.32);
  color: var(--muted-text) !important;
}

/* Final course-defense polish: login helpers and unclipped dashboard content. */
.app-main {
  padding-bottom: clamp(3rem, 5vw, 5rem);
}

.dashboard-bento-grid,
.bento-card,
.bento-card .card-body {
  overflow: visible;
}

.bento-card-vacancies .card-body {
  padding-bottom: 1.15rem;
}

.stack-list-item .badge,
.interview-item .badge {
  justify-self: end;
  white-space: nowrap;
}

.login-note {
  background: rgba(49, 87, 213, 0.08);
  border: 1px solid rgba(49, 87, 213, 0.18);
  border-radius: 0.85rem;
  color: var(--text-color);
  font-size: 0.92rem;
  padding: 0.8rem 0.9rem;
}

.demo-users-panel {
  background: var(--surface-muted) !important;
  color: var(--text-color);
}

.demo-user-row {
  align-items: center;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 0.7rem;
  color: var(--text-color);
  display: flex;
  gap: 0.65rem;
  justify-content: space-between;
  margin-top: 0.45rem;
  min-height: 42px;
  padding: 0.5rem 0.65rem;
  text-align: left;
  width: 100%;
}

.demo-user-row:hover {
  background: var(--app-primary-soft);
  border-color: rgba(129, 140, 248, 0.34);
}

@media (max-width: 767.98px) {
  .has-auth-shell .app-main {
    padding-bottom: calc(6.5rem + env(safe-area-inset-bottom));
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .has-auth-shell .app-main {
    padding-bottom: clamp(2rem, 4vw, 3rem);
  }
}

.candidate-path {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.candidate-path span {
  background: var(--surface-muted);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  color: var(--text-color);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.5rem 0.75rem;
}

html[data-theme="dark"] .login-note {
  background: rgba(99, 102, 241, 0.16);
  border-color: rgba(165, 180, 252, 0.3);
  color: #e0e7ff;
}

html[data-theme="dark"] .demo-users-panel {
  background: #111827 !important;
  border-color: #475569 !important;
}

html[data-theme="dark"] .demo-user-row {
  background: #172033;
  border-color: #334155;
  color: var(--text-color);
}

html[data-theme="dark"] .demo-user-row:hover {
  background: #1e293b;
}

html[data-theme="dark"] .candidate-path span {
  background: #1e293b;
  border-color: #475569;
  color: #f8fafc;
}

/* Table action polish: keep CRUD controls readable in the dark theme. */
.table th:last-child,
.table td:last-child {
  padding-right: 1rem;
}

.table td.text-end.text-nowrap .btn {
  margin-bottom: 0.18rem;
  margin-left: 0.18rem;
}

html[data-theme="dark"] .btn-warning {
  background-color: #fbbf24;
  border-color: #f59e0b;
  color: #111827;
}

html[data-theme="dark"] .btn-warning:hover,
html[data-theme="dark"] .btn-warning:focus {
  background-color: #f59e0b;
  border-color: #d97706;
  color: #111827;
}

@media (max-width: 1399.98px) {
  .table td.text-end.text-nowrap {
    white-space: normal !important;
  }
}

@media (max-width: 575.98px) {
  .stack-list-item,
  .interview-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .stack-list-item .badge,
  .interview-item .badge {
    grid-column: 1 / -1;
    justify-self: start;
  }
}
