/* ===== Shared Variables — Light Medical Theme ===== */

:root {
  --primary: #0891b2;
  --primary-dark: #0e7490;
  --primary-light: #a5f3fc;
  --primary-gradient: linear-gradient(135deg, #0891b2 0%, #06b6d4 50%, #22d3ee 100%);
  --bg-body: #f0f9ff;
  --card-bg: #ffffff;
  --card-border: #e0f2fe;
  --input-bg: #f8fafc;
  --input-border: #cbd5e1;
  --input-focus-border: #0891b2;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --sidebar-width: 300px;
  --header-height: 64px;
  --transition-speed: 0.3s;
}

/* ===== Login & Registration Page ===== */

.login-page {
  min-height: 100vh;
  background: var(--bg-body);
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.login-page .main-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.login-page .auth-container {
  width: 100%;
  max-width: 460px;
}

/* --- Proctoring Icon --- */

.proctoring-icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
  box-shadow: 0 8px 24px rgba(8, 145, 178, 0.25);
}

.proctoring-icon i {
  font-size: 32px;
  color: #fff;
}

.proctoring-label {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.5px;
}

/* --- Greeting --- */

.greeting-text {
  color: var(--text-primary);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.greeting-subtext {
  color: var(--text-muted);
  font-size: 0.925rem;
  margin-bottom: 2rem;
}

/* --- Auth Card --- */

.auth-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 4px 24px rgba(8, 145, 178, 0.08);
}

/* --- Tab Pills --- */

.auth-card .nav-pills .nav-link {
  color: var(--text-muted);
  font-weight: 500;
  border-radius: 10px;
  padding: 0.6rem 1.5rem;
  transition: all 0.25s ease;
  background: transparent;
  border: 1px solid transparent;
}

.auth-card .nav-pills .nav-link.active {
  background: var(--primary-gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(8, 145, 178, 0.3);
}

.auth-card .nav-pills .nav-link:not(.active):hover {
  color: var(--primary);
  border-color: var(--card-border);
}

/* --- Form Inputs with Icons --- */

.input-icon-group {
  position: relative;
  margin-bottom: 1rem;
}

.input-icon-group .input-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.95rem;
  z-index: 3;
  pointer-events: none;
  transition: color 0.2s ease;
}

.input-icon-group:focus-within .input-icon {
  color: var(--primary);
}

/* --- Password Toggle --- */

.password-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0.25rem;
  color: var(--text-muted);
  cursor: pointer;
  z-index: 4;
  line-height: 1;
  transition: color 0.2s ease;
}

.password-toggle:hover {
  color: var(--primary);
}

.input-icon-group:has(.password-toggle) .form-floating > .form-control {
  padding-right: 2.5rem;
}

.input-icon-group .form-floating {
  flex: 1;
}

.input-icon-group .form-floating > .form-control {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 10px;
  color: var(--text-primary);
  height: 3.25rem;
  padding: 1rem 0.85rem 0.35rem 2.5rem;
  font-size: 0.9rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-icon-group .form-floating > .form-control:focus {
  background: #fff;
  border-color: var(--input-focus-border);
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.12);
  color: var(--text-primary);
}

.input-icon-group .form-floating > .form-control:disabled {
  background: #e2e8f0;
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.8;
}

.input-icon-group .form-floating > .form-control::placeholder {
  color: transparent;
}

.input-icon-group .form-floating > label {
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 0.85rem 0.85rem 0.85rem 2.5rem;
}

.input-icon-group .form-floating > .form-control:focus ~ label,
.input-icon-group .form-floating > .form-control:not(:placeholder-shown) ~ label {
  color: var(--primary);
  transform: scale(0.8) translateY(-0.6rem) translateX(0.1rem);
}

.input-icon-group .form-floating > textarea.form-control {
  padding-top: 0.85rem;
}

.input-icon-group .form-floating > textarea.form-control::placeholder {
  color: var(--text-muted);
}

.input-icon-group .form-floating > textarea.form-control ~ label {
  display: none;
}

/* --- Bootstrap Validation Overrides --- */

.input-icon-group .form-floating > .form-control.is-invalid {
  border-color: #dc3545;
  background-image: none;
}

.input-icon-group .form-floating > .form-control.is-invalid:focus {
  border-color: #dc3545;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.12);
}

