/* ==========================================================================
   MindMatch · Sistema de diseño (Ciruela & Albaricoque)
   Hoja de estilos única. Todas las pantallas la enlazan.
   HTML5 + CSS a mano · sin framework.
   ========================================================================== */

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

/* ------------------------------- TOKENS ---------------------------------- */
:root {
  /* Marca */
  --color-primary:      #7A3B62;
  --color-primary-dark: #5E2B4B;
  --color-primary-soft: #F5E7EF;
  --color-primary-text: #6E3357; /* texto sobre soft */
  --color-accent:       #E8895A;
  --color-accent-dark:  #C4633A;
  --color-accent-soft:  #FBE7DB;

  /* Superficies */
  --bg-app:  #F6EEE9;
  --bg-card: #FFFFFF;
  --bg-sunken: #EFE3DC;
  --border:  #ECE0D8;
  --border-strong: #DDCEC4;

  /* Texto */
  --text-primary:   #26141E;
  --text-secondary: #6A5560;
  --text-muted:     #9E8B93;
  --text-faint:     #C3B2BA;

  /* Estados */
  --success: #2E9E6B; --success-dark: #1E7A50; --success-soft: #E1F1E9;
  --warning: #E3A63A; --warning-dark: #9A6B15; --warning-soft: #FBEFD5;
  --error:   #D14A38; --error-dark:   #A5321F; --error-soft:   #FBE3DD;
  --info:    #3E7DB8; --info-dark:    #2C5E8F; --info-soft:    #E2ECF6;

  /* Tipografía */
  --font-display: 'Sora', system-ui, sans-serif;
  --font-body:    'Plus Jakarta Sans', system-ui, sans-serif;

  /* Escala tipográfica */
  --fs-display: 40px;
  --fs-h1: 28px;
  --fs-h2: 22px;
  --fs-h3: 18px;
  --fs-body: 16px;
  --fs-small: 14px;
  --fs-caption: 12px;

  /* Espaciado */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-6: 24px; --space-8: 32px; --space-12: 48px; --space-16: 64px;

  /* Radios */
  --radius-sm: 8px; --radius-md: 14px; --radius-lg: 22px; --radius-full: 999px;

  /* Sombras */
  --shadow-card:     0 1px 2px rgba(36,16,25,.06), 0 2px 8px rgba(36,16,25,.07);
  --shadow-elevated: 0 8px 24px rgba(36,16,25,.11);
  --shadow-overlay:  0 20px 48px rgba(36,16,25,.18);

  /* Layout */
  --sidebar-w: 240px;
  --header-h: 68px;
}

