/* jobhunter: doar temă întunecată, accent indigo. Toate culorile pornesc din variabilele de mai jos;
   nuanțele (fundaluri colorate, glow-uri) se amestecă din ele cu color-mix. */
:root {
  color-scheme: dark;
  --bg: #0b0c10;
  --surface: #14161d;
  --surface-2: #1a1d26;
  --text: #e8e9f0;
  --muted: #8b8fa3;
  --border: #242734;
  --border-strong: #353a4d;
  --accent: #8b8cff;
  --accent-2: #b48cff;
  --ok: #5fd39a;
  --warn: #f0b75e;
  --danger: #ff8a80;
  --badge: #20232e;

  --radius: 12px;
  --radius-sm: 8px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --fast: 160ms;
  --mid: 280ms;
  --ring: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
}

* { box-sizing: border-box; }
html { scrollbar-color: var(--border-strong) transparent; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(900px 420px at 15% -120px, color-mix(in srgb, var(--accent) 13%, transparent), transparent 70%),
    radial-gradient(700px 360px at 95% -160px, color-mix(in srgb, var(--accent-2) 9%, transparent), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
main { max-width: 980px; margin: 0 auto; padding: 28px 16px 72px; animation: page-in 420ms var(--ease) backwards; }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } }
@keyframes fade-in { from { opacity: 0; } }

h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: -0.02em; font-weight: 700; }
h2 { font-size: 15px; margin: 28px 0 10px; font-weight: 600; letter-spacing: -0.005em; display: flex; align-items: center; gap: 8px; }
main > header p { margin: 4px 0 0; max-width: 72ch; font-size: 14px; }
a { color: var(--accent); text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 3px; transition: color var(--fast) ease, text-decoration-color var(--fast) ease; }
a:hover { text-decoration-color: currentColor; }
code { font: 0.88em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--badge); border-radius: 5px; padding: 1px 5px; }
.muted { color: var(--muted); }
.error { color: var(--danger); }
.ok { color: var(--ok); }
::selection { background: color-mix(in srgb, var(--accent) 40%, transparent); }
:focus-visible { outline: none; box-shadow: var(--ring); }

/* --- Bara de sus ------------------------------------------------------------------------------- */
.menubar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
}
.menubar-inner { max-width: 980px; margin: 0 auto; padding: 8px 16px; display: flex; gap: 4px; align-items: center; overflow-x: auto; scrollbar-width: none; }
.menu-item {
  position: relative; display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
  color: var(--muted); text-decoration: none; white-space: nowrap; font-size: 14px;
  transition: color var(--fast) ease, background var(--fast) ease;
}
.menu-item:hover { color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }
.menu-item.active { color: var(--text); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.menu-item:first-child { margin-right: 10px; padding-left: 4px; background: none; }
.menu-item strong {
  font-size: 17px; letter-spacing: -0.02em;
  background: linear-gradient(100deg, var(--text) 10%, var(--accent) 60%, var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.menu-item:first-child::before {
  content: ""; width: 9px; height: 9px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 12px 1px color-mix(in srgb, var(--accent) 70%, transparent);
}
.alert-count {
  background: var(--danger); color: var(--bg); font-size: 11px; font-weight: 700; border-radius: 999px; padding: 0 6px; line-height: 18px;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 25%, transparent); } }

/* „Ieșire”: formular (POST), aliniat la dreapta, arată ca restul meniului */
.menu-logout { margin: 0 0 0 auto; }
.menu-logout .menu-item { border: 0; background: none; cursor: pointer; font: inherit; font-size: 14px; margin-right: 0; padding-left: 12px; }
.menu-logout .menu-item::before { content: none; } /* e :first-child în formular: fără bulina logo-ului */
.menu-logout .menu-item:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }

/* Pagina de autentificare */
.login { max-width: 340px; margin: 12vh auto 0; display: grid; gap: 14px; }
.login h1 { margin: 0 0 6px; }
.login label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.login input[type=password] { font-size: 16px; padding: 10px 12px; } /* 16px: iOS nu mai face zoom pe câmp */
.login .error { margin: 0; }
.login .btn-primary { padding: 10px 20px; font-size: 14px; justify-self: start; }

/* Bară de progres sub meniu cât timp rulează o cerere htmx (clasa e pusă de app.js) */
.menubar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent);
  background-size: 50% 100%; background-repeat: no-repeat;
  opacity: 0; transition: opacity 240ms ease;
}
.is-loading .menubar::after { opacity: 1; animation: progress 1.1s ease-in-out infinite; }
@keyframes progress { from { background-position: -50% 0; } to { background-position: 150% 0; } }

