/* ===========================================================
   AutoParts CRM — tema "atelier": grafit + otel + portocaliu semnal
   =========================================================== */

:root{
  --bg:            #14171c;
  --bg-panel:      #1c2027;
  --bg-panel-2:    #232833;
  --border:        #2d333f;
  --steel:         #4a5568;
  --text:          #e6e9ef;
  --text-dim:      #9aa3b2;
  --accent:        #e8862c;   /* portocaliu semnalizare */
  --accent-dim:    #b8631a;
  --green:         #3fae6a;
  --red:           #d8534f;
  --blue:          #4a90c2;
  --amber:         #e8b23d;
  --radius:        6px;
  --mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html[data-theme="light"]{
  --bg:            #ffffff;
  --bg-panel:      #ffffff;
  --bg-panel-2:    #f4f5f7;
  --border:        #e0e3e8;
  --steel:         #c3c9d3;
  --text:          #1b1f27;
  --text-dim:      #626a79;
}
html[data-theme="light"] table{ background: var(--bg-panel); }
html[data-theme="light"] .sidebar{ background: #fafafb; }
html[data-theme="light"] .topbar{ background: #fafafb; }

*{ box-sizing: border-box; }

html,body{
  margin:0; padding:0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
  max-width: 100%;
}
/* zoom:90% a fost eliminat — cauza reala a "overflow-ului fantoma" raportat de utilizator:
   proprietatea CSS zoom face ca scrollWidth/clientWidth sa fie masurate inconsecvent in
   Chrome, ceea ce facea sa para ca elemente ies din chenar desi erau corect dimensionate. */

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

::selection{ background: var(--accent-dim); color:#fff; }

/* ---------- layout ---------- */
.wrap{ display:flex; min-height:100vh; }

.sidebar{
  width: 230px;
  flex-shrink:0;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  padding: 20px 0;
  display:flex; flex-direction:column;
}

.sidebar .brand{
  display:flex; align-items:center; gap:10px;
  padding: 0 20px 20px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.sidebar .brand img{ width:32px; height:32px; object-fit:contain; border-radius:4px; }
.sidebar .brand .name{ font-weight:700; font-size:15px; letter-spacing:.3px; }
.sidebar .brand .tag{ font-size:11px; color:var(--text-dim); text-transform:uppercase; letter-spacing:.08em; }

.nav-group-label{
  padding: 16px 20px 6px 20px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-dim);
  opacity: .65;
}
.nav-group-label:first-of-type{ padding-top: 2px; }

.nav-item{
  display:flex; align-items:center; gap:10px;
  padding: 8px 16px;
  margin: 1px 8px;
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
  border-left: 3px solid transparent;
}
.nav-item:hover{ background: var(--bg-panel-2); color: var(--text); text-decoration:none; }
.nav-item.active{ color: var(--accent); background: var(--bg-panel-2); font-weight:600; }
.nav-item .ico{ width:18px; text-align:center; opacity:.85; font-size:14px; }
.nav-item .ico-box{
  width: 32px; height: 32px;
  border-radius: 9px;
  display:flex; align-items:center; justify-content:center;
  flex-shrink: 0;
  background: linear-gradient(145deg, #4a5568, #2d3748);
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
  transition: transform .12s, box-shadow .12s;
}
.nav-item .ico-box i,
.nav-item .ico-box svg{
  width: 16px; height: 16px;
  color: #fff;
  stroke: #fff;
  fill: none;
  flex-shrink: 0;
}
.nav-item:hover .ico-box{ transform: scale(1.08); box-shadow: 0 3px 10px rgba(0,0,0,.3); }
.nav-item.active .ico-box{ box-shadow: 0 3px 12px rgba(0,0,0,.3); }

/* ---- Iconite colorate pentru cardurile din hub-ul de Rapoarte (acelasi stil ca in meniu) ---- */
.report-ico-box{
  width: 44px; height: 44px;
  border-radius: 12px;
  display:flex; align-items:center; justify-content:center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.22);
  margin-bottom: 12px;
  transition: transform .12s, box-shadow .12s;
}
.report-ico-box i,
.report-ico-box svg{
  width: 22px; height: 22px;
  color: #fff;
  stroke: #fff;
  fill: none;
  flex-shrink: 0;
}
a.card-link:hover .report-ico-box{ transform: scale(1.06); box-shadow: 0 4px 12px rgba(0,0,0,.28); }

/* ---- Culori distincte per sectiune de meniu ---- */
.nav-item[data-nav-key="dashboard"]    .ico-box { background: linear-gradient(145deg, #5c6ae8, #3a3fcc); }
.nav-item[data-nav-key="daily_report"] .ico-box { background: linear-gradient(145deg, #f4a261, #e07a30); }
.nav-item[data-nav-key="statistics"]   .ico-box { background: linear-gradient(145deg, #43c97e, #26a858); }
.nav-item[data-nav-key="reports"]      .ico-box { background: linear-gradient(145deg, #ec4899, #be185d); }
.nav-item[data-nav-key="clients"]      .ico-box { background: linear-gradient(145deg, #4cc9f0, #3a8fd4); }
.nav-item[data-nav-key="mechanics"]    .ico-box { background: linear-gradient(145deg, #8b8fa8, #5a5f78); }
.nav-item[data-nav-key="orders"]       .ico-box { background: linear-gradient(145deg, #9b6edc, #7209b7); }
.nav-item[data-nav-key="parts"]        .ico-box { background: linear-gradient(145deg, #e8862c, #b8631a); }
.nav-item[data-nav-key="inventory"]    .ico-box { background: linear-gradient(145deg, #20c5bd, #0d9e97); }
.nav-item[data-nav-key="reorder_list"] .ico-box { background: linear-gradient(145deg, #f0a500, #d47d00); }
.nav-item[data-nav-key="sales"]        .ico-box { background: linear-gradient(145deg, #3fae6a, #267a49); }
.nav-item[data-nav-key="returns"]      .ico-box { background: linear-gradient(145deg, #e05c58, #b83330); }
.nav-item[data-nav-key="employees"]    .ico-box { background: linear-gradient(145deg, #4895ef, #2662c4); }
.nav-item[data-nav-key="suppliers"]    .ico-box { background: linear-gradient(145deg, #3b82c4, #1a4a80); }
.nav-item[data-nav-key="backup"]       .ico-box { background: linear-gradient(145deg, #6b7280, #4b5563); }
.nav-item[data-nav-key="performance"]  .ico-box { background: linear-gradient(145deg, #f5c842, #d4a017); }
.nav-item[data-nav-key="activity_log"] .ico-box { background: linear-gradient(145deg, #38bdf8, #0284c7); }
.nav-item[data-nav-key="settings"]     .ico-box { background: linear-gradient(145deg, #94a3b8, #64748b); }

/* light-theme: umbra mai subtila */
html[data-theme="light"] .nav-item .ico-box{ box-shadow: 0 2px 8px rgba(0,0,0,.18); }

.sidebar .foot{
  margin-top:auto; padding: 14px 20px 0 20px; border-top:1px solid var(--border);
  font-size:13px; color:var(--text-dim);
}
.sidebar .foot .who{ color:var(--text); font-weight:600; margin-bottom:6px; }
.sidebar .foot a{ color:var(--text-dim); }

.main{ flex:1; min-width:0; }

.menu-toggle{
  display:none; width:36px; height:36px; border-radius:8px; border:1px solid var(--border);
  background: var(--bg-panel-2); color:var(--text); font-size:18px; cursor:pointer; flex-shrink:0; margin-right:12px;
  align-items:center; justify-content:center;
}
.menu-toggle i{ width:18px; height:18px; pointer-events:none; }
.sidebar-overlay{ display:none; }

.topbar{
  display:flex; align-items:center; justify-content:space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-panel);
}
.topbar h1{ font-size:18px; margin:0; font-weight:700; }
.topbar .sub{ color:var(--text-dim); font-size:13px; margin-top:2px; }

.content{ padding: 26px 28px 60px 28px; max-width: 100%; overflow-x: hidden; }

/* ---------- panels / cards ---------- */
.grid{ display:grid; gap: 18px; }
.grid-4{ grid-template-columns: repeat(4, 1fr); }
.grid-3{ grid-template-columns: repeat(3, 1fr); }
.grid-2{ grid-template-columns: repeat(2, 1fr); }
.grid-5{ grid-template-columns: repeat(5, 1fr); gap:12px; }
.stat-link-card{ transition: transform .12s, box-shadow .12s; cursor:pointer; }
.stat-link-card:hover{ transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.card-compact{ padding:12px 14px; }
@media (max-width: 1100px){ .grid-4{ grid-template-columns: repeat(2,1fr);} .grid-3{grid-template-columns: repeat(2,1fr);} .grid-5{ grid-template-columns: repeat(3,1fr);} }
@media (max-width: 600px){ .grid-5{ grid-template-columns: repeat(2,1fr);} }

.card{
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.card h3{ margin:0 0 4px 0; font-size:13px; text-transform:uppercase; letter-spacing:.06em; color:var(--text-dim); font-weight:600; }

.stat-num{ font-family: var(--mono); font-size: 28px; font-weight:700; color:var(--text); margin-top:6px; }
.stat-num.accent{ color: var(--accent); }
.stat-sub{ font-size:12px; color:var(--text-dim); margin-top:4px; }
.stat-link{ display:inline-block; margin-top:10px; font-size:12px; color:var(--accent); }
.stat-link:hover{ text-decoration:underline; }
a.card-link{ display:block; text-decoration:none; color:inherit; transition: border-color .15s, transform .1s; }
a.card-link:hover{ border-color: var(--accent); transform: translateY(-1px); }

/* ---------- 3 butoane mari (dashboard angajat) ---------- */
.quick-actions{ display:flex; flex-wrap:wrap; gap:10px; margin-bottom:8px; }
.quick-action{
  position:relative; display:flex; flex-direction:row; align-items:center; justify-content:center; gap:8px;
  background: var(--bg-panel); border:1px solid var(--border); border-radius: 8px; padding:10px 18px;
  text-decoration:none; color:var(--text); text-align:center; transition: border-color .15s, transform .1s;
  white-space:nowrap;
}
.quick-action:hover{ border-color: var(--accent); transform: translateY(-2px); }
/* Comanda noua — tenta albastra */
.quick-action[href="order_add.php"]{
  background: rgba(59,130,246,.07); border-color: rgba(59,130,246,.28);
}
.quick-action[href="order_add.php"]:hover{ background: rgba(59,130,246,.13); border-color: rgba(59,130,246,.55); }
.quick-action[href="order_add.php"] .quick-action-ico i,
.quick-action[href="order_add.php"] .quick-action-ico svg{ color:#3b82f6; stroke:#3b82f6; }
/* Vanzare noua — tenta verde */
.quick-action[href="sale_add.php"]{
  background: rgba(63,174,106,.07); border-color: rgba(63,174,106,.28);
}
.quick-action[href="sale_add.php"]:hover{ background: rgba(63,174,106,.13); border-color: rgba(63,174,106,.55); }
.quick-action[href="sale_add.php"] .quick-action-ico i,
.quick-action[href="sale_add.php"] .quick-action-ico svg{ color:#3fae6a; stroke:#3fae6a; }
/* Cec rapid — tenta rosie */
.quick-action-red{
  background: rgba(216,83,79,.07); border-color: rgba(216,83,79,.28);
  font: inherit; cursor:pointer;
}
.quick-action-red:hover{ background: rgba(216,83,79,.13); border-color: rgba(216,83,79,.55); border-color: rgba(216,83,79,.55); transform: translateY(-2px); }
.quick-action-red .quick-action-ico i,
.quick-action-red .quick-action-ico svg{ color:#d8534f; stroke:#d8534f; }
.quick-action-orange{
  background: rgba(214,122,40,.07); border-color: rgba(214,122,40,.28);
  font: inherit; cursor:pointer;
}
.quick-action-orange:hover{ background: rgba(214,122,40,.13); border-color: rgba(214,122,40,.55); transform: translateY(-2px); }
.quick-action-orange .quick-action-ico i,
.quick-action-orange .quick-action-ico svg{ color:#d67a28; stroke:#d67a28; }

/* ---------- modal generic ---------- */
.modal-overlay{
  position:fixed; inset:0; background:rgba(0,0,0,.5); z-index:1000;
  display:flex; align-items:center; justify-content:center; padding:20px;
}
.modal-overlay[hidden]{ display:none; }
.modal-box{
  background: var(--bg-panel); border-radius:12px; width:100%; max-width:720px; max-height:90vh;
  display:flex; flex-direction:column; overflow:hidden; box-shadow:0 20px 60px rgba(0,0,0,.35);
}
.modal-header{ display:flex; align-items:center; justify-content:space-between; padding:16px 20px; border-bottom:1px solid var(--border); flex-shrink:0; }
.modal-header h3{ margin:0; font-size:16px; }
.modal-close{ background:none; border:none; font-size:20px; cursor:pointer; color:var(--text-dim); line-height:1; padding:4px; }
.modal-close:hover{ color:var(--text); }
.modal-body{ padding:20px; overflow-y:auto; flex:1; }
.modal-footer{ padding:14px 20px; border-top:1px solid var(--border); flex-shrink:0; display:flex; justify-content:space-between; align-items:center; gap:10px; }
.quick-action-ico{ font-size:20px; line-height:1; display:flex; align-items:center; justify-content:center; }
.quick-action-ico i, .quick-action-ico svg{ width:20px; height:20px; color:var(--text); stroke:var(--text); fill:none; flex-shrink:0; }
.quick-action-label{ font-size:14px; font-weight:700; }
.quick-action-badge{
  position:absolute; top:-8px; right:-8px; background: var(--red); color:#fff; font-size:11px; font-weight:700;
  min-width:20px; height:20px; border-radius:10px; display:flex; align-items:center; justify-content:center; padding:0 5px;
}
.quick-actions-divider{ width:1px; align-self:stretch; background:var(--border); margin:2px 4px; }
.quick-search-form{
  display:flex; align-items:center; gap:4px; flex:1; min-width:180px;
}
.search-input-wrap{
  position:relative; flex:1; min-width:180px; display:flex; align-items:center;
}
.search-input-icon{
  position:absolute; left:11px; top:50%; transform:translateY(-50%);
  width:15px !important; height:15px !important; color:var(--text-dim); stroke:var(--text-dim); fill:none;
  pointer-events:none; flex-shrink:0; display:block;
}
input.quick-search-input{
  flex:1; width:100%; height:38px; padding:0 12px 0 38px !important; border:1px solid var(--border); border-radius:8px;
  background:var(--bg-panel); color:var(--text); font-size:13px; outline:none;
  transition: border-color .15s; box-sizing:border-box;
}
input.quick-search-input:focus{ border-color:var(--accent); }
.quick-search-btn{
  height:38px; padding:0 18px; border-radius:20px; font-size:13px; font-weight:700; line-height:1;
  flex-shrink:0; display:inline-flex; align-items:center; gap:7px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color:#fff; border:none; cursor:pointer;
  box-shadow: 0 3px 10px rgba(59,130,246,.40);
  transition: transform .13s, box-shadow .13s, background .13s;
  white-space:nowrap;
}
.quick-search-btn::before{ display:none; }
.quick-search-btn i,
.quick-search-btn svg{ width:15px; height:15px; color:#fff; stroke:#fff; fill:none; flex-shrink:0; }
.quick-search-btn:hover{
  background: linear-gradient(135deg, #2563eb, #1e40af);
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(59,130,246,.50);
  text-decoration:none; color:#fff;
}
.quick-search-btn:active{ transform: translateY(0); box-shadow: 0 2px 6px rgba(59,130,246,.35); }
@media (max-width: 700px){
  .quick-actions{ flex-direction:column; }
  .quick-action{ justify-content:flex-start; }
  .quick-search-form{ width:100%; }
}

.panel-title{
  display:flex; align-items:center; justify-content:space-between;
  margin: 30px 0 12px 0;
}
.panel-title h2{ font-size:15px; margin:0; text-transform:uppercase; letter-spacing:.05em; color:var(--text-dim); }

/* ---------- sectiuni colapsabile (details/summary) ---------- */
.collapsible{ margin-bottom:18px; }
.collapsible > summary.panel-title{
  cursor:pointer; list-style:none; user-select:none;
  justify-content:flex-start; gap:10px;
  background: var(--bg-panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 0 0 12px 0;
  transition: background .12s ease, border-color .12s ease;
}
.collapsible > summary.panel-title::-webkit-details-marker{ display:none; }
.collapsible > summary.panel-title::before{
  content:"▸"; display:inline-block; font-size:12px;
  color: var(--accent); transition: transform .15s ease;
}
.collapsible[open] > summary.panel-title::before{ transform: rotate(90deg); }
.collapsible > summary.panel-title:hover{
  background: var(--steel);
  border-color: var(--accent-dim);
}
.collapsible > summary.panel-title:hover h2{ color: var(--text); }
.collapsible[open] > summary.panel-title{
  border-color: var(--accent-dim);
  background: rgba(232,134,44,.08);
}

/* ---------- table ---------- */
table{ width:100%; border-collapse:collapse; background: var(--bg-panel); border:1px solid var(--border); border-radius: var(--radius); overflow:hidden; }
thead th{
  text-align:left; font-size:10.5px; text-transform:uppercase; letter-spacing:.05em;
  color: var(--text-dim); background: var(--bg-panel-2);
  padding: 8px 10px; border-bottom:1px solid var(--border);
}
thead th .th-sort-link{
  color: inherit; text-decoration:none; display:inline-flex; align-items:center; gap:2px;
  cursor:pointer; user-select:none;
}
thead th .th-sort-link:hover{ color: var(--text); text-decoration:none; }
thead th .th-sort-link.active{ color: var(--accent); }
thead th .th-sort-link .sort-arrow{ font-size:9px; }
tbody td{ padding: 9px 10px; border-bottom:1px solid var(--border); font-size:13px; white-space:nowrap; }
tbody tr:last-child td{ border-bottom:none; }
tbody tr:hover{ background: rgba(255,255,255,0.02); }
tbody tr.row-link{ cursor:pointer; }
tbody tr.row-link:hover{ background: rgba(232,134,44,.07); }
tbody td.td-wrap{ white-space:normal; }
tbody td .row-actions-inline{ display:flex; gap:6px; flex-wrap:nowrap; align-items:center; }
tbody td .row-actions-inline .btn-icon{ width:34px; height:30px; padding:0; display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; }
tbody td .row-actions-inline .btn-sm{ height:30px; box-sizing:border-box; display:inline-flex; align-items:center; justify-content:center; white-space:nowrap; }
.table-scroll{ overflow-x:auto; -webkit-overflow-scrolling:touch; border-radius: var(--radius); width:100%; max-width:100%; box-sizing:border-box; }
.table-scroll table{ border-radius:0; }
td.mono, .mono{ font-family: var(--mono); font-size:13px; color: var(--text-dim); }

/* ---------- badges ---------- */
.badge{
  display:inline-block; padding: 3px 10px; border-radius: 20px;
  font-size:12px; font-weight:600; letter-spacing:.02em;
}
.badge-blue{ background: rgba(74,144,194,.15); color: var(--blue); }
.badge-amber{ background: rgba(232,178,61,.15); color: var(--amber); }
.badge-green{ background: rgba(63,174,106,.15); color: var(--green); }
.badge-red{ background: rgba(216,83,79,.15); color: var(--red); }
.badge-gray{ background: rgba(154,163,178,.15); color: var(--text-dim); }
.badge-purple{ background: rgba(155,110,220,.18); color: #9b6edc; }
.badge-yellow{ background: rgba(250,200,30,.18); color: #c8a800; }
.badge-teal{ background: rgba(32,178,170,.15); color: #20b2aa; }

/* ---------- forms ---------- */
label{ display:block; font-size:13px; color: var(--text-dim); margin-bottom:5px; font-weight:500; }
input[type=text], input[type=password], input[type=number], input[type=tel],
input[type=email], input[type=file], select, textarea{
  width:100%; padding: 9px 12px;
  background: var(--bg); border:1px solid var(--border); border-radius: var(--radius);
  color: var(--text); font-size:14px; font-family: var(--sans);
}
input:focus, select:focus, textarea:focus{ outline:2px solid var(--accent-dim); border-color: var(--accent); }
.field{ margin-bottom: 16px; }
.field-row{ display:flex; gap:16px; }
.field-row .field{ flex:1; }

.btn{
  display:inline-block; padding: 9px 18px; border-radius: var(--radius);
  background: var(--accent); color:#1a1408; font-weight:700; font-size:14px;
  border:1px solid transparent; cursor:pointer; text-align:center;
}
.btn:hover{ background:#f39a44; text-decoration:none; }
.btn-secondary{ background: var(--bg-panel-2); color: var(--text); border:1px solid var(--border); }
.btn-secondary:hover{ background: var(--steel); }
.btn-danger{ background: var(--red); color:#fff; }
.btn-success{ background: var(--green); color:#fff; }
.btn-success:hover{ background:#369159; text-decoration:none; }
.btn-sm{ padding: 5px 12px; font-size:12px; }
.btn-lg-add{
  display:inline-block; padding: 16px 28px; border-radius: var(--radius);
  background: var(--accent); color:#1a1408; font-weight:700; font-size:17px;
  border:none; cursor:pointer; text-align:center; box-shadow:0 2px 10px rgba(232,134,44,.25);
}
.btn-lg-add:hover{ background:#f39a44; text-decoration:none; transform:translateY(-1px); }

.form-card{ max-width: 640px; }

/* ---------- login / install ---------- */
.center-screen{
  min-height:100vh; display:flex; align-items:center; justify-content:center;
  background: radial-gradient(circle at 50% 0%, #1e242e 0%, #14171c 60%);
}
.auth-box{
  width: 380px; background: var(--bg-panel); border:1px solid var(--border);
  border-radius: 10px; padding: 32px 30px; box-shadow: 0 20px 50px rgba(0,0,0,.4);
}
.auth-box .logo-row{ display:flex; align-items:center; gap:10px; margin-bottom:22px; }
.auth-box .logo-row .mark{ width:34px; height:34px; border-radius:8px; background:var(--accent); display:flex; align-items:center;justify-content:center; font-weight:800; color:#1a1408; }
.auth-box h1{ font-size:19px; margin:0 0 4px 0; }
.auth-box .sub{ color:var(--text-dim); font-size:13px; margin-bottom:22px; }

.install-shell{ max-width: 640px; margin: 40px auto; }
.install-shell .card{ margin-bottom:20px; }
.step-num{
  display:inline-flex; align-items:center; justify-content:center;
  width:22px;height:22px;border-radius:50%; background:var(--accent); color:#1a1408;
  font-size:12px; font-weight:800; margin-right:8px;
}

.alert{ padding: 12px 16px; border-radius: var(--radius); margin-bottom:16px; font-size:14px; }
.alert-error{ background: rgba(216,83,79,.12); border:1px solid rgba(216,83,79,.4); color:#f0a6a3; }
.alert-success{ background: rgba(63,174,106,.12); border:1px solid rgba(63,174,106,.4); color:#8fdcae; }
.alert-info{ background: rgba(74,144,194,.12); border:1px solid rgba(74,144,194,.4); color:#a9d1ec; }

.empty-state{ text-align:center; padding: 40px 20px; color: var(--text-dim); }
.empty-state .big{ font-size:32px; margin-bottom:8px; }

.pill-nav{ display:flex; gap:8px; margin-bottom: 18px; }
.pill-nav a{ padding:7px 14px; border-radius:20px; background:var(--bg-panel); border:1px solid var(--border); color:var(--text-dim); font-size:13px; font-weight:600; }
.pill-nav a.active{ background: var(--accent); color:#1a1408; border-color:var(--accent); }

.client-photo{ width:100%; max-width:260px; border-radius: var(--radius); border:1px solid var(--border); display:block; }

.discount-tag{ font-family: var(--mono); color: var(--amber); }
.strike{ text-decoration: line-through; color: var(--text-dim); }

.search-bar{ display:flex; gap:10px; margin-bottom:18px; }
.search-bar input{ flex:1; }

/* ---------- autocomplete client ---------- */
.autocomplete-results{
  position:absolute; z-index:20; left:0; right:0; top:100%; margin-top:4px;
  background: var(--bg-panel); border:1px solid var(--border); border-radius: var(--radius);
  max-height: 280px; overflow-y:auto; box-shadow: 0 12px 30px rgba(0,0,0,.35);
}
.autocomplete-results .ac-item{ padding:10px 14px; cursor:pointer; border-bottom:1px solid var(--border); }
.autocomplete-results .ac-item:last-child{ border-bottom:none; }
.autocomplete-results .ac-item:hover, .autocomplete-results .ac-item.active{ background: var(--bg-panel-2); }
.autocomplete-results .ac-item .ac-name{ font-weight:600; font-size:14px; }
.autocomplete-results .ac-item .ac-sub{ font-size:12px; color:var(--text-dim); margin-top:2px; }
.autocomplete-results .ac-empty{ padding:14px; font-size:13px; color:var(--text-dim); text-align:center; }

.text-right{ text-align:right; }
.mb-0{ margin-bottom:0; }
.mt-20{ margin-top:20px; }
.small{ font-size:12px; color:var(--text-dim); }

.item-row{ background: var(--bg-panel-2); }
.item-row .field label{ font-size:11px; }

/* rentabilitate: verde daca e plus, rosu daca e minus */
.rentab-pos{ color: var(--green) !important; font-weight:800 !important; }
.rentab-neg{ color: var(--red) !important; font-weight:800 !important; }
.rentab-zero{ color: var(--text-dim) !important; }
input.rentab-pos, input.rentab-neg{ border-color: currentColor; }

.row-actions{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.row-actions form{ margin:0; }
.btn-fixed{ min-width:112px; text-align:center; }
.reset-pass-form{ display:flex; gap:6px; align-items:center; }
.reset-pass-form input[type=password]{ padding:7px 8px; font-size:12.5px; }

/* ---------- comutator tema zi/noapte ---------- */
.theme-toggle{
  display:flex; align-items:center; gap:8px; cursor:pointer; user-select:none;
  font-size:12px; color:var(--text-dim); margin-top:10px;
}
.theme-toggle .switch{
  width:38px; height:20px; border-radius:20px; background:var(--bg); border:1px solid var(--border);
  position:relative; flex-shrink:0; transition:background .15s;
}
.theme-toggle .switch .knob{
  position:absolute; top:2px; left:2px; width:14px; height:14px; border-radius:50%;
  background:var(--accent); transition:left .15s;
}
html[data-theme="light"] .theme-toggle .switch .knob{ left:20px; }

/* ---------- setari de culoare (color pickers) ---------- */
.color-field{ display:flex; align-items:center; gap:12px; }
.color-field input[type=color]{
  width:44px; height:36px; padding:2px; border-radius:var(--radius); border:1px solid var(--border);
  background:var(--bg); cursor:pointer;
}
.color-swatch-row{ display:flex; gap:20px; flex-wrap:wrap; }

/* ---------- text automat cu majuscule (client, VIN, cod piesa etc.) ---------- */
.upper-input{ text-transform: uppercase; }
.upper-input::placeholder{ text-transform: none; }

/* ---------- tabel compact de produse (comanda noua / editare comanda) ---------- */
.items-grid-scroll{ overflow-x:auto; width:100%; max-width:100%; border:1px solid var(--border); border-radius:var(--radius); margin-bottom:12px; }
.new-item-section{
  background: rgba(74,144,194,.06);
  border: 1px dashed var(--blue);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 30px;
  margin-bottom: 18px;
}
.new-item-section .panel-title{ margin-top:0; }
.new-item-section .items-grid-scroll{ border-color: rgba(74,144,194,.35); margin-bottom:0; }
.items-grid{ display:grid; min-width:1280px; }
.items-grid.add-mode{ grid-template-columns: 1fr 100px 62px 62px 60px 90px 90px 76px 150px 90px 110px 36px; }
.items-grid.edit-mode{ grid-template-columns: 0.9fr 95px 62px 62px 55px 80px 80px 68px 140px 85px 130px 90px 92px 34px; }
.items-grid-row{ display:contents; }
.row-contents{ display:contents; }
.items-grid .gh{
  background: var(--bg-panel-2); font-size:10.5px; text-transform:uppercase; letter-spacing:.03em;
  color: var(--text-dim); padding:8px 8px; border-bottom:1px solid var(--border); position:sticky; top:0;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.items-grid .gc{
  padding:6px 8px; border-bottom:1px solid var(--border); display:flex; align-items:center; min-width:0;
}
.items-grid .gc-center{ justify-content:center; text-align:center; }
.items-grid .gc-catalog-badge, .items-grid .gc-stock-badge{
  display:inline-flex; align-items:center; justify-content:center; gap:3px;
  font-size:11px; font-weight:700; padding:4px 6px; border-radius:5px; min-width:34px; white-space:nowrap;
}
.items-grid .gc-catalog-badge.yes, .items-grid .gc-stock-badge.yes{ background: rgba(63,174,106,.15); color: var(--green); }
.items-grid .gc-catalog-badge.no, .items-grid .gc-stock-badge.no{ color: var(--text-dim); }
.items-grid .gc-stock-badge.low{ background: rgba(216,83,79,.15); color: var(--red); }
.spec-chip{
  display:inline-block; font-size:11px; padding:2px 8px; border-radius:999px;
  background: var(--bg-panel-2); border:1px solid var(--border); color: var(--text-dim);
}

/* ---------- arbore de categorii colapsabil (Marfa) ---------- */
.cat-tree{ border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; }
.cat-tree-node{ margin:0; }
.cat-tree-node > .cat-tree-children{ border-top:1px solid var(--border); }
.cat-tree-row{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:8px 12px; border-bottom:1px solid var(--border); background: var(--bg-panel);
}
.cat-tree-row:last-child{ border-bottom:none; }
.cat-tree-row:hover{ background: var(--bg-panel-2); }
.cat-tree-node > summary.cat-tree-row{ cursor:pointer; list-style:none; user-select:none; }
.cat-tree-node > summary.cat-tree-row::-webkit-details-marker{ display:none; }
.cat-tree-name{ display:inline-flex; align-items:center; gap:6px; font-size:13.5px; }
.cat-tree-name-root{ font-weight:700; text-transform:uppercase; letter-spacing:.02em; font-size:12.5px; }
.cat-tree-node > summary .cat-tree-name::before{
  content:"▸"; display:inline-block; font-size:10px; color:var(--accent); transition: transform .15s ease;
}
.cat-tree-node[open] > summary .cat-tree-name::before{ transform: rotate(90deg); }
.cat-tree-leaf .cat-tree-name{ padding-left:16px; color:var(--text-dim); }
.cat-tree-leaf .cat-tree-name::before{ content:"·"; margin-right:2px; }
.cat-tree-actions{ display:flex; gap:6px; flex-shrink:0; }
.cat-tree-actions form{ display:inline; }
.cat-tree-count{
  display:inline-block; font-size:10.5px; font-weight:700; padding:1px 7px; border-radius:999px;
  background: rgba(232,134,44,.15); color: var(--accent); margin-left:2px;
}
.cat-tree-part-row{
  display:flex; align-items:center; gap:10px; padding:6px 12px; border-bottom:1px solid var(--border);
  background: var(--bg-panel); text-decoration:none; color:var(--text);
}
.cat-tree-part-row:last-child{ border-bottom:none; }
.cat-tree-part-row:hover{ background: var(--bg-panel-2); text-decoration:none; }
.cat-tree-part-row::before{ content:""; display:none; }
.cat-tree-part-ico{ width:14px; height:14px; color:var(--text-dim); flex-shrink:0; opacity:.7; }
.cat-tree-part-cod{ color: var(--text-dim); font-size:11.5px; min-width:80px; }
.cat-tree-part-nume{ font-size:12.5px; }

/* ---------- bara de actiuni in bulc (mutare marfa intre categorii) ---------- */
.bulk-actions-bar{
  display:flex; align-items:center; gap:12px; padding:12px 16px; margin-bottom:14px;
  background: rgba(232,134,44,.08); border:1px solid var(--accent-dim);
}

/* ---------- taburi Marfa (piese din magazin vs auto-adaugate din comenzi) ---------- */
.parts-tabs{ display:flex; gap:4px; margin-bottom:16px; border-bottom:1px solid var(--border); }
.parts-tab{
  display:flex; align-items:center; gap:8px; padding:10px 18px; font-weight:700; font-size:13.5px;
  color: var(--text-dim); border-bottom:2px solid transparent; margin-bottom:-1px;
}
.parts-tab:hover{ color: var(--text); text-decoration:none; }
.parts-tab.active{ color: var(--accent); border-bottom-color: var(--accent); }
.parts-tab-count{
  display:inline-block; font-size:11px; font-weight:700; padding:1px 8px; border-radius:999px;
  background: var(--bg-panel-2); border:1px solid var(--border); color:var(--text-dim);
}
.parts-tab.active .parts-tab-count{ background: rgba(232,134,44,.15); border-color: transparent; color: var(--accent); }

/* ---------- lipire inteligenta produse din alt site ---------- */
.paste-zone{ margin-bottom:14px; }
.paste-zone #pasteZoneBody{
  margin-top:10px; padding:14px; border:1px dashed var(--accent-dim);
  border-radius: var(--radius); background: rgba(232,134,44,.05);
}
.paste-zone textarea{ width:100%; font-family:var(--mono); font-size:12.5px; resize:vertical; }
.paste-zone #pasteZoneBody.ocr-drag-over{ border-color: var(--accent); background: rgba(232,134,44,.12); }
.paste-preview-table{ width:100%; margin-top:14px; }
.paste-preview-table input{ font-size:12.5px; padding:5px 8px; }
.paste-preview-table th{ font-size:10.5px; }

/* ---------- POS / Vanzare noua ---------- */
.pos-layout{ display:grid; grid-template-columns: 1fr 320px; gap:20px; align-items:start; }
.pos-sidebar{ position:sticky; top:20px; }
.pos-summary-card{ padding:20px; }
.pos-total-label{ font-size:11px; text-transform:uppercase; letter-spacing:.06em; color:var(--text-dim); }
.pos-total-value{ font-size:34px; font-weight:800; color:var(--accent); margin-top:4px; line-height:1.1; }
.pos-checkout-btn{
  width:100%; margin-top:18px; padding:16px; font-size:17px; font-weight:800;
  background: var(--green); color:#fff; border-radius: var(--radius);
}
.pos-checkout-btn:hover{ background:#359360; }
.pos-search-results{
  position:absolute; top:100%; left:0; right:0; z-index:20; margin-top:4px;
  background: var(--bg-panel); border:1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.35); max-height:340px; overflow-y:auto;
}
.pos-search-item{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:10px 14px; border-bottom:1px solid var(--border); cursor:pointer;
}
.pos-search-item:last-child{ border-bottom:none; }
.pos-search-item:hover{ background: var(--bg-panel-2); }
.pos-search-item-side{ display:flex; align-items:center; gap:8px; flex-shrink:0; }
.pos-search-price{ font-weight:700; color:var(--accent); white-space:nowrap; }
.pos-search-stock{ font-size:11px; color:var(--green); white-space:nowrap; }
.pos-search-stock.low{ color:var(--red); }
.pos-search-empty{ padding:14px; color:var(--text-dim); font-size:13px; }

/* ---------- rezultate cautare client / service centru la Cec — layout pe verticala, fara scroll orizontal ---------- */
#posClientResults{ min-width:360px; max-width:480px; }
.pos-client-item{ display:block !important; white-space:normal; }
.pos-client-item .pos-search-item-main{ font-size:14px; }
.pos-client-item .pos-search-item-side{
  display:flex !important; flex-wrap:wrap; gap:4px 10px; margin-top:4px;
  font-size:12px; line-height:1.5; white-space:normal;
}
.pos-client-item .pos-search-item-side > span:not(:last-child)::after{ content:"·"; margin-left:10px; color:var(--text-dim); }
#posCartTable input{ padding:5px 8px; font-size:13px; }
@media (max-width: 900px){
  .pos-layout{ grid-template-columns: 1fr; }
  .pos-sidebar{ position:static; }
}

/* --- Badge verde pentru pretul de achizitie in cosul POS --- */
.badge-pret-achiz{
  display:inline-block; padding:3px 9px; border-radius:6px;
  background: rgba(63,174,106,.14); color: var(--green); font-weight:700; font-size:12px;
  border:1px solid rgba(63,174,106,.3); white-space:nowrap;
}

/* --- Pastila colorata de stoc in cosul POS --- */
.pos-stock-pill{
  display:inline-block; padding:2px 10px; border-radius:999px;
  font-weight:700; font-size:12px; min-width:28px; text-align:center; white-space:nowrap;
}
.pos-stock-pill.ok{
  background: rgba(63,174,106,.14); color: var(--green); border:1px solid rgba(63,174,106,.3);
}
.pos-stock-pill.low{
  background: rgba(232,178,61,.15); color: var(--amber); border:1px solid rgba(232,178,61,.35);
}
.pos-stock-pill.insufficient{
  background: rgba(216,83,79,.14); color: var(--red); border:1px solid rgba(216,83,79,.3);
}
.pos-stock-pill.zero{
  background: rgba(216,83,79,.18); color: var(--red); border:1px solid rgba(216,83,79,.4); font-weight:800;
}
.pos-stock-pill.unknown{ color: var(--text-dim); }

/* --- Randuri extra sub totalul POS (reducere + rentabilitate) --- */
.pos-extra-line{
  display:flex; align-items:center; justify-content:space-between; gap:8px;
  padding:7px 0; border-top:1px dashed var(--border); margin-top:6px;
}
.pos-extra-label{
  font-size:10.5px; text-transform:uppercase; letter-spacing:.06em; color:var(--text-dim); flex-shrink:0;
}
.pos-extra-val{
  font-weight:800; font-size:15px;
}
.pos-rest-line{
  display:flex; align-items:baseline; flex-wrap:wrap; gap:6px 10px;
  margin-top:8px; padding:8px 10px; border-radius:6px; background: var(--bg-panel-2);
}
.pos-rest-line .pos-extra-label{ text-transform:none; letter-spacing:0; font-size:12px; flex:1 1 auto; min-width:0; }
.pos-rest-line .pos-extra-val{ font-size:15px; white-space:nowrap; margin-left:auto; }
/* Reducere — galben */
.pos-reducere-val{
  color: #c8a800;
}
html[data-theme="light"] .pos-reducere-val{ color: #9b7c00; }
.items-grid .gc.just-pasted{ background: rgba(63,174,106,.18); transition: background 2s ease 3s; }
.items-grid .gc input, .items-grid .gc select{
  width:100%; padding:7px 8px; font-size:12.5px; border-radius:4px; height:34px;
}
.items-grid .gc span.gc-readout{
  display:flex; align-items:center; width:100%; height:34px; padding:0 8px; font-size:12.5px; border-radius:4px;
  background: var(--bg-panel-2); border:1px solid var(--border); color: var(--text);
  box-sizing:border-box; line-height:1.2; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.items-grid .gc-final span.fPretFinal{ color: var(--amber); font-weight:700; }

/* rentabilitate: aceeasi caseta ca restul coloanelor needitabile, doar culoarea textului difera */
.items-grid .gc span.fRentabilitate{ font-weight:800; }
.items-grid span.fRentabilitate.rentab-pos{ color: var(--green) !important; }
.items-grid span.fRentabilitate.rentab-neg{ color: var(--red) !important; }
.items-grid span.fRentabilitate.rentab-zero{ color: var(--text-dim) !important; font-weight:600; }

/* aliniere numerica pe coloanele cu cifre, ca intr-un tabel de calcul */
.items-grid .gc-num input, .items-grid .gc-num select,
.items-grid .gc-num span{ text-align:right; }
.items-grid .gh.gh-num{ text-align:right; }
.items-grid .gc-remove{ justify-content:center; }
.items-grid .gc-remove button{ width:34px; height:34px; padding:0; border-radius:5px; display:flex; align-items:center; justify-content:center; }
.items-grid .gc button.btn-sm{ width:100%; height:34px; white-space:nowrap; padding:0 4px; font-size:11.5px; box-sizing:border-box; overflow:hidden; text-overflow:ellipsis; }
.items-grid-actions{ display:flex; gap:16px; align-items:center; margin-bottom:16px; flex-wrap:wrap; }

.pagination{ display:flex; gap:6px; margin-top:16px; flex-wrap:wrap; align-items:center; }
.pagination a{ padding:6px 12px; border-radius:5px; border:1px solid var(--border); color:var(--text-dim); font-size:13px; text-decoration:none; }
.pagination a.active{ background: var(--accent); border-color: var(--accent); color:#1a1408; font-weight:700; }
.pagination a:hover{ border-color: var(--accent); }
.pagination .pg-ellipsis{ padding:6px 4px; color:var(--text-dim); font-size:13px; }
.pg-jump{ display:flex; gap:4px; align-items:center; margin-left:4px; }
.pg-jump input{ width:56px; padding:6px 8px; font-size:13px; text-align:center; }
.pg-jump button{ padding:6px 10px; font-size:13px; border-radius:5px; border:1px solid var(--border); background:var(--bg-panel-2); color:var(--text); cursor:pointer; }
.pg-jump button:hover{ border-color: var(--accent); color: var(--accent); }

.checkbox-pills{ display:flex; flex-wrap:wrap; gap:8px; }
.checkbox-pill{ display:inline-flex; align-items:center; gap:6px; cursor:pointer; }
.checkbox-pill input{ width:15px; height:15px; accent-color: var(--accent); cursor:pointer; }

/* bara de filtre orizontala (cautare + selectori + butoane), aliniata pe un singur rand cand incape */
.inline-filter-bar{ display:flex; gap:10px; flex-wrap:wrap; align-items:flex-end; }
.inline-filter-bar .field{ margin-bottom:0; }
.inline-filter-actions{ display:flex; gap:10px; flex-shrink:0; align-items:center; height:38px; }

/* ---------- selector de data propriu (calendar) ---------- */
.js-date-display{ cursor:pointer; background-image: none; }
.dp-panel{
  position:fixed; z-index:9999; width:260px; background: var(--bg-panel); border:1px solid var(--border);
  border-radius: 8px; box-shadow: 0 14px 34px rgba(0,0,0,.4); padding:12px; font-size:13px;
}
.dp-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.dp-label{ font-weight:700; font-size:13px; color:var(--text); text-transform:capitalize; }
.dp-nav{ width:26px; height:26px; border-radius:5px; border:1px solid var(--border); background:var(--bg-panel-2); color:var(--text); cursor:pointer; font-size:15px; line-height:1; }
.dp-nav:hover{ border-color: var(--accent); color: var(--accent); }
.dp-grid{ display:grid; grid-template-columns: repeat(7, 1fr); gap:3px; }
.dp-dow{ text-align:center; font-size:10.5px; color:var(--text-dim); text-transform:uppercase; padding-bottom:4px; }
.dp-day{ aspect-ratio:1; border:none; background:transparent; color:var(--text); border-radius:5px; cursor:pointer; font-size:12.5px; }
.dp-day:hover{ background: var(--bg-panel-2); }
.dp-day.is-today{ border:1px solid var(--accent); }
.dp-day.is-selected{ background: var(--accent); color:#1a1408; font-weight:700; }
.dp-foot{ display:flex; justify-content:space-between; margin-top:10px; padding-top:8px; border-top:1px solid var(--border); }
.dp-link{ background:none; border:none; color: var(--accent); cursor:pointer; font-size:12px; padding:2px 4px; }
.dp-link:hover{ text-decoration:underline; }

/* ===========================================================
   Responsive — mobil si tablete
   =========================================================== */
@media (max-width: 900px){
  .menu-toggle{ display:inline-flex; align-items:center; justify-content:center; }

  .sidebar{
    position:fixed; top:0; left:0; height:100vh; z-index:300;
    transform: translateX(-100%); transition: transform .2s ease;
    box-shadow: 10px 0 30px rgba(0,0,0,.3);
  }
  .sidebar.open{ transform: translateX(0); }

  .sidebar-overlay.open{
    display:block; position:fixed; inset:0; background: rgba(0,0,0,.45); z-index:250;
  }

  .content{ padding: 16px 14px 40px 14px; }
  .topbar{ padding: 12px 14px; }
  .topbar h1{ font-size:16px; }

  .grid-4, .grid-3{ grid-template-columns: 1fr 1fr; gap:12px; }
  .field-row{ flex-wrap:wrap; }
  .field-row .field{ min-width:100% !important; max-width:none !important; }

  .items-grid.add-mode, .items-grid.edit-mode{ min-width:960px; }

  .panel-title{ flex-wrap:wrap; gap:8px; }
  .search-bar{ flex-wrap:wrap; }
  .search-bar form{ width:100%; }

  table{ font-size:13px; }
  tbody td, thead th{ padding:9px 10px; }
}

@media (max-width: 560px){
  .grid-4, .grid-3{ grid-template-columns: 1fr; }
  .stat-num{ font-size:22px; }
  .card{ padding:14px; }
  .checkbox-pills{ gap:6px; }
  .items-grid-actions{ flex-direction:column; align-items:flex-start; }
  .dp-panel{ width: calc(100vw - 32px); max-width:300px; }
}

/* ---------- modal vizualizare imagine (poza pasaport tehnic etc) ---------- */
.iv-overlay{
  display:none; position:fixed; inset:0; z-index:1000; background: rgba(0,0,0,.88);
}
.iv-overlay.open{ display:flex; flex-direction:column; }
.iv-toolbar{
  display:flex; gap:8px; align-items:center; justify-content:center;
  padding:12px; background: rgba(20,23,28,.9); border-bottom:1px solid rgba(255,255,255,.08);
}
.iv-toolbar button, .iv-toolbar a{
  width:36px; height:36px; display:flex; align-items:center; justify-content:center;
  border-radius:6px; border:1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.06);
  color:#fff; cursor:pointer; font-size:16px; text-decoration:none;
}
.iv-toolbar button:hover, .iv-toolbar a:hover{ background: rgba(255,255,255,.15); border-color: var(--accent); }
.iv-toolbar button[data-act="reset"]{ width:auto; padding:0 14px; font-size:13px; }
.iv-canvas{
  flex:1; display:flex; align-items:center; justify-content:center; overflow:hidden; position:relative;
}
.iv-img{
  max-width:90vw; max-height:80vh; transition: transform .05s linear; cursor:grab; user-select:none;
  box-shadow: 0 10px 40px rgba(0,0,0,.5); background:#fff; border-radius:4px;
}
.iv-hint{ text-align:center; color: rgba(255,255,255,.5); font-size:12px; padding:10px; }
@media (max-width:600px){
  .iv-toolbar{ flex-wrap:wrap; }
  .iv-toolbar button[data-act="reset"]{ order:10; }
}

/* ---------- subtitlu de pagina cu cifre evidentiate (Clienti, Comenzi, Retururi) ---------- */
.stat-pill{
  display:inline-flex; align-items:center; gap:5px; padding:3px 10px 3px 8px; border-radius:20px;
  background: rgba(232,134,44,.14); border:1px solid rgba(232,134,44,.35); color: var(--accent);
  font-weight:700; font-size:12.5px; margin-right:6px;
}
.stat-pill .stat-pill-num{ font-family: var(--mono); font-size:13px; }
.stat-pill.green{ background: rgba(63,174,106,.14); border-color: rgba(63,174,106,.35); color: var(--green); }
.stat-pill.red{ background: rgba(216,83,79,.14); border-color: rgba(216,83,79,.35); color: var(--red); }
.stat-pill.blue{ background: rgba(74,144,194,.14); border-color: rgba(74,144,194,.35); color: var(--blue); }

/* ---------- schimbare rapida de status direct din tabel (arata ca un badge, dar e select functional) ---------- */
.quick-status-form{ display:inline-block; margin:0; }
select.status-select{
  appearance:none; -webkit-appearance:none; border:1px solid transparent; border-radius:20px;
  padding:5px 26px 5px 11px; font-size:12px; font-weight:600; letter-spacing:.02em; cursor:pointer;
  min-width:0; width:auto; max-width:180px;
  text-align:center; text-align-last:center;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M0 0l5 6 5-6z' fill='%239aa3b2'/></svg>");
  background-repeat:no-repeat; background-position: right 9px center;
}
select.status-select.badge-gray{ background-color: rgba(154,163,178,.15); color: var(--text-dim); }
select.status-select.badge-yellow{ background-color: rgba(250,200,30,.18); color: #c8a800; }
select.status-select.badge-teal{ background-color: rgba(32,178,170,.15); color: #20b2aa; }
select.status-select.badge-amber{ background-color: rgba(232,178,61,.15); color: var(--amber); }
select.status-select.badge-blue{ background-color: rgba(74,144,194,.15); color: var(--blue); }
select.status-select.badge-purple{ background-color: rgba(155,110,220,.18); color: #9b6edc; }
select.status-select.badge-green{ background-color: rgba(63,174,106,.15); color: var(--green); }
select.status-select.badge-red{ background-color: rgba(216,83,79,.15); color: var(--red); }
select.status-select:hover{ border-color: currentColor; }
select.status-select:focus{ outline:none; border-color: currentColor; }

/* ---------- comutator limba (RO / RU) ---------- */
.lang-switch{ display:flex; align-items:center; gap:6px; margin-top:10px; }
.lang-opt{
  padding:3px 9px; border-radius:5px; border:1px solid var(--border); font-size:11px; font-weight:700;
  color: var(--text-dim); text-decoration:none;
}
.lang-opt.active{ background: var(--accent); border-color: var(--accent); color:#1a1408; }
.lang-opt:hover{ border-color: var(--accent); }

/* ---------- istoric status comanda (timeline) ---------- */
.status-timeline{ display:flex; flex-direction:column; gap:16px; }
.status-timeline-item{ display:flex; gap:12px; align-items:flex-start; }
.status-timeline-dot{ width:10px; height:10px; border-radius:50%; margin-top:6px; flex-shrink:0; background:var(--text-dim); }
.status-timeline-dot.badge-gray{ background: var(--text-dim); }
.status-timeline-dot.badge-yellow{ background: #c8a800; }
.status-timeline-dot.badge-teal{ background: #20b2aa; }
.status-timeline-dot.badge-amber{ background: var(--amber); }
.status-timeline-dot.badge-blue{ background: var(--blue); }
.status-timeline-dot.badge-purple{ background: #9b6edc; }
.status-timeline-dot.badge-green{ background: var(--green); }
.status-timeline-dot.badge-red{ background: var(--red); }
.status-timeline-body{ flex:1; }

/* ---------- caseta mare de cautare universala (dashboard + pagina de cautare) ---------- */
.big-search-form{ display:flex; gap:10px; }
.big-search-input{
  flex:1; padding:16px 18px; font-size:16px; border-radius:10px; border:1px solid var(--border);
  background: var(--bg-panel-2); color: var(--text);
}
.big-search-input:focus{ outline:none; border-color: var(--accent); }
/* ---- Buton cautare mare (pagina cautare / dashboard) ---- */
.big-search-btn{
  padding:0 32px; height:54px; font-size:15px; font-weight:700;
  border-radius:27px; border:none; cursor:pointer;
  display:inline-flex; align-items:center; gap:9px; flex-shrink:0;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color:#fff;
  box-shadow: 0 4px 16px rgba(59,130,246,.45);
  transition: transform .13s, box-shadow .13s, background .13s;
  text-decoration:none;
}
.big-search-btn::before{
  content:'';
  display:inline-block;
  width:18px; height:18px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><path d='m21 21-4.35-4.35'/></svg>");
  background-size: 18px 18px;
  background-repeat:no-repeat;
  flex-shrink:0;
}
.big-search-btn:hover{
  background: linear-gradient(135deg, #2563eb, #1e40af);
  transform: translateY(-2px);
  box-shadow: 0 7px 22px rgba(59,130,246,.55);
  text-decoration:none; color:#fff;
}
.big-search-btn:active{ transform: translateY(0); box-shadow: 0 3px 8px rgba(59,130,246,.35); }
@media (max-width:600px){
  .big-search-form{ flex-direction:column; }
}

/* ---------- evidentiere termen cautat (pastila verde) ---------- */
.search-hit{
  background: rgba(63,174,106,.22); color: var(--green); font-weight:700;
  padding:1px 5px; border-radius:4px; border:1px solid rgba(63,174,106,.4);
}

/* ---------- stare de plata (achitat / neachitat / avans) — pastile vechi (pastrate pentru compatibilitate) ---------- */
.payment-pills{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.payment-pill{
  display:flex; align-items:center; gap:6px; padding:8px 16px; border-radius:8px;
  border:2px solid var(--border); cursor:pointer; font-weight:700; font-size:13.5px;
  background: var(--bg-panel); color: var(--text-dim); transition: all .12s;
}
.payment-pill input{ display:none; }
.payment-pill:hover{ border-color: currentColor; }
.payment-pill-unpaid:has(input:checked), .payment-pill-unpaid.is-checked{ background: rgba(216,83,79,.18); border-color: var(--red); color: var(--red); }
.payment-pill-advance:has(input:checked), .payment-pill-advance.is-checked{ background: rgba(232,178,61,.18); border-color: var(--amber); color: var(--amber); }
.payment-pill-paid:has(input:checked), .payment-pill-paid.is-checked{ background: rgba(63,174,106,.18); border-color: var(--green); color: var(--green); }
.payment-save-btn{ padding:8px 20px; font-size:13.5px; border-radius:8px; }

/* ---------- HERO suma spre plata (noul bloc de totaluri) ---------- */
.order-totals-hero-card{ margin-bottom:12px; overflow:hidden; }
.order-totals-split{
  display:flex;
  align-items:stretch;
  gap:0;
}
.order-totals-hero{
  text-align:center;
  padding: 10px 0 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.order-totals-hero-half{
  flex: 1 1 0;
  min-width: 0;
  border-bottom: none;
  margin-bottom: 0;
  display:flex; flex-direction:column; justify-content:center;
  padding-right: 20px;
}
.order-totals-buttons-half{
  flex: 1 1 0;
  min-width: 0;
  display:flex; align-items:center;
  border-left: 1px solid var(--border);
  padding: 0 20px;
}
.order-totals-buttons-half .pay4-form{ width:100%; }
.order-totals-client-half{
  flex: 1 1 0;
  min-width: 0;
  display:flex; flex-direction:column; gap:8px;
  border-left: 1px solid var(--border);
  padding-left: 20px;
}
.order-totals-split > div + div{
  /* separare gestionata individual pe fiecare coloana de mai sus */
}
.order-totals-client-info{ padding-bottom:8px; border-bottom:1px solid var(--border); }
.order-totals-client-info strong{ font-size:14px; }
.order-totals-client-2col{ display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-bottom:2px; }
.order-totals-client-2col > .field{ min-width:0; }
.order-totals-client-2col select,
.order-totals-client-2col input{ width:100%; min-width:0; max-width:100%; box-sizing:border-box; }
.order-totals-client-form .field label{ font-size:11px; margin-bottom:3px; }
.order-totals-client-form input,
.order-totals-client-form select,
.order-totals-client-form textarea{ padding:6px 8px; font-size:12.5px; }
.order-totals-client-history{ padding-top:6px; border-top:1px solid var(--border); }
/* Rândul de sus — 4 butoane egale */
.pay4-top-row{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap:8px;
}
/* Linie separator */
.pay4-separator{
  border:none;
  border-top:1px solid var(--border);
  margin:10px 0;
}
/* Rândul de jos — Achitat + Neachitat, mai înalte */
.pay4-bottom-row{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:8px;
}
.pay4-big{
  padding-top:14px;
  padding-bottom:14px;
  font-size:14px;
}
/* pastrate pentru compatibilitate */
.pay4-payment-btns-2x2{ display:grid; grid-template-columns: repeat(2, 1fr); gap:8px; }
.pay4-action-btns-row{ display:flex; gap:8px; margin-top:8px; padding-top:8px; border-top:1px solid var(--border); }
.pay4-action-btns-row .pay4-btn{ flex:1; }
@media (max-width:1100px){
  .order-totals-split{ flex-direction:column; }
  .order-totals-hero-half,
  .order-totals-buttons-half,
  .order-totals-client-half{
    flex:1 1 auto; width:100%; padding-right:0;
  }
  .order-totals-buttons-half{
    border-left:none; border-top:1px solid var(--border);
    padding:16px 0 0 0; margin-top:8px;
  }
  .order-totals-client-half{
    border-left:none; border-top:1px solid var(--border);
    padding-left:0; padding-top:16px; margin-top:8px;
  }
  .pay4-payment-btns-2x2{ grid-template-columns: repeat(2, 1fr); }
  .pay4-action-btns-row{ flex-wrap:wrap; }
  .pay4-top-row{ grid-template-columns: repeat(2, 1fr); }
  .pay4-bottom-row{ grid-template-columns: 1fr 1fr; }
}
.order-totals-hero-label{
  font-size:10px; font-weight:700; text-transform:uppercase;
  letter-spacing:.1em; color:var(--text-dim); margin-bottom:4px;
}
.order-totals-hero-label-achitat{
  display:inline-block;
  font-size:12px; font-weight:800; text-transform:uppercase;
  letter-spacing:.08em; color:#fff;
  background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
  padding: 4px 16px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(39,174,96,.3);
  margin-bottom: 6px;
}
.order-totals-hero-amount{
  font-size:32px; font-weight:900; line-height:1;
  color:var(--accent); font-family:var(--mono);
}
.order-totals-sub-details{
  display:flex; flex-wrap:wrap; gap:4px 12px;
  justify-content:center; align-items:center;
  margin-top:8px; font-size:12.5px; color:var(--text);
}
.order-totals-sep{ color:var(--border); }
.order-totals-avans-row{
  display:flex; flex-wrap:wrap; gap:4px 16px;
  justify-content:center; align-items:center;
  margin-top:8px; padding-top:8px;
  border-top:1px solid var(--border);
  font-size:13px;
}

/* ---------- 4 butoane mari de plata ---------- */
.pay4-form{ }
.pay4-grid{
  display:flex;
  align-items:stretch;
  gap:10px;
}
.pay4-payment-btns{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap:10px;
  flex:1;
}
.pay4-action-btn{
  text-decoration:none;
  white-space:nowrap;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
}
.pay4-btn{
  padding:9px 10px;
  font-size:13px; font-weight:700;
  border-radius:8px;
  border:2px solid var(--border);
  background: var(--bg-panel);
  color: var(--text-dim);
  cursor:pointer;
  transition: all .15s;
  text-align:center;
  line-height:1.2;
}
.pay4-btn:hover{ opacity:.9; transform:translateY(-1px); }

/* Achitat — border normal + border-bottom verde gros cand activ */
.pay4-achita{
  border-bottom:3px solid var(--border);
}
.pay4-achita:hover,    .pay4-achita.pay4-active    { background:rgba(63,174,106,.18); border-color:var(--green); border-bottom-color:var(--green); border-bottom-width:3px; color:var(--green); }

/* Neachitat — border normal + border-bottom rosu gros cand activ */
.pay4-neachitat{
  border-bottom:3px solid var(--border);
}
.pay4-neachitat:hover, .pay4-neachitat.pay4-active  { background:rgba(216,83,79,.18); border-color:var(--red); border-bottom-color:var(--red); border-bottom-width:3px; color:var(--red); }

.pay4-avans:hover,     .pay4-avans.pay4-active      { background:rgba(232,178,61,.18); border-color:var(--amber);  color:var(--amber);  }
.pay4-datorie:hover, .pay4-datorie.pay4-open, .pay4-datorie.pay4-active { background:rgba(74,144,194,.18); border-color:var(--blue); color:var(--blue); }
.pay4-avans-save-btn{ padding:10px 22px; font-size:14px; background:var(--amber); color:#1a1408; }

/* Vanzare — border normal, verde doar cand e creata (done) */
.pay4-vanzare-btn{
  background: var(--bg-panel);
  border-color: var(--border);
  color: var(--text-dim);
  margin-left:6px;
}
.pay4-vanzare-btn:hover{ background:rgba(63,174,106,.08); border-color:var(--green); color:var(--green); }
.pay4-vanzare-done{
  background:rgba(63,174,106,.08);
  border-color:var(--green);
  border-bottom-width:3px;
  color:var(--green);
  opacity:.85;
  margin-left:6px;
  text-decoration:none;
}
.pay4-vanzare-done:hover{ opacity:1; transform:none; }
.pay4-retur-btn{ background:var(--bg-panel); border-color:var(--border); color:var(--text-dim); }
.pay4-retur-btn:hover{ background:rgba(216,83,79,.08); border-color:var(--border); color:var(--text-dim); }
@media (max-width:700px){
  .pay4-grid{ flex-direction:column; }
  .pay4-payment-btns{ grid-template-columns: repeat(2, 1fr); }
  .pay4-action-btns{ border-left:none; padding-left:0; border-top:2px solid var(--border); padding-top:10px; margin-left:0; }
  .order-totals-hero-amount{ font-size:28px; }
}

/* ---------- formulare datorie/plata side-by-side ---------- */
.order-ledger-forms-row{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-bottom:10px;
}
@media (max-width:700px){
  .order-ledger-forms-row{ grid-template-columns:1fr; }
}

/* ---------- banner "Marchează ca Datorie" ---------- */
.datorie-save-banner{
  margin-bottom:10px;
  padding: 10px 14px;
  background: rgba(74,144,194,.07);
  border-color: rgba(74,144,194,.35);
}
.datorie-save-btn{
  background: rgba(74,144,194,.85);
  color: #fff;
  font-weight: 700;
  padding: 7px 14px;
  font-size:13px;
}
.datorie-save-btn:hover{ background: var(--blue); }

/* buton stergere rand ledger */
.btn-icon-del{
  display:inline-flex; align-items:center; justify-content:center;
  width:26px; height:26px; border-radius:6px;
  border:1px solid rgba(220,53,69,.35);
  background:transparent; color:var(--red);
  font-size:11px; font-weight:700; cursor:pointer;
  transition:background .15s, color .15s;
}
.btn-icon-del:hover{ background:var(--red); color:#fff; border-color:var(--red); }

/* ---------- datorie / avans client (registru) ---------- */
.client-balance-link{ text-decoration:none; display:inline-block; margin-top:6px; }
.client-balance{ font-weight:800; font-size:14px; padding:4px 10px; border-radius:6px; display:inline-block; }
.client-balance-debt{ color:var(--red); background: rgba(216,83,79,.12); }
.client-balance-advance{ color:var(--green); background: rgba(63,174,106,.12); }
.client-balance-clean{ color:var(--text-dim); background: var(--bg-panel-2); }
.client-balance-link:hover .client-balance{ filter:brightness(1.15); }

/* ---------- Totaluri comanda + datorie/plata, intr-un singur rand (60/30/10) ---------- */
.order-summary-row{ display:grid; grid-template-columns: 6fr 3fr 1fr; gap:16px; align-items:stretch; margin-bottom:18px; }
.order-summary-row > .card{ min-width:0; overflow:hidden; }
.order-summary-row .field{ min-width:0; }
.order-ledger-history-pill{
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px;
  text-decoration:none; color:var(--text); text-align:center;
  transition: border-color .15s, transform .1s;
}
.order-ledger-history-pill:hover{ border-color: var(--accent); transform: translateY(-1px); }
@media (max-width:1000px){ .order-summary-row{ grid-template-columns: 1fr; } }

/* ---------- mini-jurnal in pastila "Istoric" (pe pagina comenzii) ---------- */
.ledger-mini-log-line{
  font-size:11px; font-weight:700; line-height:1.4; padding:4px 0; border-bottom:1px dashed var(--border);
}
.ledger-mini-log-line:last-child{ border-bottom:none; }
.order-ledger-history-pill:hover{ border-color: var(--accent); }

/* ---------- Raport zilnic (daily_report.php): separare clara intre cecuri + totaluri lizibile ---------- */
.daily-report-sale-start td{
  border-top: 2px solid var(--accent-dim, var(--border));
}
.daily-report-total-row{
  font-weight:800; background: var(--bg-panel-2); white-space:nowrap;
}
.daily-report-total-row td{
  padding: 12px 18px !important;
  border-top: 2px solid var(--border);
}
.daily-report-total-row td:not(:last-child){
  border-right: 1px solid var(--border);
}

/* ---------- Raport zilnic: cecuri colapsabile (click pe rand pentru a extinde/restrange) ---------- */
.cec-group.collapsed tr.cec-item-row{ display: none; }
.cec-header-row:hover{ background: var(--bg-panel-2); }
.cec-arrow{ display:inline-block; width:12px; color: var(--accent); font-size:10px; }
.cec-badge{
  display:inline-block; margin-left:8px; padding:1px 8px; border-radius:999px;
  background: var(--bg-panel-2); border:1px solid var(--border); color:var(--text-dim);
  font-size:11px; font-weight:700; white-space:nowrap;
}

/* ---------- Print global: ascunde sidebar/topbar la Print/PDF pentru orice pagina (rapoarte etc.) ---------- */
@media print {
  .sidebar, .sidebar-overlay, .topbar, .no-print { display: none !important; }
  .wrap { display: block !important; }
  .main { width: 100% !important; }
  .content { padding: 0 !important; }
  table { font-size: 11px; }
  a[href]::after { content: none !important; }
}

/* ---------- Raport zilnic: cecuri afisate ca si carduri separate, mai usor de citit ---------- */
/* .cec-list-header si .cec-card-header folosesc EXACT aceleasi coloane (grid),
   ca liniile despartitoare sa coincida perfect intre antet si fiecare rand */
.cec-list-header,
.cec-card-header{
  display:grid;
  grid-template-columns: 14px 46px 50px 1fr 130px 110px 100px;
  align-items:center;
  column-gap:16px;
}
.cec-list-header{
  padding:8px 16px; margin-bottom:6px;
  border-bottom:2px solid var(--border);
  font-size:10.5px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--text-dim);
}
.cec-list-header > span{ border-right:1px solid var(--border); }
.cec-list-header > span:last-child{ border-right:none; }
.cec-list{ display:flex; flex-direction:column; gap:10px; margin-bottom:16px; }
.cec-card{
  border:1px solid var(--border); border-radius:10px; background:var(--bg-panel);
  overflow:hidden;
}
.cec-card-header{
  padding:12px 16px;
  background:var(--bg-panel-2);
  cursor:pointer;
  user-select:none;
}
.cec-card-header.no-toggle{ cursor:default; }
.cec-card-header:hover{ filter:brightness(1.03); }
.cec-card-arrow{ color:var(--accent); font-size:11px; }
.cec-card-id{ font-weight:700; }
.cec-card-time{ color:var(--text-dim); font-size:12.5px; }
.cec-card-client{ font-weight:600; font-size:13.5px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cec-card-employee{ color:var(--text-dim); font-size:12.5px; text-align:right; }
.cec-card-count{
  font-size:11px; font-weight:700; color:var(--text-dim);
  background:var(--bg-panel); border:1px solid var(--border);
  padding:3px 10px; border-radius:999px; white-space:nowrap; justify-self:start;
}
.cec-card-total{ font-weight:800; text-align:right; }
.cec-card-body table{ width:100%; border-collapse:collapse; }
.cec-card-body table thead th,
.cec-card-body table tbody td{ border-right:1px solid var(--border) !important; }
.cec-card-body table thead th:last-child,
.cec-card-body table tbody td:last-child{ border-right:none !important; }
.cec-card-body table th{
  font-size:10.5px; text-transform:uppercase; letter-spacing:.04em; color:var(--text-dim);
  padding:8px 16px; border-bottom:1px solid var(--border); text-align:left; background:transparent;
}
.cec-card-body table td{ padding:9px 16px; border-bottom:1px solid var(--border); font-size:13px; }
.cec-card-body table tbody tr:last-child td{ border-bottom:none; }
.cec-card.collapsed .cec-card-body{ display:none; }
.cec-grand-total-bar{
  display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:10px;
  margin-top:6px; padding:14px 20px; border-radius:10px;
  background: var(--bg-panel-2); border:1px solid var(--border); font-weight:800; font-size:15px;
}
@media (max-width: 760px) {
  .cec-card-header{ grid-template-columns: 14px 40px 46px 1fr; row-gap:6px; }
  .cec-card-employee, .cec-card-count, .cec-card-total{ grid-column: span 4; text-align:left; justify-self:start; }
  .cec-list-header{ display:none; }
}

/* ---------- Iconite rapide de contact (Viber/WhatsApp/Telegram) linga numarul de telefon ---------- */
.contact-quick-links{ display:inline-flex; gap:6px; }
.contact-quick-link{
  display:inline-flex; align-items:center; justify-content:center;
  width:24px; height:24px; border-radius:6px; color:#fff;
  transition: transform .12s, box-shadow .12s;
}
.contact-quick-link:hover{ transform: scale(1.08); text-decoration:none; }
.contact-quick-link.wa{ background:#25D366; }
.contact-quick-link.vb{ background:#7360F2; }
.contact-quick-link.tg{ background:#29A9EA; }