/* -------------------------------- BASE ----------------------------------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  color: var(--text-primary);
  background: var(--bg-app);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
:focus-visible { outline: 3px solid rgba(122,59,98,.4); outline-offset: 2px; }

h1,h2,h3,h4 { margin: 0; }
.mm-display { font-family: var(--font-display); font-size: var(--fs-display); font-weight: 700; letter-spacing: -0.02em; line-height: 1.05; }
.mm-h1 { font-family: var(--font-display); font-size: var(--fs-h1); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.mm-h2 { font-family: var(--font-display); font-size: var(--fs-h2); font-weight: 700; letter-spacing: -0.015em; }
.mm-h3 { font-size: var(--fs-h3); font-weight: 700; }
.mm-small { font-size: var(--fs-small); }
.mm-muted { color: var(--text-muted); }
.mm-secondary { color: var(--text-secondary); }
.mm-caption { font-size: var(--fs-caption); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }

.mm-eyebrow { font-size: var(--fs-caption); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--color-primary); }

/* utilities */
.mm-row { display: flex; align-items: center; gap: var(--space-3); }
.mm-col { display: flex; flex-direction: column; }
.mm-between { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.mm-grow { flex: 1; }
.mm-divider { height: 1px; background: var(--border); border: 0; margin: 0; }
.mm-hidden { display: none !important; }
.mm-icon { display: inline-flex; }
.mm-icon svg { display: block; }

/* ------------------------------ BUTTONS ---------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  height: 44px; padding: 0 20px; border: none; border-radius: var(--radius-md);
  font: 600 15px/1 var(--font-body); cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .05s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { cursor: not-allowed; }

.btn--primary { background: var(--color-primary); color: #fff; }
.btn--primary:hover { background: var(--color-primary-dark); }
.btn--primary:disabled { background: #E6CFDB; }

.btn--secondary { background: var(--bg-card); color: var(--text-primary); border: 1.5px solid var(--border-strong); }
.btn--secondary:hover { background: var(--bg-app); border-color: #D0C4B7; }
.btn--secondary:disabled { color: var(--text-faint); border-color: var(--border); }

.btn--ghost { background: transparent; color: var(--color-primary); }
.btn--ghost:hover { background: var(--color-primary-soft); color: var(--color-primary-dark); }
.btn--ghost:disabled { color: var(--text-faint); background: transparent; }

.btn--destructive { background: var(--error); color: #fff; }
.btn--destructive:hover { background: var(--error-dark); }
.btn--destructive:disabled { background: #EDC4BC; }

.btn--success { background: var(--success); color: #fff; }
.btn--success:hover { filter: brightness(.94); }

.btn--sm { height: 36px; padding: 0 14px; border-radius: var(--radius-sm); font-size: 13px; }
.btn--lg { height: 52px; padding: 0 26px; border-radius: 16px; font-size: 16px; }
.btn--block { width: 100%; }
.btn--icon { width: 44px; padding: 0; }
.btn--icon.btn--sm { width: 36px; }

/* loading spinner inside button */
.btn__spinner {
  width: 15px; height: 15px; border-radius: var(--radius-full);
  border: 2px solid rgba(255,255,255,.45); border-top-color: #fff;
  animation: mm-spin .7s linear infinite;
}
.btn--secondary .btn__spinner { border-color: rgba(107,96,88,.25); border-top-color: var(--text-secondary); }
@keyframes mm-spin { to { transform: rotate(360deg); } }

/* -------------------------------- FORMS ---------------------------------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.label { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.helper { font-size: 13px; color: var(--text-muted); }
.error-text { font-size: 13px; color: var(--color-primary-text); display: flex; align-items: center; gap: 6px; }

.input, .textarea, .select {
  width: 100%; height: 46px; padding: 0 14px;
  border: 1.5px solid var(--border-strong); border-radius: 12px;
  background: var(--bg-card); font: 400 15px var(--font-body); color: var(--text-primary);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.textarea { height: auto; padding: 12px 14px; line-height: 1.5; resize: vertical; min-height: 92px; }
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(122,59,98,.18);
}
.input:disabled, .textarea:disabled, .select:disabled {
  background: #F7F2EC; color: var(--text-faint); border-color: var(--border); cursor: not-allowed;
}
.input--error { border-color: var(--error); box-shadow: 0 0 0 3px rgba(209,74,56,.15); }

.select-wrap { position: relative; }
.select { appearance: none; padding-right: 40px; cursor: pointer; }
.select-wrap::after {
  content: ""; position: absolute; right: 15px; top: 50%; width: 10px; height: 10px;
  border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}

/* checkbox / radio / toggle (native + label) */
.check { display: inline-flex; align-items: center; gap: 12px; font-size: 15px; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--color-primary); cursor: pointer; }
.toggle { position: relative; width: 46px; height: 27px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.toggle__track { position: absolute; inset: 0; border-radius: var(--radius-full); background: var(--border-strong); transition: background .15s ease; pointer-events: none; }
.toggle__thumb { position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: var(--radius-full); background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.18); transition: left .15s ease; pointer-events: none; }
.toggle input:checked ~ .toggle__track { background: var(--color-accent); }
.toggle input:checked ~ .toggle__thumb { left: 22px; }

