
  /* ===== RESET & VARIABLES ===== */
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

  :root {
    --navy: #1a2035;
    --navy-dark: #141829;
    --blue-accent: #4a90d9;
    --white: #ffffff;
    --light-gray: #f4f6fb;
    --mid-gray: #b0b8cc;
    --text-dark: #222;
    --text-mid: #555;
    --sidebar-w: 220px;
    --sidebar-w-cv: 210px;
  }

  body {
    font-family: 'DM Sans', sans-serif;
    background: var(--light-gray);
    color: var(--text-dark);
    min-height: 100vh;
  }

  /* ===== APP LAYOUT ===== */
  .app {
    display: flex;
    min-height: 100vh;
  }

  /* ===== FORM PANEL ===== */
  .form-panel {
    width: 420px;
    min-width: 360px;
    max-width: 440px;
    background: var(--white);
    border-right: 1.5px solid #e4e8f0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: sticky;
    top: 0;
    height: 100vh;
    box-shadow: 4px 0 24px rgba(26,32,53,0.07);
    z-index: 10;
  }

  .form-header {
    background: var(--navy);
    padding: 28px 28px 22px;
    color: var(--white);
    flex-shrink: 0;
  }

  .form-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
  }

  .form-header p {
    font-size: 13px;
    color: var(--mid-gray);
    font-weight: 300;
  }

  .form-body {
    padding: 24px 28px 28px;
    flex: 1;
    overflow-y: auto;
  }

  .section-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: var(--navy);
    margin: 20px 0 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--navy);
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .section-label:first-child { margin-top: 0; }

  label {
    display: block;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-mid);
    margin-bottom: 4px;
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  input[type="text"], input[type="email"], input[type="tel"], textarea, select {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid #dde3ef;
    border-radius: 7px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13.5px;
    color: var(--text-dark);
    background: var(--light-gray);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
  }

  input[type="text"]:focus, input[type="email"]:focus, input[type="tel"]:focus,
  textarea:focus, select:focus {
    border-color: var(--blue-accent);
    box-shadow: 0 0 0 3px rgba(74,144,217,0.12);
    background: #fff;
  }

  textarea { resize: vertical; min-height: 72px; }

  .add-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 8px 14px;
    border: 1.5px dashed var(--blue-accent);
    background: none;
    border-radius: 7px;
    color: var(--blue-accent);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    width: 100%;
    justify-content: center;
  }
  .add-btn:hover { background: rgba(74,144,217,0.07); }

  .entry-card {
    background: var(--light-gray);
    border: 1.5px solid #dde3ef;
    border-radius: 8px;
    padding: 12px 14px;
    margin-top: 10px;
    position: relative;
  }

  .entry-card .remove-btn {
    position: absolute;
    top: 8px; right: 10px;
    background: none;
    border: none;
    color: #c0392b;
    font-size: 17px;
    cursor: pointer;
    line-height: 1;
    font-weight: 700;
  }

  .entry-card label { margin-top: 6px; }
  .entry-card label:first-child { margin-top: 0; }

  .photo-upload-area {
    border: 2px dashed #dde3ef;
    border-radius: 50%;
    width: 90px; height: 90px;
    margin: 6px auto 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    background: var(--light-gray);
    transition: border-color 0.2s;
  }
  .photo-upload-area:hover { border-color: var(--blue-accent); }
  .photo-upload-area img {
    position: absolute;
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 50%;
  }
  .photo-upload-area span {
    font-size: 11px;
    color: var(--mid-gray);
    text-align: center;
    z-index: 1;
    pointer-events: none;
  }
  .photo-upload-area input { display: none; }

  .photo-wrapper { display: flex; justify-content: center; margin: 4px 0 10px; }

  /* ===== GENERATE BUTTON ===== */
  .generate-btn {
    width: 100%;
    padding: 14px;
    background: var(--navy);
    color: var(--white);
    border: none;
    border-radius: 9px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.6px;
    cursor: pointer;
    margin-top: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s, transform 0.1s;
  }
  .generate-btn:hover { background: #232d4a; transform: translateY(-1px); }
  .generate-btn:active { transform: translateY(0); }

  /* ===== PREVIEW PANEL ===== */
  .preview-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px 60px;
    background: #e8ecf5;
    overflow-y: auto;
  }

  .preview-toolbar {
    width: 100%;
    max-width: 820px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
  }

  .preview-toolbar h2 {
    font-family: 'Playfair Display', serif;
    font-size: 17px;
    color: var(--navy);
    font-weight: 700;
  }

  .download-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 20px;
    background: var(--blue-accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
  }
  .download-btn:hover { background: #3a7bc8; }

  /* ===== CV PREVIEW STYLES ===== */
  #cv-preview {
    width: 794px;
    min-height: 1123px;
    background: #fff;
    display: flex;
    flex-wrap: nowrap;
    box-shadow: 0 8px 48px rgba(26,32,53,0.18);
    border-radius: 3px;
    overflow: hidden;
  }

  /* SIDEBAR */
  .cv-sidebar {
    width: var(--sidebar-w-cv);
    min-width: var(--sidebar-w-cv);
    flex-shrink: 0;
    background: var(--navy);
    color: var(--white);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 0 24px;
  }

  .cv-photo-wrap {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid rgba(255,255,255,0.15);
    margin-bottom: 14px;
    background: #2a3455;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .cv-photo-wrap img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
  }

  .cv-photo-placeholder {
    width: 56px; height: 56px;
    opacity: 0.3;
  }

  .cv-name {
    font-family: 'Playfair Display', serif;
    font-size: 19px;
    font-weight: 700;
    text-align: center;
    padding: 0 18px;
    line-height: 1.2;
    margin-bottom: 4px;
  }

  .cv-title {
    color: var(--blue-accent);
    font-size: 11px;
    text-align: center;
    font-weight: 500;
    padding: 0 14px;
    margin-bottom: 22px;
  }

  .cv-sidebar-section {
    width: 100%;
    padding: 0 18px;
    margin-bottom: 18px;
  }

  .cv-sidebar-heading {
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--white);
    border-bottom: 1.5px solid rgba(255,255,255,0.18);
    padding-bottom: 4px;
    margin-bottom: 10px;
  }

  .cv-contact-item {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    font-size: 10.5px;
    color: rgba(255,255,255,0.85);
    margin-bottom: 6px;
    line-height: 1.4;
  }

  .cv-contact-item .icon {
    width: 14px;
    min-width: 14px;
    margin-top: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .cv-skill-item {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 10.5px;
    color: rgba(255,255,255,0.85);
    margin-bottom: 5px;
  }

  .cv-skill-dot {
    width: 5px; height: 5px;
    border: 1.5px solid rgba(255,255,255,0.5);
    border-radius: 50%;
    flex-shrink: 0;
  }

  .cv-lang-item {
    display: flex;
    justify-content: space-between;
    font-size: 10.5px;
    color: rgba(255,255,255,0.85);
    margin-bottom: 5px;
  }

  .cv-lang-level {
    font-weight: 700;
    color: rgba(255,255,255,0.95);
  }

  .cv-hobby-item {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 10.5px;
    color: rgba(255,255,255,0.85);
    margin-bottom: 5px;
  }

  /* CV MAIN CONTENT */
  .cv-main {
    flex: 1;
    padding: 32px 32px 28px 28px;
  }

  .cv-section-title {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--navy);
    border-bottom: 1.5px solid var(--navy);
    padding-bottom: 4px;
    margin-bottom: 12px;
    margin-top: 20px;
  }

  .cv-section-title:first-child { margin-top: 0; }

  .cv-profile-text {
    font-size: 11px;
    line-height: 1.7;
    color: var(--text-mid);
    text-align: justify;
  }

  .cv-job {
    margin-bottom: 14px;
  }

  .cv-job-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1px;
  }

  .cv-job-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--navy);
  }

  .cv-job-dates {
    font-size: 10px;
    color: var(--text-mid);
    font-weight: 500;
    white-space: nowrap;
    margin-left: 10px;
  }

  .cv-job-company {
    font-size: 10.5px;
    color: var(--text-mid);
    margin-bottom: 6px;
  }

  .cv-job-bullets {
    padding-left: 14px;
  }

  .cv-job-bullets li {
    font-size: 10.5px;
    color: var(--text-mid);
    line-height: 1.55;
    margin-bottom: 3px;
    list-style: disc;
    text-align: justify;
  }

  .cv-edu {
    margin-bottom: 12px;
  }

  .cv-edu-degree {
    font-size: 12px;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 2px;
  }

  .cv-edu-dates {
    font-size: 10px;
    color: var(--text-mid);
    margin-bottom: 1px;
  }

  .cv-edu-school {
    font-size: 10.5px;
    color: var(--text-mid);
    font-style: italic;
  }

  /* ===== RESPONSIVE ===== */
  @media (max-width: 1200px) {
    .form-panel { min-width: 340px; max-width: 380px; }
    #cv-preview { width: 700px; }
    .cv-sidebar { width: 185px; min-width: 185px; }
  }

  @media (max-width: 900px) {
    .app { flex-direction: column; }
    .form-panel { width: 100%; max-width: 100%; position: relative; height: auto; }
    .preview-panel { padding: 20px 8px 40px; }
    #cv-preview { width: 100%; min-width: 0; overflow-x: auto; }
  }

  /* ===== UTILITY ===== */
  .row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .empty-state {
    text-align: center;
    color: #aab0c0;
    font-size: 13px;
    margin-top: 60px;
    font-style: italic;
  }