.input-icon-group .form-floating > .form-control.is-valid {
  border-color: #16a34a;
  background-image: none;
}

.input-icon-group .form-floating > .form-control.is-valid:focus {
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}

.input-icon-group .form-floating > .form-control.is-invalid ~ label,
.input-icon-group .form-floating > .form-control.is-valid ~ label {
  color: inherit;
}

.input-icon-group .invalid-feedback {
  font-size: 0.78rem;
  padding-left: 2.5rem;
  margin-top: 0.15rem;
}

/* --- Password Requirements Hint --- */

.password-requirements {
  margin: -0.5rem 0 0.75rem 0.25rem;
  padding-left: 1.2rem;
  list-style: none;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.password-requirements li::before {
  content: '\f111';
  font-family: 'FontAwesome';
  font-size: 0.35rem;
  vertical-align: middle;
  margin-right: 0.45rem;
  color: var(--input-border);
  transition: color 0.2s ease;
}

.password-requirements li.valid {
  color: #16a34a;
}

.password-requirements li.valid::before {
  content: '\f00c';
  font-size: 0.7rem;
  color: #16a34a;
}

/* --- Login Options (Remember me / Forgot password) --- */

.login-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
}

.login-options .form-check-input {
  background-color: var(--input-bg);
  border-color: var(--input-border);
  cursor: pointer;
}

.login-options .form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

.login-options .form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.12);
  border-color: var(--primary);
}

.login-options .form-check-label {
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
}

.forgot-password-link {
  color: var(--primary);
  font-size: 0.85rem;
  text-decoration: none;
  font-weight: 500;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color 0.2s ease;
}

.forgot-password-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* --- Forgot Password Modal --- */

.forgot-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.forgot-modal-backdrop.d-none {
  display: none;
}

.forgot-modal {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 16px 48px rgba(8, 145, 178, 0.15);
}

.forgot-modal-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.forgot-modal-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

/* --- Buttons --- */

.btn-primary-gradient {
  background: var(--primary-gradient);
  border: none;
  border-radius: 10px;
  padding: 0.7rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
  transition: opacity 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
  box-shadow: 0 4px 12px rgba(8, 145, 178, 0.3);
}

.btn-primary-gradient:hover {
  opacity: 0.92;
  box-shadow: 0 6px 20px rgba(8, 145, 178, 0.4);
  color: #fff;
  transform: translateY(-1px);
}

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

.btn-primary-gradient:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary-gradient .fa {
  margin-right: 0.4rem;
}

