/* ═══════════════════════════════════════════════════════════
     app.css — Stiluri globale SUBIN CRM
     ═══════════════════════════════════════════════════════════ */

  /* ─── Variabile CSS ───────────────────────────────────────── */
  :root {
      --bg:           #f3f5f9;
      --sidebar:      #ffffff;
      --card:         #ffffff;
      --primary:      #2c7be5;
      --primary-soft: #eaf2fd;
      --green:        #22a06b;
      --green-soft:   #e4f5ee;
      --orange:       #e08e0b;
      --orange-soft:  #fcf3e3;
      --red:          #d6455d;
      --red-soft:     #fbe9ec;
      --purple:       #7857c4;
      --purple-soft:  #efeaf9;
      --text:         #384356;
      --heading:      #1f2733;
      --muted:        #8b97a8;
      --border:       #e7ebf0;
      --shadow:       0 1px 3px rgba(28,39,60,.06), 0 1px 2px rgba(28,39,60,.04);
      --sidebar-w:    240px;
      --topbar-h:     60px;
      --radius:       10px;
  }

  /* ─── Reset & Base ────────────────────────────────────────── */
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

  body {
      font-family: 'Inter', sans-serif;
      background: var(--bg);
      color: var(--text);
      font-size: 14px;
      line-height: 1.5;
      -webkit-font-smoothing: antialiased;
  }

  a { color: var(--primary); text-decoration: none; }
  a:hover { text-decoration: underline; }

  h1, h2, h3, h4, h5 { color: var(--heading); font-weight: 600; }

  /* ─── Layout principal ────────────────────────────────────── */
  .crm-layout {
      display: flex;
      min-height: 100vh;
  }

  /* ─── SIDEBAR ─────────────────────────────────────────────── */
  .sidebar {
      width: var(--sidebar-w);
      background: var(--sidebar);
      border-right: 1px solid var(--border);
      position: fixed;
      top: 0;
      left: 0;
      height: 100vh;
      display: flex;
      flex-direction: column;
      z-index: 100;
      overflow-y: auto;
  }

  /* Brand top */
  .sidebar-brand {
      height: var(--topbar-h);
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 0 16px;
      border-bottom: 1px solid var(--border);
      flex-shrink: 0;
  }

  .sidebar-logo {
      width: 32px;
      height: 32px;
      border-radius: 8px;
      background: linear-gradient(135deg, #22a06b 0%, #2c7be5 100%);
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
  }

  .sidebar-logo i { color: #fff; font-size: 15px; }

  .sidebar-brand-text strong {
      display: block;
      font-size: 14px;
      font-weight: 700;
      color: var(--heading);
      line-height: 1.2;
  }

  .sidebar-brand-text span {
      font-size: 11px;
      color: var(--muted);
      font-weight: 400;
  }

  /* Nav */
  .sidebar-nav {
      padding: 12px 10px;
      flex: 1;
  }

  .nav-label {
      font-size: 11px;
      font-weight: 600;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: .6px;
      padding: 10px 8px 6px;
  }

  .nav-label:first-child { padding-top: 4px; }

  .nav-item {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 9px 12px;
      border-radius: 8px;
      color: var(--text);
      font-size: 13.5px;
      font-weight: 500;
      cursor: pointer;
      transition: background .15s, color .15s;
      margin-bottom: 2px;
      text-decoration: none;
  }

  .nav-item i {
      width: 18px;
      text-align: center;
      font-size: 14px;
      color: var(--muted);
      transition: color .15s;
      flex-shrink: 0;
  }

  .nav-item:hover {
      background: #f5f7fa;
      color: var(--heading);
      text-decoration: none;
  }

  .nav-item:hover i { color: var(--text); }

  .nav-item.active {
      background: var(--primary-soft);
      color: var(--primary);
  }

  .nav-item.active i { color: var(--primary); }

  /* ─── TOPBAR ──────────────────────────────────────────────── */
  .topbar {
      position: fixed;
      top: 0;
      left: var(--sidebar-w);
      right: 0;
      height: var(--topbar-h);
      background: #fff;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      padding: 0 24px;
      gap: 16px;
      z-index: 99;
  }

  .topbar-search {
      position: relative;
      flex: 1;
      max-width: 380px;
  }

  .topbar-search i {
      position: absolute;
      left: 11px;
      top: 50%;
      transform: translateY(-50%);
      color: var(--muted);
      font-size: 13px;
      pointer-events: none;
  }

  .topbar-search input {
      width: 100%;
      padding: 8px 12px 8px 32px;
      background: #f7f9fc;
      border: 1px solid var(--border);
      border-radius: 8px;
      font-size: 13.5px;
      font-family: 'Inter', sans-serif;
      color: var(--text);
      outline: none;
      transition: border-color .18s, box-shadow .18s;
  }

  .topbar-search input:focus {
      border-color: var(--primary);
      background: #fff;
      box-shadow: 0 0 0 3px rgba(44,123,229,.12);
  }

  .topbar-right {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-left: auto;
  }

  .icon-btn {
      width: 36px;
      height: 36px;
      border-radius: 8px;
      background: transparent;
      border: none;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      color: var(--muted);
      font-size: 15px;
      transition: background .15s, color .15s;
      position: relative;
  }

  .icon-btn:hover { background: var(--bg); color: var(--text); }

  .topbar-user {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 5px 10px 5px 5px;
      border-radius: 10px;
      cursor: pointer;
      transition: background .15s;
      text-decoration: none;
  }

  .topbar-user:hover { background: var(--bg); text-decoration: none; }

  .avatar {
      width: 34px;
      height: 34px;
      border-radius: 50%;
      object-fit: cover;
      flex-shrink: 0;
  }

  .topbar-user-info { line-height: 1.25; }

  .topbar-user-info strong {
      display: block;
      font-size: 13px;
      font-weight: 600;
      color: var(--heading);
  }

  .topbar-user-info span {
      font-size: 11px;
      color: var(--muted);
      text-transform: capitalize;
  }

  /* ─── CONTENT ─────────────────────────────────────────────── */
  .main-content {
      margin-left: var(--sidebar-w);
      padding-top: var(--topbar-h);
      min-height: 100vh;
      flex: 1;
      min-width: 0; /* flex shrink fix — mobil */
  }

  .page-inner {
      padding: 24px;
  }

  /* ─── Page header ─────────────────────────────────────────── */
  .page-header {
      margin-bottom: 20px;
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 16px;
      flex-wrap: wrap;
  }

  .page-header h2 {
      font-size: 20px;
      font-weight: 700;
      color: var(--heading);
      line-height: 1.2;
  }

  .page-header .subtitle {
      font-size: 13px;
      color: var(--muted);
      margin-top: 3px;
  }

  /* ─── Card ────────────────────────────────────────────────── */
  .card {
      background: var(--card);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      border: 1px solid var(--border);
  }

  .card-body { padding: 20px 24px; }
  .card-header {
      padding: 16px 24px;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
  }

  .card-header h3 {
      font-size: 15px;
      font-weight: 600;
      color: var(--heading);
  }

  /* ─── Badge ───────────────────────────────────────────────── */
  .badge {
      display: inline-block;
      padding: 3px 9px;
      border-radius: 20px;
      font-size: 11.5px;
      font-weight: 600;
      line-height: 1.4;
  }

  .badge-primary  { background: var(--primary-soft); color: var(--primary); }
  .badge-green    { background: var(--green-soft);   color: var(--green); }
  .badge-orange   { background: var(--orange-soft);  color: var(--orange); }
  .badge-red      { background: var(--red-soft);     color: var(--red); }
  .badge-purple   { background: var(--purple-soft);  color: var(--purple); }
  .badge-muted    { background: #f1f3f6;             color: var(--muted); }

  /* ─── Butoane ─────────────────────────────────────────────── */
  .btn {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      padding: 8px 16px;
      border-radius: 8px;
      font-size: 13.5px;
      font-weight: 500;
      font-family: 'Inter', sans-serif;
      border: none;
      cursor: pointer;
      transition: background .18s, opacity .18s, transform .1s;
      text-decoration: none;
      line-height: 1.4;
  }

  .btn:active { transform: scale(.98); }

  .btn-primary { background: var(--primary); color: #fff; }
  .btn-primary:hover { background: #2469c9; color: #fff; text-decoration: none; }

  .btn-secondary { background: #f1f3f6; color: var(--text); }
  .btn-secondary:hover { background: #e7ebf0; text-decoration: none; }

  .btn-success { background: var(--green); color: #fff; }
  .btn-success:hover { background: #1b8a5a; color: #fff; text-decoration: none; }

  .btn-danger { background: var(--red); color: #fff; }
  .btn-danger:hover { background: #bf3a50; color: #fff; text-decoration: none; }

  .btn-sm { padding: 5px 11px; font-size: 12.5px; }

  /* ─── Tabel ───────────────────────────────────────────────── */
  .table-wrap { overflow-x: auto; }

  table {
      width: 100%;
      border-collapse: collapse;
      font-size: 13.5px;
  }

  thead th {
      background: #f7f9fc;
      padding: 10px 14px;
      text-align: left;
      font-size: 12px;
      font-weight: 600;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: .5px;
      border-bottom: 1px solid var(--border);
  }

  tbody td {
      padding: 12px 14px;
      border-bottom: 1px solid var(--border);
      color: var(--text);
      vertical-align: middle;
  }

  tbody tr:last-child td { border-bottom: none; }
  tbody tr:hover td { background: #f9fafc; }

  /* ─── Form ────────────────────────────────────────────────── */
  .form-row {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
      gap: 16px;
      margin-bottom: 0;
  }

  .form-group { margin-bottom: 16px; }

  .form-group label {
      display: block;
      font-size: 12.5px;
      font-weight: 500;
      color: var(--text);
      margin-bottom: 6px;
  }

  .form-control {
      width: 100%;
      padding: 8px 12px;
      border: 1px solid var(--border);
      border-radius: 8px;
      font-size: 13.5px;
      font-family: 'Inter', sans-serif;
      color: var(--text);
      background: #fff;
      outline: none;
      transition: border-color .18s, box-shadow .18s;
      appearance: none;
  }

  .form-control:focus {
      border-color: var(--primary);
      box-shadow: 0 0 0 3px rgba(44,123,229,.12);
  }

  textarea.form-control { resize: vertical; min-height: 80px; }

  /* ─── Alert ───────────────────────────────────────────────── */
  .alert {
      padding: 11px 16px;
      border-radius: 8px;
      font-size: 13px;
      margin-bottom: 16px;
      display: flex;
      align-items: center;
      gap: 9px;
  }

  .alert-danger  { background: var(--red-soft);    color: var(--red); }
  .alert-success { background: var(--green-soft);  color: var(--green); }
  .alert-warning { background: var(--orange-soft); color: var(--orange); }
  .alert-info    { background: var(--primary-soft);color: var(--primary); }

  /* ─── Stat cards (dashboard) ──────────────────────────────── */
  .stat-cards {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
      gap: 16px;
      margin-bottom: 24px;
  }

  .stat-card {
      background: var(--card);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      border: 1px solid var(--border);
      padding: 20px;
      display: flex;
      align-items: flex-start;
      gap: 14px;
  }

  .stat-icon {
      width: 42px;
      height: 42px;
      border-radius: 10px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 18px;
      flex-shrink: 0;
  }

  .stat-info strong {
      display: block;
      font-size: 22px;
      font-weight: 700;
      color: var(--heading);
      line-height: 1.1;
  }

  .stat-info span {
      font-size: 12.5px;
      color: var(--muted);
      margin-top: 3px;
      display: block;
  }

  /* ─── Welcome card ────────────────────────────────────────── */
  .welcome-card {
      background: linear-gradient(135deg, #22a06b 0%, #2c7be5 100%);
      border-radius: var(--radius);
      padding: 28px;
      color: #fff;
      margin-bottom: 24px;
  }

  .welcome-card h2 {
      color: #fff;
      font-size: 20px;
      margin-bottom: 6px;
  }

  .welcome-card p {
      opacity: .85;
      font-size: 14px;
  }

  /* ─── Utilități ───────────────────────────────────────────── */
  .text-muted   { color: var(--muted) !important; }
  .text-primary { color: var(--primary) !important; }
  .text-success { color: var(--green) !important; }
  .text-danger  { color: var(--red) !important; }
  .text-warning { color: var(--orange) !important; }
  .fw-600       { font-weight: 600; }
  .mt-1 { margin-top: 6px; }
  .mt-2 { margin-top: 12px; }
  .mt-3 { margin-top: 20px; }
  .mb-1 { margin-bottom: 6px; }
  .mb-2 { margin-bottom: 12px; }
  .mb-3 { margin-bottom: 20px; }
  .gap-2 { gap: 8px; }
  .d-flex { display: flex; }
  .align-center { align-items: center; }
  .justify-between { justify-content: space-between; }
  .flex-wrap { flex-wrap: wrap; }
  

  /* ═══════════════════════════════════════════════════════════
     ADĂUGIRI — Modal, Toast, Switch, Progress, Filters
     ═══════════════════════════════════════════════════════════ */

  /* ─── Toast ──────────────────────────────────────────────── */
  #toast-container {
      position: fixed;
      top: 20px;
      right: 20px;
      z-index: 9999;
      display: flex;
      flex-direction: column;
      gap: 8px;
      pointer-events: none;
  }

  .toast {
      background: var(--card);
      border-radius: 10px;
      padding: 13px 16px;
      display: flex;
      align-items: center;
      gap: 10px;
      font-size: 13.5px;
      box-shadow: 0 4px 20px rgba(28,39,60,.14);
      border-left: 4px solid var(--primary);
      min-width: 260px;
      max-width: 380px;
      opacity: 0;
      transform: translateX(20px);
      transition: opacity .25s, transform .25s;
      pointer-events: all;
  }

  .toast.show { opacity: 1; transform: translateX(0); }
  .toast-success { border-left-color: var(--green); }
  .toast-success i { color: var(--green); }
  .toast-error { border-left-color: var(--red); }
  .toast-error i { color: var(--red); }
  .toast-warning { border-left-color: var(--orange); }
  .toast-warning i { color: var(--orange); }
  .toast-info { border-left-color: var(--primary); }
  .toast-info i { color: var(--primary); }
  .toast span { flex: 1; }
  .toast-close { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 13px; padding: 0 0 0 6px; }

  /* ─── Modal ──────────────────────────────────────────────── */
  .modal {
      display: none;
      position: fixed;
      inset: 0;
      z-index: 1000;
      align-items: center;
      justify-content: center;
  }

  .modal.open { display: flex; }

  .modal-overlay {
      position: absolute;
      inset: 0;
      background: rgba(28,39,60,.45);
      backdrop-filter: blur(2px);
  }

  .modal-card {
      position: relative;
      z-index: 1;
      background: #fff;
      border-radius: 14px;
      box-shadow: 0 8px 40px rgba(28,39,60,.18);
      width: 100%;
      max-width: 560px;
      max-height: 92vh;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      margin: 16px;
      animation: modalIn .2s ease;
  }

  @keyframes modalIn {
      from { opacity: 0; transform: scale(.96) translateY(-8px); }
      to   { opacity: 1; transform: scale(1) translateY(0); }
  }

  .modal-card.modal-lg { max-width: 760px; }
  .modal-card.modal-xl { max-width: 960px; }

  .modal-header {
      padding: 18px 24px;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-shrink: 0;
  }

  .modal-header h3 { font-size: 16px; font-weight: 600; color: var(--heading); }

  .modal-close {
      width: 32px; height: 32px;
      border-radius: 8px;
      background: none;
      border: none;
      cursor: pointer;
      color: var(--muted);
      font-size: 16px;
      display: flex; align-items: center; justify-content: center;
      transition: background .15s;
  }

  .modal-close:hover { background: var(--bg); color: var(--text); }

  .modal-body {
      padding: 20px 24px;
      overflow-y: auto;
      flex: 1;
  }

  .modal-footer {
      padding: 14px 24px;
      border-top: 1px solid var(--border);
      display: flex;
      justify-content: flex-end;
      gap: 10px;
      flex-shrink: 0;
  }

  /* ─── Toggle Switch ──────────────────────────────────────── */
  .switch-wrap,
  .form-group .switch-wrap,
  .form-group label.switch-wrap {
      display: flex !important;
      align-items: center;
      gap: 10px;
      cursor: pointer;
      user-select: none;
      margin-bottom: 0;
      font-weight: normal;
      font-size: inherit;
      color: inherit;
  }

  /* Pe mobil: switch + text clar separate, nu overlap */
  @media (max-width: 640px) {
    .switch-wrap,
    .form-group .switch-wrap,
    .form-group label.switch-wrap {
      display: flex !important;
      flex-direction: row;
      align-items: center;
      gap: 12px;
      flex-wrap: nowrap;
    }
    .switch-track { flex-shrink: 0; }
  }

  .switch-input { display: none; }

  .switch-track {
      width: 40px; height: 22px;
      background: var(--border);
      border-radius: 11px;
      position: relative;
      transition: background .2s;
      flex-shrink: 0;
  }

  .switch-track::after {
      content: '';
      position: absolute;
      top: 3px; left: 3px;
      width: 16px; height: 16px;
      border-radius: 50%;
      background: #fff;
      box-shadow: 0 1px 3px rgba(0,0,0,.2);
      transition: left .2s;
  }

  .switch-input:checked + .switch-track { background: var(--primary); }
  .switch-input:checked + .switch-track::after { left: 21px; }

  /* ─── Progress bar ───────────────────────────────────────── */
  .progress-wrap {
      background: #f1f3f6;
      border-radius: 20px;
      height: 8px;
      overflow: hidden;
      min-width: 80px;
  }

  .progress-bar {
      height: 100%;
      border-radius: 20px;
      background: var(--primary);
      transition: width .4s;
  }

  .progress-bar.green  { background: var(--green); }
  .progress-bar.orange { background: var(--orange); }
  .progress-bar.red    { background: var(--red); }

  /* ─── Filter bar ─────────────────────────────────────────── */
  .filter-bar {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 16px;
      flex-wrap: wrap;
  }

  .filter-bar select, .filter-bar input[type=text] {
      padding: 7px 12px;
      border: 1px solid var(--border);
      border-radius: 8px;
      font-size: 13px;
      font-family: 'Inter', sans-serif;
      color: var(--text);
      background: #fff;
      outline: none;
  }

  .filter-bar select:focus, .filter-bar input:focus {
      border-color: var(--primary);
      box-shadow: 0 0 0 3px rgba(44,123,229,.10);
  }

  /* ─── Avatar group (echipă proiect) ──────────────────────── */
  .avatar-group {
      display: flex;
      align-items: center;
  }

  .avatar-group .avatar-sm {
      width: 28px; height: 28px;
      border-radius: 50%;
      border: 2px solid #fff;
      margin-left: -8px;
      font-size: 11px;
  }

  .avatar-group .avatar-sm:first-child { margin-left: 0; }

  /* ─── Pagination ─────────────────────────────────────────── */
  .pagination-bar {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 8px;
      padding: 12px 14px;
      border-top: 1px solid var(--border);
      font-size: 13px;
      color: var(--muted);
  }

  .pagination-bar button {
      padding: 5px 12px;
      border: 1px solid var(--border);
      border-radius: 7px;
      background: #fff;
      cursor: pointer;
      font-size: 13px;
      transition: background .15s;
  }

  .pagination-bar button:hover:not(:disabled) { background: var(--bg); }
  .pagination-bar button:disabled { opacity: .4; cursor: default; }

  /* ─── Positions table (ofertă editor) ────────────────────── */
  .pozitii-table input[type=number], .pozitii-table input[type=text] {
      width: 100%;
      padding: 6px 8px;
      border: 1px solid var(--border);
      border-radius: 6px;
      font-size: 13px;
      font-family: 'Inter', sans-serif;
  }

  .pozitii-table input:focus {
      border-color: var(--primary);
      outline: none;
  }

  .pozitii-table td { padding: 8px 6px; vertical-align: middle; }

  .total-box {
      background: #f7f9fc;
      border-radius: 10px;
      padding: 16px 20px;
      margin-top: 16px;
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 6px;
  }

  .total-box .total-row { display: flex; gap: 24px; font-size: 13.5px; }
  .total-box .total-row span:first-child { color: var(--muted); min-width: 120px; text-align: right; }
  .total-box .total-row span:last-child { font-weight: 600; min-width: 130px; text-align: right; }
  .total-box .total-final span:first-child { font-size: 14px; font-weight: 600; }
  .total-box .total-final span:last-child { font-size: 18px; color: var(--primary); }

  /* ─── Offer view (print) ─────────────────────────────────── */
  @media print {
      .sidebar, .topbar, .btn, .no-print { display: none !important; }
      .main-content { margin-left: 0 !important; padding-top: 0 !important; }
      .page-inner { padding: 0 !important; }
  }

  .print-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      margin-bottom: 28px;
      padding-bottom: 20px;
      border-bottom: 2px solid var(--border);
  }

  .print-logo-area { display: flex; align-items: center; gap: 12px; }
  .print-logo { width: 46px; height: 46px; border-radius: 12px; background: linear-gradient(135deg,#22a06b,#2c7be5); display:flex; align-items:center; justify-content:center; }
  .print-logo i { color:#fff; font-size:22px; }

  /* ─── Deadline badge helper ──────────────────────────────── */
  .deadline-urgent   { background: var(--red-soft);    color: var(--red); }
  .deadline-aproape  { background: var(--orange-soft); color: var(--orange); }
  .deadline-normal   { background: #f1f3f6;            color: var(--muted); }
  .deadline-depasit  { background: var(--red-soft);    color: var(--red); }

  /* ─── Timeline ───────────────────────────────────────────── */
  .timeline { position: relative; padding-left: 28px; }
  .timeline::before { content:''; position:absolute; left:9px; top:0; bottom:0; width:2px; background:var(--border); }
  .timeline-item { position: relative; margin-bottom: 20px; }
  .timeline-item::before { content:''; position:absolute; left:-22px; top:4px; width:10px; height:10px; border-radius:50%; background:var(--primary); border:2px solid #fff; box-shadow:0 0 0 2px var(--primary); }
  .timeline-item .tl-date { font-size:11.5px; color:var(--muted); margin-bottom:4px; }
  .timeline-item .tl-content { font-size:13.5px; }

  /* ─── Form select custom ─────────────────────────────────── */
  select.form-control {
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238b97a8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 12px center;
      padding-right: 32px;
  }

  /* ─── Empty state ────────────────────────────────────────── */
  .empty-state {
      text-align: center;
      padding: 48px 24px;
      color: var(--muted);
  }

  .empty-state i { font-size: 36px; opacity: .3; display: block; margin-bottom: 14px; }
  .empty-state p { font-size: 14px; }

  /* ─── Section separator ──────────────────────────────────── */
  .section-title {
      font-size: 12px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: .6px;
      color: var(--muted);
      margin: 20px 0 10px;
  }
  

  /* ═══════════════════════════════════════════════════════════════
     RESPONSIVE — Mobile-first media queries
     ═══════════════════════════════════════════════════════════════ */

  /* ─── Hamburgher buton (ascuns pe desktop) ─────────────────── */
  .hamburger {
      display: none;
      align-items: center;
      justify-content: center;
      width: 38px;
      height: 38px;
      border-radius: 9px;
      background: none;
      border: 1px solid var(--border);
      cursor: pointer;
      color: var(--text);
      font-size: 16px;
      flex-shrink: 0;
      transition: background .15s;
  }
  .hamburger:hover { background: var(--bg); }

  /* ─── Sidebar overlay (mobil) ──────────────────────────────── */
  .sidebar-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(28, 39, 60, .45);
      z-index: 199;
      backdrop-filter: blur(1px);
      animation: fadeIn .2s ease;
  }
  .sidebar-overlay.show { display: block; }
  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

  /* ─── Search expandabil (mobil) ───────────────────────────── */
  .topbar-search-wrap {
      display: flex;
      align-items: center;
      flex: 1;
      gap: 8px;
  }
  .search-toggle {
      display: none;
      align-items: center;
      justify-content: center;
      width: 36px; height: 36px;
      border-radius: 8px;
      background: none;
      border: 1px solid var(--border);
      cursor: pointer;
      color: var(--muted);
      font-size: 15px;
      flex-shrink: 0;
  }
  .topbar-user-name { display: flex; flex-direction: column; }

  /* ─── Table column visibility helpers ─────────────────────── */
  .col-hide-mobile { /* ascunde pe mobil */ }
  .col-hide-tablet { /* ascunde pe tablet */ }

  /* ════════════════════════════════════════
     TABLET — max-width: 1024px
     ════════════════════════════════════════ */
  @media (max-width: 1024px) {
      .sidebar {
          width: 200px;
      }
      .sidebar-brand-text strong { font-size: 14px; }
      .stat-cards {
          grid-template-columns: repeat(2, 1fr);
      }
      /* Ascunde coloane mai puțin importante pe tablet */
      .col-hide-tablet { display: none; }
  }

  /* ════════════════════════════════════════
     MOBIL LANDSCAPE / TABLET MIC — max-width: 768px
     ════════════════════════════════════════ */
  @media (max-width: 768px) {
      /* ── Topbar: start de la left:0 pe mobil ────────────────── */
      .topbar {
          left: 0 !important;
      }
      /* ─── Sidebar — drawer ─────────────── */
      .sidebar {
          position: fixed;
          top: 0;
          left: -260px;
          width: 240px;
          height: 100vh;
          z-index: 200;
          transition: left .28s cubic-bezier(.4,0,.2,1);
          box-shadow: none;
      }
      .sidebar.drawer-open {
          left: 0;
          box-shadow: 4px 0 24px rgba(28,39,60,.18);
      }

      /* ─── Main content — fără margin stânga ─────────────────── */
      .main-content {
          margin-left: 0 !important;
      }

      /* ─── Topbar ───────────────────────── */
      .topbar {
          padding: 0 14px;
          gap: 10px;
      }
      .hamburger { display: flex; }
      .topbar-search { flex: 1; }
      .topbar-search input {
          width: 100%;
          max-width: none;
      }

      /* ─── Page inner padding ───────────── */
      .page-inner { padding: 16px 14px; }

      /* ─── Page header ──────────────────── */
      .page-header {
          flex-direction: column;
          align-items: flex-start;
          gap: 10px;
      }
      .page-header > div:last-child { width: 100%; }
      .page-header .btn { width: 100%; justify-content: center; }

      /* ─── Stat cards — 2 coloane ──────── */
      .stat-cards { grid-template-columns: repeat(2, 1fr); }

      /* ─── Cards grid pe dashboard ─────── */
      div[style*="grid-template-columns:1fr 1fr"] {
          display: block !important;
      }
      div[style*="grid-template-columns:1fr 1fr"] > .card {
          margin-bottom: 14px;
      }

      /* ─── Table overflow scroll ────────── */
      .table-wrap {
          overflow-x: auto;
          -webkit-overflow-scrolling: touch;
      }
      .table-wrap table { min-width: 540px; }

      /* ─── Filter bar wrap ──────────────── */
      .filter-bar { flex-direction: column; align-items: stretch; }
      .filter-bar input, .filter-bar select { width: 100% !important; }

      /* ─── Topbar user — ascunde text ───── */
      .topbar-user-name { display: none; }

      /* ─── Avatar rămâne vizibil ─────────── */
      .topbar-user { gap: 0; }

      /* ─── Modale — aproape full screen ─── */
      .modal-card {
          max-width: 95vw !important;
          max-height: 92vh;
          margin: 4vh 2.5vw;
      }
      .modal-card.modal-lg,
      .modal-card.modal-xl { max-width: 95vw !important; }

      /* ─── Modal footer — butoane stacked ── */
      .modal-footer {
          flex-direction: column-reverse;
          gap: 8px;
      }
      .modal-footer .btn { width: 100%; justify-content: center; }

      /* ─── Form rows — 1 coloană ────────── */
      .form-row { grid-template-columns: 1fr !important; }

      /* ─── Coloane ascunse ──────────────── */
      .col-hide-mobile { display: none !important; }
      .col-hide-tablet { display: none !important; }

      /* ─── Ofertă editor — layout stack ─── */
      div[style*="grid-template-columns:1fr 380px"] {
          display: flex !important;
          flex-direction: column !important;
      }

      /* ─── Client detaliu — layout stack ── */
      div[style*="grid-template-columns:320px 1fr"] {
          display: flex !important;
          flex-direction: column !important;
      }

      /* ─── Proiect detaliu — layout stack ─ */
      div[style*="grid-template-columns:300px 1fr"] {
          display: flex !important;
          flex-direction: column !important;
      }

      /* ─── Rapoarte — layout stack ─────── */
      div[style*="grid-template-columns:1fr 380px"] {
          display: flex !important;
          flex-direction: column !important;
      }

      /* ─── Total box ofertă (keep clear) ── */
      .total-box { padding: 12px 14px; }
      .total-box .total-row { gap: 12px; }
      #t-total { font-size: 18px !important; }

      /* ─── Pagination bar ───────────────── */
      .pagination-bar { justify-content: center; flex-wrap: wrap; }
  
      /* ── Search panel expandabil pe mobil ────────────────────── */
      .topbar-search:not(.is-open) input { display: none; }
      .topbar-search.is-open {
          position: absolute;
          top: 100%;
          left: 0;
          right: 0;
          background: #fff;
          padding: 10px 16px;
          border-bottom: 1px solid var(--border);
          z-index: 30;
          display: block !important;
      }
      .topbar-search.is-open input {
          display: block !important;
          width: 100%;
          padding: 9px 12px 9px 36px;
          border: 1px solid var(--border);
          border-radius: 8px;
          background: #f7f9fc;
          font-size: 14px;
      }
}

  /* ════════════════════════════════════════
     MOBIL PORTRAIT — max-width: 640px
     ════════════════════════════════════════ */
  @media (max-width: 640px) {
      /* ─── Stat cards — 1 coloană ──────── */
      .stat-cards { grid-template-columns: 1fr; gap: 10px; }

      /* ─── Tables ca carduri ────────────── */
      /* Fiecare rând devine card */
      .table-card-mode thead { display: none; }
      .table-card-mode tbody tr {
          display: flex;
          flex-direction: column;
          background: #fff;
          border: 1px solid var(--border);
          border-radius: 10px;
          padding: 12px 14px;
          margin-bottom: 10px;
          box-shadow: 0 1px 4px rgba(28,39,60,.05);
      }
      .table-card-mode tbody td {
          border: none;
          padding: 3px 0;
          font-size: 13.5px;
          display: flex;
          align-items: center;
          gap: 8px;
      }
      .table-card-mode tbody td::before {
          content: attr(data-label);
          font-size: 11px;
          font-weight: 600;
          text-transform: uppercase;
          letter-spacing: .4px;
          color: var(--muted);
          min-width: 90px;
          flex-shrink: 0;
      }
      /* Prima celulă = titlu card */
      .table-card-mode tbody td:first-child {
          font-size: 15px;
          font-weight: 600;
          padding-bottom: 8px;
          border-bottom: 1px solid var(--border);
          margin-bottom: 4px;
      }
      .table-card-mode tbody td:first-child::before { display: none; }
      /* Celula de acțiuni */
      .table-card-mode tbody td:last-child {
          padding-top: 8px;
          border-top: 1px solid var(--border);
          margin-top: 4px;
          justify-content: flex-end;
      }
      .table-card-mode tbody td:last-child::before { display: none; }
      /* Ascundem coloane marcate */
      .table-card-mode td.col-hide-mobile { display: none; }
      /* Tabele fără card mode: overflow scroll */
      .table-wrap:not(.card-wrap) { overflow-x: auto; }

      /* ─── Login card ────────────────────── */
      .login-card { max-width: 90vw !important; padding: 24px 18px !important; }

      /* ─── Topbar search — icon only ─────── */
      .topbar-search input { display: none; }
      .topbar-search input.search-expanded { display: block; }
      .search-toggle { display: flex; }

      /* ─── Editor ofertă — poziții ca carduri */
      #tbl-pozitii thead { display: none; }
      #tbl-pozitii tbody tr {
          display: flex;
          flex-direction: column;
          background: #f7f9fc;
          border-radius: 10px;
          padding: 12px;
          margin-bottom: 10px;
          border: 1px solid var(--border);
      }
      #tbl-pozitii tbody td {
          border: none;
          padding: 4px 0;
          display: flex;
          align-items: center;
          gap: 8px;
      }
      #tbl-pozitii tbody td:first-child { display: none; } /* index # */
      #tbl-pozitii tbody td::before {
          content: attr(data-label);
          font-size: 11px;
          font-weight: 600;
          text-transform: uppercase;
          color: var(--muted);
          min-width: 80px;
          flex-shrink: 0;
      }
      #tbl-pozitii tbody td:last-child { justify-content: flex-end; margin-top: 4px; }
      #tbl-pozitii tbody td:last-child::before { display: none; }
      .pozitii-table input[type=number],
      .pozitii-table input[type=text] { font-size: 15px; padding: 8px 10px; }

      /* ─── Card header — wrap ───────────── */
      .card-header { flex-wrap: wrap; gap: 8px; }
      .card-header .btn { flex-shrink: 0; }

      /* ─── Modale — full screen aproape ─── */
      .modal-card {
          max-width: 100vw !important;
          max-height: 100vh;
          border-radius: 0;
          margin: 0;
          height: 100vh;
      }
      .modal { align-items: flex-end; }

      /* ─── Print/vizualizare ofertă ─────── */
      .of-wrap { padding: 20px 14px; }
      .of-header { flex-direction: column; gap: 14px; }
  }

  /* ────────────────────────────────────────
     Utilitare responsive
     ──────────────────────────────────────── */
  .d-mobile-only { display: none; }
  @media (max-width: 768px) {
      .d-desktop-only { display: none !important; }
      .d-mobile-only { display: block; }
  }
  

  /* ═══════════════════════════════════════════════════════════════
     RESPONSIVE — Mobile-first media queries  (v2 — transform fix)
     ═══════════════════════════════════════════════════════════════ */

  /* ─── Hamburger — ascuns pe desktop ────────────────────────── */
  .hamburger {
      display: none;
      align-items: center;
      justify-content: center;
      width: 38px; height: 38px;
      border-radius: 9px;
      background: none;
      border: 1px solid var(--border);
      cursor: pointer;
      color: var(--text);
      font-size: 17px;
      flex-shrink: 0;
      transition: background .15s;
  }
  .hamburger:hover { background: var(--bg); }

  /* ─── Sidebar overlay ───────────────────────────────────────── */
  .sidebar-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(28, 39, 60, .45);
      z-index: 199;
  }
  .sidebar-overlay.is-visible { display: block; }

  /* ─── Search toggle buton (ascuns pe desktop) ───────────────── */
  .search-toggle { display: none; }

  /* ─── Utilitare ─────────────────────────────────────────────── */
  .d-mobile-only { display: none; }

  /* ════════════════════════════════════════════════════════
     TABLET — max-width: 1024px
     ════════════════════════════════════════════════════════ */
  @media (max-width: 1024px) {
      .stat-cards { grid-template-columns: repeat(2, 1fr); }
      .col-hide-tablet { display: none !important; }
  }

  /* ════════════════════════════════════════════════════════
     MOBIL — max-width: 768px
     ════════════════════════════════════════════════════════ */
  @media (max-width: 768px) {

      /* ── Sidebar: ascuns prin transform, iese cu is-open ── */
      .sidebar {
          transform: translateX(-100%) !important;
          transition: transform .28s cubic-bezier(.4,0,.2,1) !important;
          z-index: 200 !important;
          box-shadow: none;
      }
      .sidebar.is-open {
          left: 0 !important;
          transform: translateX(0) !important;
          box-shadow: 4px 0 24px rgba(28,39,60,.18) !important;
      }

      /* ── Main content: fără margin stânga ───────────────── */
      .main-content {
          margin-left: 0 !important;
      }

      /* ── Hamburger: vizibil ──────────────────────────────── */
      .hamburger {
          display: inline-flex !important;
      }

      /* ── Topbar ─────────────────────────────────────────── */
      .topbar { padding: 0 12px; gap: 8px; }
      .topbar-search input { width: 160px; }

      /* ── Ascunde textul user (rămâne avatar) ─────────────── */
      .topbar-user-name { display: none !important; }
      .topbar-user { gap: 0; }

      /* ── Page inner ─────────────────────────────────────── */
      .page-inner { padding: 14px 12px; }

      /* ── Page header ─────────────────────────────────────── */
      .page-header { flex-direction: column; align-items: flex-start; gap: 10px; }
      .page-header > *:last-child { width: 100%; }
      .page-header > *:last-child .btn { width: 100%; justify-content: center; }

      /* ── Stat cards — 2 col ──────────────────────────────── */
      .stat-cards { grid-template-columns: repeat(2, 1fr); gap: 12px; }

      /* ── Filter bar ──────────────────────────────────────── */
      .filter-bar { flex-direction: column; align-items: stretch; gap: 8px; }
      .filter-bar input, .filter-bar select, .filter-bar .btn {
          width: 100% !important; box-sizing: border-box;
      }

      /* ── Table: overflow scroll fallback ─────────────────── */
      .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

      /* ── Ascunde coloane marcate ─────────────────────────── */
      .col-hide-mobile { display: none !important; }
      .col-hide-tablet { display: none !important; }

      /* ── Modale ──────────────────────────────────────────── */
      .modal-card,
      .modal-card.modal-lg,
      .modal-card.modal-xl { max-width: 95vw !important; }
      .modal-footer { flex-direction: column-reverse !important; gap: 8px; }
      .modal-footer .btn { width: 100% !important; justify-content: center !important; }

      /* ── Formulare — 1 coloană ───────────────────────────── */
      .form-row { grid-template-columns: 1fr !important; }

      /* ── Layout-uri grid inline → coloană ───────────────── */
      .oferta-layout,
      .client-detaliu-layout,
      .proiect-layout { flex-direction: column !important; }

      /* ── Search toggle ───────────────────────────────────── */
      .search-toggle { display: inline-flex !important; }

      /* ── Desktop-only hidden ─────────────────────────────── */
      .d-desktop-only { display: none !important; }
      .d-mobile-only  { display: block !important; }
  }

  /* ════════════════════════════════════════════════════════
     MOBIL PORTRAIT — max-width: 640px
     ════════════════════════════════════════════════════════ */
  @media (max-width: 640px) {

      /* ── Stat cards — 1 coloană ──────────────────────────── */
      .stat-cards { grid-template-columns: 1fr !important; gap: 10px; }

      /* ════ TABLE → CARD MODE ════════════════════════════════
         Fiecare rând devine card stivuit.
         Necesită class="table-card-mode" pe <table>
         și data-label="" pe fiecare <td>.
      ════════════════════════════════════════════════════════ */
      .table-card-mode thead { display: none !important; }

      .table-card-mode tbody tr {
          display: block !important;
          background: #fff;
          border: 1px solid var(--border);
          border-radius: 12px;
          padding: 14px 16px;
          margin-bottom: 12px;
          box-shadow: var(--shadow);
      }

      .table-card-mode tbody td {
          display: flex !important;
          justify-content: space-between;
          align-items: center;
          padding: 5px 0 !important;
          border: none !important;
          text-align: left !important;
          font-size: 13.5px;
          gap: 10px;
      }

      /* Label din data-label */
      .table-card-mode tbody td::before {
          content: attr(data-label);
          font-size: 11px;
          font-weight: 700;
          text-transform: uppercase;
          letter-spacing: .5px;
          color: var(--muted);
          min-width: 88px;
          flex-shrink: 0;
          white-space: nowrap;
      }

      /* Prima celulă = titlu card — fără label, mai mare */
      .table-card-mode tbody td:first-child {
          font-size: 15px !important;
          font-weight: 700;
          padding-bottom: 10px !important;
          border-bottom: 1px solid var(--border) !important;
          margin-bottom: 4px;
      }
      .table-card-mode tbody td:first-child::before { display: none; }

      /* Ultima celulă = acțiuni — fără label, aliniat dreapta */
      .table-card-mode tbody td:last-child {
          padding-top: 10px !important;
          border-top: 1px solid var(--border) !important;
          margin-top: 4px;
          justify-content: flex-end !important;
      }
      .table-card-mode tbody td:last-child::before { display: none; }

      /* Coloane ascunse rămân ascunse și în card mode */
      .table-card-mode tbody td.col-hide-mobile { display: none !important; }

      /* ── Editor ofertă — poziții ca carduri ──────────────── */
      #tbl-pozitii thead { display: none !important; }

      #tbl-pozitii tbody tr {
          display: block !important;
          background: #f7f9fc;
          border: 1px solid var(--border);
          border-radius: 10px;
          padding: 12px 14px;
          margin-bottom: 10px;
      }

      #tbl-pozitii tbody td {
          display: flex !important;
          align-items: center;
          padding: 5px 0 !important;
          border: none !important;
          gap: 10px;
      }

      #tbl-pozitii tbody td:first-child { display: none !important; } /* nr. # */

      #tbl-pozitii tbody td::before {
          content: attr(data-label);
          font-size: 11px;
          font-weight: 700;
          text-transform: uppercase;
          color: var(--muted);
          min-width: 80px;
          flex-shrink: 0;
      }

      #tbl-pozitii tbody td:last-child {
          justify-content: flex-end !important;
          padding-top: 8px !important;
          border-top: 1px solid var(--border) !important;
          margin-top: 4px;
      }
      #tbl-pozitii tbody td:last-child::before { display: none; }

      #tbl-pozitii input { font-size: 15px; padding: 8px 10px; }

      /* ── Modale — full height ─────────────────────────────── */
      .modal { align-items: flex-end !important; }
      .modal-card {
          max-width: 100vw !important;
          max-height: 96vh !important;
          border-radius: 16px 16px 0 0 !important;
          margin: 0 !important;
      }

      /* ── Login ───────────────────────────────────────────── */
      .login-card { max-width: 92vw !important; padding: 24px 16px !important; }

      /* ── Vizualizare ofertă ───────────────────────────────── */
      .of-wrap { padding: 16px 12px; }
      .of-header { flex-direction: column; gap: 12px; }
  }
  