/* ===================================================================
   STUDY PORTAL — Design System CSS
   Based on study-portal-design-system.mdc (Figma)
   =================================================================== */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&family=Inter:wght@300;400;500;600&display=swap');

/* ===================================================================
   1. CSS CUSTOM PROPERTIES (TOKENS)
   =================================================================== */
:root {
  /* ── Colors ── */
  --color-primary-ink: #020617;
  --color-tertiary-text: #64748b;
  --color-secondary-text: #475569;
  --color-sidebar: #0f172a;
  --color-accent-purple: #9333ea;
  --color-primary-orange: #ed9d08;
  --color-orange-highlight: #ffb222;
  --color-card-border: #f3e3c3;
  --color-light-border: #e4e4e4;
  --color-panel-border: #e2e8f0;
  --color-overlay-scrim: rgba(26, 26, 26, 0.20);
  --color-danger: #c92146;
  --color-success: #00bf29;
  --color-weakness: #f09400;
  --color-recommendation: #008bef;
  --color-white: #ffffff;
  --color-question-bubble: #f8eed9;
  --color-answer-bubble: #f3f4f6;
  --color-feedback-bg: #fffce8;
  --color-suggested-bg: #e9ffe8;
  --color-emotion-track: #e9e9e9;
  --color-emotion-fill: #5ebfa1;
  --color-nav-chip: #f6a816;
  --color-ai-badge: #ffe100;
  --color-field-label: #515151;
  --color-placeholder: rgba(81, 81, 81, 0.7);
  --color-link-accent: #c5730a;
  --color-link-emphasis: #c6740a;
  --color-heading-login: #363636;
  --color-row-separator: #d7d7d7;
  --color-table-header-bg: #f8eed9;
  --color-subsection-active: #f3e3c3;
  --color-recorder-bg: #2f2f2f;

  /* ── Tag Colors ── */
  --color-tag-easy: #ffd58f;
  --color-tag-questions: #bbf7d0;
  --color-tag-attempts: #d9f99d;
  --color-tag-easy-alt: #ebbc00;
  --color-tag-questions-alt: #00ebd0;
  --color-tag-attempts-alt: #c8eb00;

  /* ── Legend ── */
  --color-legend-visa: #e07204;
  --color-legend-comm: #e0046f;

  /* ── Surfaces ── */
  --surface-card: rgba(255, 255, 255, 0.36);
  --surface-white: #ffffff;

  /* ── Gradients ── */
  --gradient-primary-btn: linear-gradient(135deg, #ffb222, #ed9d08);
  --gradient-warm-bg: linear-gradient(160deg, #fefcf7 0%, #fdf6e8 40%, #fef9f0 100%);

  /* ── Radius ── */
  --radius-main: 10px;
  --radius-card: 12px;
  --radius-pill: 999px;
  --radius-input: 5px;
  --radius-small: 4px;
  --radius-sidebar: 20px;
  --radius-player: 20px;
  --radius-emotion: 8px;
  --radius-callout: 5px;

  /* ── Shadows ── */
  --shadow-input: 0 1px 6px rgba(0, 0, 0, 0.04);
  --shadow-topbar: 0 1px 4px rgba(0, 0, 0, 0.15);
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-sidebar-active: 0 0 12px rgba(255, 178, 34, 0.25);

  /* ── Typography ── */
  --font-display: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* ── Spacing (8px rhythm) ── */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* ── Sizes ── */
  --input-height: 54px;
  --sidebar-width-compact: 93px;
  --sidebar-width-expanded: 319px;
  --sidebar-icon-size: 59px;
  --header-height: 64px;
  --notification-pill-size: 55px;
  --control-size: 42px;
}

/* ===================================================================
   2. RESET & BASE
   =================================================================== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-body);
  color: var(--color-primary-ink);
  background: var(--gradient-warm-bg);
  min-height: 100vh;
  line-height: 1.5;
}

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

ul,
ol {
  list-style: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

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

input,
select,
textarea {
  font-family: var(--font-body);
  outline: none;
  border: none;
}

/* ===================================================================
   3. TYPOGRAPHY UTILITIES
   =================================================================== */
.font-display {
  font-family: var(--font-display);
}

.font-body {
  font-family: var(--font-body);
}

/* Headings — Poppins */
.heading-h1 {
  font-family: var(--font-display);
  font-size: 48px;
  line-height: 56px;
  font-weight: 600;
}

.heading-h2 {
  font-family: var(--font-display);
  font-size: 40px;
  line-height: 48px;
  font-weight: 600;
}

.heading-h3 {
  font-family: var(--font-display);
  font-size: 32px;
  line-height: 38px;
  font-weight: 500;
}

.heading-h4 {
  font-family: var(--font-display);
  font-size: 32px;
  line-height: 38px;
  font-weight: 500;
}

.heading-h5 {
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 30px;
  font-weight: 500;
}

.heading-h6 {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 24px;
  font-weight: 500;
}

/* Body — Inter */
.body-1 {
  font-size: 18px;
  line-height: 28px;
  font-weight: 400;
}

.body-2 {
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
}

.body-3 {
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
}

.body-4 {
  font-size: 12px;
  line-height: 16px;
  font-weight: 400;
}

.label-1 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
}

.label-2 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
}