.btn-outline-secondary {
  border-color: var(--input-border);
  color: var(--text-secondary);
  border-radius: 10px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-outline-secondary:hover {
  background: var(--input-bg);
  border-color: var(--text-muted);
  color: var(--text-primary);
}

/* --- Switch Text --- */

.switch-text {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.switch-text a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.switch-text a:hover {
  color: var(--primary-dark);
}

/* --- Contact Text --- */

.contact-text {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.contact-text .fa {
  margin-right: 0.3rem;
}

.contact-text a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.contact-text a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* --- Toast Alert --- */

.alert-toast {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  min-width: 300px;
  max-width: 420px;
  border-radius: 10px;
  border: none;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.alert-toast .toast-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 0.1rem;
}

.toast-list {
  margin: 0;
  padding-left: 1.1rem;
  list-style: disc;
  font-size: 0.85rem;
  line-height: 1.6;
}

/* --- Language Switcher (login page) --- */

.login-page .lang-switcher {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 10;
}

/* --- Language Switcher (shared) --- */

.lang-switcher .btn {
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  background: var(--card-bg);
  transition: all 0.2s ease;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.flag-icon {
  width: 18px;
  height: 12px;
  object-fit: cover;
  border-radius: 2px;
  vertical-align: middle;
}

.lang-switcher .btn.active {
  color: var(--primary-dark);
  border-color: var(--primary);
  background: rgba(8, 145, 178, 0.08);
}

.lang-switcher .btn:hover:not(.active) {
  color: var(--text-secondary);
  border-color: var(--text-muted);
}

/* --- Footer (login page) --- */

.login-footer {
  padding: 1.25rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.login-footer span {
  vertical-align: middle;
}

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--primary);
}

.footer-link img {
  height: 20px;
  width: auto;
  margin-left: 0.35rem;
  vertical-align: middle;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.footer-link:hover img {
  opacity: 1;
}

/* --- Spinner --- */

.auth-card .spinner-border-sm,
.modal-custom .spinner-border-sm {
  width: 1rem;
  height: 1rem;
  border-width: 0.15em;
}

/* --- Responsive (login page) --- */

@media (max-width: 576px) {
  .auth-card {
    padding: 1.5rem;
  }

  .greeting-text {
    font-size: 1.25rem;
  }

  .proctoring-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
  }

  .proctoring-icon i {
    font-size: 26px;
  }

  .login-options {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}


/* ============================================================
   DASHBOARD LAYOUT
   ============================================================ */

.dashboard-page {
  min-height: 100vh;
  background: var(--bg-body);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* --- Header --- */

.dashboard-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--card-bg);
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  z-index: 1000;
  box-shadow: 0 1px 8px rgba(8, 145, 178, 0.06);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-toggle:hover {
  background: var(--input-bg);
  color: var(--primary);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.header-brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(8, 145, 178, 0.2);
}

.header-brand-icon i {
  font-size: 17px;
  color: #fff;
}

.header-brand-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.3px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* --- Header Language Switcher --- */

.dashboard-header .lang-switcher {
  display: flex;
  gap: 0.35rem;
}

/* --- Profile Dropdown --- */

.profile-dropdown {
  position: relative;
}

.profile-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: none;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.profile-btn:hover {
  border-color: var(--primary-light);
  background: rgba(8, 145, 178, 0.04);
}

.profile-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-avatar i {
  font-size: 15px;
  color: #fff;
}

.profile-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

.profile-info {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.2;
}

.profile-greeting {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.profile-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-arrow {
  font-size: 0.65rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.profile-dropdown.open .profile-arrow {
  transform: rotate(180deg);
}

.profile-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 200px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(8, 145, 178, 0.12);
  padding: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  z-index: 1010;
}

.profile-dropdown.open .profile-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.profile-menu-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.55rem 0.75rem;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.profile-menu-item:hover {
  background: var(--input-bg);
  color: var(--text-primary);
}

.profile-menu-item i {
  font-size: 0.95rem;
  width: 18px;
  text-align: center;
}

.profile-menu-logout:hover {
  background: #fef2f2;
  color: #dc3545;
}

.profile-menu-divider {
  height: 1px;
  background: var(--card-border);
  margin: 0.35rem 0.5rem;
}

/* --- Sidebar --- */

.sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--card-bg);
  border-right: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  z-index: 999;
  transition: transform var(--transition-speed) ease;
  box-shadow: 1px 0 8px rgba(8, 145, 178, 0.04);
}

.sidebar.collapsed {
  transform: translateX(-100%);
}

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

.sidebar-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-item {
  margin-bottom: 0.25rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
}

a.sidebar-link:hover {
  background: rgba(8, 145, 178, 0.06);
  color: var(--primary);
}

.sidebar-item.active .sidebar-link {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 4px 12px rgba(8, 145, 178, 0.3);
}

.sidebar-item.active .sidebar-link i {
  color: #fff;
}

.sidebar-link > i:first-child {
  font-size: 1.05rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-item.disabled .sidebar-link {
  color: var(--text-muted);
  cursor: default;
  opacity: 0.7;
}

.sidebar-badge {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  margin-left: auto;
  white-space: nowrap;
}

.sidebar-info-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem;
  font-size: 0.9rem;
  transition: color 0.2s ease;
  flex-shrink: 0;
}

.sidebar-info-btn:hover {
  color: var(--primary);
}

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

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--card-border);
  text-align: center;
}

.sidebar-footer-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.sidebar-footer-text .footer-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 500;
}

.sidebar-footer-text .footer-link img {
  height: 16px;
}

.sidebar-footer-contact {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.sidebar-footer-contact i {
  margin-right: 0.2rem;
}

.sidebar-footer-contact a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.sidebar-footer-contact a:hover {
  text-decoration: underline;
}

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

.sidebar-overlay {
  position: fixed;
  inset: 0;
  top: var(--header-height);
  background: rgba(15, 23, 42, 0.3);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-speed) ease;
}