/* --- Formulare ---------------------------------------------------------------------------------- */
input, select, button, textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 7px 11px;
  transition: border-color var(--fast) ease, box-shadow var(--fast) ease, background var(--fast) ease, color var(--fast) ease, opacity var(--fast) ease, transform var(--fast) ease;
}
input:hover, select:hover, textarea:hover { border-color: var(--border-strong); }
input:focus, select:focus, textarea:focus { outline: none; border-color: color-mix(in srgb, var(--accent) 70%, var(--border)); box-shadow: var(--ring); }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
select {
  appearance: none; -webkit-appearance: none; padding-right: 30px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238b8fa3' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
input[type=checkbox] {
  appearance: none; -webkit-appearance: none; width: 18px; height: 18px; padding: 0; margin: 0; border-radius: 5px; cursor: pointer;
  display: inline-grid; place-content: center; flex: none; background: var(--surface-2);
}
input[type=checkbox]::before {
  content: ""; width: 10px; height: 10px; transform: scale(0); transition: transform 180ms var(--ease);
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%); background: var(--bg);
}
input[type=checkbox]:checked { background: var(--accent); border-color: var(--accent); }
input[type=checkbox]:checked::before { transform: scale(1); }
input[type=search]::-webkit-search-cancel-button { filter: invert(0.6); cursor: pointer; }
input[type=file] { padding: 5px; color: var(--muted); }
input[type=file]::file-selector-button {
  font: inherit; font-size: 13px; color: var(--text); background: var(--surface-2); border: 1px solid var(--border-strong);
  border-radius: 6px; padding: 4px 10px; margin-right: 10px; cursor: pointer; transition: background var(--fast) ease;
}
input[type=file]::file-selector-button:hover { background: var(--badge); }

/* Butoane: implicit „fantomă”; .btn-applied și .btn-primary sunt cele pline */
.btn {
  font-size: 13px; font-weight: 500; padding: 6px 12px; cursor: pointer; border-radius: var(--radius-sm);
  background: transparent; border-color: transparent; color: var(--muted); white-space: nowrap;
}
.btn:hover { color: var(--text); background: color-mix(in srgb, var(--text) 7%, transparent); }
.btn:active { transform: scale(0.96); }
.btn:disabled { cursor: progress; opacity: 0.6; }
.btn-applied, .btn-primary, .bookmarklet {
  color: #0d0b1f; font-weight: 600; border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 4px 16px -6px color-mix(in srgb, var(--accent) 80%, transparent);
}
.btn-applied:hover, .btn-primary:hover, .bookmarklet:hover {
  color: #0d0b1f; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 88%, white), color-mix(in srgb, var(--accent-2) 88%, white));
  box-shadow: 0 6px 22px -6px color-mix(in srgb, var(--accent) 95%, transparent); transform: translateY(-1px);
}
.btn-applied:active, .btn-primary:active { transform: scale(0.96); }
.bookmarklet { display: inline-block; text-decoration: none; padding: 8px 16px; border-radius: 999px; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.btn-hidden:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }

/* Buton în curs: text ascuns (lățimea rămâne), rotiță în centru */
.btn-ai.htmx-request, .analyze-top.htmx-request .btn, .details .btn.htmx-request { position: relative; color: transparent !important; pointer-events: none; }
.btn-ai.htmx-request::after, .analyze-top.htmx-request .btn::after, .details .btn.htmx-request::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 14px; height: 14px;
  border: 2px solid color-mix(in srgb, var(--muted) 50%, transparent); border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.analyze-top.htmx-request .btn::after { border-color: color-mix(in srgb, #0d0b1f 30%, transparent); border-top-color: #0d0b1f; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Inbox: tab-uri, filtre ---------------------------------------------------------------------- */
.tabs {
  display: flex; gap: 4px; flex-wrap: wrap; margin: 0 0 16px; padding: 4px; width: fit-content; max-width: 100%;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
}
.tab {
  display: flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px;
  text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 500;
  transition: color var(--fast) ease, background var(--mid) var(--ease), box-shadow var(--mid) var(--ease);
}
.tab:hover { color: var(--text); background: color-mix(in srgb, var(--text) 5%, transparent); }
.tab.active { color: var(--text); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border-strong), 0 2px 10px -4px rgb(0 0 0 / 60%); }
.count {
  font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--muted);
  background: var(--badge); border-radius: 999px; padding: 1px 7px; transition: background var(--fast) ease, color var(--fast) ease;
}
.tab.active .count { color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }

.filters {
  display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; padding: 14px;
  background: color-mix(in srgb, var(--surface) 70%, transparent); border: 1px solid var(--border); border-radius: var(--radius);
}
.filters-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters-row select { max-width: 100%; font-size: 13px; padding-top: 6px; padding-bottom: 6px; background-color: var(--surface-2); }
.filters input[type=search] {
  flex: 1 1 260px; padding-left: 36px; background-color: var(--surface-2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b8fa3' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 12px center;
}
/* Un filtru setat iese în evidență */
.filters-row select:has(option:checked:not([value=""])) { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); color: var(--text); background-color: color-mix(in srgb, var(--accent) 10%, var(--surface-2)); }
#city-filter { display: contents; }
.zone-toggle { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; padding: 4px 6px; user-select: none; }
.zone-toggle:hover { color: var(--text); }

.analyze-top {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; font-size: 13px; color: var(--muted);
  padding: 10px 14px; border-radius: var(--radius);
  background: linear-gradient(100deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
}
.analyze-top label { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.analyze-top input[type=number] { width: 4.5em; padding: 4px 8px; text-align: center; }
.analyze-top .btn { color: #0d0b1f; font-weight: 600; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.analyze-top .btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px -8px var(--accent); }
.htmx-indicator { opacity: 0; transition: opacity var(--mid) ease; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }

.list-head { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; margin: 0 4px 8px; min-height: 1.2em; }
.list-head a { text-decoration: none; }

/* Lista se estompează cât se încarcă rezultatele noi (filtre, pagini) */
#job-list { transition: opacity 200ms ease, filter 200ms ease; }
body:has(.filters.htmx-request) #job-list, #job-list:has(.pagination .htmx-request) { opacity: 0.45; filter: saturate(0.6); pointer-events: none; }

/* --- Carduri de job ------------------------------------------------------------------------------ */
.jobs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.job {
  position: relative; display: grid; grid-template-columns: 1fr; gap: 10px;
  padding: 14px 16px; border-radius: var(--radius);
  background: linear-gradient(180deg, color-mix(in srgb, var(--text) 2.5%, var(--surface)), var(--surface));
  border: 1px solid var(--border);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--text) 4%, transparent) inset, 0 4px 18px -12px rgb(0 0 0 / 80%);
  transition: border-color var(--mid) var(--ease), box-shadow var(--mid) var(--ease), transform var(--mid) var(--ease);
  animation: fade-up 420ms var(--ease) backwards;
  animation-delay: calc(var(--i, 0) * 35ms);
}
.job:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  box-shadow: 0 1px 0 color-mix(in srgb, var(--text) 5%, transparent) inset, 0 10px 30px -14px color-mix(in srgb, var(--accent) 45%, transparent);
  transform: translateY(-1px);
}
/* Intrare eșalonată: primele carduri apar pe rând */
.job:nth-child(2) { --i: 1; } .job:nth-child(3) { --i: 2; } .job:nth-child(4) { --i: 3; } .job:nth-child(5) { --i: 4; }
.job:nth-child(6) { --i: 5; } .job:nth-child(7) { --i: 6; } .job:nth-child(8) { --i: 7; } .job:nth-child(n+9) { --i: 8; }

/* Job scos din listă (aplic / mai târziu / ascund): animația rulează cât ține swap:450ms din htmx */
.job.htmx-swapping { animation: job-leave 450ms ease-in forwards; pointer-events: none; }
.job.htmx-swapping[data-leaving="applied"] { animation-name: job-applied; }
.job.htmx-swapping[data-leaving="hidden"] { animation-name: job-hide; }
@keyframes job-leave { to { opacity: 0; transform: translateX(-20px); } }
@keyframes job-hide { to { opacity: 0; transform: scale(0.97); filter: blur(2px); } }
@keyframes job-applied {
  0% { box-shadow: 0 0 0 0 var(--ok); }
  25% { background: color-mix(in srgb, var(--ok) 18%, var(--surface)); border-color: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 30%, transparent), 0 0 40px -6px var(--ok); transform: scale(1.015); }
  60% { background: color-mix(in srgb, var(--ok) 18%, var(--surface)); border-color: var(--ok); opacity: 1; transform: scale(1); }
  100% { background: color-mix(in srgb, var(--ok) 18%, var(--surface)); border-color: var(--ok); opacity: 0; transform: translateX(48px); }
}