.label-3 {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.text-primary {
  color: var(--color-primary-ink);
}

.text-secondary {
  color: var(--color-secondary-text);
}

.text-tertiary {
  color: var(--color-tertiary-text);
}

.text-white {
  color: var(--color-white);
}

.text-danger {
  color: var(--color-danger);
}

.text-success {
  color: var(--color-success);
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-semibold {
  font-weight: 600;
}

.text-medium {
  font-weight: 500;
}

.text-bold {
  font-weight: 700;
}

/* ===================================================================
   4. LAYOUT UTILITIES
   =================================================================== */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.items-end {
  align-items: flex-end;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-end {
  justify-content: flex-end;
}

.flex-1 {
  flex: 1;
}

.flex-shrink-0 {
  flex-shrink: 0;
}

.grid {
  display: grid;
}

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

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.gap-1 {
  gap: var(--space-1);
}

.gap-2 {
  gap: var(--space-2);
}

.gap-3 {
  gap: var(--space-3);
}

.gap-4 {
  gap: var(--space-4);
}

.gap-5 {
  gap: var(--space-5);
}

.gap-6 {
  gap: var(--space-6);
}

.gap-7 {
  gap: var(--space-7);
}

.gap-8 {
  gap: var(--space-8);
}

.relative {
  position: relative;
}

.absolute {
  position: absolute;
}

.fixed {
  position: fixed;
}

.sticky {
  position: sticky;
  top: 0;
  z-index: 10;
}

.w-full {
  width: 100%;
}

.h-full {
  height: 100%;
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

.overflow-hidden {
  overflow: hidden;
}

.overflow-auto {
  overflow-y: auto;
}

.hidden {
  display: none !important;
}

.visible {
  display: block;
}

/* ===================================================================
   5. PAGE SHELL
   =================================================================== */
.page-shell {
  display: flex;
  min-height: 100vh;
  background: var(--gradient-warm-bg);
}

.page-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.page-container {
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--space-5);
}

.main-content {
  flex: 1;
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

/* ===================================================================
   6. HEADER
   =================================================================== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 var(--space-5);
  background: var(--surface-white);
  box-shadow: var(--shadow-topbar);
  z-index: 1001;
}

.header__menu-toggle {
  display: none;
  cursor: pointer;
  color: var(--color-primary-ink);
  margin-right: var(--space-3);
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  transition: background 0.2s ease;
}

.header__menu-toggle:hover {
  background: rgba(0, 0, 0, 0.05);
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

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

.header__logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.header__logo-icon {
  width: 36px;
  height: 36px;
  background: var(--gradient-primary-btn);
  border-radius: var(--radius-emotion);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-white);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
}

.header__brand {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--color-primary-ink);
}

.header__right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.header__notification {
  width: var(--notification-pill-size);
  height: 40px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-light-border);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-input);
  background: var(--surface-white);
  cursor: pointer;
  position: relative;
  transition: box-shadow 0.2s;
}

.header__notification:hover {
  box-shadow: var(--shadow-card);
}

.header__notification-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  background: var(--color-danger);
  border-radius: 50%;
  border: 2px solid var(--surface-white);
}

.header__greeting {
  text-align: right;
}

.header__greeting-text {
  font-size: 12px;
  color: var(--color-tertiary-text);
}

.header__greeting-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-primary-ink);
}

.header__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-accent-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-white);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.2s;
}

.header__avatar:hover {
  transform: scale(1.05);
}

/* ===================================================================
   7. SIDEBAR
   =================================================================== */
.sidebar {
  width: var(--sidebar-width-compact);
  background: var(--color-sidebar);
  border-radius: var(--radius-sidebar);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-5) 0;
  gap: var(--space-3);
  margin: var(--space-4);
  flex-shrink: 0;
  transition: width 0.3s ease;
}

.sidebar--expanded {
  width: var(--sidebar-width-expanded);
  align-items: flex-start;
  padding: var(--space-5) var(--space-4);
}

.sidebar__item {
  width: var(--sidebar-icon-size);
  height: var(--sidebar-icon-size);
  border-radius: var(--radius-main);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 20px;
}

.sidebar__item:hover {
  color: var(--color-white);
  background: rgba(255, 255, 255, 0.08);
}

.sidebar__item--active {
  color: var(--color-white);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-sidebar-active);
}

.sidebar--expanded .sidebar__item {
  width: 100%;
  justify-content: flex-start;
  gap: var(--space-3);
  padding: 0 var(--space-4);
}

.sidebar__item-label {
  display: none;
  font-size: 14px;
  color: var(--color-white);
  font-family: var(--font-body);
}

.sidebar--expanded .sidebar__item-label {
  display: inline;
}

.sidebar__divider {
  width: 60%;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
  margin: var(--space-2) auto;
}

.sidebar__bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
}

.sidebar--expanded .sidebar__bottom {
  align-items: flex-start;
}

.sidebar--expanded .sidebar__divider {
  width: 100%;
}

/* Toggle button (hamburger / menu icon at top) */
.sidebar__toggle {
  width: var(--sidebar-icon-size);
  height: var(--sidebar-icon-size);
  border-radius: var(--radius-main);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: var(--space-3);
}

.sidebar__toggle:hover {
  color: var(--color-white);
  background: rgba(255, 255, 255, 0.08);
}

/* Open state — triggered by JS toggling .sidebar--open */
.sidebar.sidebar--open {
  width: var(--sidebar-width-expanded);
  align-items: flex-start;
  padding: var(--space-5) var(--space-4);
}

.sidebar--open .sidebar__item {
  width: 100%;
  justify-content: flex-start;
  gap: var(--space-3);
  padding: 0 var(--space-4);
}

.sidebar--open .sidebar__item-label {
  display: inline;
}

.sidebar--open .sidebar__bottom {
  align-items: flex-start;
}

.sidebar--open .sidebar__divider {
  width: 100%;
}

/* Logout specific accent */
.sidebar__item--logout {
  color: rgba(255, 100, 100, 0.7);
}

.sidebar__item--logout:hover {
  color: #ff6b6b;
  background: rgba(255, 100, 100, 0.1);
}

/* ===================================================================
   8. CARDS
   =================================================================== */
.card {
  background: var(--surface-card);
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-card);
  padding: var(--space-6);
  transition: box-shadow 0.2s ease;
}

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

