/* ix-shell.css — IX Inventory shared chrome.
   Palette + base styling mirrored from IX Creator for visual consistency.
   Roobert is the brand font but is licence-restricted and placed on the server
   manually; a clean system stack is the fallback so the UI looks right without it. */

:root {
    --purple:#4900C3; --mint:#8DE2A5; --periwinkle:#CFD4FF; --coral:#ff3366;
    --bg-dark:#141429; --bg-card:#1e1e38; --border:#2a2a50; --border-light:#3a3a60;
    --input-bg:#252545; --text:#EEF0FF; --muted:#515177;
    --font: 'Roobert', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
}

* { box-sizing:border-box; margin:0; padding:0; }
html, body { height:100%; }
body { font-family:var(--font); background:var(--bg-dark); color:var(--text); }

/* ---- Wordmark ---- */
.brand, .wordmark { font-weight:800; letter-spacing:-0.02em; }
.brand span, .wordmark span { color:var(--coral); }

/* ============ Auth screens (login / setup) ============ */
.auth-page { min-height:100vh; display:flex; align-items:center; justify-content:center; padding:40px; }
.auth-card { width:100%; max-width:440px; }
.auth-card .brand-logo { height:42px; width:auto; display:block; margin-bottom:22px; }
.auth-card .lead { font-size:15px; color:var(--periwinkle); line-height:1.6; margin-bottom:28px; }

.auth-card form { display:flex; flex-direction:column; }
.auth-card label { font-size:12px; font-weight:700; color:var(--mint); text-transform:uppercase;
    letter-spacing:.06em; margin-bottom:8px; }
.auth-card input[type=password] { width:100%; padding:14px 16px; background:var(--input-bg);
    border:1px solid var(--border-light); color:var(--text); border-radius:12px;
    font-family:inherit; font-size:15px; margin-bottom:18px; transition:border-color .15s; }
.auth-card input[type=password]:focus { border-color:var(--mint); outline:none; }
.auth-card button[type=submit] { align-self:flex-end; padding:13px 26px; background:var(--coral);
    color:#fff; border:none; border-radius:12px; font-family:inherit; font-weight:700;
    font-size:15px; cursor:pointer; transition:background .15s; }