.matching-priorities {
  margin-top: 4px; padding: 18px; border: 1px solid var(--border);
  border-radius: var(--radius-md); background: var(--bg-app);
}
.matching-priorities fieldset {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px 28px;
  min-width: 0; margin: 18px 0 0; padding: 0; border: 0;
}
.matching-priority label { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.matching-priority output {
  min-width: 34px; padding: 3px 8px; border-radius: var(--radius-full);
  background: var(--color-primary-soft); color: var(--color-primary-text);
  font-size: 12px; font-weight: 700; text-align: center;
}
.matching-priority input[type="range"] {
  --range-value: 0%;
  width: 100%; height: 6px; margin: 12px 0 3px; border-radius: var(--radius-full);
  appearance: none; cursor: pointer;
  background: linear-gradient(
    to right,
    var(--color-primary) 0 var(--range-value),
    var(--border-strong) var(--range-value) 100%
  );
}
.matching-priority input[type="range"]::-webkit-slider-thumb {
  width: 20px; height: 20px; border: 3px solid var(--color-primary);
  border-radius: 50%; appearance: none; background: #fff; box-shadow: var(--shadow-card);
}
.matching-priority input[type="range"]::-moz-range-thumb {
  width: 15px; height: 15px; border: 3px solid var(--color-primary);
  border-radius: 50%; background: #fff; box-shadow: var(--shadow-card);
}

/* -------------------------------- CARD ----------------------------------- */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-card); }
.card--flat { box-shadow: none; }
.card__header { padding: 16px 18px; background: var(--bg-app); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; border-radius: 16px 16px 0 0; }
.card__body { padding: 18px; }

/* -------------------------------- BADGE ---------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: var(--radius-full);
  font-size: 12px; font-weight: 600; line-height: 1; white-space: nowrap;
}
.badge svg { width: 14px; height: 14px; }
.badge--neutral { background: var(--bg-sunken); color: var(--text-secondary); }
.badge--success { background: var(--success-soft); color: var(--success-dark); }
.badge--warning { background: var(--warning-soft); color: var(--warning-dark); }
.badge--error   { background: var(--error-soft);   color: var(--error-dark); }
.badge--info    { background: var(--info-soft);    color: var(--info-dark); }
.badge--accent  { background: var(--color-accent-soft); color: var(--color-accent-dark); }
.badge--primary { background: var(--color-primary-soft); color: var(--color-primary-text); }

/* --- Estados de candidatura (mini-sistema). data-status en el elemento --- */
.status { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: var(--radius-full); font-size: 12px; font-weight: 600; line-height: 1; white-space: nowrap; }
.status svg { width: 14px; height: 14px; }
.status[data-status="INTERVIEW_PREPARING"],
.status[data-status="INTERVIEW_PENDING"] { background: var(--info-soft);          color: var(--info-dark); }
.status[data-status="TESTS_IN_PROGRESS"] { background: var(--color-accent-soft);  color: var(--color-accent-dark); }
.status[data-status="REVIEW_PENDING"]    { background: var(--warning-soft);       color: var(--warning-dark); }
.status[data-status="RESULTS_PENDING"]   { background: var(--color-primary-soft); color: var(--color-primary-text); }
.status[data-status="COMPLETED"]         { background: var(--success-soft);       color: var(--success-dark); }
.status[data-status="REJECTED"]          { background: var(--error-soft);         color: var(--error-dark); }
.status[data-status="ABANDONED"]         { background: var(--bg-sunken);          color: var(--text-secondary); }

/* ------------------------------- AVATAR ---------------------------------- */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--radius-full);
  background: var(--color-primary-soft); color: var(--color-primary-text);
  font-weight: 700; font-size: 15px; flex-shrink: 0; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--sm { width: 28px; height: 28px; font-size: 12px; }
.avatar--lg { width: 56px; height: 56px; font-size: 20px; }
.avatar--xl { width: 72px; height: 72px; font-size: 26px; }
.avatar--accent { background: var(--color-accent-soft); color: var(--color-accent-dark); }
.avatar--info { background: var(--info-soft); color: var(--info-dark); }
.avatar--neutral { background: var(--bg-sunken); color: var(--text-secondary); }

/* -------------------------------- TABS ----------------------------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1.5px solid var(--border); }
.tab { padding: 11px 16px; font-size: 14px; font-weight: 500; color: var(--text-secondary); cursor: pointer; background: none; border: none; border-bottom: 2.5px solid transparent; margin-bottom: -1.5px; transition: color .15s ease, border-color .15s ease; }
.tab:hover { color: var(--text-primary); }
.tab--active { color: var(--color-primary); font-weight: 600; border-bottom-color: var(--color-primary); }
.tab:disabled { color: var(--text-faint); cursor: not-allowed; }

/* ---------------------------- PROGRESS / STEPPER ------------------------- */
.progress { height: 10px; border-radius: var(--radius-full); background: var(--bg-sunken); overflow: hidden; }
.progress__bar { height: 100%; border-radius: var(--radius-full); background: var(--color-primary); transition: width .3s ease; }
.progress--sm { height: 6px; }