.sidebar-overlay.visible {
  opacity: 1;
  visibility: visible;
}

/* --- Main Wrapper --- */

.main-wrapper {
  margin-left: var(--sidebar-width);
  margin-top: var(--header-height);
  padding: 1.5rem;
  min-height: calc(100vh - var(--header-height));
  transition: margin-left var(--transition-speed) ease;
}

.main-wrapper.expanded {
  margin-left: 0;
}

/* ============================================================
   DASHBOARD CONTENT
   ============================================================ */

.dashboard-content {
  max-width: 1100px;
  margin: 0 auto;
}

/* --- Page Title --- */

.page-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.page-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0.2rem 0 0;
}

.test-counter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 0.5rem 1rem;
}

.test-counter-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.test-counter-value {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  background: rgba(8, 145, 178, 0.08);
  padding: 0.15rem 0.6rem;
  border-radius: 6px;
}

.test-counter-info {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.15rem;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
}

.test-counter-info:hover {
  color: var(--primary);
}

/* --- Stats Row --- */

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.stat-card:hover {
  box-shadow: 0 4px 16px rgba(8, 145, 178, 0.1);
  transform: translateY(-2px);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon i {
  font-size: 1.25rem;
  color: #fff;
}

.stat-icon-tests {
  background: linear-gradient(135deg, #0891b2, #22d3ee);
}

.stat-icon-questions {
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
}

.stat-icon-candidates {
  background: linear-gradient(135deg, #059669, #34d399);
}

.stat-icon-sessions {
  background: linear-gradient(135deg, #d97706, #fbbf24);
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* --- Tests Section --- */

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title i {
  color: var(--primary);
}

/* --- Empty State --- */

.empty-state {
  background: var(--card-bg);
  border: 2px dashed var(--card-border);
  border-radius: 16px;
  padding: 3rem 2rem;
  text-align: center;
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(8, 145, 178, 0.08), rgba(34, 211, 238, 0.08));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
}

.empty-state-icon i {
  font-size: 2rem;
  color: var(--primary);
}

.empty-state-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.empty-state-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

/* --- Tests Grid --- */

.tests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.test-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.15s ease;
  display: flex;
  flex-direction: column;
}

.test-card:hover {
  box-shadow: 0 4px 20px rgba(8, 145, 178, 0.1);
  transform: translateY(-2px);
}

.test-card-image {
  width: 100%;
  height: 140px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(8, 145, 178, 0.06), rgba(34, 211, 238, 0.06));
}

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

.test-card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.test-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.test-card-header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.test-card-delete {
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.test-card-delete:hover {
  background: #fee2e2;
  border-color: #fecaca;
  color: #dc2626;
}

.test-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(8, 145, 178, 0.1), rgba(34, 211, 238, 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.test-card-icon i {
  font-size: 1.1rem;
  color: var(--primary);
}

.test-card-status {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
}

.test-card-status.draft {
  background: #f1f5f9;
  color: var(--text-muted);
}

.test-card-status.active {
  background: #ecfdf5;
  color: #059669;
}

.test-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.test-card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.test-card-meta {
  display: flex;
  gap: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--card-border);
}

.test-card-meta-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.test-card-meta-item i {
  font-size: 0.85rem;
  color: var(--primary);
}

.test-card-meta {
  align-items: center;
  justify-content: space-between;
}

.test-card-countdown {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  white-space: nowrap;
}

.test-card-countdown i {
  font-size: 0.8rem;
}

.test-card-countdown.state-scheduled {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.test-card-countdown.state-running {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.test-card-countdown.state-warning {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

.test-card-countdown.state-critical {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
  animation: countdown-pulse 1.4s ease-in-out infinite;
}

.test-card-countdown.state-ended {
  background: #f1f5f9;
  color: var(--text-muted);
  border-color: #e2e8f0;
}

@keyframes countdown-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.25); }
  50%      { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
}

/* --- Create Test Row --- */

.create-test-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.25rem;
}

.free-limit-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ============================================================
   SHARED MODALS (dashboard)
   ============================================================ */

.modal-backdrop-custom {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop-custom.d-none {
  display: none;
}

.modal-custom {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 2rem;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 16px 48px rgba(8, 145, 178, 0.15);
}

.modal-custom-lg {
  max-width: 540px;
}

.modal-custom-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.modal-custom-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background: var(--input-bg);
  color: var(--text-primary);
}

.modal-custom .d-flex > .btn.flex-fill {
  flex: 1 1 0 !important;
}

/* --- Profile Picture Upload --- */

.profile-picture-upload {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--card-border);
}

.profile-picture-wrapper {
  position: relative;
  flex-shrink: 0;
}

.profile-picture-preview {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(8, 145, 178, 0.2);
}

.profile-picture-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-picture-preview i {
  font-size: 28px;
  color: #fff;
}

.profile-picture-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #dc3545;
  color: #fff;
  border: 2px solid var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.6rem;
  padding: 0;
  transition: background 0.2s ease, transform 0.15s ease;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(220, 53, 69, 0.35);
}

.profile-picture-remove:hover {
  background: #b91c1c;
  transform: scale(1.1);
}

.profile-picture-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.profile-picture-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-outline-primary-custom {
  border: 1px solid var(--primary);
  color: var(--primary);
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.3rem 0.7rem;
  background: none;
  transition: all 0.2s ease;
}

.btn-outline-primary-custom:hover {
  background: rgba(8, 145, 178, 0.08);
  color: var(--primary-dark);
}

.profile-picture-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* --- Password Section Toggle --- */

.password-section-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.6rem 0.85rem;
  margin-bottom: 0.75rem;
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.password-section-toggle:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}

