
:root { --bg:#0b0f14; --panel:#0f172a; --panel-2:#111827; --bd:#1f2937; --muted:#a3b3c7; --text:#e5e7eb; --ok:#7cf29a; --err:#ff6b6b; --chip:#1f2937; --accent:#5de4c7; --accent-2:#6ea8fe; }
* { box-sizing: border-box; } html, body { height:100%; }
body { margin:0; font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; background:var(--bg); color:var(--text); }
.wrapper { width: 90%; max-width: none; margin: 0 auto; padding: 18px; }
@media (max-width: 1100px){ .wrapper{ width: 96%; } }
@media (max-width: 700px){ .wrapper{ width: 100%; padding: 14px; } }
.card { background:var(--panel); border:1px solid var(--bd); border-radius:16px; padding:18px; box-shadow:0 10px 30px rgba(0,0,0,.35); overflow:hidden; }
.row { display:flex; gap:10px; margin-bottom:14px; flex-wrap:wrap; }
.input { flex:1; } .input input { width:100%; padding:14px 12px; border-radius:12px; border:1px solid #2a3a52; background:#0f172a; color:var(--text); box-shadow:inset 0 0 0 1px rgba(255,255,255,.02); }
.btn { padding:10px 14px; border-radius:12px; border:1px solid #2a3a52; background:#0f172a; color:var(--text); cursor:pointer; text-decoration:none; display:inline-block; transition:transform .05s ease, border-color .2s ease, box-shadow .2s ease; }
.btn:hover{ border-color:#3b4f6d; box-shadow:0 4px 14px rgba(0,0,0,.25); }
.btn:active{ transform:translateY(1px); }
.status { display:flex; gap:12px; align-items:center; min-height:22px; }
.err { color:var(--err); } .ok { color:var(--ok); }
.grid { display:grid; grid-template-columns: 280px 1fr 1fr; gap:14px; } @media (max-width:1100px){ .grid{grid-template-columns:1fr;} }
.panel { background:var(--panel-2); border:1px solid var(--bd); border-radius:14px; padding:14px; box-shadow:none; overflow:hidden; }
.h3 { margin:0 0 8px; font-size:12px; color:var(--muted); text-transform: uppercase; letter-spacing:.08em; }
.kv { display:grid; grid-template-columns: 180px 1fr; gap:8px; } .kv div { padding:2px 0; } .k { color:var(--muted);} .v { color:var(--text); word-break: break-word; }
#p_img { display:none; background:var(--panel-2); border:1px solid var(--bd); border-radius:12px; overflow:hidden; }
#p_img img { display:block; width:100%; height:auto; object-fit:contain; }
.chips { display:flex; flex-wrap:wrap; gap:6px; } .chip { background:var(--chip); border:1px solid var(--bd); color:var(--text); padding:6px 10px; border-radius:999px; font-size:12px; }
.desc { line-height:1.45; white-space:pre-wrap; }
.toggle { display:none; margin-top:8px; font-size:12px; color:#c7d2fe; background:transparent; border:1px solid #334155; padding:6px 10px; border-radius:8px; cursor:pointer; }
.muted { color:var(--muted); } .hr { height:1px; background:var(--bd); border:0; margin:12px 0; } .small { font-size:12px; }
.form-row { display:flex; gap:8px; flex-wrap:wrap; }
.form-row .field { flex:1 1 160px; display:flex; flex-direction:column; gap:6px; }
.field label { font-size:12px; color:var(--muted); }
.field input, .field select { width:100%; padding:10px 12px; border-radius:12px; border:1px solid #2a3a52; background:#0f172a; color:var(--text); }
.actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:8px; }
.actions .btn.secondary { background:#0d1320; }
.sum { font-weight:600; color:var(--accent); }
.scan-modal{position:fixed;inset:0;background:rgba(4,8,14,.8);display:flex;align-items:center;justify-content:center;padding:16px;z-index:50}
.scan-card{width:100%;max-width:520px;background:var(--panel);border:1px solid var(--bd);border-radius:16px;padding:12px}
.scan-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px}
#scanVideo{width:100%;max-height:60vh;border-radius:14px;background:#000;border:1px solid var(--bd)}
.table { width:100%; border-collapse: collapse; }
.table th, .table td { border-bottom:1px solid var(--bd); padding:10px; text-align:left; }
.table th { color:var(--muted); font-weight:600; font-size:12px; text-transform:uppercase; cursor:pointer; }
.table tr:hover { background:#0e1625; }
.table-wrap{width:100%;overflow:auto;border:1px solid var(--bd);border-radius:12px;background:rgba(8,12,20,.55)}
.table-wrap .table{min-width:720px}
.badge { display:inline-block; padding:2px 8px; border-radius:999px; font-size:12px; border:1px solid #334155; }
.badge.ok { color:var(--ok); border-color:#2f855a; } .badge.err { color:var(--err); border-color:#b83232; }
pre.log{background:#0d1320;border:1px solid var(--bd);border-radius:10px;padding:10px;max-height:420px;overflow:auto}
.columns{display:grid;grid-template-columns:1fr 1fr;gap:12px} @media (max-width:900px){ .columns{grid-template-columns:1fr} }
.toolbar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:10px}
.toolbar .grow{flex:1}
.pager{display:flex;gap:8px;align-items:center}
.table a{ color: var(--text); text-decoration: none; border-bottom: 1px dotted #475569; }
.table a:hover{ text-decoration: underline; }
.productlist-thumb{display:block;width:56px;height:56px;object-fit:cover;border-radius:12px;border:1px solid var(--bd);background:#0b1220}
.productlist-name a{display:inline-block;max-width:320px;word-break:break-word}

.inventory-shell{display:flex;flex-direction:column;gap:18px}
.inventory-title{margin:0;font-size:clamp(1.5rem,2.2vw,2.4rem);line-height:1.1}
.inventory-lead{max-width:78ch;margin:8px 0 0}
.inventory-hero{display:flex;flex-direction:column;gap:18px}
.inventory-hero__head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;flex-wrap:wrap}
.inventory-hero__actions{align-items:flex-start}
.inventory-meta-grid{display:grid;grid-template-columns:1.2fr .8fr;gap:14px}
.inventory-meta-card{height:100%}
.inventory-kv{grid-template-columns:170px 1fr}
.inventory-hint{margin:10px 0 0}
.inventory-check{display:flex;align-items:center;gap:10px;margin-bottom:12px;color:var(--text);font-size:.95rem}
.inventory-check input{width:18px;height:18px;accent-color:var(--accent)}
.inventory-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}
.inventory-stat{display:flex;flex-direction:column;gap:8px}
.inventory-stat__value{font-size:clamp(1.4rem,2vw,2rem);font-weight:700;line-height:1;color:var(--accent)}
.inventory-progress{display:flex;flex-direction:column;gap:8px}
.inventory-progress__bar{width:100%;height:14px;border-radius:999px;background:#0b1220;border:1px solid var(--bd);overflow:hidden}
.inventory-progress__bar span{display:block;height:100%;width:0;background:linear-gradient(90deg,var(--accent),var(--accent-2));border-radius:999px;transition:width .2s ease}
.inventory-create__head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:14px;flex-wrap:wrap}
.inventory-create__title{font-size:1.2rem;font-weight:700}
.inventory-year-field{max-width:180px}
.inventory-empty-state{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap}
.inventory-empty-state__title{font-size:1.15rem;font-weight:700;margin-bottom:6px}
.inventory-layout{display:grid;grid-template-columns:minmax(320px,.92fr) minmax(360px,1.08fr);gap:18px;align-items:start}
.inventory-section-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:14px}
.inventory-section-title{font-size:1.2rem;font-weight:700}
.inventory-section-copy{margin-top:6px;max-width:72ch;line-height:1.45}
.inventory-toolbar{display:flex;gap:10px;align-items:flex-end;flex-wrap:wrap;margin-bottom:10px}
.inventory-toolbar__buttons{display:flex;gap:8px;flex-wrap:wrap}
.inventory-filter-field{min-width:180px}
.inventory-check--toolbar{margin:0 6px 2px 0;padding:10px 12px;border:1px solid var(--bd);border-radius:14px;background:rgba(12,18,32,.62)}
.inventory-status-row{margin-bottom:10px}
.inventory-list{display:flex;flex-direction:column;gap:10px;min-height:220px}
.inventory-list-item{width:100%;text-align:left;background:var(--panel-2);border:1px solid var(--bd);border-radius:16px;padding:14px;color:var(--text);cursor:pointer;transition:border-color .2s ease,transform .05s ease,box-shadow .2s ease}
.inventory-list-item:hover{border-color:#3b4f6d;box-shadow:0 6px 18px rgba(0,0,0,.22)}
.inventory-list-item:active{transform:translateY(1px)}
.inventory-list-item.is-active{border-color:var(--accent);box-shadow:0 0 0 1px rgba(93,228,199,.2)}
.inventory-list-item__body{display:grid;grid-template-columns:72px 1fr;gap:14px;align-items:start}
.inventory-list-item__image{width:72px;height:72px;border-radius:14px;border:1px solid var(--bd);overflow:hidden;background:#0b1220;display:flex;align-items:center;justify-content:center;color:var(--muted);font-size:.75rem;text-align:center}
.inventory-list-item__image img{display:block;width:100%;height:100%;object-fit:cover}
.inventory-list-item__content{min-width:0}
.inventory-list-item__top,.inventory-list-item__meta{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap}
.inventory-list-item__title{font-size:1rem;font-weight:700;margin:10px 0 8px;word-break:break-word}
.inventory-list-item__pos{font-size:.86rem;color:var(--muted)}
.inventory-list-item__meta{font-size:.9rem;color:var(--muted)}
.inventory-list-empty{border:1px dashed var(--bd);border-radius:16px;padding:24px;color:var(--muted);text-align:center;background:rgba(12,18,32,.5)}
.inventory-list-footer{display:flex;justify-content:center;margin-top:14px}
.inventory-editor-empty{min-height:320px;display:flex;align-items:center;justify-content:center;border:1px dashed var(--bd);border-radius:16px;padding:28px;text-align:center;color:var(--muted);background:rgba(12,18,32,.5)}
.inventory-product-head{display:grid;grid-template-columns:120px 1fr;gap:14px;align-items:start;margin-bottom:16px}
.inventory-product-head__media{border:1px solid var(--bd);border-radius:16px;background:var(--panel-2);overflow:hidden;min-height:120px;display:flex;align-items:center;justify-content:center}
.inventory-product-head__media img{display:block;width:100%;height:100%;object-fit:contain}
.inventory-product-head__placeholder{padding:12px;color:var(--muted);font-size:.9rem;text-align:center}
.inventory-product-head__title{font-size:1.3rem;font-weight:700;margin-bottom:10px;word-break:break-word}
.inventory-product-head__meta{display:flex;gap:8px;flex-wrap:wrap}
.inventory-editor-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.inventory-inline-info{margin:10px 0 0}
.inventory-editor-actions{margin-top:12px}
.inventory-print-card{display:flex;flex-direction:column;gap:14px}
.badge--open{color:#f8c85b;border-color:#8b6b20;background:rgba(248,200,91,.08)}
.badge--counted,.badge--unchanged{color:var(--ok);border-color:#2f855a;background:rgba(124,242,154,.08)}
.badge--changed{color:#ffd166;border-color:#ad7d12;background:rgba(255,209,102,.08)}
.badge--closed{color:#cbd5e1;border-color:#475569;background:rgba(100,116,139,.12)}
.badge--hidden{color:#f4b8ff;border-color:#8f46a6;background:rgba(192,82,243,.12)}
.badge--neutral{color:#cbd5e1;border-color:#475569;background:rgba(100,116,139,.12)}
.inventory-btn-danger{border-color:#7f1d1d;color:#fecaca;background:#1f1012}
.inventory-btn-danger:hover{border-color:#b91c1c}
textarea{width:100%;padding:10px 12px;border-radius:12px;border:1px solid #2a3a52;background:#0f172a;color:var(--text);resize:vertical;min-height:96px}
button:disabled,input:disabled,select:disabled,textarea:disabled{opacity:.6;cursor:not-allowed}
@media (max-width: 1200px){
  .inventory-layout{grid-template-columns:1fr}
}
@media (max-width: 900px){
  .inventory-meta-grid,.inventory-stats,.inventory-editor-grid{grid-template-columns:1fr}
  .inventory-product-head{grid-template-columns:1fr}
}
@media (max-width: 700px){
  .inventory-shell{gap:14px}
  .inventory-toolbar,.inventory-hero__head,.inventory-empty-state,.inventory-create__head{flex-direction:column;align-items:stretch}
  .inventory-toolbar__buttons,.inventory-hero__actions,.inventory-editor-actions{display:grid;grid-template-columns:1fr;gap:8px;width:100%}
  .inventory-kv{grid-template-columns:1fr}
  .inventory-product-head__media{min-height:180px}
  .inventory-list-item__body{grid-template-columns:60px 1fr;gap:12px}
  .inventory-list-item__image{width:60px;height:60px}
  .inventory-list-item__top,.inventory-list-item__meta{flex-direction:column;align-items:flex-start}
}