.card--white {
  background: var(--surface-white);
}

.card--no-hover:hover {
  box-shadow: none;
}

.card__title {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 24px;
  font-weight: 500;
  color: var(--color-primary-ink);
  margin-bottom: var(--space-4);
}

.card__subtitle {
  font-size: 14px;
  color: var(--color-tertiary-text);
  margin-bottom: var(--space-4);
}

/* ===================================================================
   9. BUTTONS
   =================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.btn--primary {
  background: var(--gradient-primary-btn);
  color: var(--color-white);
  padding: var(--space-3) var(--space-6);
  border: none;
  box-shadow: 0 2px 8px rgba(237, 157, 8, 0.3);
}

.btn--primary:hover {
  box-shadow: 0 4px 16px rgba(237, 157, 8, 0.45);
  transform: translateY(-1px);
}

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

.btn--primary-lg {
  padding: var(--space-3) var(--space-10);
}

.btn--outline {
  background: var(--surface-white);
  border: 1px solid var(--color-light-border);
  color: var(--color-primary-ink);
  padding: var(--space-3) var(--space-6);
}

.btn--outline:hover {
  border-color: var(--color-primary-orange);
  background: rgba(255, 178, 34, 0.04);
}

.btn--danger {
  background: var(--color-danger);
  color: var(--color-white);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-input);
}

.btn--danger:hover {
  background: #a81c3b;
}

.btn--ghost {
  background: transparent;
  color: var(--color-secondary-text);
  padding: var(--space-2) var(--space-4);
}

.btn--ghost:hover {
  background: rgba(0, 0, 0, 0.04);
}

.btn--link {
  background: none;
  color: var(--color-primary-ink);
  padding: 0;
  font-weight: 500;
}

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

.btn--icon {
  width: var(--control-size);
  height: var(--control-size);
  padding: 0;
  border-radius: 50%;
  background: var(--surface-white);
  border: 1px solid var(--color-light-border);
}

.btn--icon:hover {
  border-color: var(--color-primary-orange);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ===================================================================
   10. FORM ELEMENTS
   =================================================================== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-label {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--color-field-label);
  font-weight: 400;
}

.form-label--sm {
  font-size: 14px;
  color: var(--color-secondary-text);
}

.form-input,
.form-select {
  height: var(--input-height);
  width: 100%;
  padding: 0 var(--space-4);
  background: var(--surface-white);
  border: 1px solid var(--color-light-border);
  border-radius: var(--radius-input);
  box-shadow: var(--shadow-input);
  font-size: 14px;
  color: var(--color-primary-ink);
  transition: border-color 0.2s ease;
}

.form-input::placeholder,
.form-select::placeholder {
  font-size: 14px;
  color: var(--color-placeholder);
}

.form-input:focus,
.form-select:focus {
  border-color: var(--color-orange-highlight);
  box-shadow: 0 0 0 3px rgba(255, 178, 34, 0.1);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: var(--space-10);
}

.form-input--modal,
.form-select--modal {
  border-color: var(--color-panel-border);
}

.form-error {
  font-size: 12px;
  color: var(--color-danger);
}

.form-hint {
  font-size: 12px;
  color: var(--color-tertiary-text);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-5);
}

/* ===================================================================
   11. MODAL
   =================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-overlay-scrim);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

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

.modal {
  background: var(--surface-white);
  border: 1px solid #f1f5f9;
  border-radius: var(--radius-main);
  min-width: 400px;
  max-width: 450px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.3s ease;
}

.modal-overlay--active .modal {
  transform: translateY(0) scale(1);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5);
  border-bottom: 1px solid var(--color-panel-border);
}

.modal__title {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 24px;
  font-weight: 500;
}

.modal__close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-small);
  color: var(--color-tertiary-text);
  cursor: pointer;
  transition: background 0.2s;
}

.modal__close:hover {
  background: rgba(0, 0, 0, 0.05);
}

.modal__body {
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  overflow-y: auto;
  flex: 1;
}

.modal__footer {
  padding: 0 var(--space-6) var(--space-6);
}

/* ===================================================================
   12. TAGS / CHIPS
   =================================================================== */
