:root {
    --hg-bg: #0c1626;
    --hg-panel: #12233d;
    --hg-panel-2: #173154;
    --hg-border: rgba(212, 175, 55, 0.25);
    --hg-gold: #d4af37;
    --hg-gold-soft: rgba(212, 175, 55, 0.12);
    --hg-text: #f5f7fb;
    --hg-muted: #9fb1c7;
    --hg-danger: #cf5c5c;
    --hg-success: #57b26a;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    background: linear-gradient(180deg, #09111e 0%, var(--hg-bg) 100%);
    color: var(--hg-text);
    font-family: Inter, Segoe UI, Arial, sans-serif;
}
a { color: inherit; }
.h-shell { max-width: 980px; margin: 0 auto; padding: 16px; }
.h-header {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin-bottom: 16px; position: sticky; top: 0; z-index: 10;
    background: rgba(12,22,38,.92); backdrop-filter: blur(10px); padding: 12px 0;
}
.h-logo { font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--hg-gold); }
.h-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.h-nav a, .h-btn, button {
    border: 1px solid var(--hg-border);
    background: var(--hg-panel);
    color: var(--hg-text);
    border-radius: 14px;
    padding: 10px 14px;
    text-decoration: none;
    font-weight: 600;
}
.h-btn--gold, button.primary { background: var(--hg-gold); color: #1a2130; border-color: var(--hg-gold); }
.h-btn--danger { background: rgba(207,92,92,.14); color: #ffd8d8; border-color: rgba(207,92,92,.3); }
button, input, textarea, select { font: inherit; }
input, textarea, select {
    width: 100%;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.04);
    color: var(--hg-text);
    padding: 12px 14px;
}
textarea { min-height: 120px; resize: vertical; }
.h-grid { display: grid; gap: 14px; }
.h-grid--2 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.h-card {
    background: linear-gradient(180deg, rgba(23,49,84,.92), rgba(18,35,61,.95));
    border: 1px solid var(--hg-border);
    border-radius: 22px;
    padding: 16px;
    box-shadow: 0 10px 35px rgba(0,0,0,.25);
}
.h-title { margin: 0 0 8px; font-size: 1.35rem; }
.h-sub { color: var(--hg-muted); margin: 0 0 12px; }
.h-stats { display:grid; gap:10px; grid-template-columns: repeat(3, 1fr); }
.h-stat { background: rgba(255,255,255,.04); border-radius: 18px; padding: 12px; text-align: center; }
.h-stat strong { display:block; font-size: 1.4rem; color: var(--hg-gold); }
.h-list { display: grid; gap: 10px; }
.h-carton-link { display:block; text-decoration:none; }
.h-carton-line {
    display:flex; justify-content:space-between; gap:10px; align-items:center;
    padding:14px; border-radius:18px; background: rgba(255,255,255,.035); border:1px solid rgba(255,255,255,.06);
}
.h-meta { color: var(--hg-muted); font-size:.94rem; }
.h-chip {
    display:inline-flex; align-items:center; gap:6px; border-radius:999px; padding:6px 10px;
    background: rgba(212,175,55,.12); color: #f7df8a; font-size:.85rem; font-weight:700;
}
.h-chip--ok { background: rgba(87,178,106,.14); color: #b8f1c4; }
.h-chip--danger { background: rgba(207,92,92,.14); color: #ffd8d8; }
.h-actions { display:flex; gap:8px; flex-wrap:wrap; }
.h-form { display:grid; gap:12px; }
.h-inline { display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.h-inline > * { flex: 1 1 180px; }
.h-kv { display:grid; grid-template-columns: 110px 1fr; gap:8px 10px; }
.h-kv dt { color: var(--hg-muted); }
.h-kv dd { margin:0; }
.h-photo { width:100%; border-radius:18px; border:1px solid var(--hg-border); display:block; }
.h-qr { width: 170px; max-width:100%; background:#fff; padding:10px; border-radius:18px; }
.h-flash { margin-bottom:12px; padding:12px 14px; border-radius:14px; }
.h-flash--success { background: rgba(87,178,106,.15); color: #c7f2cf; }
.h-flash--error { background: rgba(207,92,92,.16); color: #ffd5d5; }
.h-empty { color: var(--hg-muted); font-style: italic; }
.h-history { display:grid; gap:8px; }
.h-history-entry { padding:10px 12px; border-radius:14px; background: rgba(255,255,255,.035); }
video#scanner-preview { width:100%; border-radius:18px; background:#000; min-height: 240px; }
@media (max-width: 720px) {
    .h-stats { grid-template-columns: 1fr; }
    .h-kv { grid-template-columns: 1fr; }
}

.h-list-box{
    padding:.75rem 1rem;
    border:1px solid rgba(255,255,255,.08);
    border-radius:1rem;
    background:rgba(255,255,255,.03);
}

.h-simple-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.h-simple-row {
    display: grid;
    grid-template-columns: 14px minmax(0, 1fr) auto;
    align-items: center;
    gap: .55rem;
    margin: .45rem 0;
}

.h-simple-row::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: rgba(255,255,255,.7);
    display: block;
    margin-left: 2px;
}

.h-simple-label {
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: .45rem;
    flex-wrap: wrap;
}

.h-simple-actions {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    justify-self: end;
}

.h-meta-inline {
    color: var(--hg-muted);
    font-size: .92rem;
    white-space: nowrap;
}

.h-inline-form{
    display:inline;
    margin:0;
}

.h-icon-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:2rem;
    height:2rem;
    padding:0;
    border-radius:.65rem;
    border:1px solid rgba(212,175,55,.35);
    background:rgba(8,20,40,.35);
    color:#f5f7fb;
    cursor:pointer;
}

.h-icon-btn--danger{
    border-color:rgba(176,78,107,.45);
    color:#ffd7e0;
}

.h-icon-btn svg{
    width:.95rem;
    height:.95rem;
    stroke:currentColor;
    stroke-width:1.9;
    fill:none;
    stroke-linecap:round;
    stroke-linejoin:round;
}

.h-file-input-native{
    width:100%;
    padding:.85rem 1rem;
    border-radius:1rem;
    border:1px solid rgba(255,255,255,.12);
    background:rgba(255,255,255,.04);
    color:var(--hg-muted);
    font-size:.95rem;
}

.h-file-input-native::file-selector-button{
    margin-right:.75rem;
    padding:.7rem 1rem;
    border:1px solid var(--hg-border);
    border-radius:.85rem;
    background:var(--hg-panel);
    color:var(--hg-text);
    font:inherit;
    font-weight:600;
    cursor:pointer;
}

.h-file-input-native::file-selector-button:hover{
    background:var(--hg-panel-2);
    border-color:rgba(212,175,55,.45);

}

select {
    color-scheme: dark;
    background: rgba(255,255,255,.04);
    color: var(--hg-text);
}
