:root { --bg: #f3f4f6; --panel: #fff; --line: #e5e7eb; --text: #111827; --muted: #6b7280; --brand: #2563eb; }
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }

/* ---------- Bara de sus ---------- */
.topbar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 16px; background: #111827; color: #fff; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
button, .btn { font: inherit; font-size: 14px; border: 0; border-radius: 8px; padding: 8px 14px; background: var(--brand); color: #fff; cursor: pointer; }
.ghost { background: transparent; color: inherit; border: 1px solid currentColor; opacity: .85; }
.link { background: none; color: #dc2626; padding: 0; font-size: 13px; }
select, input[type=color] { font: inherit; font-size: 14px; border-radius: 8px; border: 0; padding: 7px; height: 36px;  }
input[type=color] { width: 44px; padding: 2px; cursor: pointer; }

/* ---------- Editor ---------- */
.layout { display: grid; grid-template-columns: minmax(320px, 440px) 1fr; gap: 24px; padding: 24px 16px; max-width: 1400px; margin: 0 auto; }
.layout > * { min-width: 0; }
.editor { display: flex; flex-direction: column; gap: 16px; }
fieldset { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 0; display: flex; flex-direction: column; gap: 10px; }
legend { font-weight: 700; padding: 0 6px; }
.editor label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); flex: 1; }
.editor input, .editor textarea { font: inherit; font-size: 14px; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; }
.editor input:focus, .editor textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
.row { display: flex; gap: 10px; }
.list { display: flex; flex-direction: column; gap: 12px; }
.item { border: 1px dashed var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.item label { width: 100%; }
.privacy { font-size: 13px; color: var(--muted); text-align: center; }

/* ---------- Foaia A4 ---------- */
.preview-wrap { display: flex; justify-content: center; align-items: flex-start; }
.cv { --accent: #2563eb; width: 210mm; min-height: 297mm; background: #fff; box-shadow: 0 10px 40px rgba(0,0,0,.12); padding: 16mm 16mm; font-size: 10.5pt; line-height: 1.45; color: #1f2937; position: sticky; top: 76px; }
.cv h1 { margin: 0; font-size: 24pt; line-height: 1.1; }
.cv h2 { font-size: 10pt; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); margin: 18px 0 8px; padding-bottom: 4px; border-bottom: 1.5px solid var(--accent); }
.cv p { margin: 0 0 6px; }
.cv-head { display: flex; gap: 16px; align-items: center; }
.photo { width: 28mm; height: 28mm; border-radius: 50%; object-fit: cover; }
.role { font-size: 12pt; color: var(--accent); font-weight: 600; margin-top: 4px !important; }
.contact { color: #4b5563; font-size: 9.5pt; }
.contact b { color: var(--accent); }
.entry { margin-bottom: 10px; break-inside: avoid; }
.entry-head { display: flex; justify-content: space-between; gap: 12px; }
.entry-head span, .muted { color: #6b7280; font-size: 9.5pt; }
.entry ul { margin: 4px 0 0; padding-left: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span { border: 1px solid var(--accent); color: var(--accent); border-radius: 999px; padding: 2px 10px; font-size: 9pt; }

/* Șablonul clasic: centrat, cu serif. */
.cv.clasic { font-family: Georgia, "Times New Roman", serif; }
.cv.clasic .cv-head { flex-direction: column; text-align: center; }
.cv.clasic h2 { text-align: center; border-bottom: 0; border-top: 1px solid #d1d5db; padding-top: 8px; color: #111827; }
.cv.clasic .chips span { border-color: #9ca3af; color: #374151; }

/* ---------- Telefon ---------- */
@media (max-width: 1000px) {
  .layout { grid-template-columns: 1fr; }
  .preview-wrap { overflow-x: auto; justify-content: flex-start; }
  .cv { position: static; transform-origin: top left; }
  .row { flex-direction: column; }
}

/* ---------- PDF: tipărim doar foaia ---------- */
@page { size: A4; margin: 0; }
@media print {
  body { background: #fff; }
  .topbar, .editor { display: none; }
  .layout { display: block; padding: 0; }
  .cv { box-shadow: none; position: static; width: auto; min-height: auto; }
}