.password-section-toggle.open {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(8, 145, 178, 0.04);
}

.password-section-toggle > .fa-lock {
  font-size: 0.9rem;
}

.password-section-arrow {
  margin-left: auto;
  font-size: 0.65rem;
  transition: transform 0.25s ease;
}

.password-section-toggle.open .password-section-arrow {
  transform: rotate(180deg);
}

.password-section-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.password-section-body.open {
  max-height: 500px;
}

.password-change-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: -0.5rem;
  margin-bottom: 0.5rem;
}

/* --- Feature Info Modal --- */

.feature-modal-body {
  text-align: center;
  padding: 0.5rem 0;
}

.feature-modal-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(217, 119, 6, 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.75rem;
  color: #d97706;
}

.feature-modal-alert {
  text-align: left;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  border-radius: 12px;
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
  font-size: 0.88rem;
  line-height: 1.65;
  border: 1px solid rgba(8, 145, 178, 0.2);
  background: rgba(8, 145, 178, 0.06);
  color: var(--text-secondary);
}

.feature-modal-alert-icon {
  font-size: 1.15rem;
  color: var(--primary);
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.feature-modal-alert-text {
  margin: 0;
}

.feature-modal-alert-text p {
  margin: 0;
}

.free-limit-icon {
  background: linear-gradient(135deg, rgba(8, 145, 178, 0.1), rgba(34, 211, 238, 0.1));
  color: var(--primary);
}

.confirm-modal-icon-info {
  background: linear-gradient(135deg, rgba(8, 145, 178, 0.1), rgba(34, 211, 238, 0.1));
  color: var(--primary);
}

.confirm-modal-icon-warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(217, 119, 6, 0.1));
  color: #d97706;
}

.confirm-modal-icon-danger {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.1));
  color: #dc2626;
}

.confirm-modal-message {
  margin: 0 0 0.35rem;
  color: var(--text-secondary);
}

.confirm-modal-target {
  margin: 0;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-word;
}

.free-limit-list {
  list-style: none;
  padding: 0;
  margin: 0.65rem 0 0;
}

.free-limit-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.free-limit-list li i {
  color: var(--primary);
  width: 18px;
  text-align: center;
  font-size: 0.9rem;
}

.feature-modal-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 1rem;
  border-radius: 8px;
}

/* ============================================================
   RESPONSIVE — DASHBOARD
   ============================================================ */

@media (max-width: 992px) {
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .profile-info {
    display: none;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .main-wrapper {
    margin-left: 0;
  }

  .page-title-row {
    flex-direction: column;
  }

  .header-brand-text {
    display: none;
  }
}

@media (max-width: 576px) {
  .stats-row {
    grid-template-columns: 1fr;
  }

  .main-wrapper {
    padding: 1rem;
  }

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

  .dashboard-header .lang-switcher {
    display: none;
  }
}