.stepper { display: flex; align-items: center; }
.stepper__dot { width: 30px; height: 30px; border-radius: var(--radius-full); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; background: var(--bg-card); border: 2px solid var(--border-strong); color: var(--text-muted); }
.stepper__dot--done { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }
.stepper__dot--current { background: var(--color-primary); border-color: var(--color-primary); color: #fff; box-shadow: 0 0 0 4px var(--color-primary-soft); }
.stepper__line { flex: 1; height: 2.5px; background: var(--border-strong); }
.stepper__line--done { background: var(--color-primary); }

/* -------------------------------- TABLE ---------------------------------- */
.table { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.table__head, .table__row { display: grid; gap: 16px; align-items: center; padding: 14px 22px; }
.table__head { background: var(--bg-app); border-bottom: 1px solid var(--border); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.table__row { border-bottom: 1px solid #F1E9E0; }
.table__row:last-child { border-bottom: none; }
.table__row--link { cursor: pointer; transition: background .12s ease; }
.table__row--link:hover { background: #FDFAF7; }
.cell-strong { font-weight: 600; font-size: 14px; }
.cell-sub { font-size: 12px; color: var(--text-muted); }
.chevron { color: var(--text-faint); }

/* score mini bar */
.score { display: flex; align-items: center; gap: 8px; }
.score__num { font-weight: 700; font-size: 15px; }
.score__track { width: 44px; height: 6px; border-radius: var(--radius-full); background: var(--bg-sunken); overflow: hidden; }
.score__fill { display: block; height: 100%; background: var(--success); }

/* -------------------------------- MODAL ---------------------------------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(43,37,33,.42); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 100; }
.modal { background: var(--bg-card); border-radius: 18px; padding: 26px; width: 100%; max-width: 380px; box-shadow: var(--shadow-overlay); }
.modal__icon { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.modal__actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* -------------------------------- TOAST ---------------------------------- */
.toast-region { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 12px; z-index: 200; max-width: 380px; }
.toast { display: flex; gap: 12px; align-items: center; padding: 13px 15px; border-radius: var(--radius-md); background: var(--bg-card); border: 1px solid var(--border); box-shadow: var(--shadow-elevated); }
.toast__icon { width: 32px; height: 32px; border-radius: var(--radius-full); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.toast--success .toast__icon { background: var(--success-soft); color: var(--success-dark); }
.toast--error .toast__icon   { background: var(--error-soft);   color: var(--error-dark); }
.toast--info .toast__icon    { background: var(--info-soft);    color: var(--info-dark); }
.toast__title { font-weight: 600; font-size: 14px; }
.toast__msg { font-size: 13px; color: var(--text-muted); }

/* ------------------------------- SKELETON -------------------------------- */
.skeleton { border-radius: 8px; background: linear-gradient(90deg, var(--bg-sunken) 25%, #F7F2EC 37%, var(--bg-sunken) 63%); background-size: 200% 100%; animation: mm-shimmer 1.4s infinite; }
.skeleton--text { height: 13px; }
.skeleton--circle { border-radius: var(--radius-full); }
@keyframes mm-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ------------------------------ EMPTY STATE ------------------------------ */
.empty { border: 1.5px dashed var(--border-strong); border-radius: 16px; padding: 48px 24px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.empty__icon { width: 72px; height: 72px; border-radius: 20px; background: var(--bg-app); border: 1px solid var(--border); color: var(--text-faint); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 18px; }

/* --------------------------------- CHAT ---------------------------------- */
.chat { display: flex; flex-direction: column; min-height: 0; }
.chat__header { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); background: var(--bg-card); flex-shrink: 0; }
.chat__title { font-weight: 700; font-size: 15px; }
.chat__sub { font-size: 12px; color: var(--text-secondary); }
.chat__presence { font-size: 12px; color: var(--color-accent-dark); font-weight: 600; display: flex; align-items: center; gap: 5px; }
.chat__presence::before { content: ""; width: 7px; height: 7px; border-radius: var(--radius-full); background: var(--color-accent); }
.chat__log { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; background: var(--bg-app); }
.chat__daysep { align-self: center; font-size: 11px; color: var(--text-muted); background: var(--bg-sunken); padding: 4px 12px; border-radius: var(--radius-full); }

.bubble { max-width: 78%; padding: 11px 15px; border-radius: 16px; font-size: 15px; line-height: 1.45; }
.bubble-in { align-self: flex-start; display: flex; gap: 10px; align-items: flex-end; max-width: 82%; }
.bubble-in .bubble { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px 16px 16px 5px; }
.bubble-out { align-self: flex-end; max-width: 82%; text-align: right; }
.bubble-out .bubble { background: var(--color-primary); color: #fff; border-radius: 16px 16px 5px 16px; text-align: left; display: inline-block; }
.bubble__time { font-size: 11px; color: var(--text-muted); margin-top: 5px; }
.bubble-out .bubble__time { display: flex; gap: 4px; justify-content: flex-end; align-items: center; }

/* typing indicator */
.typing { align-self: flex-start; background: var(--bg-card); border: 1px solid var(--border); padding: 14px 16px; border-radius: 16px 16px 16px 5px; display: inline-flex; gap: 5px; }
.typing span { width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--text-faint); animation: mm-type 1.3s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes mm-type { 0%,60%,100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* composer */
.composer { flex-shrink: 0; padding: 12px 16px; background: var(--bg-card); border-top: 1px solid var(--border); display: flex; gap: 10px; align-items: center; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
.composer .input { border-radius: var(--radius-full); height: 48px; }
.composer__send { width: 48px; height: 48px; border: none; border-radius: var(--radius-full); background: var(--color-primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; cursor: pointer; transition: background .15s ease; }
.composer__send:hover { background: var(--color-primary-dark); }
.composer__send:disabled { background: #E6CFDB; cursor: not-allowed; }

/* ============================ LAYOUTS ==================================== */

/* Candidate: centered mobile-first column */
.candidate-shell { min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg-app); }
.candidate-main { width: 100%; max-width: 460px; margin: 0 auto; flex: 1; display: flex; flex-direction: column; }
.candidate-topbar { display: flex; align-items: center; gap: 12px; padding: 14px 20px; }
.candidate-content { flex: 1; padding: 8px 20px 24px; }
.candidate-footer { position: sticky; bottom: 0; background: var(--bg-app); border-top: 1px solid var(--border); padding: 16px 20px calc(16px + env(safe-area-inset-bottom)); }
.candidate-footer .candidate-main { max-width: 460px; }

/* icon button (back etc.) */
.iconbtn { width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--border); background: var(--bg-card); display: inline-flex; align-items: center; justify-content: center; color: var(--text-primary); cursor: pointer; flex-shrink: 0; }
.iconbtn:hover { background: var(--bg-app); }
.iconbtn--bare { border: none; background: transparent; color: var(--text-muted); }

/* Full-height chat page */
.chat-page { height: 100dvh; display: flex; flex-direction: column; }
.chat-page .chat { flex: 1; min-height: 0; }
.chat-page .chat__log-wrap { width: 100%; max-width: 720px; margin: 0 auto; }

/* Company: app shell with sidebar */
.app { min-height: 100dvh; display: flex; background: var(--bg-app); }
.sidebar { width: var(--sidebar-w); background: var(--bg-card); border-right: 1px solid var(--border); display: flex; flex-direction: column; flex-shrink: 0; position: sticky; top: 0; height: 100dvh; }
.sidebar--admin { background: var(--text-primary); }
.sidebar__brand { padding: 22px; display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.sidebar--admin .sidebar__brand { color: #fff; }
.sidebar__nav { padding: 0 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.navlink { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 11px; color: var(--text-secondary); font-size: 14px; font-weight: 500; cursor: pointer; transition: background .12s ease, color .12s ease; }
.navlink:hover { background: var(--bg-app); }
.navlink--active { background: var(--color-primary-soft); color: var(--color-primary-text); font-weight: 600; }
.sidebar--admin .navlink { color: #A69A8F; }
.sidebar--admin .navlink:hover { background: #3D362F; color: #fff; }
.sidebar--admin .navlink--active { background: #3D362F; color: #fff; }
.sidebar__foot { padding: 16px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 11px; }
.sidebar__foot > div { min-width: 0; }
.sidebar__foot > div > div:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 20px 36px; border-bottom: 1px solid var(--border); background: var(--bg-card); }
.page { padding: 28px 36px; }
.candidate-dashboard { width: 100%; max-width: 980px; margin: 0 auto; }
.candidate-dashboard > .tabs,
.candidate-dashboard > .mm-col,
.candidate-dashboard > .empty { width: 100%; }
.crumbs { font-size: 14px; color: var(--text-muted); }
.crumbs strong { color: var(--text-primary); font-weight: 600; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 18px 20px; }
.stat__label { font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.stat__value { font-family: var(--font-display); font-size: 28px; font-weight: 700; }

.form-section { display: grid; grid-template-columns: 220px 1fr; gap: 28px; }
.form-section__aside h2 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.form-section__aside p { font-size: 13px; color: var(--text-muted); margin: 0; line-height: 1.4; }

/* chips */
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: var(--radius-full); background: var(--color-accent-soft); color: var(--color-accent-dark); font-size: 13px; font-weight: 600; }
.chip button { background: none; border: none; color: inherit; cursor: pointer; display: inline-flex; padding: 0; }
.chip--add { background: var(--bg-card); border: 1.5px dashed var(--border-strong); color: var(--text-secondary); cursor: pointer; }

/* ------------------------------ DOC LIST --------------------------------- */
.doc-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }
.doc-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.doc-counter { font-size: 12px; font-weight: 700; color: var(--color-primary-text); background: var(--color-primary-soft); padding: 3px 10px; border-radius: var(--radius-full); }

.doc-list { display: flex; flex-direction: column; gap: 8px; }
.doc-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 14px;
  background: var(--bg-card); border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}
.doc-item__icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--color-primary-soft); color: var(--color-primary);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.doc-item__icon svg { width: 18px; height: 18px; }
.doc-item__info { flex: 1; min-width: 0; }
.doc-item__name { font-size: 14px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-item__date { font-size: 12px; color: var(--text-muted); }
.doc-item__del {
  width: 32px; height: 32px; border: none; border-radius: 8px;
  background: transparent; color: var(--text-muted); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .12s ease, color .12s ease; flex-shrink: 0;
}
.doc-item__del:hover { background: var(--error-soft); color: var(--error-dark); }

.doc-upload-btn {
  width: 100%; height: 48px; padding: 0 16px; border-radius: 14px;
  border: 1.5px dashed var(--color-primary); background: var(--bg-card);
  color: var(--color-primary-text); font: 600 14px var(--font-body);
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.doc-upload-btn:hover { background: var(--color-primary-soft); border-color: var(--color-primary-dark); }
.doc-upload-btn:disabled { opacity: .5; cursor: not-allowed; border-color: var(--border-strong); background: var(--bg-app); color: var(--text-muted); }
.doc-upload-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ============================ RESPONSIVE ================================= */
.mm-menu-btn { display: none; }

@media (max-width: 900px) {
  .sidebar { position: fixed; z-index: 50; transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.is-open { transform: translateX(0); }
  .topbar, .page { padding-left: 20px; padding-right: 20px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .form-section { grid-template-columns: 1fr; gap: 12px; }
  .mm-menu-btn { display: inline-flex; }
  .sidebar-overlay.is-open { display: block; }
}

.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(24,18,14,.38); z-index: 45; }
@media (max-width: 560px) {
  :root { --fs-display: 30px; --fs-h1: 24px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .page { padding: 20px 16px; }
  .table__head { display: none; }
  .table__row { grid-template-columns: 1fr auto !important; gap: 8px; }
  .matching-priorities fieldset { grid-template-columns: 1fr; }
}

/* Touch targets ≥ 44px on coarse pointers */
@media (pointer: coarse) {
  .tab, .navlink { min-height: 44px; }
}