.tag {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-small);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.tag--easy {
  background: var(--color-tag-easy);
  color: var(--color-primary-ink);
}

.tag--questions {
  background: var(--color-tag-questions);
  color: var(--color-primary-ink);
}

.tag--attempts {
  background: var(--color-tag-attempts);
  color: var(--color-primary-ink);
}

.tag--orange {
  background: var(--color-nav-chip);
  color: var(--color-white);
  border-radius: var(--radius-pill);
}

.tag--filter {
  background: var(--color-orange-highlight);
  color: var(--color-white);
  border-radius: var(--radius-small);
}

.tag--body-lang {
  background: #dbeafe;
  color: var(--color-primary-ink);
}

.legend-dot--visa {
  color: var(--color-legend-visa);
}

.legend-dot--comm {
  color: var(--color-legend-comm);
}

.legend-dot--body {
  color: #3b82f6;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-small);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
}

.chip:hover {
  opacity: 0.85;
}

.chip--active {
  background: var(--color-orange-highlight);
  color: var(--color-white);
}

.chip--inactive {
  background: var(--surface-white);
  color: var(--color-secondary-text);
  border: 1px solid var(--color-panel-border);
}

/* ===================================================================
   13. TABS
   =================================================================== */
.tabs {
  display: flex;
  gap: 0;
}

.tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3) var(--space-4);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.02em;
  cursor: pointer;
  border: 1px solid var(--color-panel-border);
  background: var(--surface-white);
  color: var(--color-secondary-text);
  transition: all 0.2s ease;
}

.tab:first-child {
  border-radius: var(--radius-input) 0 0 var(--radius-input);
}

.tab:last-child {
  border-radius: 0 var(--radius-input) var(--radius-input) 0;
}

.tab--active {
  background: var(--color-orange-highlight);
  color: var(--color-white);
  border-color: var(--color-orange-highlight);
}

.tab:hover:not(.tab--active) {
  background: rgba(255, 178, 34, 0.06);
}

/* ===================================================================
   14. TABLE
   =================================================================== */
.table-wrapper {
  overflow-x: auto;
}

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

.table__head {
  background: var(--color-table-header-bg);
}

.table__head th {
  padding: var(--space-4);
  font-size: 14px;
  font-weight: 400;
  color: var(--color-primary-ink);
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.table__head th .sort-icon {
  display: inline-block;
  margin-left: var(--space-1);
  opacity: 0.4;
  font-size: 10px;
}

.table__body tr {
  border-bottom: 1px solid var(--color-row-separator);
  transition: background 0.15s;
}

.table__body tr:hover {
  background: rgba(255, 178, 34, 0.03);
}

.table__body td {
  padding: var(--space-4);
  font-size: 14px;
  line-height: 20px;
  color: var(--color-primary-ink);
}

.table-card {
  min-width: 0;
  overflow: hidden;
}

/* ===================================================================
   15. DONUT / PROGRESS
   =================================================================== */
.donut {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.donut__svg {
  transform: rotate(-90deg);
}

.donut__track {
  fill: none;
  stroke: var(--color-emotion-track);
}

.donut__fill {
  fill: none;
  stroke: var(--color-primary-orange);
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease;
}

.donut__value {
  position: absolute;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--color-primary-ink);
}

.donut--lg .donut__value {
  font-size: 32px;
}

.donut--md .donut__value {
  font-size: 18px;
}

.donut--sm .donut__value {
  font-size: 12px;
}

.donut--lg {
  width: 140px;
  height: 140px;
  flex-shrink: 0;
}

.donut--md {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}

.donut--sm {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.donut-label {
  text-align: center;
  font-size: 12px;
  color: var(--color-tertiary-text);
  margin-top: var(--space-2);
}

.mini-donuts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4) var(--space-6);
  justify-items: center;
}


/* ===================================================================
   16. EMOTION METER
   =================================================================== */
.emotion-row {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.emotion-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-emotion);
  border: 1px solid var(--color-light-border);
  background: var(--surface-white);
  min-width: 120px;
  flex: 1;
}