.job-title { font-weight: 600; font-size: 16px; line-height: 1.35; text-decoration: none; color: var(--text); letter-spacing: -0.01em; transition: color var(--fast) ease; }
.job-title:hover { color: var(--accent); }
.job-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 13px; margin-top: 6px; color: var(--muted); }
.company { font-weight: 500; color: var(--text); }
.badge {
  display: inline-flex; align-items: center; font-size: 12px; font-weight: 500; line-height: 20px;
  background: var(--badge); color: var(--muted); border-radius: 999px; padding: 0 9px;
}
.score {
  display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums;
  min-width: 2.6em; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--badge); color: var(--muted);
}
.score-high { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ok) 30%, transparent); }
.score-low { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.verdict-potrivit { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); font-weight: 600; }
.verdict-la_limita { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); font-weight: 600; }
.verdict-nepotrivit { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); font-weight: 600; }
.mode-remote { color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.mode-hybrid { color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.zone-out { font-style: italic; }
.salary { color: var(--ok); font-weight: 500; }
.age-unknown { font-style: italic; }
.reposted { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.reasons { font-size: 12px; color: color-mix(in srgb, var(--muted) 85%, transparent); margin-top: 6px; }
.reasons:empty { display: none; }

.analysis { font-size: 13px; margin-top: 10px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--accent) 6%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 16%, transparent); }
.analysis summary { cursor: pointer; padding: 8px 12px; list-style: none; display: flex; gap: 8px; color: var(--text); }
.analysis summary::-webkit-details-marker { display: none; }
.analysis summary::before { content: "›"; color: var(--accent); font-weight: 700; transition: transform var(--mid) var(--ease); }
.analysis[open] summary::before { transform: rotate(90deg); }
.analysis-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 16px; padding: 0 12px; }
.analysis[open] > :not(summary) { animation: fade-up 300ms var(--ease) backwards; }
.analysis > p { padding: 0 12px 10px; margin: 8px 0 0; }
.analysis ul { margin: 4px 0 0; padding-left: 18px; color: var(--muted); }
.analysis li::marker { color: var(--accent); }

.job-actions { display: flex; gap: 2px; flex-wrap: wrap; align-items: center; margin: 0 -6px -4px; padding-top: 8px; border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent); }
.job-actions .btn-applied { order: 10; margin-left: auto; }
.job-actions select { font-size: 13px; padding-top: 5px; padding-bottom: 5px; margin-right: 6px; background-color: var(--surface-2); }

.details:empty { display: none; }
.details > * { animation: fade-up 320ms var(--ease) backwards; }
.description {
  white-space: pre-line; font-size: 14px; line-height: 1.6; color: color-mix(in srgb, var(--text) 88%, var(--muted));
  border-top: 1px solid var(--border); padding: 12px 2px 0; max-height: 480px; overflow: auto;
  mask-image: linear-gradient(180deg, #000 calc(100% - 24px), transparent);
}
.links { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; }
.links a { text-decoration: none; }
.links a::after { content: " ↗"; font-size: 11px; }
.empty { color: var(--muted); padding: 48px 24px; text-align: center; border: 1px dashed var(--border-strong); border-radius: var(--radius); animation: fade-in 400ms ease backwards; }

/* --- Paginare ------------------------------------------------------------------------------------ */
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-top: 22px; }
.page {
  min-width: 2.3em; text-align: center; padding: 5px 10px; border-radius: 999px; text-decoration: none;
  font-size: 13px; font-variant-numeric: tabular-nums; color: var(--muted);
  transition: background var(--fast) ease, color var(--fast) ease, transform var(--fast) ease;
}
a.page:hover { color: var(--text); background: var(--surface-2); }
a.page:active { transform: scale(0.94); }
.page.current { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #0d0b1f; font-weight: 700; box-shadow: 0 4px 14px -6px var(--accent); }
.page.gap { color: var(--muted); }
.page.disabled { opacity: 0.35; }
@media (max-width: 640px) { .page-step { flex-basis: 100%; order: -1; } }

/* --- Toasturi ------------------------------------------------------------------------------------ */
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 80; max-width: min(380px, calc(100vw - 32px)); }
.toast {
  background: color-mix(in srgb, var(--surface-2) 92%, transparent); backdrop-filter: blur(10px);
  border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 10px 14px 10px 36px; font-size: 13px; position: relative;
  box-shadow: 0 12px 32px -12px rgb(0 0 0 / 70%); cursor: pointer;
  animation: toast-in 320ms var(--ease) backwards;
}
.toast::before { content: ""; position: absolute; left: 14px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.toast-error::before { background: var(--danger); box-shadow: 0 0 10px var(--danger); }
.toast-success::before, .toast-ok::before { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.toast.leaving { animation: toast-out 220ms ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(0.97); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px); } }

