/* ============ Design system (ERP) ============ */
* { box-sizing: border-box; }
:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e6e9ef;
  --line-2: #eef1f5;
  --accent: #2f5bea;
  --accent-2: #2447c7;
  --accent-soft: #eef3ff;
  --ok: #12925b;
  --ok-soft: #e7f7ef;
  --warn: #dc2626;
  --warn-soft: #fef2f2;
  --amber: #b45309;
  --amber-soft: #fff7ed;
  --radius: 10px;
  --radius-sm: 7px;
  --sh-sm: 0 1px 2px rgba(15,23,42,.05);
  --sh: 0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.03);
  --sh-md: 0 6px 20px rgba(15,23,42,.10);
  --sh-lg: 0 16px 48px rgba(15,23,42,.16);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Arial, sans-serif;
}
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 14px; -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
h1,h2,h3 { letter-spacing: -.01em; }

button { cursor: pointer; border: 1px solid var(--line); background: #fff; padding: 7px 13px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; color: var(--ink-2); transition: background .12s, border-color .12s, box-shadow .12s; font-family: var(--font); }
button:hover { background: #f6f8fb; border-color: #d5dae4; }
button:active { transform: translateY(.5px); }
input, select { padding: 8px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 13.5px; background: #fff; color: var(--ink); font-family: var(--font); transition: border-color .12s, box-shadow .12s; }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.err { color: var(--warn); font-size: 13px; min-height: 16px; }
.muted { color: var(--muted); font-size: 13px; }

/* ============ Login ============ */
.login-wrap { display: flex; min-height: 100vh; align-items: center; justify-content: center; background: radial-gradient(1200px 500px at 50% -10%, #eaeefb 0%, var(--bg) 60%); }
.login-box { background: var(--panel); padding: 34px 32px; border-radius: 16px; box-shadow: var(--sh-lg); display: flex; flex-direction: column; gap: 12px; width: 340px; border: 1px solid var(--line); }
.login-box h1 { font-size: 15px; margin: 0 0 10px; color: var(--muted); font-weight: 600; text-align: center; letter-spacing: .02em; }
.login-logo { width: 150px; align-self: center; margin-bottom: 4px; }
.login-box button { background: var(--accent); color: #fff; border: none; padding: 11px; font-weight: 600; font-size: 14px; }
.login-box button:hover { background: var(--accent-2); }

/* ============ Layout ============ */
#app { display: flex; min-height: 100vh; }
.sidebar { width: 236px; flex: none; background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side-logo { padding: 16px 16px 12px; display: flex; align-items: center; }
.side-logo img { height: 18px; opacity: .92; }
.side-nav { flex: 1; overflow-y: auto; padding: 8px 10px; }
.nav-group { margin-bottom: 14px; }
.nav-title { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: #94a0b3; padding: 6px 10px 4px; font-weight: 700; }
.side-nav .tab { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: none; background: transparent; padding: 8px 11px; border-radius: 8px; font-weight: 500; font-size: 13.5px; color: var(--ink-2); margin-top: 1px; position: relative; }
.side-nav .tab:hover { background: #f4f6fa; }
.side-nav .tab.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side-nav .tab.active::before { content: ""; position: absolute; left: -10px; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.badge { background: var(--accent); color: #fff; border-radius: 999px; padding: 1px 7px; font-size: 10.5px; font-weight: 600; margin-left: auto; min-width: 18px; text-align: center; }
.side-nav .tab.active .badge { background: var(--accent); }
.side-foot { border-top: 1px solid var(--line); padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.me { font-size: 12px; color: var(--muted); font-weight: 500; }
.side-foot button { padding: 6px 11px; font-size: 12.5px; }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,.85); backdrop-filter: saturate(180%) blur(8px); border-bottom: 1px solid var(--line); padding: 13px 22px; position: sticky; top: 0; z-index: 5; }
.page-title { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.topbar .right { display: flex; gap: 8px; align-items: center; }
.store-switch { font-weight: 600; color: var(--accent); border-color: #cdd9ff; background: var(--accent-soft); padding: 7px 10px; max-width: 220px; }
.store-pill { font-size: 10px; padding: 1px 7px; border-radius: 999px; background: #f3e8ff; color: #7c3aed; font-weight: 600; vertical-align: middle; }
.toolbar .store-switch { margin-right: 4px; }

main { padding: 22px; max-width: 1220px; width: 100%; margin: 0 auto; }
.view h2 { font-size: 13px; margin: 24px 0 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }

/* ============ Cards / KPI ============ */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 15px; box-shadow: var(--sh-sm); position: relative; overflow: hidden; }
.card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); opacity: .0; }
.card:hover { box-shadow: var(--sh); }
.card .num { font-size: 23px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.card .lbl { color: var(--muted); font-size: 12px; margin-top: 2px; }
.card.warn .num { color: var(--warn); }
.card.ok .num { color: var(--ok); }
.card.warn::before { background: var(--warn); opacity: 1; }
.card.ok::before { background: var(--ok); opacity: 1; }

/* ============ Toolbar ============ */
.toolbar { display: flex; align-items: center; gap: 12px; margin: 18px 0 12px; }
.toolbar #search, .toolbar #lsearch, .toolbar #dsearch { flex: 1; max-width: 440px; }

/* ============ Rows / tables ============ */
.row, .liv-row, .disp-row { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 15px; margin-bottom: 7px; display: grid; gap: 12px; align-items: center; box-shadow: var(--sh-sm); transition: box-shadow .12s, border-color .12s; }
.row { grid-template-columns: 96px 1fr 155px 150px 130px; }
.row:hover, .liv-row:hover, .disp-row:hover { box-shadow: var(--sh); border-color: #dbe0ea; }
.row.head, .liv-row.head { background: transparent; border: none; box-shadow: none; padding: 2px 15px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 0; font-weight: 600; }
.row .nr, .liv-row .nr, .disp-row .nr { font-weight: 700; letter-spacing: -.01em; }
.row .models { font-size: 13.5px; }
.row .models .it { display: block; margin-bottom: 2px; }
.row .models .stofa { color: var(--muted); }
.side { display: inline-block; font-size: 10.5px; padding: 1px 7px; border-radius: 5px; background: var(--accent-soft); color: var(--accent); margin-left: 6px; font-weight: 600; }
.side.dreapta { background: var(--amber-soft); color: var(--amber); }
.scad { font-size: 13px; }
.scad.late { color: var(--warn); font-weight: 600; }
.actions-cell { text-align: right; display: flex; gap: 6px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.actions-cell button { font-size: 12.5px; }

/* Button variants */
.btn-give, #modal-ok, #edit-ok, #liv-ok, .user-form button, .login-box button { background: var(--accent); color: #fff; border: none; }
.btn-give:hover, #modal-ok:hover, #edit-ok:hover, #liv-ok:hover { background: var(--accent-2); }
.btn-fin, .btn-liv { background: var(--ok); color: #fff; border: none; }
.btn-fin:hover, .btn-liv:hover { background: #0e7a4b; }
.btn-edit, .btn-print { padding: 6px 9px; line-height: 1; }
.pill { font-size: 11px; padding: 2px 9px; border-radius: 999px; background: var(--line-2); color: var(--muted); font-weight: 500; }
.empty { text-align: center; color: var(--muted); padding: 48px 20px; background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); }

/* ============ Modal ============ */
.modal { position: fixed; inset: 0; background: rgba(15,23,42,.45); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; z-index: 20; animation: fade .12s ease; }
@keyframes fade { from { opacity: 0; } }
.modal-box { background: #fff; border-radius: 14px; padding: 24px; width: 440px; max-width: calc(100vw - 32px); max-height: calc(100vh - 40px); overflow-y: auto; display: flex; flex-direction: column; gap: 7px; box-shadow: var(--sh-lg); animation: pop .14s ease; }
@keyframes pop { from { transform: translateY(6px) scale(.99); opacity: .6; } }
.modal-box h3 { margin: 0 0 6px; font-size: 17px; }
.modal-box label { font-size: 11.5px; color: var(--muted); margin-top: 8px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.modal-actions .ghost { background: #fff; }

/* ============ Dashboard chart ============ */
.chart { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 8px; box-shadow: var(--sh-sm); }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; }
.bar { width: 66%; max-width: 26px; background: linear-gradient(180deg, #4f74f0, var(--accent)); border-radius: 5px 5px 0 0; transition: height .25s ease; }
.bar.zero { background: var(--line); }
.bar-val { font-size: 11px; color: var(--ink); font-weight: 700; }
.bar-lbl { font-size: 10px; color: var(--muted); white-space: nowrap; transform: rotate(-45deg); transform-origin: center; margin-top: 6px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.top-list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 16px; box-shadow: var(--sh-sm); }
.top-list .ln { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.top-list .ln:last-child { border-bottom: none; }
.top-list .cnt { color: var(--accent); font-weight: 700; }

/* ============ Utilizatori ============ */
.users-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 26px; margin-top: 8px; }
.user-form { display: flex; flex-direction: column; gap: 4px; max-width: 340px; background: var(--panel); border: 1px solid var(--line); padding: 18px; border-radius: var(--radius); box-shadow: var(--sh-sm); }
.user-form label { font-size: 11.5px; color: var(--muted); margin-top: 8px; font-weight: 600; }
.user-form button { margin-top: 14px; padding: 10px; }
.user-row { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 15px; margin-bottom: 8px; box-shadow: var(--sh-sm); }
.user-row .u-name { font-weight: 600; }
.user-row .u-meta { color: var(--muted); font-size: 13px; }
.user-row.inactive { opacity: .5; }
.user-row .spacer { margin-left: auto; }
.role-pill { font-size: 10.5px; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.role-pill.admin { background: var(--amber-soft); color: var(--amber); }

/* ============ Istoric ============ */
.hist { margin-top: 10px; border-top: 1px solid var(--line-2); padding-top: 8px; }
.hist summary { cursor: pointer; font-size: 13px; color: var(--accent); font-weight: 500; }
.hist .h-ln { font-size: 12px; color: var(--muted); padding: 4px 0; border-bottom: 1px solid var(--line-2); }

/* ============ Livrari / Comenzi ============ */
.subtabs { display: inline-flex; gap: 2px; background: var(--line-2); padding: 3px; border-radius: 9px; }
.subtab { background: transparent; color: var(--muted); border: none; padding: 6px 14px; border-radius: 7px; font-weight: 600; font-size: 13px; }
.subtab:hover { background: #fff; }
.subtab.active { background: #fff; color: var(--accent); box-shadow: var(--sh-sm); }
.liv-row { grid-template-columns: 120px 1fr 210px 160px; }
.liv-row .prod { font-size: 13px; color: var(--ink-2); }
.liv-row .sums { font-size: 13px; }
.liv-row .dif { font-weight: 700; color: var(--warn); }
.liv-row .paid-pill { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); font-weight: 600; }
.liv-info { background: var(--accent-soft); border: 1px solid #dbe4ff; border-radius: 9px; padding: 11px 13px; font-size: 13px; margin-bottom: 6px; }
.liv-info .big { font-size: 18px; font-weight: 700; color: var(--warn); }
.cod-tag { font-size: 10.5px; padding: 1px 7px; border-radius: 5px; background: var(--amber-soft); color: var(--amber); font-weight: 600; }
.invoices { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.inv-badge { font-size: 11px; padding: 2px 8px; border-radius: 6px; background: var(--ok-soft); color: var(--ok); border: 1px solid #bce7d3; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 600; }
.inv-badge.final { background: var(--accent-soft); color: var(--accent); border-color: #cdd9ff; }
.btn-inv { font-size: 11px; padding: 3px 9px; border: 1px solid var(--accent); color: var(--accent); background: #fff; border-radius: 6px; font-weight: 600; }
.btn-inv:hover { background: var(--accent-soft); }
.btn-inv:disabled { opacity: .5; cursor: not-allowed; border-color: var(--line); color: var(--muted); }

/* metoda expediere */
.method-pick { display: inline-flex; gap: 4px; margin-right: 6px; align-items: center; }
.btn-m { font-size: 11px; padding: 3px 9px; border-radius: 6px; border: 1px solid var(--line); background: #fff; font-weight: 600; }
.btn-m:hover { background: #f4f6fa; }
.btn-m.own { border-color: #cdd9ff; color: var(--accent); }
.method-badge { font-size: 11px; padding: 3px 9px; border-radius: 6px; margin-right: 6px; cursor: pointer; border: 1px solid; font-weight: 600; }
.method-badge.cur { background: var(--amber-soft); color: var(--amber); border-color: #fed7aa; }
.method-badge.noi { background: var(--accent-soft); color: var(--accent); border-color: #cdd9ff; }
.zone-tag { font-size: 10px; padding: 1px 7px; border-radius: 5px; font-weight: 600; }
.zone-tag.in { background: var(--accent-soft); color: var(--accent); }
.zone-tag.out { background: var(--line-2); color: var(--muted); }
.paid-cont { font-size: 11px; padding: 2px 8px; border-radius: 6px; background: var(--ok-soft); color: var(--ok); cursor: pointer; font-weight: 600; }
.btn-paid { font-size: 11px; padding: 2px 8px; border-radius: 6px; border: 1px dashed var(--line); background: #fff; color: var(--muted); }
.btn-paid:hover { border-color: var(--ok); color: var(--ok); }

/* dispecerat zone */
.zone { margin-bottom: 20px; }
.zone-head { font-size: 13.5px; padding: 9px 14px; background: var(--accent-soft); border: 1px solid #dbe4ff; border-radius: 9px; margin-bottom: 7px; font-weight: 600; }
.zone-head .dif { color: var(--warn); font-weight: 700; }
.disp-row { grid-template-columns: 120px 1fr 130px auto; }

/* ============ Toast ============ */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 20px; border-radius: 10px; z-index: 30; font-size: 13.5px; font-weight: 500; box-shadow: var(--sh-md); }
.toast.err { background: var(--warn); }

/* inventar */
.inv-row { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 15px; margin-bottom: 7px; display: grid; grid-template-columns: 1fr 160px 100px 1fr; gap: 12px; align-items: center; box-shadow: var(--sh-sm); }
.inv-row.head { background: transparent; border: none; box-shadow: none; font-size: 11px; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 2px 15px; }
.ean-inp { width: 100%; font-family: ui-monospace, monospace; }
.colete-inp { width: 70px; text-align: center; font-weight: 700; }
.stoc-loc { font-size: 12px; background: var(--line-2); padding: 3px 8px; border-radius: 6px; margin: 0 4px 4px 0; display: inline-flex; align-items: center; gap: 4px; }
.stoc-inp { width: 54px; padding: 3px 5px; text-align: center; font-weight: 700; }
/* stocul care NU e liber: promis unei comenzi (rezervat) sau blocat in carantina */
.tag-rez { font-size: 10px; font-weight: 700; background: #fef3c7; color: #92400e; padding: 1px 5px; border-radius: 4px; }
.tag-blk { font-size: 10px; font-weight: 700; background: #fee2e2; color: #991b1b; padding: 1px 5px; border-radius: 4px; }
.mod-checks { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.mchk { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.mchk input { width: auto; }

/* go live */
.golive-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; background: var(--panel); border: 1px solid var(--line); border-left: 5px solid var(--muted); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--sh); margin-bottom: 8px; }
.golive-card.live { border-left-color: var(--ok); background: var(--ok-soft); }
.golive-title { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.golive-btn { background: var(--ink); color: #fff; border: none; padding: 14px 24px; border-radius: 10px; font-size: 15px; font-weight: 700; white-space: nowrap; }
.golive-btn.on { background: var(--ok); }
.map-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 10px 14px; margin-bottom: 6px; max-width: 520px; }
.map-row select { min-width: 220px; }

/* transferuri */
.btn-primary { background: var(--accent); color: #fff; border: none; padding: 9px 16px; font-weight: 600; margin-bottom: 12px; }
.tb-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--sh-sm); margin-bottom: 16px; max-width: 640px; }
.tb-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.tb-row label { font-size: 12px; color: var(--muted); font-weight: 600; }
.tb-res { padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; margin-bottom: 4px; cursor: pointer; }
.tb-res:hover { background: var(--accent-soft); }
.tb-line { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.tb-line span { flex: 1; }
.transf-row { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 15px; margin-bottom: 7px; display: grid; grid-template-columns: 150px 1fr 90px auto; gap: 12px; align-items: center; box-shadow: var(--sh-sm); }
.transf-row.transit { border-left: 4px solid var(--amber); }

/* materii prime */
.mat-row { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 15px; margin-bottom: 7px; display: grid; grid-template-columns: 1fr 160px 90px 120px; gap: 12px; align-items: center; box-shadow: var(--sh-sm); }
.mat-row.head { background: transparent; border: none; box-shadow: none; font-size: 11px; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 2px 15px; }
.mat-row.low { border-left: 4px solid var(--warn); }
.mat-row .actions-cell button { font-weight: 700; min-width: 34px; }

/* retetare */
.fp-row { background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 10px 14px; margin-bottom: 6px; cursor: pointer; box-shadow: var(--sh-sm); }
.fp-row:hover { border-color: var(--accent); }
.fp-row.sel { background: var(--accent-soft); border-color: var(--accent); }
.rec-line { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.rec-line span:first-child { flex: 1; }
.rec-add { display: flex; gap: 8px; margin-top: 12px; }
.rec-add select { flex: 1; }

/* showroom vanzare */
.sh-res { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 10px 14px; margin-bottom: 6px; box-shadow: var(--sh-sm); }
.sh-res button { background: var(--accent); color: #fff; border: none; }
.sh-res button:disabled { opacity: .4; }

/* eticheta mediu de test */
.env-ribbon { position: fixed; top: 0; left: 0; right: 0; height: 26px; line-height: 26px; text-align: center; background: repeating-linear-gradient(45deg, #b45309, #b45309 12px, #92400e 12px, #92400e 24px); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .05em; z-index: 100; }
body.has-ribbon .sidebar, body.has-ribbon .topbar { top: 26px; }
body.has-ribbon .sidebar { height: calc(100vh - 26px); }
body.has-ribbon #app { padding-top: 26px; }

/* ============ Responsive ============ */
@media (max-width: 860px) {
  .two-col, .users-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  #app { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .side-nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .nav-group { margin: 0 6px 6px 0; }
  .row, .liv-row, .disp-row { grid-template-columns: 1fr; gap: 6px; }
  .actions-cell { justify-content: flex-start; }
}
.backorder-tag { font-size: 10px; padding: 1px 7px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-weight: 700; }
.loc-checks { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 6px; border-top: 1px dashed var(--line); }
.loc-checks .loc-lbl { font-size: 12px; color: var(--ink-2); font-weight: 600; }
/* ===== Faza 2: Recepție / PO / bin-uri ===== */
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.card-box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--sh-sm); margin-bottom: 12px; }
.card-box h3 { margin: 0 0 4px; font-size: 15px; }
.card-box h4 { margin: 14px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.form-grid { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0; }
.form-grid label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); font-weight: 600; }
.po-row { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 15px; margin-bottom: 7px; display: flex; align-items: center; gap: 12px; box-shadow: var(--sh-sm); cursor: pointer; transition: box-shadow .12s, border-color .12s; }
.po-row:hover { box-shadow: var(--sh); border-color: #dbe0ea; }
.po-prog { font-weight: 700; font-size: 13px; }
.po-badge { font-size: 10.5px; padding: 1px 8px; border-radius: 999px; font-weight: 700; }
.po-badge.s-open { background: var(--accent-soft); color: var(--accent); }
.po-badge.s-partial { background: var(--amber-soft); color: var(--amber); }
.po-badge.s-received { background: var(--ok-soft); color: var(--ok); }
.po-badge.s-draft { background: #f1f5f9; color: var(--muted); }
.po-badge.s-cancelled { background: var(--warn-soft); color: var(--warn); }
.po-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.po-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); }
.po-table td { padding: 7px 8px; border-bottom: 1px solid var(--line-2); }
.pick-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 6px; box-shadow: var(--sh-sm); }
.pick-row.inactive { opacity: .5; }
.btn-primary { background: var(--accent); color: #fff; border: none; padding: 9px 15px; border-radius: var(--radius-sm); font-weight: 600; }
.btn-primary:hover { background: var(--accent-2); }
button.danger { color: var(--warn); border-color: #f3c9c9; }
.warn-text { color: var(--warn); font-weight: 600; }
.ok-text { color: var(--ok); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 600; }
.chip a { cursor: pointer; margin-left: 4px; opacity: .7; }
.chip a:hover { opacity: 1; }
.unmapped-tag { font-size: 10px; padding: 1px 7px; border-radius: 999px; background: #fef2f2; color: #b91c1c; font-weight: 700; border: 1px solid #fecaca; }

/* ecranul de bin-uri: codul + CE E IN EL (intrebarea de zi cu zi din depozit) */
.bin-card { border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 8px; margin-bottom: 6px; }
.bin-card.inactive { opacity: .55; }
.bin-cont { display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 4px 2px 2px; }
.bin-item { font-size: 12px; background: var(--line-2); padding: 2px 7px; border-radius: 5px; }
.tag-bin { font-size: 11px; font-weight: 700; background: #dbeafe; color: #1e40af; padding: 1px 6px; border-radius: 4px; margin-left: 6px; }

/* produs care nu poate fi scanat la impachetare: fara cod de bare sau cu text de SKU in camp */
.ean-bad { border: 2px solid #f59e0b !important; background: #fffbeb; }
.warn-pill { margin-left: 8px; font-size: 12px; font-weight: 700; background: #fef3c7; color: #92400e;
  border: 1px solid #fbbf24; padding: 3px 9px; border-radius: 999px; cursor: pointer; }

/* metoda de expediere, in ecranul de trimitere la pick */
.m-pill { font-size: 10px; font-weight: 700; background: var(--line-2); color: #475569; padding: 1px 6px; border-radius: 4px; }
.m-pill.curier { background: #dbeafe; color: #1e40af; }
.m-pill.noi { background: #dcfce7; color: #166534; }

/* registrul de miscari: fiecare bucata care intra sau iese */
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th { text-align: left; background: var(--line-2); padding: 7px 8px; font-weight: 700; position: sticky; top: 0; }
.tbl td { padding: 6px 8px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.tbl tr:hover td { background: var(--line-2); }
.tbl .neg { color: #b91c1c; }   /* a iesit din gestiune */
.tbl .poz { color: #15803d; }   /* a intrat */
.tag-ok { font-size: 10px; font-weight: 700; background: #dcfce7; color: #166534; padding: 1px 6px; border-radius: 4px; }

/* avertisment operational: ceva ce trebuie reparat in date, nu in aplicatie */
.warn-box { background: #fffbeb; border-left: 4px solid #f59e0b; padding: 10px 14px; border-radius: 6px; font-size: 13px; }

/* comanda data unui picker anume (fara asta e libera pentru oricine) */
.tag-asg { font-size: 10px; font-weight: 700; background: #ede9fe; color: #5b21b6; padding: 1px 6px; border-radius: 4px; }

/* Istoric produs: viata lui in depozit, dintr-un click din lista de produse */
.modal-wide { max-width: 980px; width: 94vw; }
.ist-btn { font-size: 11px; padding: 2px 8px; margin-left: 8px; border-radius: 5px; cursor: pointer;
  background: #eef2ff; color: #4338ca; border: 1px solid #c7d2fe; font-weight: 600; }
.ist-btn:hover { background: #e0e7ff; }
.ist-cap { font-size: 12.5px; color: #475569; background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 7px; padding: 9px 11px; margin-bottom: 11px; line-height: 1.65; }
#ist-body { max-height: 62vh; overflow-y: auto; }
#ist-body .tbl td { vertical-align: top; font-size: 12.5px; }

/* PLANUL DEPOZITULUI — harta la scara: rafturile se trag cu mouse-ul, codurile se genereaza singure */
#plan-wrap { overflow: auto; background: #fbfcfe; border: 1px solid #e2e8f0; border-radius: 10px; padding: 4px; }
#plan-svg { display: block; }
#plan-svg .hall { fill: #fff; stroke: #94a3b8; stroke-width: 2; stroke-dasharray: 5 3; }
#plan-svg .rl { stroke: #cbd5e1; stroke-width: 1; }
#plan-svg .dim { fill: #64748b; font-size: 11px; text-anchor: middle; font-weight: 600; }
#plan-svg .rk { cursor: grab; }
#plan-svg .rk.drag { cursor: grabbing; opacity: .85; }
#plan-svg .rk-box { fill: #dbeafe; stroke: #2563eb; stroke-width: 1.5; }
#plan-svg .rk-box.plin { fill: #bbf7d0; stroke: #16a34a; }
#plan-svg .rk:hover .rk-box { fill: #bfdbfe; }
#plan-svg .rk-lbl { fill: #1e3a8a; font-size: 13px; font-weight: 800; text-anchor: middle; pointer-events: none; }
#plan-info { margin-top: 9px; font-size: 12.5px; }
.rk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 6px; }
.rk-grid label { display: flex; flex-direction: column; font-size: 12px; color: #475569; gap: 3px; }
.rk-grid input, .rk-grid select { padding: 6px 8px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 13px; }

/* Detaliul comenzii: ca pagina din Shopify + ce stie doar depozitul */
.nr-link { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.nr-link:hover { color: #2563eb; }
.det-head { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; font-size: 12.5px;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px 12px; margin-bottom: 9px; }
.det-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 9px; }
.tagp { font-size: 11px; font-weight: 600; background: #e0e7ff; color: #3730a3; border-radius: 5px; padding: 2px 8px; }
.det-box { font-size: 12.5px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 9px 11px; margin-bottom: 9px; }
.det-tbl { font-size: 12.5px; } .det-tbl td.r, .det-tbl th.r { text-align: right; }
.det-tbl td.c, .det-tbl th.c { text-align: center; }
.det-tbl tbody tr:last-child td { border-top: 2px solid #94a3b8; font-size: 14px; }

/* Maparea gestiune -> locatie Shopify, per magazin (id-urile de locatie sunt ale magazinului lor) */
.map-grp { border: 1px solid #e2e8f0; border-radius: 8px; padding: 4px 10px; margin-bottom: 9px; background: #fbfcfe; }
.map-grp .map-row + .map-row { border-top: 1px dashed #e2e8f0; }

/* Starea din depozit pe comanda: ce e in cutie si asteapta curierul vs ce n-a inceput nimeni */
.pack-tag { font-size: 11px; font-weight: 700; border-radius: 5px; padding: 2px 7px; white-space: nowrap; }
.pack-tag.gata { background: #dcfce7; color: #15803d; }
.pack-tag.lucru { background: #fef3c7; color: #92400e; }
.pack-tag.trimisa { background: #e0e7ff; color: #3730a3; font-weight: 600; }