.emotion-card__label {
  font-size: 12px;
  color: var(--color-secondary-text);
}

.emotion-card__value {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--color-primary-ink);
}

.emotion-bar {
  height: 6px;
  background: var(--color-emotion-track);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.emotion-bar__fill {
  height: 100%;
  background: var(--color-emotion-fill);
  border-radius: var(--radius-pill);
  transition: width 0.8s ease;
}

/* ===================================================================
   17. INTERVIEW COMPONENTS
   =================================================================== */
/* Question/Answer bubbles */
.bubble {
  padding: var(--space-5);
  border-radius: var(--radius-main);
  display: flex;
  gap: var(--space-2);
}

.bubble--question {
  background: var(--color-question-bubble);
}

.bubble--answer {
  background: var(--color-answer-bubble);
}

.bubble__prefix {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--color-primary-ink);
  flex-shrink: 0;
}

.bubble__text {
  font-size: 16px;
  line-height: 24px;
  color: var(--color-primary-ink);
}

/* Callouts */
.callout {
  padding: var(--space-4);
  border-radius: var(--radius-callout);
}

.callout--feedback {
  background: var(--color-feedback-bg);
}

.callout--suggested {
  background: var(--color-suggested-bg);
}

.callout__title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.callout__text {
  font-size: 12px;
  line-height: 19px;
  color: var(--color-primary-ink);
}

/* Interview bar */
.interview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-5);
  background: var(--surface-white);
  border-radius: var(--radius-main);
  box-shadow: var(--shadow-topbar);
}

.interview-bar__left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.interview-bar__title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
}

.interview-bar__controls {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* Video pane */
.video-pane {
  position: relative;
  border-radius: var(--radius-main);
  overflow: hidden;
  background: var(--color-recorder-bg);
  min-height: 400px;
}

.video-pane__self-preview {
  position: absolute;
  bottom: var(--space-4);
  right: var(--space-4);
  width: 180px;
  height: 135px;
  border-radius: var(--radius-main);
  overflow: hidden;
  background: #1a1a1a;
  border: 2px solid var(--surface-white);
  box-shadow: var(--shadow-card);
}

.ai-badge {
  position: absolute;
  top: var(--space-4);
  left: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-ai-badge);
  border-radius: var(--radius-main);
  font-size: 14px;
  font-weight: 500;
  z-index: 5;
}

/* ===================================================================
   18. LOGIN PAGE
   =================================================================== */
.login-page {
  display: flex;
  min-height: 100vh;
  overflow: hidden;
}

.login-form-column {
  width: 40%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 40px 20px;
  height: 100vh;
  overflow-y: auto;
}

.login-image-column {
  flex: 1;
  min-width: 0;
  height: 100vh;
  overflow: hidden;
}

.login-image-column img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.login-title {
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 30px;
  font-weight: 500;
  color: var(--color-heading-login);
  margin-bottom: var(--space-8);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.login-action-text {
  font-size: 14px;
  color: var(--color-link-accent);
  cursor: pointer;
  transition: color 0.2s;
}

.login-action-text:hover {
  color: var(--color-primary-orange);
}

.login-links {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-size: 14px;
  color: var(--color-secondary-text);
}

.login-links a {
  text-decoration: underline;
  color: var(--color-secondary-text);
}

.login-links a:hover {
  color: var(--color-primary-orange);
}

.login-divider {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.login-divider__line {
  flex: 1;
  height: 1px;
  background: var(--color-light-border);
}

.login-divider__text {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--color-light-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--color-tertiary-text);
  background: var(--surface-white);
}

.login-google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-6);
  border: 1px solid var(--color-light-border);
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-primary-ink);
  cursor: pointer;
  background: var(--surface-white);
  transition: all 0.2s;
  width: 100%;
}

.login-google-btn:hover {
  border-color: var(--color-primary-orange);
  box-shadow: var(--shadow-input);
}

.login-bottom-text {
  font-size: 14px;
  color: var(--color-field-label);
  text-align: center;
}

.login-branding-spacer {
  margin-bottom: var(--space-10);
}

.login-bottom-text a {
  color: var(--color-link-emphasis);
  font-weight: 500;
}

/* ===================================================================
   19. DASHBOARD
   =================================================================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 327px;
  gap: var(--space-5);
  min-width: 0;
  /* Ensures the grid can shrink */
}

@media (max-width: 992px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.dashboard-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  min-width: 0;
  /* Allow column to shrink below content width */
}

.dashboard-rail {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  flex-shrink: 0;
  /* Keep rail fixed at 327px */
}

.performance-card {
  min-height: 306px;
}

/* ── Dashboard Performance Card – Figma layout ───────────────────── */
#performance-card {
  padding: var(--space-8);
}

.perf-card-content {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  /* Reduced from space-8 */
  justify-content: center;
}

.perf-card__left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  width: 140px;
  flex-shrink: 0;
}

#performance-card .card__title {
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  margin: 0;
  white-space: nowrap;
}