/* --- Aplicări ------------------------------------------------------------------------------------ */
.timeline { font-size: 12px; color: var(--muted); margin-top: 8px; }
.notes { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.notes textarea { width: 100%; resize: vertical; font-size: 14px; background: var(--surface-2); }
.cv-library, .cv-box details { font-size: 13px; }
.cv-library { margin-bottom: 18px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.cv-library summary, .cv-box summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
.cv-library summary::-webkit-details-marker, .cv-box summary::-webkit-details-marker { display: none; }
.cv-library summary::before, .cv-box summary::before { content: "›"; color: var(--accent); font-weight: 700; transition: transform var(--mid) var(--ease); }
.cv-library[open] summary::before, .cv-box details[open] summary::before { transform: rotate(90deg); }
.cv-library[open] > ul, .cv-box details[open] > :not(summary) { animation: fade-up 300ms var(--ease) backwards; }
.cv-library ul { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 6px; }
.cv-library li { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cv-library li .cv-form { margin-top: 0; flex: 1 1 420px; }
.cv-box { font-size: 13px; margin-top: 8px; }
.cv-box summary { color: var(--muted); margin-top: 4px; transition: color var(--fast) ease; }
.cv-box summary:hover { color: var(--text); }
.cv-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.cv-form select, .cv-form input[type=text] { min-width: 0; flex: 1 1 220px; font-size: 13px; }
.cv-form input[type=file] { flex: 1 1 200px; min-width: 0; font-size: 13px; }
.cv-form .btn { border: 1px solid var(--border-strong); color: var(--text); }
.cv-form .btn-danger { color: var(--danger); }
.field-hint { font-size: 12px; }
#applications > section h2 .count { font-size: 12px; }

/* --- Rulări și erori ----------------------------------------------------------------------------- */
.sources { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.source-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; font-size: 14px; min-width: 0;
  animation: fade-up 380ms var(--ease) backwards; transition: border-color var(--mid) var(--ease);
}
.source-card:hover { border-color: var(--border-strong); }
.source-card .muted { font-size: 13px; margin-top: 4px; }
.source-card.failing { border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); background: linear-gradient(135deg, color-mix(in srgb, var(--danger) 8%, var(--surface)), var(--surface) 60%); }
.error-text { white-space: pre-wrap; word-break: break-word; color: var(--danger); font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; margin: 8px 0 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.runs { width: 100%; border-collapse: collapse; font-size: 13px; }
.runs th, .runs td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.runs tbody tr:last-child td { border-bottom: 0; }
.runs th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; background: var(--surface-2); }
.runs tbody tr { transition: background var(--fast) ease; }
.runs tbody tr:hover { background: color-mix(in srgb, var(--text) 3%, transparent); }
.runs td:nth-child(-n+4) { white-space: nowrap; }
.runs .num { text-align: right; font-variant-numeric: tabular-nums; }
.runs tr.failing td { background: color-mix(in srgb, var(--danger) 6%, transparent); }
.error-cell { color: var(--danger); min-width: 220px; word-break: break-word; }

/* --- Reguli -------------------------------------------------------------------------------------- */
.rules h2 { margin: 28px 0 10px; font-size: 16px; }
.rules-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 12px;
  transition: border-color var(--mid) var(--ease), opacity var(--mid) ease;
  animation: fade-up 400ms var(--ease) backwards;
}
.rules-card:focus-within { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
/* Profil oprit: cardul trece în plan secund */
.rules-card:has(.profile-toggle input:not(:checked)) .rules-grid { opacity: 0.45; }
.rules-grid { transition: opacity var(--mid) ease; }
.rules-card > header p { margin: 4px 0 14px; font-size: 13px; }
.profile-toggle { display: inline-flex; gap: 10px; align-items: center; cursor: pointer; font-size: 15px; }
/* Comutatorul de profil arată ca un switch */
.profile-toggle input[type=checkbox] { width: 34px; height: 20px; border-radius: 999px; place-content: center start; padding: 0 2px; background: var(--badge); border-color: var(--border-strong); }
.profile-toggle input[type=checkbox]::before { width: 14px; height: 14px; border-radius: 50%; clip-path: none; transform: none; background: var(--muted); transition: transform 240ms var(--ease), background 240ms ease; }
.profile-toggle input[type=checkbox]:checked { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.profile-toggle input[type=checkbox]:checked::before { transform: translateX(14px); background: #fff; }
.rules-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field-label { font-size: 13px; font-weight: 600; }
.field textarea { width: 100%; resize: vertical; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); }
.field-number input { width: 7em; background: var(--surface-2); }
.numbers { display: flex; flex-wrap: wrap; gap: 14px 22px; margin-top: 16px; }
.rules-actions { margin: 20px 0; position: sticky; bottom: 16px; z-index: 5; }
.rules-actions .btn-primary { padding: 10px 20px; font-size: 14px; border-radius: 999px; }
.rules-reset { margin-top: 28px; }
.rules-reset .btn { border: 1px solid var(--border-strong); }
.notice {
  background: linear-gradient(100deg, color-mix(in srgb, var(--ok) 12%, var(--surface)), var(--surface) 70%);
  border: 1px solid color-mix(in srgb, var(--ok) 40%, var(--border)); border-radius: var(--radius); padding: 10px 14px; margin: 0 0 14px;
  animation: fade-up 400ms var(--ease) backwards;
}
.notice-error { background: linear-gradient(100deg, color-mix(in srgb, var(--danger) 12%, var(--surface)), var(--surface) 70%); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.notice ul { margin: 4px 0 0; padding-left: 20px; }

/* --- Bookmarklet --------------------------------------------------------------------------------- */
main ol { padding-left: 22px; }
main ol li { margin-bottom: 6px; }
main ol li::marker { color: var(--accent); font-weight: 600; }

/* --- Hotlist (Etapa 4c): tab fix pe lateral + flyout --------------------------------------------- */
.hotlist { --hot: var(--accent); --hot-soft: color-mix(in srgb, var(--hot) 14%, var(--surface)); --hot-line: color-mix(in srgb, var(--hot) 45%, var(--border)); }

.hotlist-tab {
  position: fixed; right: 0; top: 50%; z-index: 45; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 8px; border: 1px solid var(--hot-line); border-right: 0; border-radius: 12px 0 0 12px;
  background: linear-gradient(160deg, var(--hot-soft), var(--surface) 70%);
  box-shadow: -6px 0 24px -10px color-mix(in srgb, var(--hot) 55%, transparent);
  cursor: pointer; transition: padding 160ms ease, box-shadow 160ms ease, opacity 200ms ease;
}
.hotlist-tab:hover, .hotlist-tab:focus-visible { padding-right: 12px; box-shadow: -8px 0 28px -8px color-mix(in srgb, var(--hot) 70%, transparent); }
.hotlist-tab:active { transform: translateY(-50%); }
.hotlist-tab-star { color: var(--hot); font-size: 16px; line-height: 1; }
.hotlist-tab-label { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text); }
.hotlist-tab-count { font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--hot); background: color-mix(in srgb, var(--hot) 16%, transparent); border-radius: 8px; padding: 1px 5px; }
.hotlist[data-count="0"] .hotlist-tab-count { color: var(--muted); background: var(--badge); }
.hotlist[data-full] .hotlist-tab-count { color: var(--warn); background: color-mix(in srgb, var(--warn) 16%, transparent); }

.hotlist-backdrop {
  position: fixed; inset: 0; z-index: 55; background: rgb(0 0 0 / 50%);
  backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity 220ms ease;
}
.hotlist-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 60; width: min(420px, 100vw);
  display: flex; flex-direction: column; outline: none;
  background:
    radial-gradient(120% 60% at 100% 0%, color-mix(in srgb, var(--hot) 14%, transparent), transparent 60%),
    var(--surface);
  border-left: 1px solid var(--hot-line);
  box-shadow: -24px 0 48px -12px rgb(0 0 0 / 60%);
  transform: translateX(100%); visibility: hidden;
  transition: transform 280ms var(--ease), visibility 0s linear 280ms;
}
.hotlist-open .hotlist-backdrop { opacity: 1; pointer-events: auto; }
.hotlist-open .hotlist-panel { transform: none; visibility: visible; transition: transform 280ms var(--ease); }
.hotlist-open .hotlist-tab { opacity: 0; pointer-events: none; }
.hotlist-open .hot-card { animation: fade-up 360ms var(--ease) backwards; animation-delay: calc(60ms + var(--i, 0) * 30ms); }
.hot-card:nth-child(2) { --i: 1; } .hot-card:nth-child(3) { --i: 2; } .hot-card:nth-child(4) { --i: 3; } .hot-card:nth-child(5) { --i: 4; }
.hot-card:nth-child(6) { --i: 5; } .hot-card:nth-child(7) { --i: 6; } .hot-card:nth-child(8) { --i: 7; } .hot-card:nth-child(n+9) { --i: 8; }

.hotlist-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; padding: 20px 20px 12px; }
.hotlist-head h2 { margin: 0; font-size: 19px; letter-spacing: -0.01em; }
.hotlist-head h2 span { color: var(--hot); }
.hotlist-sub { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.hotlist-close { border: 1px solid transparent; background: none; color: var(--muted); font-size: 22px; line-height: 1; padding: 2px 9px; border-radius: 8px; cursor: pointer; }
.hotlist-close:hover { color: var(--text); background: var(--badge); }

.hotlist-meter { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; padding: 0 20px 14px; }
.hotlist-meter span { height: 4px; border-radius: 2px; background: var(--badge); transition: background 200ms ease; }
.hotlist-meter span.on { background: var(--hot); box-shadow: 0 0 8px -1px color-mix(in srgb, var(--hot) 70%, transparent); }
.hotlist-meter.is-full span.on { background: var(--warn); box-shadow: 0 0 8px -1px color-mix(in srgb, var(--warn) 70%, transparent); }

.hotlist-items { list-style: none; margin: 0; padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; flex: 1; }
.hot-card {
  position: relative; display: grid; grid-template-columns: auto 1fr; gap: 10px;
  padding: 12px 12px 12px 10px; border-radius: 12px; cursor: pointer;
  background: color-mix(in srgb, var(--text) 3%, var(--surface));
  border: 1px solid var(--border);
  transition: border-color 160ms ease, box-shadow 200ms ease, opacity 200ms ease, transform 160ms ease, background 200ms ease;
}
.hot-card:hover { border-color: var(--hot-line); transform: translateY(-1px); }
.hot-rank {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--muted); background: var(--badge); transition: background 200ms ease, color 200ms ease;
}
.hot-body { min-width: 0; }
.hot-title { display: block; font-weight: 600; text-decoration: none; color: var(--text); line-height: 1.3; }
.hot-title:hover { color: var(--hot); }
.hot-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12px; margin-top: 6px; color: var(--muted); }
.hot-status { color: var(--ok); }
.hot-actions { display: flex; gap: 6px; margin-top: 10px; }
.hot-actions .btn { font-size: 12px; padding: 4px 12px; border-radius: 999px; }
.hot-actions .btn:not(.btn-applied) { border: 1px solid var(--border-strong); }
.hot-focus-tag {
  position: absolute; top: -9px; right: 12px; font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: #0d0b1f; background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-radius: 6px; padding: 1px 7px;
  opacity: 0; transform: translateY(4px); transition: opacity 160ms ease, transform 160ms ease; pointer-events: none;
}
/* Jobul „în lucru”: bordură și inel în culoarea accentului; celelalte carduri trec în plan secund */
.hot-card.focused {
  border-color: var(--hot);
  background: linear-gradient(135deg, color-mix(in srgb, var(--hot) 16%, var(--surface)), color-mix(in srgb, var(--text) 3%, var(--surface)) 70%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--hot) 25%, transparent), 0 10px 28px -12px color-mix(in srgb, var(--hot) 70%, transparent);
}
.hot-card.focused .hot-rank { color: #0d0b1f; background: var(--hot); }
.hot-card.focused .hot-focus-tag { opacity: 1; transform: none; }
.hotlist-items.has-focus .hot-card:not(.focused) { opacity: 0.55; }
.hotlist-items.has-focus .hot-card:not(.focused):hover { opacity: 0.9; }

.hotlist-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px 32px; gap: 2px; }
.hotlist-empty p { margin: 0; }
.hotlist-empty .muted { font-size: 13px; }
.hotlist-empty-star { font-size: 40px; color: var(--hot-line); line-height: 1; margin-bottom: 8px; animation: float 3s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-4px); } }
.hotlist-foot { padding: 10px 20px 14px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); }

