/* AxaFacturare — stil de bază (culorile principale vin din Personalizare) */
:root{ --red:#B3121B; --gold:#D4A017; --ink:#1d1d24; --mut:#6b6f7b; --line:#e8e5de; --bg:#f6f4ef; --ok:#1f8a4c; --okbg:#e5f6ec; --err:#b91c1c; --errbg:#fde2e2; --blue:#2563eb; --side:#1d1d24; }
*{ box-sizing:border-box; }
html,body{ margin:0; }
body{ font-family:"Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; color:var(--ink); background:var(--bg); font-size:15px; line-height:1.45; }
a{ color:var(--blue); text-decoration:none; } a:hover{ text-decoration:underline; }
h1{ font-size:24px; margin:0 0 16px; }
h2{ font-size:18px; margin:0 0 10px; }
small,.mut{ color:var(--mut); }

/* ---------- Layout ---------- */
.app{ display:flex; min-height:100vh; }
.side{ width:230px; background:var(--side); color:#d9d6ce; display:flex; flex-direction:column; position:sticky; top:0; height:100vh; flex-shrink:0; }
.brand{ display:flex; align-items:center; gap:10px; padding:16px; border-bottom:1px solid #33333d; color:#fff; font-size:16px; }
.brand:hover{ text-decoration:none; }
.brand img{ width:38px; height:38px; background:#fff; border-radius:50%; object-fit:contain; }
.side nav{ flex:1; overflow:auto; padding:8px 0; }
.side .it{ display:flex; gap:10px; align-items:center; padding:9px 18px; color:#d9d6ce; border-left:3px solid transparent; }
.side .it:hover{ background:#2a2a33; text-decoration:none; }
.side .it.on{ background:var(--red); color:#fff; border-left-color:var(--gold); }
.side .ic{ width:20px; text-align:center; }
.side .sep{ font-size:11px; text-transform:uppercase; letter-spacing:.6px; color:#8d8a83; padding:14px 18px 4px; }
.who{ border-top:1px solid #33333d; padding:12px 18px; font-size:13px; }
.who small{ color:#9c9890; }
.who-links{ display:flex; justify-content:space-between; align-items:center; margin:6px 0; }
.who a{ color:#d9d6ce; }
.who select{ background:#2a2a33; color:#fff; border:1px solid #444; border-radius:4px; font-size:12px; }
.link{ background:none; border:0; color:#d9d6ce; cursor:pointer; padding:0; font:inherit; }
.inline{ display:inline; }
.main{ flex:1; padding:24px 28px; min-width:0; }
.menu-btn{ display:none; }

/* ---------- Componente ---------- */
.card{ background:#fff; border:1px solid var(--line); border-radius:10px; padding:16px 18px; margin-bottom:16px; }
.grid{ display:grid; gap:12px 16px; }
.g2{ grid-template-columns:1fr 1fr; } .g3{ grid-template-columns:repeat(3,1fr); } .g4{ grid-template-columns:repeat(4,1fr); }
.span2{ grid-column:span 2; }
.kpi .k{ font-size:13px; color:#555; } .kpi .v{ font-size:24px; font-weight:700; color:var(--red); } .kpi .s{ font-size:12px; color:var(--mut); }
.btn{ display:inline-block; padding:8px 18px; border-radius:22px; border:1px solid var(--ink); background:#fff; color:var(--ink); font-weight:600; font-size:14px; cursor:pointer; font-family:inherit; }
.btn:hover{ text-decoration:none; filter:brightness(.96); }
.btn.p{ background:var(--red); border-color:var(--red); color:#fff; }
.btn.g{ background:var(--gold); border-color:var(--gold); color:var(--ink); }
.btn.sm{ padding:4px 12px; font-size:13px; }
.btn.block{ display:block; width:100%; }
.btn[disabled]{ opacity:.5; cursor:not-allowed; }
label{ display:block; font-weight:600; font-size:13px; margin:0 0 4px; }
input[type=text],input[type=email],input[type=password],input[type=number],input[type=date],input[type=color],select,textarea{
  width:100%; padding:8px 10px; border:1px solid #d7d3ca; border-radius:7px; font:inherit; background:#fff; color:var(--ink); }
input:focus,select:focus,textarea:focus{ outline:2px solid var(--gold); border-color:var(--gold); }
input[readonly],input[disabled],select[disabled],textarea[readonly]{ background:#f1efe9; color:#444; }
input[type=color]{ height:40px; padding:3px; }
textarea{ min-height:80px; resize:vertical; }
.field{ margin-bottom:12px; }
.req{ color:var(--red); }
.flash{ padding:10px 14px; border-radius:8px; margin-bottom:14px; font-size:14px; }
.flash.ok{ background:var(--okbg); color:var(--ok); } .flash.err{ background:var(--errbg); color:var(--err); }
.flash.info{ background:#fff6dc; color:#7a5800; }
.note{ background:#fff6dc; border:1px solid #f2dfa6; border-radius:8px; padding:10px 12px; font-size:14px; }
.lock{ background:#f1efe9; border-radius:8px; padding:8px 12px; font-size:14px; color:#555; margin-bottom:14px; }
table.t{ width:100%; border-collapse:collapse; font-size:14px; }
table.t th{ text-align:left; color:#666; font-weight:600; padding:8px; border-bottom:1px solid var(--line); }
table.t td{ padding:8px; border-bottom:1px solid #f0eee8; vertical-align:middle; }
.pill{ display:inline-block; padding:1px 10px; border-radius:12px; font-size:12px; font-weight:600; }
.pl-ok{ background:var(--okbg); color:var(--ok); } .pl-off{ background:#ececec; color:#555; }
.pl-sa{ background:#fde8e9; color:var(--red); } .pl-mg{ background:#fff6dc; color:#8a6400; } .pl-op{ background:#e7efff; color:var(--blue); }
.tabs{ display:flex; gap:6px; margin-bottom:14px; flex-wrap:wrap; }
.tabs a{ padding:6px 14px; border-radius:7px; color:#555; }
.tabs a.on{ background:#fff; color:var(--ink); font-weight:600; border:1px solid var(--line); }
.top{ display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:16px; flex-wrap:wrap; }
.top h1{ margin:0; }
.actions{ display:flex; gap:6px; flex-wrap:wrap; }
.copybox{ display:flex; gap:6px; } .copybox input{ flex:1; }
dialog{ border:0; border-radius:12px; padding:20px; width:min(520px,92vw); box-shadow:0 10px 40px rgba(0,0,0,.3); }
dialog::backdrop{ background:rgba(20,20,25,.5); }
.pager{ display:flex; gap:6px; justify-content:flex-end; margin-top:10px; }
.qr{ display:flex; justify-content:center; margin:10px 0; }
.mono{ font-family:Consolas, monospace; letter-spacing:1px; word-break:break-all; }

/* ---------- Conectare ---------- */
body.auth{ min-height:100vh; display:flex; align-items:center; justify-content:center; padding:20px;
  background:linear-gradient(135deg,#1d1d24,#3a0d10); }
body.auth-dark{ background:#1d1d24; }
.auth-card{ background:#fff; border-radius:14px; padding:28px 30px; width:min(400px,100%); text-align:center; box-shadow:0 10px 40px rgba(0,0,0,.35); }
.auth-card.gold-top{ border-top:5px solid var(--gold); }
.auth-card form{ text-align:left; }
.auth-logo{ width:84px; height:84px; object-fit:contain; }
.auth-title{ font-size:22px; font-weight:800; color:var(--red); margin:6px 0 2px; }
.auth-sub{ color:var(--mut); margin-bottom:16px; }
.auth-row{ display:flex; justify-content:space-between; align-items:center; font-size:13px; margin:4px 0 14px; }
.auth-row label{ font-weight:400; margin:0; display:flex; gap:5px; align-items:center; }
.auth-lang{ margin-top:16px; font-size:12px; color:var(--mut); }
.code-in{ text-align:center; font-size:22px; letter-spacing:8px; }

/* ---------- Telefon ---------- */
@media (max-width: 860px){
  .side{ position:fixed; left:-240px; z-index:20; transition:left .2s; }
  .side.open{ left:0; }
  .menu-btn{ display:inline-block; background:var(--side); color:#fff; border:0; border-radius:6px; padding:6px 10px; font-size:18px; margin-bottom:12px; }
  .main{ padding:16px; }
  .g2,.g3,.g4{ grid-template-columns:1fr; } .span2{ grid-column:auto; }
  table.t{ font-size:13px; }
  .tablewrap{ overflow-x:auto; }
}

/* ---------- Clienți ---------- */
.filters{ display:flex; gap:8px; margin-bottom:12px; flex-wrap:wrap; }
.filters input{ flex:1; min-width:200px; } .filters select{ width:auto; }
.tico{ display:inline-flex; width:32px; height:32px; border-radius:50%; background:#f3f1ec; align-items:center; justify-content:center; }
.kebab{ position:relative; } .kebab summary{ list-style:none; cursor:pointer; padding:2px 10px; font-size:18px; border-radius:6px; }
.kebab summary::-webkit-details-marker{ display:none; } .kebab summary:hover{ background:#f3f1ec; }
.kebab .menu{ position:absolute; right:0; top:100%; z-index:5; background:#fff; border:1px solid var(--line); border-radius:8px; box-shadow:0 6px 20px rgba(0,0,0,.12); min-width:210px; padding:6px 0; }
.kebab .menu a,.kebab .menu .dis,.kebab .menu button{ display:block; width:100%; text-align:left; padding:7px 14px; color:var(--ink); font:inherit; background:none; border:0; cursor:pointer; }
.kebab .menu a:hover,.kebab .menu button:hover{ background:#f6f4ef; text-decoration:none; }
.kebab .menu .dis{ color:#aaa; cursor:default; } .kebab .menu .link-danger{ color:var(--err); }
.opt{ display:flex; gap:12px; align-items:center; border:1px solid var(--line); border-radius:10px; padding:12px 14px; margin-bottom:10px; color:var(--ink); }
.opt:hover{ border-color:var(--gold); background:#fffdf7; text-decoration:none; }
.opt b{ color:var(--red); } .opt-ic{ width:44px; height:44px; border-radius:50%; background:#f3f1ec; display:flex; align-items:center; justify-content:center; font-size:20px; flex-shrink:0; }
.chips{ display:flex; gap:10px; margin-bottom:14px; flex-wrap:wrap; }
.chip{ flex:1; min-width:220px; display:flex; justify-content:space-between; align-items:center; gap:8px; border:1px solid var(--line); border-radius:10px; padding:8px 12px; }
.chip select{ border:0; padding:4px 0; } .chip a{ font-size:13px; color:var(--mut); }
.lookup{ background:#f4f2ed; border-radius:10px; padding:14px; margin-bottom:16px; text-align:center; }
.lookup small{ display:block; color:var(--mut); margin:2px 0 8px; }
.lookup-row{ display:flex; gap:8px; max-width:460px; margin:0 auto; } .lookup-row input{ flex:1; }
.lookup-msg{ margin-top:8px; font-size:14px; min-height:18px; } .lookup-msg.ok{ color:var(--ok); } .lookup-msg.err{ color:var(--err); }
input.filled{ background:#f6fbf7; border-color:#9fd3b2; }
@media (max-width: 860px){ .lookup-row{ flex-direction:column; } }

/* Celula de acțiuni din tabele rămâne celulă de tabel (linia de jos aliniată) */
table.t td.actions{ display:table-cell; white-space:nowrap; text-align:right; }
table.t td.actions > *{ display:inline-block; margin:2px 0 2px 4px; vertical-align:middle; }

/* ---------- Facturi ---------- */
.ac{ position:relative; }
.ac-list{ position:absolute; left:0; right:0; top:100%; z-index:10; background:#fff; border:1px solid var(--line); border-radius:8px; box-shadow:0 6px 20px rgba(0,0,0,.12); max-height:280px; overflow:auto; }
.ac-list:empty{ display:none; }
.ac-item{ padding:8px 12px; cursor:pointer; border-bottom:1px solid #f3f1ec; } .ac-item:hover{ background:#fffbea; }
.ac-item b{ display:block; } .ac-item small{ color:var(--mut); }
.client-box{ font-size:13px; color:#555; margin:6px 0 4px; min-height:18px; }
table.items-t td{ padding:5px 4px; } table.items-t input,table.items-t select{ padding:6px 8px; }
.add-item{ display:block; width:100%; border:1px dashed var(--gold); background:#fffbea; border-radius:8px; padding:8px; margin:10px 0 16px; cursor:pointer; font:inherit; }
.totals{ text-align:right; } .totals .grand{ font-size:26px; font-weight:800; color:var(--red); }
.kv{ display:flex; justify-content:space-between; gap:10px; padding:4px 0; border-bottom:1px solid #f3f1ec; font-size:14px; } .kv span{ color:var(--mut); }
tr.rowlink{ cursor:pointer; } tr.rowlink:hover td{ background:#fffdf7; }
.top h1 .pill{ vertical-align:middle; font-size:13px; }

/* ---------- Încărcări și documente ---------- */
.upgrid{ display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.2fr); gap:18px; }
.upbox .drop{ display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; border:2px dashed #d7d3ca; border-radius:10px;
  padding:26px 12px; text-align:center; color:#555; cursor:pointer; font-weight:400; background:#fcfbf8; }
.upbox .drop:hover{ border-color:var(--gold); background:#fffdf5; }
.upbox .drop-ic{ font-size:28px; } .upbox .drop small{ color:var(--mut); }
.upbox.has-file .drop{ padding:10px; flex-direction:row; } .upbox.has-file .drop-ic,.upbox.has-file .drop small{ display:none; }
.preview{ margin-top:10px; } .preview:empty{ display:none; }
.preview img{ max-width:100%; max-height:520px; display:block; margin:0 auto; border:1px solid var(--line); border-radius:6px; }
.preview iframe{ width:100%; height:520px; border:1px solid var(--line); border-radius:6px; background:#fff; }
.preview.tall iframe{ height:700px; }
.upinfo{ font-size:13px; color:var(--mut); margin-top:6px; text-align:center; }
.doc-card{ padding:14px 18px; }
.doc-head{ display:flex; justify-content:space-between; align-items:center; gap:10px; }
.ok-ic{ color:var(--ok); font-weight:700; }
.doc-help summary{ background:#f4f2ed; border-radius:6px; padding:6px 10px; margin-top:10px; cursor:pointer; color:#555; font-size:14px; }
.doc-help p{ font-size:14px; color:#555; margin:8px 4px; }
.doc-row{ display:flex; justify-content:space-between; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid #f0eee8; flex-wrap:wrap; }
.doc-row:last-child{ border-bottom:0; }
.doc-meta{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
@media (max-width: 860px){ .upgrid{ grid-template-columns:1fr; } .preview iframe{ height:380px; } }

/* ---------- Taxe, rapoarte, statistici ---------- */
.bar{ height:8px; background:#eee; border-radius:4px; overflow:hidden; margin:6px 0 4px; }
.bar i{ display:block; height:100%; background:linear-gradient(90deg,var(--gold),var(--red)); }
.chart{ display:flex; align-items:flex-end; gap:6px; height:170px; border-bottom:1px solid #ddd; padding-top:6px; }
.chart-col{ flex:1; display:flex; gap:2px; align-items:flex-end; height:100%; }
.chart-col span{ flex:1; border-radius:3px 3px 0 0; min-height:1px; }
.bar-a{ background:var(--red); } .bar-b{ background:var(--gold); }
.chart-months{ display:flex; gap:6px; font-size:11px; color:var(--mut); } .chart-months span{ flex:1; text-align:center; }
.stackbar{ display:flex; height:14px; border-radius:7px; overflow:hidden; background:#eee; }
.ob-form{ display:flex; gap:4px; align-items:center; display:inline-flex; }
.ob-form select{ width:auto; padding:4px 6px; } .ob-form input{ width:90px; padding:4px 6px; } .ob-form input[name=notes]{ width:140px; }
@media (max-width: 860px){ .grid[style*="1.3fr"]{ grid-template-columns:1fr !important; } .ob-form{ flex-wrap:wrap; } }
.kv b{ white-space:nowrap; }

/* ---------- Citire automată bonuri ---------- */
.ocr-box{ margin-top:10px; text-align:center; } .ocr-box small{ display:block; margin-top:6px; }
.ocr-msg{ font-size:14px; margin-top:6px; min-height:18px; } .ocr-msg.ok{ color:var(--ok); } .ocr-msg.err{ color:var(--err); }
[hidden]{ display:none !important; }