.perf-card__right {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  align-items: center;
}

.mini-donuts-row {
  display: flex;
  justify-content: center;
  gap: var(--space-8);
  /* Reduced horizontal gap */
}

/* Green stroke for mini-donuts in dashboard */
#performance-card .donut__fill {
  stroke: var(--color-success);
}

/* Overall donut stays yellow */
#performance-card .donut--lg .donut__fill {
  stroke: var(--color-primary-orange);
}

.mini-donut-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}

#performance-card .donut--sm {
  width: 52px;
  /* Slightly smaller to fit better on mobile */
  height: 52px;
}

@media (max-width: 768px) {
  .perf-card-content {
    flex-direction: column;
    gap: var(--space-6);
  }

  .mini-donuts-row {
    flex-wrap: wrap;
    gap: var(--space-4) var(--space-6);
    justify-content: center;
  }
}


.score-chart-card {
  min-height: 306px;
}

.period-toggle {
  display: flex;
  gap: 0;
  background: rgba(0, 0, 0, 0.03);
  border-radius: var(--radius-small);
  padding: 2px;
  flex-shrink: 0;
}

@media (max-width: 576px) {

  /* Allow tabs to wrap or shrink on very small screens */
  .score-chart-card .flex.items-center.gap-4 {
    flex-wrap: wrap;
    /* Allow tags/bullets to wrap if space is tight */
  }

  .score-chart-card .flex.items-center.justify-between {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
  }

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

  .period-toggle__item {
    flex: 1;
    text-align: center;
    padding: var(--space-2) var(--space-1);
    font-size: 11px;
  }
}


.period-toggle__item {
  padding: var(--space-1) var(--space-3);
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-small);
  cursor: pointer;
  color: var(--color-tertiary-text);
  transition: all 0.2s;
}

.period-toggle__item--active {
  background: var(--color-orange-highlight);
  color: var(--color-white);
}

.coming-soon-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  color: var(--color-tertiary-text);
  opacity: 0.6;
}

/* ===================================================================
   20. PRE-INTERVIEW
   =================================================================== */
.pre-interview-panels {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-5);
  max-width: 1200px;
  margin: 0 auto;
}

.pre-interview-panel {
  min-height: 500px;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-6);
}

.pre-interview-panel__title {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 24px;
  font-weight: 500;
  text-align: center;
}

.media-placeholder {
  background: #d9d9d9;
  border-radius: var(--radius-main);
  height: 248px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-tertiary-text);
}

.checklist {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.checklist__item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: 12px;
  line-height: 19px;
  color: var(--color-primary-ink);
}

.checklist__icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 1px;
}

.checklist__icon--success {
  color: var(--color-success);
}

.checklist__icon--warning {
  color: var(--color-orange-highlight);
}

.instructions-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-left: var(--space-4);
}

.instructions-list li {
  font-size: 12px;
  line-height: 19px;
  position: relative;
  padding-left: var(--space-3);
}

.instructions-list li::before {
  content: '•';
  position: absolute;
  left: 0;
}

.instructions-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 12px;
  font-weight: 600;
}

.pre-interview-cta {
  display: flex;
  justify-content: center;
  padding: var(--space-8) 0;
}

/* ===================================================================
   21. INTERVIEW ROOM
   =================================================================== */
.interview-layout {
  display: grid;
  grid-template-columns: 1fr 500px;
  gap: var(--space-5);
  flex: 1;
}

.interview-video-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.interview-qa-col {
  display: flex;
  flex-direction: column;
}

.qa-feed {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-5);
  overflow-y: auto;
  flex: 1;
}

.qa-feed__title {
  font-family: var(--font-display);
  font-size: 32px;
  line-height: 38px;
  font-weight: 500;
  margin-bottom: var(--space-4);
}

/* ===================================================================
   22. INTERVIEW COMPLETED
   =================================================================== */
.completion-card {
  max-width: 600px;
  min-height: 411px;
  margin: var(--space-10) auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  text-align: center;
  position: relative;
}

.completion-card__close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
}

.completion-card__icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #e6f7e6;
  display: flex;
  align-items: center;
  justify-content: center;
}

.completion-card__icon svg {
  width: 32px;
  height: 32px;
  color: var(--color-success);
}

.completion-card__title {
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 30px;
  font-weight: 500;
}

.completion-card__text {
  font-size: 18px;
  line-height: 28px;
  color: var(--color-secondary-text);
  max-width: 400px;
}

.completion-card__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 16px;
  font-weight: 500;
  color: var(--color-primary-ink);
  cursor: pointer;
  transition: color 0.2s;
}

.completion-card__link:hover {
  color: var(--color-primary-orange);
}

/* ===================================================================
   23. EVALUATION REPORT
   =================================================================== */
.report-top-band {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-5);
}

.report-summary {
  display: flex;
  gap: var(--space-8);
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  height: 100%;
}

#report-analytics-card {
  display: flex;
  align-items: center;
  justify-content: center;
}