/* Butonul din rânduri */
.hot-toggle { color: var(--muted); }
.hot-toggle.on { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.hot-toggle.on:hover { color: var(--accent); background: color-mix(in srgb, var(--accent) 22%, transparent); }
.hot-toggle.on { animation: star-pop 360ms var(--ease); }
@keyframes star-pop { 40% { transform: scale(1.08); } }
.hot-toggle:disabled { cursor: not-allowed; opacity: 0.4; }
/* Până rulează app.js: lista plină dezactivează vizual adăugarea */
body:has(#hotlist[data-full]) .hot-toggle:not(.on) { opacity: 0.4; pointer-events: none; }

/* --- CV-uri (4d): CV-ul în stânga, lista în dreapta; în editare, textul lângă previzualizare --------- */
main.wide { max-width: 1480px; padding-right: 64px; } /* loc pentru butonul hotlist de pe margine */
.cvs { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; align-items: start; }
.cvs-editing { grid-template-columns: minmax(0, 1fr); }
.cv-stage { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.cv-stage .notice { margin: 0; }
.cv-stage-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 10px 16px; }
.cv-stage-head h1 { font-size: 22px; margin: 0; }
.cv-stage-head p { margin: 4px 0 0; font-size: 13px; }
.cv-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cv-actions form { margin: 0; }
.cv-actions .btn { border: 1px solid var(--border-strong); color: var(--text); text-decoration: none; display: inline-block; }
.cv-actions .btn-primary { border-color: transparent; color: #0d0b1f; }
.cv-actions .btn-danger { color: var(--danger); }
.cv-rename { display: flex; gap: 6px; }
.cv-rename input { width: 200px; font-size: 13px; }
.cv-locked { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.cv-frame { width: 100%; height: calc(100vh - 190px); min-height: 520px; border: 1px solid var(--border); border-radius: var(--radius); background: #e6e7eb; }
.cv-sent { font-size: 13px; padding: 8px 12px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--warn) 6%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warn) 22%, var(--border)); }
.cv-sent summary { cursor: pointer; }
.cv-sent ul { margin: 6px 0; padding-left: 18px; }
.cv-sent p { margin: 4px 0 0; }

.cv-side { position: sticky; top: 64px; display: flex; flex-direction: column; gap: 4px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); max-height: calc(100vh - 84px); overflow-y: auto; }
.cv-side form { margin: 0; }
.cv-new { width: 100%; padding: 9px 14px; border-radius: 999px; }
.cv-side h2 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 14px 2px 4px; }
.cv-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.cv-item { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: var(--radius-sm); text-decoration: none; color: var(--text); transition: background var(--fast) ease; }
.cv-item:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
.cv-item.active { background: color-mix(in srgb, var(--accent) 16%, transparent); box-shadow: inset 2px 0 0 var(--accent); }
.cv-item-name { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.cv-item .muted { font-size: 12px; }
.cv-lock { margin-right: 5px; font-size: 12px; }
.cv-side-empty { font-size: 12px; margin: 4px 2px; }

.cv-editor { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.cv-label-input { flex: 1 1 260px; max-width: 480px; font-size: 18px; font-weight: 600; }
.cv-save-hint { font-size: 12px; margin-right: 4px; }
.cv-edit-grid { display: grid; grid-template-columns: minmax(340px, 1fr) minmax(0, 840px); gap: 14px; align-items: start; }
.cv-text { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cv-text textarea { width: 100%; height: calc(100vh - 190px); min-height: 520px; resize: vertical; background: var(--surface-2);
  font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; tab-size: 2; }
.cv-syntax { font-size: 12px; }
.cv-syntax summary { cursor: pointer; color: var(--muted); }
.cv-syntax table { border-collapse: collapse; margin-top: 6px; }
.cv-syntax td { padding: 3px 8px 3px 0; vertical-align: top; }
.cv-syntax code { white-space: nowrap; }
@media (max-width: 1100px) {
  .cvs { grid-template-columns: minmax(0, 1fr); }
  .cv-side { position: static; max-height: none; order: -1; }
  .cv-edit-grid { grid-template-columns: minmax(0, 1fr); }
  .cv-text textarea { height: 50vh; min-height: 320px; }
}

/* --- Mobil --------------------------------------------------------------------------------------- */
@media (max-width: 640px) {
  main { padding-top: 20px; }
  h1 { font-size: 22px; }
  .tabs { border-radius: var(--radius); }
  .job { padding: 12px 14px; }
  .job-actions .btn-applied { margin-left: 0; }
  .hotlist-tab { top: auto; bottom: 88px; transform: none; padding: 10px 6px; }
  .hotlist-tab:active { transform: none; }
  .hotlist-tab-label { display: none; }
}

/* Mișcare redusă: fără intrări și pulsuri; schimbările de stare rămân instant */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .job.htmx-swapping { animation-duration: 150ms !important; }
}