.auth-card button[type=submit]:hover { background:#ff527e; }

.error { background:rgba(255,51,102,.14); border:1px solid rgba(255,51,102,.4); color:#ff7a99;
    padding:11px 14px; border-radius:10px; font-size:14px; margin-bottom:18px; }

/* ============ Topbar ============ */
.topbar { height:57px; display:flex; border-bottom:1px solid var(--border); }
.topbar-left { display:flex; align-items:center; padding:0 22px; background:var(--border); }
.topbar-left .wordmark { font-size:20px; color:#fff; }
.topbar-right { flex:1; display:flex; align-items:center; justify-content:flex-end; gap:18px;
    padding:0 28px; background:#1a1a2e; }
.topbar-right .who { color:var(--muted); font-size:14px; }
.logout-form { margin:0; }
.logout-link { background:none; border:none; cursor:pointer; font-family:inherit;
    color:var(--muted); font-size:14px; transition:color .15s; }
.logout-link:hover { color:var(--coral); }

/* ============ Home ============ */
.home-page { min-height:100vh; }
.logout-corner { position:fixed; top:22px; right:34px; margin:0; z-index:10; }

.home { max-width:1180px; margin:0 auto; padding:92px 32px 48px; }
.home-grid { display:grid; grid-template-columns:420px 460px; column-gap:72px;
    justify-content:center; grid-template-rows:auto auto minmax(0,1fr); align-items:start; }

/* logo: same width as the action cards (col 1), bottom-aligned with the dropdown */
.hg-logo { grid-column:1; grid-row:1; align-self:end; }
.home-logo { width:100%; height:auto; display:block; }

.hg-cathead { grid-column:2; grid-row:1; align-self:end; }
.cat-heading { font-size:21px; font-weight:600; color:var(--mint); margin-bottom:16px; }

.hg-divider { grid-column:1 / -1; grid-row:2; height:2px; background:var(--coral);
    border-radius:2px; margin:24px 0 30px; }

.hg-actions { grid-column:1; grid-row:3; display:flex; flex-direction:column; gap:16px; }
.hg-list { grid-column:2; grid-row:3; min-height:0; }

/* action cards */
.action-card { display:flex; align-items:center; gap:18px; padding:20px 22px; background:var(--bg-card);
    border:1px solid var(--border); border-radius:18px; text-decoration:none;
    transition:border-color .15s, transform .15s; }
.action-card:hover { border-color:var(--mint); transform:translateY(-1px); }
.action-ic { width:56px; height:56px; flex-shrink:0; background:var(--coral); border-radius:14px;
    display:flex; align-items:center; justify-content:center; }
.action-ic .ic-mask { width:28px; height:28px; background:#fff;
    -webkit-mask-repeat:no-repeat; mask-repeat:no-repeat;
    -webkit-mask-position:center; mask-position:center; -webkit-mask-size:contain; mask-size:contain; }
.action-text { display:flex; flex-direction:column; gap:5px; }
.action-title { font-size:24px; font-weight:800; color:#fff; letter-spacing:-0.02em; }
.action-desc { font-size:14px; color:var(--muted); line-height:1.5; max-width:320px; }

/* sort dropdown */
.sort { position:relative; }
.sort-btn { width:100%; display:flex; align-items:center; gap:12px; padding:14px 16px;
    background:var(--bg-card); border:1px solid var(--border); border-radius:12px;
    color:var(--periwinkle); font-family:inherit; font-size:16px; cursor:pointer; transition:border-color .15s; }
.sort-btn:hover { border-color:var(--border-light); }
.sort-ic { width:20px; height:20px; flex-shrink:0; background:var(--muted);
    -webkit-mask:url('../assets/Icon_SortingOrder.svg') center/contain no-repeat;
    mask:url('../assets/Icon_SortingOrder.svg') center/contain no-repeat; }
.sort-label { flex:1; text-align:left; }
.sort-chev { display:flex; color:var(--muted); transition:transform .15s; }
.sort-chev svg { width:18px; height:18px; }
.sort.open .sort-chev { transform:rotate(180deg); }
.sort-menu { position:absolute; top:calc(100% + 6px); left:0; right:0; list-style:none; margin:0; padding:6px;
    background:var(--bg-card); border:1px solid var(--border-light); border-radius:12px; z-index:20; display:none; }
.sort.open .sort-menu { display:block; }
.sort-menu li { padding:10px 12px; border-radius:8px; color:var(--text); font-size:15px; cursor:pointer; }
.sort-menu li:hover { background:var(--input-bg); }
.sort-menu li.active { color:var(--mint); font-weight:700; }

/* category list */
/* The scrollbar sits in a gutter to the RIGHT of the buttons (margin into the
   column gap) so the button right edge lines up with the dropdown + divider. */
.cat-list { list-style:none; margin:0 -16px 0 0; padding:0 16px 0 0; display:flex; flex-direction:column; gap:10px;
    max-height:calc(100vh - 300px); overflow-y:auto;
    scrollbar-width:thin; scrollbar-color:var(--border-light) transparent; }
.cat-list::-webkit-scrollbar { width:8px; }
.cat-list::-webkit-scrollbar-track { background:transparent; }
.cat-list::-webkit-scrollbar-thumb { background:var(--border-light); border-radius:8px; }
.cat-item { display:flex; align-items:center; gap:16px; padding:16px 20px; background:var(--bg-card);
    border:1px solid var(--border); border-radius:14px; text-decoration:none; color:var(--mint);
    transition:background .12s, color .12s, border-color .12s; }
.cat-item .cat-ic { width:26px; height:26px; flex-shrink:0; background-color:var(--mint);
    -webkit-mask-repeat:no-repeat; mask-repeat:no-repeat;
    -webkit-mask-position:center; mask-position:center; -webkit-mask-size:contain; mask-size:contain; }
.cat-item .cat-label { flex:1; font-size:21px; font-weight:600; }
.cat-item .cat-chev { display:flex; opacity:0; color:#0d0d1a; transition:opacity .12s; }
.cat-item .cat-chev svg { width:20px; height:20px; }
.cat-item:hover { background:var(--mint); color:#0d0d1a; border-color:var(--mint); }
.cat-item:hover .cat-ic { background-color:#0d0d1a; }
.cat-item:hover .cat-chev { opacity:1; }

@media (max-width:880px) {
    .home-grid { grid-template-columns:1fr; }
    .hg-logo, .hg-cathead, .hg-divider, .hg-actions, .hg-list { grid-column:1; }
    .hg-cathead { grid-row:auto; } .hg-divider { grid-row:auto; }
    .hg-actions { grid-row:auto; } .hg-list { grid-row:auto; }
    .cat-list { max-height:none; }
}

/* ============ Item List View ============ */
.lv { height:100vh; display:flex; flex-direction:column; overflow:hidden; }
.lv-header { height:57px; flex-shrink:0; display:flex; border-bottom:1px solid var(--border); }
.lv-header-left { width:280px; flex-shrink:0; background:var(--border); display:flex; align-items:center; gap:14px; padding:0 20px; }
.lv-header-left .logo { height:24px; width:auto; }
.lv-header-right { flex:1; background:#1a1a2e; display:flex; align-items:center; justify-content:flex-end; padding:0 28px; }
.lv-body { flex:1; display:flex; min-height:0; }

/* selects (filters + order) */
.lv-select { width:100%; padding:11px 34px 11px 13px; background:var(--bg-card); border:1px solid var(--border-light);
    color:var(--text); border-radius:10px; font-family:inherit; font-size:14px; cursor:pointer; appearance:none; -webkit-appearance:none;
    background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%23515177' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M3 5l4 4 4-4'/></svg>");
    background-repeat:no-repeat; background-position:right 12px center; }
.lv-select:focus { border-color:var(--mint); outline:none; }

/* List Manager */
.lv-manager { width:280px; flex-shrink:0; background:#1a1a2e; border-right:1px solid var(--border);
    padding:22px 20px; display:flex; flex-direction:column; gap:16px; overflow-y:auto; }
.lv-manager .filter label { display:block; font-size:13px; color:var(--muted); margin-bottom:6px; }
.lv-search { width:100%; padding:11px 13px; background:var(--input-bg); border:1px solid var(--border-light);
    color:var(--text); border-radius:10px; font-family:inherit; font-size:14px; }
.lv-search:focus { border-color:var(--mint); outline:none; }
.lv-search::placeholder { color:var(--muted); }
.add-item-btn { margin-top:auto; justify-content:center; text-decoration:none; }
.btn.coral { background:var(--coral); color:#fff; }
.btn.coral:hover { background:#ff527e; }
.add-item-btn .ic-mask { width:18px; height:18px; background:#fff;
    -webkit-mask-repeat:no-repeat; mask-repeat:no-repeat; -webkit-mask-position:center; mask-position:center; -webkit-mask-size:contain; mask-size:contain; }

/* Item List */
.lv-list { width:440px; flex-shrink:0; border-right:1px solid var(--border); display:flex; flex-direction:column; min-height:0; }
.lv-list-head { padding:22px 16px 14px; flex-shrink:0; }
.lv-list-head label { display:block; font-size:13px; color:var(--muted); margin-bottom:6px; }
.item-list { list-style:none; margin:0; padding:0 16px 16px 16px; flex:1; min-height:0; overflow-y:auto;
    display:flex; flex-direction:column; gap:10px; scrollbar-width:thin; scrollbar-color:var(--border-light) transparent; }
.item-list::-webkit-scrollbar { width:8px; }
.item-list::-webkit-scrollbar-thumb { background:var(--border-light); border-radius:8px; }
.list-msg { color:var(--muted); font-size:14px; padding:18px 6px; }

.item-card { width:100%; display:flex; align-items:stretch; gap:0; padding:0; background:var(--bg-card);
    border:1px solid var(--border-light); border-radius:16px; overflow:hidden; cursor:pointer; text-align:left;
    font-family:inherit; min-height:84px; transition:border-color .12s, background .12s; }
.item-card:hover { border-color:var(--periwinkle); }
/* Thumbnail bleeds to the card's left edge, full height; the card's overflow:hidden
   rounds its left corners to match, right edge stays square (as in the SVG clip path). */
.ic-thumb { width:84px; flex-shrink:0; align-self:stretch; background:var(--input-bg);
    display:flex; align-items:center; justify-content:center; overflow:hidden; }
.ic-thumb img { width:100%; height:100%; object-fit:cover; display:block; }
.ic-thumb .thumb-ph { width:100%; height:100%; display:flex; align-items:center; justify-content:center; }
.ic-thumb .thumb-ph .thumb-ic { width:44%; height:44%; background:#fff;
    -webkit-mask-repeat:no-repeat; mask-repeat:no-repeat; -webkit-mask-position:center; mask-position:center; -webkit-mask-size:contain; mask-size:contain; }
.ic-body { flex:1; min-width:0; display:flex; align-items:center; gap:14px; padding:10px 14px; }
.ic-main { flex:1; min-width:0; }
.ic-name { display:block; font-size:18px; font-weight:700; color:#fff; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ic-sub { display:block; font-size:13px; color:var(--muted); margin-top:2px; }
.ic-meta { display:flex; flex-direction:column; align-items:flex-end; gap:8px; flex-shrink:0; }
.ic-status { display:flex; gap:6px; }
.ic-id { font-size:13px; color:var(--muted); }
.st-ic { width:20px; height:20px; display:inline-flex; }
.st-ic.defect { background:var(--coral); -webkit-mask-repeat:no-repeat; mask-repeat:no-repeat; -webkit-mask-position:center; mask-position:center; -webkit-mask-size:contain; mask-size:contain; }
.st-ic.lost { background:#8B5CF6; -webkit-mask-repeat:no-repeat; mask-repeat:no-repeat; -webkit-mask-position:center; mask-position:center; -webkit-mask-size:contain; mask-size:contain; }
.st-ic.impaired { color:#F59E0B; } .st-ic.impaired svg { width:20px; height:20px; }
.st-ic.repaired { color:#10B981; } .st-ic.repaired svg { width:19px; height:19px; }

.item-card.defect .ic-name { color:var(--coral); }
.item-card.selected { background:var(--mint); border-color:var(--mint); }
.item-card.selected .ic-name { color:#0d0d1a; }
.item-card.selected .ic-sub, .item-card.selected .ic-id { color:#2c4d39; }

/* Item View */
.lv-view { flex:1; min-height:0; background:var(--bg-dark); overflow:hidden; }
.lv-view-empty { color:var(--muted); font-size:15px; padding:44px; }
.iv-scroll { height:100%; overflow-y:auto; padding:34px 44px 60px; max-width:780px; }
.iv-titlebar { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; }
.iv-title-main { min-width:0; }
.iv-name { font-size:30px; font-weight:800; color:#fff; letter-spacing:-0.02em; }
.iv-subdate { color:var(--muted); font-size:13px; margin-top:4px; }
.iv-title-status { display:flex; flex-direction:column; align-items:flex-end; gap:10px; flex-shrink:0; }
.iv-badges { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.iv-lost-row { display:flex; align-items:center; gap:8px; }
.iv-lost-label { color:var(--muted); font-size:13px; }
.iv-cat { max-width:280px; }
.iv-addunits { margin-top:12px; }
.badge.cond, .badge.lost { font-size:12px; font-weight:700; padding:5px 12px; border-radius:999px; }
.badge.cond.normal { background:var(--border); color:var(--periwinkle); }
.badge.cond.repaired { background:#10B981; color:#06281c; }
.badge.cond.impaired { background:#F59E0B; color:#241700; }
.badge.cond.defect { background:var(--coral); color:#fff; }
.badge.lost { background:#8B5CF6; color:#fff; }
.iv-section { margin-top:26px; border-top:1px solid var(--border); padding-top:20px; }
.iv-section h3 { font-size:13px; text-transform:uppercase; letter-spacing:.05em; color:var(--mint); margin-bottom:14px; }
.iv-row { display:flex; gap:16px; padding:7px 0; align-items:flex-start; }
.iv-k { width:130px; flex-shrink:0; color:var(--muted); font-size:14px; }
.iv-v { color:var(--text); font-size:14px; }
.iv-tags { display:flex; flex-wrap:wrap; gap:6px; }
.iv-empty { color:var(--muted); font-size:14px; }
.iv-soon p { color:var(--muted); font-size:13px; font-style:italic; }

/* item-view label / QR */
.iv-qr { display:flex; gap:18px; align-items:flex-start; flex-wrap:wrap; }
.iv-qr-img { width:150px; height:150px; flex:none; background:#fff; border-radius:12px;
    padding:8px; border:1px solid var(--border); }
.iv-qr-side { flex:1; min-width:220px; display:flex; flex-direction:column; gap:10px; }
.iv-qr-hint { color:var(--muted); font-size:13px; line-height:1.5; }
.iv-qr-url { font-size:13px; color:var(--periwinkle); word-break:break-all;
    background:var(--input-bg); border:1px solid var(--border-light); border-radius:9px; padding:9px 11px; }
.iv-qr-actions { display:flex; gap:8px; flex-wrap:wrap; }
.iv-qr-print { align-self:flex-start; opacity:.6; cursor:not-allowed; }

/* item-view editing */
.iv-name-wrap { display:flex; align-items:center; gap:10px; min-width:0; }
.iv-name-edit { background:none; border:none; color:var(--muted); cursor:pointer; padding:4px; display:flex; transition:color .12s; }
.iv-name-edit:hover { color:var(--mint); }
.iv-name-edit svg { width:18px; height:18px; }
.iv-name-input { font-size:26px; font-weight:800; color:#fff; background:var(--input-bg);
    border:1px solid var(--border-light); border-radius:10px; padding:6px 12px; font-family:inherit; min-width:0; flex:1; }
.iv-name-input:focus { border-color:var(--mint); outline:none; }
.iv-loc { max-width:280px; }

.switch { position:relative; display:inline-block; width:46px; height:26px; }
.switch input { opacity:0; width:0; height:0; }
.switch .slider { position:absolute; inset:0; background:var(--border-light); border-radius:999px; transition:background .15s; cursor:pointer; }
.switch .slider::before { content:''; position:absolute; width:20px; height:20px; left:3px; top:3px; background:#fff; border-radius:50%; transition:transform .15s; }
.switch input:checked + .slider { background:#8B5CF6; }
.switch input:checked + .slider::before { transform:translateX(20px); }

.iv-danger { border-top-color:rgba(255,51,102,.3); }
.iv-danger h3 { color:var(--coral); }
.iv-danger .btn.danger { margin-top:6px; }

/* ============ Notes ============ */
.note-composer { background:var(--bg-card); border:1px solid var(--border); border-radius:14px; padding:12px; margin-bottom:16px; }
.note-toolbar { display:flex; gap:4px; margin-bottom:8px; }
.note-toolbar button { width:34px; height:30px; border:1px solid var(--border-light); background:var(--input-bg);
    color:var(--text); border-radius:7px; cursor:pointer; font-family:inherit; font-size:13px; padding:0; }
.note-toolbar button[data-cmd="insertUnorderedList"] { width:auto; padding:0 10px; }
.note-toolbar button:hover { border-color:var(--mint); }
.note-editor { min-height:70px; background:var(--input-bg); border:1px solid var(--border-light); border-radius:10px;
    padding:10px 12px; color:var(--text); font-size:14px; line-height:1.5; outline:none; }
.note-editor:focus { border-color:var(--mint); }
.note-editor:empty::before { content:attr(data-ph); color:var(--muted); }
.note-editor ul { padding-left:20px; }
.note-foot { display:flex; gap:10px; align-items:center; margin-top:10px; flex-wrap:wrap; }
.note-foot .note-status { width:auto; min-width:200px; }
.note-attach { display:inline-flex; align-items:center; padding:9px 14px; border:1px dashed var(--border-light);
    border-radius:9px; color:var(--muted); font-size:13px; cursor:pointer; }
.note-attach:hover { border-color:var(--mint); color:var(--mint); }
.note-foot .btn.mint { margin-left:auto; }
.note-staged { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.note-staged .staged { position:relative; width:60px; height:60px; border-radius:8px; overflow:hidden; }
.note-staged .staged img { width:100%; height:100%; object-fit:cover; }
.note-staged .staged button { position:absolute; top:2px; right:2px; width:18px; height:18px; border:none;
    border-radius:5px; background:rgba(8,8,20,.7); color:#fff; cursor:pointer; font-size:12px; line-height:1; }

.note-list { display:flex; flex-direction:column; gap:10px; }
.note { background:var(--bg-card); border:1px solid var(--border); border-radius:12px; padding:12px 14px; }
.note-head { display:flex; align-items:center; gap:10px; margin-bottom:8px; }
.note-date { color:var(--muted); font-size:13px; }
.note-del { margin-left:auto; background:none; border:none; color:var(--muted); cursor:pointer; padding:2px; display:flex; }
.note-del:hover { color:var(--coral); }
.note-del svg { width:16px; height:16px; }
.note-body { color:var(--text); font-size:14px; line-height:1.55; word-wrap:break-word; }
.note-body ul, .note-body ol { padding-left:20px; }
.note-body a { color:var(--mint); }
.note-photos { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.note-photo { width:72px; height:72px; border-radius:8px; overflow:hidden; display:block; cursor:zoom-in; }
.note-photo img { width:100%; height:100%; object-fit:cover; }
.note-history-toggle { display:inline-flex; align-items:center; gap:7px; margin-top:4px; padding:8px 14px;
    background:var(--bg-card); border:1px solid var(--border-light); border-radius:9px; color:var(--periwinkle);
    font-family:inherit; font-size:13px; font-weight:600; cursor:pointer; transition:border-color .12s, color .12s; }
.note-history-toggle:hover { border-color:var(--mint); color:var(--mint); }
.note-history-toggle .hist-chev { width:15px; height:15px; transition:transform .15s; }
.note-history-toggle.open .hist-chev { transform:rotate(180deg); }
.note-history { display:flex; flex-direction:column; gap:10px; margin-top:10px; }
.note-history[hidden] { display:none; }

/* ============ Add-item form ============ */
.form-page { min-height:100vh; }
.form-top { height:57px; display:flex; align-items:center; gap:14px; padding:0 20px; background:var(--border); }
.form-top .logo { height:24px; width:auto; }
.form-wrap { display:flex; justify-content:center; padding:48px 24px 80px; }
.form-card { width:100%; max-width:560px; }
.form-title { font-size:30px; font-weight:800; color:#fff; letter-spacing:-0.02em; margin-bottom:26px; }
.form-field { margin-bottom:20px; }
.form-field label { display:block; font-size:13px; font-weight:700; color:var(--mint); text-transform:uppercase; letter-spacing:.05em; margin-bottom:8px; }
.form-field label .req { color:var(--coral); }
.form-field input[type=text] { width:100%; padding:13px 15px; background:var(--input-bg); border:1px solid var(--border-light);
    color:var(--text); border-radius:11px; font-family:inherit; font-size:15px; }
.form-field input[type=text]:focus { border-color:var(--mint); outline:none; }
.tag-pick { display:flex; flex-wrap:wrap; gap:8px; }
.tag-chip { padding:7px 14px; border-radius:999px; border:1.5px solid var(--tc); background:transparent;
    color:var(--text); font-family:inherit; font-size:13px; font-weight:700; cursor:pointer; transition:background .12s, color .12s; }
.tag-chip.sel { background:var(--tc); color:#0d0d1a; }
.field-hint { margin-top:8px; color:var(--muted); font-size:13px; }
.field-hint code { background:var(--input-bg); padding:1px 6px; border-radius:5px; color:var(--mint); }
/* number stepper (− [input] +), styled like IX Creator's version control */
.stepper-row { display:flex; gap:6px; align-items:center; }
.stepper-btn { width:38px; height:46px; flex-shrink:0; background:var(--input-bg); border:1px solid var(--border-light);
    color:var(--text); border-radius:11px; font-family:inherit; font-size:20px; line-height:1; cursor:pointer;
    display:flex; align-items:center; justify-content:center; transition:border-color .15s, color .15s; }
.stepper-btn:hover { border-color:var(--mint); color:var(--mint); }
.stepper-input { width:64px; height:46px; text-align:center; background:var(--input-bg); border:1px solid var(--border-light);
    color:var(--text); border-radius:11px; font-family:inherit; font-size:15px; -moz-appearance:textfield; appearance:textfield; }
.stepper-input:focus { border-color:var(--mint); outline:none; }
.stepper-input::-webkit-outer-spin-button, .stepper-input::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }
.name-suggest { margin-top:8px; display:flex; flex-direction:column; gap:5px; }
.name-suggest .sug-head { font-size:12px; color:var(--muted); margin-bottom:2px; }
.sug-item { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:9px 12px;
    background:var(--input-bg); border:1px solid var(--border-light); border-radius:9px; color:var(--text);
    font-family:inherit; font-size:14px; cursor:pointer; text-align:left; }
.sug-item:hover { border-color:var(--mint); }
.sug-count { color:var(--muted); font-size:13px; flex-shrink:0; }
.form-error { color:#ff7a99; font-size:14px; min-height:20px; margin-bottom:6px; }
.form-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:8px; }
.form-actions .ghost { text-decoration:none; display:inline-flex; align-items:center; }

/* ============ Photos (Item View) ============ */
.photo-grid { display:flex; flex-wrap:wrap; gap:12px; }
.photo { position:relative; width:120px; height:120px; border-radius:12px; overflow:hidden;
    border:1px solid var(--border-light); background:var(--input-bg); cursor:grab; }
.photo img { width:100%; height:100%; object-fit:cover; display:block; }
.photo.dragging { opacity:.4; }
.photo.over { outline:2px solid var(--mint); outline-offset:-2px; }
.photo-badge { position:absolute; left:6px; bottom:6px; background:var(--mint); color:#0d0d1a;
    font-size:10px; font-weight:700; padding:2px 7px; border-radius:999px; text-transform:uppercase; letter-spacing:.03em; }
.photo-del { position:absolute; top:5px; right:5px; width:22px; height:22px; border:none; border-radius:6px;
    background:rgba(8,8,20,.6); color:#fff; font-size:15px; line-height:1; cursor:pointer; transition:background .12s; }
.photo-del:hover { background:var(--coral); }
.photo-add { width:120px; height:120px; border-radius:12px; border:1.5px dashed var(--border-light);
    display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px;
    color:var(--muted); font-size:12px; cursor:pointer; transition:border-color .12s, color .12s; }
.photo-add:hover { border-color:var(--mint); color:var(--mint); }
.photo-add-plus { font-size:26px; line-height:1; }
.photo-hint { margin:0 0 14px; color:var(--muted); font-size:13px; }

/* lightbox (double-click a photo) */
.lightbox { position:fixed; inset:0; background:rgba(5,5,15,.9); display:none; align-items:center;
    justify-content:center; z-index:100; padding:32px; cursor:zoom-out; }
.lightbox.open { display:flex; }
.lightbox img { max-width:92vw; max-height:92vh; border-radius:10px; box-shadow:0 20px 60px rgba(0,0,0,.6); }

/* ============ Type-ahead picker (tags / manufacturer) ============ */
.ixp-field { min-height:46px; background:var(--input-bg); border:1px solid var(--border-light); border-radius:11px;
    padding:7px 9px; display:flex; flex-wrap:wrap; gap:6px; align-items:center; cursor:pointer; transition:border-color .15s; }
.ixp-field.open, .ixp-field:focus-within { border-color:var(--mint); }
.ixp-chip { display:inline-flex; align-items:center; gap:6px; padding:5px 8px 5px 11px; border-radius:8px;
    font-size:13px; font-weight:700; background:var(--border); color:var(--text); white-space:nowrap; }
.ixp-chip-x { border:none; background:none; color:inherit; cursor:pointer; font-size:15px; line-height:1; opacity:.6; padding:0; }
.ixp-chip-x:hover { opacity:1; }
.ixp-add { border:none; background:none; color:var(--muted); font-family:inherit; font-size:14px; cursor:pointer; padding:4px 6px; }
.ixp-add:hover { color:var(--mint); }

.ixp-dropdown { position:fixed; z-index:80; display:none; background:var(--bg-card); border:1px solid var(--border-light);
    border-radius:12px; box-shadow:0 14px 40px rgba(0,0,0,.45); padding:8px; max-height:300px; overflow:hidden; }
.ixp-dropdown.open { display:block; }
.ixp-search { width:100%; padding:10px 12px; background:var(--input-bg); border:1px solid var(--border-light);
    color:var(--text); border-radius:9px; font-family:inherit; font-size:14px; margin-bottom:6px; }
.ixp-search:focus { border-color:var(--mint); outline:none; }
.ixp-list { max-height:220px; overflow-y:auto; scrollbar-width:thin; scrollbar-color:var(--border-light) transparent; }
.ixp-item { display:flex; align-items:center; gap:9px; padding:9px 10px; border-radius:8px; cursor:pointer; color:var(--text); font-size:14px; }
.ixp-item:hover { background:var(--input-bg); }
.ixp-item.on { color:var(--mint); }
.ixp-dot { width:11px; height:11px; border-radius:50%; flex-shrink:0; }
.ixp-name { flex:1; }
.ixp-check { color:var(--mint); }
.ixp-empty { color:var(--muted); font-size:13px; padding:10px; }
.ixp-create { display:flex; align-items:center; gap:7px; padding:9px 10px; border-radius:8px; cursor:pointer;
    color:var(--mint); font-size:14px; }
.ixp-create:hover { background:rgba(141,226,165,.1); }
.ixp-plus { font-size:16px; line-height:1; }

/* ============ Metadata editor ============ */
.app { display:flex; height:100vh; overflow:hidden; }
.sidebar { width:300px; flex-shrink:0; background:#1a1a2e; border-right:1px solid var(--border);
    display:flex; flex-direction:column; }
.side-head { height:57px; flex-shrink:0; background:var(--border); display:flex; align-items:center;
    gap:14px; padding:0 20px; }
.back-btn { width:32px; height:32px; border:none; background:var(--coral); color:#fff; display:flex;
    align-items:center; justify-content:center; border-radius:8px; transition:background .15s; text-decoration:none; }
.back-btn:hover { background:#ff527e; }
.back-btn svg { width:17px; height:17px; }
.back-btn .back-ic { width:16px; height:16px; background:#fff;
    -webkit-mask:url('../assets/Icon_Back.svg') center/contain no-repeat;
    mask:url('../assets/Icon_Back.svg') center/contain no-repeat; }
.side-head .logo { height:26px; width:auto; display:block; }
.side-body { flex:1; overflow-y:auto; padding:24px 16px; }
.meta-title { display:flex; align-items:center; gap:11px; margin:0 6px 22px; }
.meta-title .meta-ic { width:26px; height:26px; flex-shrink:0; background:var(--periwinkle);
    -webkit-mask:url('../assets/Icon_Metadata.svg') center/contain no-repeat;
    mask:url('../assets/Icon_Metadata.svg') center/contain no-repeat; }
.meta-title h1 { font-weight:800; font-size:28px; color:#fff; letter-spacing:-0.02em; }
.nav-item { width:100%; display:flex; align-items:center; gap:10px; padding:11px 14px; margin-bottom:6px;
    background:var(--bg-card); border:2px solid transparent; border-radius:11px; color:var(--text);
    text-align:left; font-family:inherit; font-size:14px; font-weight:600; transition:border-color .15s, background .15s; }
.nav-item:hover { background:#23233f; }
.nav-item.active { border-color:var(--mint); }

.main { flex:1; display:flex; flex-direction:column; overflow:hidden; }
.main-head { height:57px; flex-shrink:0; background:#1a1a2e; border-bottom:1px solid var(--border);
    display:flex; align-items:center; justify-content:flex-end; gap:16px; padding:0 28px; }
.main-head .who { color:var(--muted); font-size:14px; }
.main-body { flex:1; overflow-y:auto; padding:32px 40px 80px; }

.section-head { display:flex; align-items:flex-start; justify-content:space-between; gap:24px;
    margin-bottom:24px; max-width:860px; }
.section-head h2 { font-weight:800; font-size:26px; color:#fff; letter-spacing:-0.02em; margin-bottom:6px; }
.section-head p { font-size:14px; color:var(--periwinkle); line-height:1.5; max-width:560px; }

.btn { display:inline-flex; align-items:center; gap:8px; padding:10px 16px; border:none; border-radius:10px;
    font-family:inherit; font-weight:700; font-size:14px; background:var(--purple); color:#fff;
    white-space:nowrap; cursor:pointer; transition:background .15s, opacity .15s; }
.btn:hover { background:#5c0ef0; }
.btn.mint { background:var(--mint); color:#0d0d1a; }
.btn.mint:hover { background:#a0eab6; }
.btn.ghost { background:transparent; border:1px solid var(--border-light); color:var(--text); }
.btn.ghost:hover { border-color:var(--periwinkle); }
.btn.danger { background:var(--coral); color:#fff; }
.btn.danger:hover { background:#ff527e; }
.btn svg { width:15px; height:15px; }

.items { display:flex; flex-direction:column; gap:8px; max-width:860px; }
.empty { color:var(--muted); font-size:14px; padding:24px 0; }
.item { background:var(--bg-card); border:1px solid var(--border); border-radius:12px; padding:11px 14px;
    display:flex; align-items:center; gap:14px; }
.item-main { flex:1; min-width:0; }
.item-name { font-size:15px; font-weight:700; color:#fff; }
.item-actions { display:flex; gap:7px; flex-shrink:0; }
.icon-btn { width:30px; height:30px; border:1px solid var(--border-light); background:transparent;
    border-radius:8px; color:var(--periwinkle); display:flex; align-items:center; justify-content:center;
    cursor:pointer; transition:border-color .15s, color .15s, background .15s; }
.icon-btn:hover { border-color:var(--periwinkle); }
.icon-btn.del:hover { border-color:var(--coral); color:var(--coral); background:rgba(255,51,102,.08); }
.icon-btn svg { width:15px; height:15px; }

.cat-row .drag { width:20px; color:var(--muted); cursor:grab; flex-shrink:0; display:flex; }
.cat-row .drag svg { width:18px; height:18px; }
.cat-row.dragging { opacity:.4; }
.cat-row.over { border-color:var(--mint); }
.cat-ic { width:24px; height:24px; flex-shrink:0; background-color:var(--mint); }
.cat-ic.empty { background:var(--border-light); border-radius:6px; }

.chip { display:inline-flex; align-items:center; padding:4px 12px; border-radius:999px;
    font-size:13px; font-weight:700; }

/* inline edit form */
.item.edit { flex-direction:column; align-items:stretch; gap:14px; border-color:var(--border-light); }
.edit-fields input[type=text] { width:100%; padding:11px 13px; background:var(--input-bg);
    border:1px solid var(--border-light); color:var(--text); border-radius:10px; font-family:inherit; font-size:14px; }
.edit-fields input[type=text]:focus { border-color:var(--mint); outline:none; }
.edit-actions { display:flex; justify-content:flex-end; gap:8px; }

.icon-picker { display:grid; grid-template-columns:repeat(auto-fill, 44px); gap:8px; margin-top:12px; }
.icon-opt { width:44px; height:44px; border:1px solid var(--border-light); background:var(--input-bg);
    border-radius:10px; cursor:pointer; display:flex; align-items:center; justify-content:center; transition:border-color .15s; }
.icon-opt:hover { border-color:var(--periwinkle); }
.icon-opt.sel { border-color:var(--mint); background:rgba(141,226,165,.12); }
.icon-opt span { width:24px; height:24px; background-color:var(--mint); }

.color-picker { display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; }
.color-opt { width:34px; height:34px; border-radius:9px; border:2px solid transparent; cursor:pointer;
    display:flex; align-items:center; justify-content:center; color:#0d0d1a; }
.color-opt.sel { border-color:#fff; }
.color-opt svg { width:16px; height:16px; }

/* password modal */
.modal-overlay { position:fixed; inset:0; background:rgba(8,8,20,.66); display:none;
    align-items:center; justify-content:center; padding:24px; z-index:50; }
.modal-overlay.active { display:flex; }
.modal { width:100%; max-width:400px; background:var(--bg-card); border:1px solid var(--border-light);
    border-radius:16px; padding:24px; }
.modal h3 { font-size:19px; color:#fff; margin-bottom:8px; }
.modal p { font-size:14px; color:var(--periwinkle); line-height:1.5; margin-bottom:16px; }
.modal input[type=password] { width:100%; padding:12px 14px; background:var(--input-bg);
    border:1px solid var(--border-light); color:var(--text); border-radius:10px; font-family:inherit; font-size:15px; }
.modal input[type=password]:focus { border-color:var(--coral); outline:none; }
.modal-error { display:none; color:#ff7a99; font-size:13px; margin-top:10px; }
.modal-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:18px; }

/* toast */
.toast { position:fixed; left:50%; bottom:28px; transform:translateX(-50%) translateY(20px);
    background:var(--mint); color:#0d0d1a; font-weight:700; font-size:14px; padding:11px 20px;
    border-radius:10px; opacity:0; pointer-events:none; transition:opacity .2s, transform .2s; z-index:60; }
.toast.show { opacity:1; transform:translateX(-50%) translateY(0); }
.toast.err { background:var(--coral); color:#fff; }

/* ============================ Balans (stocktake) ============================ */

/* shared chips */
.bl-chip { display:inline-flex; align-items:center; font-size:11px; font-weight:700; padding:3px 9px; border-radius:999px; }
.bl-chip.vermist { background:#8B5CF6; color:#fff; }
.bl-chip.mis { background:#F59E0B; color:#241700; }
.bl-chip.found { background:#10B981; color:#06281c; }

/* ---- overview ---- */
.bl-ov { flex:1; overflow:auto; padding:32px 40px; max-width:1000px; width:100%; margin:0 auto; }
.bl-ov-title { font-size:26px; color:#fff; margin:0 0 4px; }
.bl-ov-lead { color:var(--muted); margin:0 0 26px; }
.bl-ov-group { margin-bottom:28px; }
.bl-ov-h { font-size:13px; text-transform:uppercase; letter-spacing:.05em; color:var(--periwinkle); margin:0 0 12px; }
.bl-ov-cards { display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:16px; }
.bl-ov-card { background:var(--bg-card); border:1px solid var(--border-light); border-radius:14px; padding:18px 20px; }
.bl-ov-card.done { opacity:.85; }
.bl-ov-card-top { display:flex; justify-content:space-between; align-items:baseline; gap:10px; margin-bottom:12px; }
.bl-ov-card-top h3 { font-size:17px; color:#fff; margin:0; }
.bl-ov-date { font-size:12px; color:var(--muted); white-space:nowrap; }
.bl-ov-progress { height:8px; background:var(--input-bg); border-radius:6px; overflow:hidden; margin-bottom:10px; }
.bl-ov-bar { height:100%; background:var(--mint); border-radius:6px; transition:width .3s; }
.bl-ov-stats { display:flex; align-items:center; gap:10px; flex-wrap:wrap; font-size:13px; color:var(--periwinkle); margin-bottom:14px; }
.bl-ov-stats b { color:#fff; }
.bl-ov-actions { display:flex; gap:8px; flex-wrap:wrap; }
.bl-ov-actions .btn { font-size:13px; padding:8px 14px; }
.bl-ov-empty { color:var(--muted); }

/* ---- start modal ---- */
.modal.bl-start { max-width:560px; }
.bl-field { display:block; margin-bottom:14px; }
.bl-field-lbl { display:block; font-size:12px; color:var(--muted); margin-bottom:5px; }
.bl-input { width:100%; padding:11px 13px; background:var(--input-bg); border:1px solid var(--border-light);
    border-radius:9px; color:var(--text); font:inherit; }
.bl-input:focus { border-color:var(--mint); outline:none; }
.bl-scope { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-bottom:8px; }
.bl-scope-head { display:flex; justify-content:space-between; align-items:center; font-size:12px;
    color:var(--periwinkle); font-weight:700; margin-bottom:6px; }
.bl-toggle-all { background:none; border:none; color:var(--mint); font-size:11px; cursor:pointer; padding:0; }
.bl-scope-list { max-height:180px; overflow:auto; border:1px solid var(--border-light); border-radius:9px;
    padding:8px 10px; background:var(--input-bg); }
.bl-scope-check { display:flex; align-items:center; gap:8px; font-size:13px; color:var(--text); padding:3px 0; cursor:pointer; }
.bl-scope-check input { width:15px; height:15px; flex-shrink:0; accent-color:var(--mint); }
.bl-scope-none { color:var(--muted); font-size:13px; margin:0; }
.bl-hint { font-size:12px; color:var(--muted); margin:8px 0 0; }

/* ---- count screen ---- */
.bl-readonly { background:#3a2a10; color:#f5c877; padding:9px 16px; font-size:13px; text-align:center; }
.bl-tel { flex:1; display:flex; min-height:0; }
.bl-tel-head { gap:14px; }
.bl-tel-name { color:#fff; font-weight:700; margin-right:auto; }
.bl-tel-side { width:340px; flex-shrink:0; border-right:1px solid var(--border); padding:20px; overflow:auto; }
.bl-tel-main { flex:1; display:flex; flex-direction:column; min-width:0; }

.bl-scanbox { margin-bottom:14px; }
.bl-scan-lbl { display:block; font-size:12px; color:var(--muted); margin-bottom:6px; }
.bl-scan { width:100%; padding:14px 16px; font-size:18px; background:var(--input-bg);
    border:2px solid var(--mint); border-radius:11px; color:var(--text); }
.bl-scan:focus { outline:none; box-shadow:0 0 0 3px rgba(141,226,165,.25); }
.bl-banner { min-height:46px; border-radius:10px; padding:12px 14px; margin-bottom:16px; font-weight:700;
    font-size:15px; display:flex; align-items:center; opacity:0; transition:opacity .15s; }
.bl-banner.show { opacity:1; }
.bl-banner.ok { background:#10B981; color:#06281c; }
.bl-banner.warn { background:#F59E0B; color:#241700; }
.bl-banner.err { background:var(--coral); color:#fff; }

.bl-counters { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:16px; }
.bl-cnt { background:var(--bg-card); border:1px solid var(--border-light); border-radius:11px; padding:12px; text-align:center; }
.bl-cnt-n { display:block; font-size:26px; font-weight:800; color:#fff; line-height:1.1; }
.bl-cnt-l { font-size:11px; color:var(--muted); text-transform:uppercase; letter-spacing:.03em; }
.bl-cnt.vermist { border-color:#8B5CF6; } .bl-cnt.vermist .bl-cnt-n { color:#b79cf7; }
.bl-cnt.mis { border-color:#F59E0B; } .bl-cnt.mis .bl-cnt-n { color:#f5c877; }

.bl-mislist { font-size:13px; }
.bl-mislist summary { cursor:pointer; color:var(--periwinkle); font-weight:700; }
.bl-mis-row { display:flex; justify-content:space-between; gap:10px; padding:6px 0; border-bottom:1px solid var(--border);
    color:var(--text); }
.bl-mis-loc { color:var(--muted); white-space:nowrap; }

.bl-listbar { display:flex; align-items:center; justify-content:space-between; padding:14px 20px;
    border-bottom:1px solid var(--border); flex-shrink:0; }
.bl-listbar-title { font-size:13px; text-transform:uppercase; letter-spacing:.05em; color:var(--periwinkle); }
.bl-sort { display:inline-flex; border:1px solid var(--border-light); border-radius:9px; overflow:hidden; }
.bl-sort button { background:var(--bg-card); border:none; color:var(--muted); font:inherit; font-size:13px;
    padding:7px 14px; cursor:pointer; border-left:1px solid var(--border-light); }
.bl-sort button:first-child { border-left:none; }
.bl-sort button.active { background:var(--purple); color:#fff; }

.bl-list { flex:1; overflow:auto; padding:10px 20px 40px; }
.bl-row { display:flex; align-items:center; gap:12px; padding:11px 12px; border-radius:10px; margin-bottom:6px;
    background:var(--bg-card); border:1px solid var(--border); }
.bl-row.state-found { background:rgba(16,185,129,.12); border-color:#10B981; }
.bl-row.state-reeds { border-color:#8B5CF6; }
.bl-check { flex-shrink:0; width:30px; height:30px; border-radius:8px; border:2px solid var(--border-light);
    background:transparent; cursor:pointer; display:flex; align-items:center; justify-content:center; }
.bl-check-box { color:transparent; font-weight:800; font-size:15px; line-height:1; }
.bl-row.state-found .bl-check { background:#10B981; border-color:#10B981; }
.bl-row.state-found .bl-check-box { color:#06281c; }
.bl-check:disabled { cursor:default; opacity:.6; }
.bl-row-main { flex:1; min-width:0; }
.bl-row-name { display:block; color:var(--text); font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.bl-row-meta { display:block; font-size:12px; color:var(--muted); }
.bl-row-badges { display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-end; max-width:230px; }
.bl-tag { font-size:11px; font-weight:700; padding:3px 8px; border-radius:999px; background:var(--border); color:var(--periwinkle); }
.bl-tag.vermist { background:#8B5CF6; color:#fff; }
.bl-tag.note { background:var(--input-bg); color:var(--periwinkle); }
.bl-tag.cond.repaired { background:#10B981; color:#06281c; }
.bl-tag.cond.impaired { background:#F59E0B; color:#241700; }
.bl-tag.cond.defect { background:var(--coral); color:#fff; }
.bl-row-note { background:none; border:1px solid var(--border-light); color:var(--periwinkle); font:inherit;
    font-size:12px; padding:6px 12px; border-radius:8px; cursor:pointer; flex-shrink:0; }
.bl-row-note:hover { border-color:var(--periwinkle); }
.bl-row-note:disabled { opacity:.4; cursor:default; }

/* ---- note + close modals ---- */
.bl-note-for { color:#fff; font-weight:700; margin-bottom:12px; }
.bl-textarea { width:100%; padding:11px 13px; background:var(--input-bg); border:1px solid var(--border-light);
    border-radius:9px; color:var(--text); font:inherit; resize:vertical; margin-bottom:12px; }
.bl-textarea:focus { border-color:var(--mint); outline:none; }
.modal.bl-close-modal { max-width:720px; }
.bl-close-cols { display:grid; grid-template-columns:1fr 1fr; gap:18px; margin:8px 0; }
.bl-close-col h4 { font-size:14px; color:#fff; margin:0 0 2px; display:flex; align-items:center; gap:8px; }
.bl-close-sub { font-size:12px; color:var(--muted); margin:0 0 8px; }
.bl-close-list { max-height:260px; overflow:auto; border:1px solid var(--border-light); border-radius:9px; padding:6px; background:var(--input-bg); }
.bl-close-row { display:flex; align-items:center; gap:9px; padding:6px 6px; font-size:13px; color:var(--text); cursor:pointer; }
.bl-close-row span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bl-close-loc { margin-left:auto; color:var(--muted); font-size:12px; }
.bl-close-none { color:var(--muted); font-size:13px; font-style:italic; padding:8px; margin:0; }

@media (max-width:720px) {
    .bl-scope, .bl-close-cols, .bl-counters { grid-template-columns:1fr; }
    .bl-tel { flex-direction:column; }
    .bl-tel-side { width:auto; border-right:none; border-bottom:1px solid var(--border); }
}