.summary-section__heading {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 24px;
  font-weight: 500;
  margin-bottom: var(--space-4);
}

.summary-section__subhead {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.summary-section__subhead--strength {
  color: var(--color-success);
}

.summary-section__subhead--weakness {
  color: var(--color-weakness);
}

.summary-section__subhead--recommendation {
  color: var(--color-recommendation);
}

.summary-section__body {
  font-size: 12px;
  line-height: 19px;
  color: var(--color-primary-ink);
  margin-bottom: var(--space-4);
}

/* Detailed report — Executive Summary card layout (Figma) */
#executive-summary-card .exec-summary-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--space-8);
  align-items: center;
}

#executive-summary-card .exec-summary-left {
  display: flex;
  align-items: center;
  justify-content: center;
}

#executive-summary-card .exec-summary-right {
  padding-top: var(--space-2);
}

/* Key Strengths + Key Weakness side-by-side; Recommendations full-width below */
#executive-summary-card .exec-summary-right .flex.flex-col.gap-3 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: var(--space-8);
  row-gap: var(--space-4);
}

#executive-summary-card .exec-summary-right .flex.flex-col.gap-3>div:last-child {
  grid-column: 1 / -1;
}

@media (max-width: 768px) {
  #executive-summary-card .exec-summary-grid {
    grid-template-columns: 1fr;
  }

  #executive-summary-card .exec-summary-left {
    justify-content: flex-start;
  }

  #executive-summary-card .exec-summary-right .flex.flex-col.gap-3 {
    grid-template-columns: 1fr;
  }

  #executive-summary-card .exec-summary-right .flex.flex-col.gap-3>div:last-child {
    grid-column: 1;
  }
}


/* Question Analysis */
.qa-analysis {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: var(--space-5);
}

.qa-rail {
  background: var(--color-question-bubble);
  border-radius: var(--radius-card);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  height: fit-content;
}

.qa-rail__item {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-input);
  cursor: pointer;
  font-size: 14px;
  color: var(--color-primary-ink);
  transition: background 0.2s;
  border-left: 3px solid transparent;
}

.qa-rail__item:hover {
  background: rgba(255, 178, 34, 0.1);
}

.qa-rail__item--active {
  background: var(--surface-white);
  border-left-color: var(--color-primary-orange);
  font-weight: 500;
}

.qa-detail {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.qa-detail__performance {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  justify-content: flex-end;
}

/* Recording section */
.recording-player {
  background: var(--color-recorder-bg);
  border-radius: var(--radius-player);
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.5);
}

.quick-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.quick-nav__chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  background: var(--color-nav-chip);
  color: var(--color-white);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
}

.quick-nav__chip:hover {
  opacity: 0.85;
}

/* Insight cards */
.insight-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

.insight-card {
  padding: var(--space-4);
  border: 1px solid var(--color-light-border);
  border-radius: var(--radius-card);
  background: var(--surface-white);
}

.insight-card__title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: var(--space-3);
}

.insight-card__metric {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) 0;
}

.insight-card__metric-label {
  font-size: 12px;
  color: var(--color-secondary-text);
}

.insight-card__metric-value {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-primary-ink);
}


/* ===================================================================
   24. PROFILE
   =================================================================== */
.identity-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.identity-card__avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-accent-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-white);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  flex-shrink: 0;
}

.identity-card__name {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 24px;
  font-weight: 500;
}

.identity-card__email {
  font-size: 14px;
  color: var(--color-secondary-text);
}

.profile-layout {
  display: grid;
  grid-template-columns: 200px 1px 1fr;
  gap: var(--space-5);
}

.profile-menu {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.profile-menu__item {
  padding: var(--space-2) var(--space-3);
  font-size: 12px;
  line-height: 16px;
  border-radius: var(--radius-small);
  cursor: pointer;
  color: var(--color-primary-ink);
  transition: background 0.2s;
}

.profile-menu__item:hover {
  background: rgba(243, 227, 195, 0.5);
}

.profile-menu__item--active {
  background: var(--color-subsection-active);
}

.profile-divider {
  width: 1px;
  background: var(--color-light-border);
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5) var(--space-8);
}

.profile-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.profile-field__label {
  font-size: 12px;
  color: var(--color-secondary-text);
}

.profile-field__value {
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: var(--color-primary-ink);
  word-break: break-all;
}

/* --- Entry card for list items like education and work --- */
.entry-card {
  grid-column: span 3;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-main);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
}

.entry-card__header {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-light-border);
  padding-bottom: var(--space-2);
}

.entry-card__title {
  font-weight: 600;
  color: var(--color-primary-ink);
}

.entry-card__tag {
  color: var(--color-primary-orange);
  font-weight: 500;
  font-size: 12px;
}

/* --- Skeleton Loading --- */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 4px;
  height: 16px;
  width: 100%;
  display: inline-block;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.profile-field__value {
  font-size: 14px;
  color: var(--color-primary-ink);
  font-weight: 500;
}

/* ===================================================================
   25. PENDING INTERVIEWS TABLE CARD
   =================================================================== */
.table-card {
  min-height: 400px;
}

.table-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
}

.table-card__title {
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 30px;
  font-weight: 500;
}

.table-card__filter {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: var(--radius-small);
  color: var(--color-tertiary-text);
  transition: background 0.2s;
}

.table-card__filter:hover {
  background: rgba(0, 0, 0, 0.04);
}

/* ===================================================================
   26. ANIMATIONS
   =================================================================== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

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

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-16px);
  }

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

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.6;
  }
}

.animate-fadeIn {
  animation: fadeIn 0.4s ease-out both;
}

.animate-scaleIn {
  animation: scaleIn 0.3s ease-out both;
}

.animate-slideIn {
  animation: slideInLeft 0.4s ease-out both;
}

.animate-pulse {
  animation: pulse 2s infinite;
}

.stagger-1 {
  animation-delay: 0.05s;
}

.stagger-2 {
  animation-delay: 0.1s;
}

.stagger-3 {
  animation-delay: 0.15s;
}

.stagger-4 {
  animation-delay: 0.2s;
}

.stagger-5 {
  animation-delay: 0.25s;
}

/* ===================================================================
   27. RESPONSIVE
   =================================================================== */
@media (max-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-rail {
    flex-direction: row;
  }

  .report-top-band {
    grid-template-columns: 1fr;
  }

  .qa-analysis {
    grid-template-columns: 1fr;
  }

  .interview-layout {
    grid-template-columns: 1fr;
  }

  .insight-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  #sidebar-compact-wrapper {
    display: none !important;
  }

  #sidebar-expanded-wrapper {
    display: block !important;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1002;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex !important;
    border-radius: 0 var(--radius-sidebar) var(--radius-sidebar) 0;
    width: var(--sidebar-width-expanded);
    padding: var(--space-5) var(--space-4);
    align-items: flex-start;
    margin: 0;
    background: var(--color-sidebar);
  }

  .sidebar.sidebar--open {
    transform: translateX(0);
    box-shadow: 10px 0 30px rgba(15, 23, 42, 0.2);
  }

  /* Force expanded styles on mobile */
  .sidebar .sidebar__item {
    width: 100%;
    justify-content: flex-start;
    gap: var(--space-3);
    padding: 0 var(--space-4);
  }

  .sidebar .sidebar__item-label {
    display: inline;
  }

  .sidebar .sidebar__bottom {
    align-items: flex-start;
    width: 100%;
  }

  .sidebar .sidebar__divider {
    width: 100%;
  }

  .sidebar__toggle {
    display: none;
  }

  .header__menu-toggle {
    display: flex;
  }

  .header__greeting-text {
    display: none;
  }

  .login-page {
    flex-direction: column;
  }

  .login-form-column {
    width: 100%;
    padding: var(--space-8);
  }

  .login-image-column {
    display: none;
  }

  .pre-interview-panels {
    grid-template-columns: 1fr;
  }

  .profile-layout {
    grid-template-columns: 1fr;
  }

  .profile-divider {
    width: 100%;
    height: 1px;
  }

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

  .dashboard-rail {
    flex-direction: column;
  }

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

  .page-shell {
    flex-direction: column;
  }

  .main-content {
    padding: var(--space-4);
  }

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

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

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

  .tabs {
    flex-wrap: wrap;
  }

  .tab {
    flex: 1 1 45%;
  }

  .tab:first-child,
  .tab:last-child {
    border-radius: var(--radius-input);
  }

  .emotion-row {
    flex-direction: column;
  }
}

/* ===================================================================
   28. SCROLLBAR
   =================================================================== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-pill);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.2);
}

/* =====================================================
   INTEGRATION ADDITIONS — Backend-wired UI helpers
   ===================================================== */

/* Sidebar partial loader */
[data-include] {
  display: contents;
}

/* Badge variants for difficulty */
.badge {
  display: inline-flex;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge--low {
  background: #dcfce7;
  color: #166534;
}

.badge--medium {
  background: #fef9c3;
  color: #854d0e;
}

.badge--high {
  background: #fee2e2;
  color: #991b1b;
}

/* Table helpers */
.table-empty {
  padding: 80px 24px;
  text-align: center;
  color: #94a3b8;
  font-size: 15px;
}

.table-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid var(--color-brand, #f59e0b);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.table-link {
  color: #f59e0b;
  font-weight: 600;
  text-decoration: none;
}

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

/* Pagination */
.table-pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 16px 24px;
  border-top: 1px solid #f1f5f9;
  flex-wrap: wrap;
}

.pagination-info {
  color: #94a3b8;
  font-size: 13px;
  margin-right: auto;
}

.page-btn {
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
  border-color: #f59e0b;
  color: #f59e0b;
}

.page-btn--active {
  background: #f59e0b;
  color: #fff;
  border-color: #f59e0b;
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}