:root {
    --pv-red: #e31e24;
    --pv-bg-main: #0a0a0a;
    --pv-panel: #141414;
    --pv-border: #2a2a2a;
    --pv-text: #e0e0e0;
    --pv-text-muted: #888;
    --pv-highlight: #ffffff;
    --ok: #37b26b;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; }
body { background: var(--pv-bg-main); color: var(--pv-text); font-size: 0.92rem; line-height: 1.5; }
h1 { font-size: 1.5rem; font-weight: 800; color: var(--pv-highlight); }
h2 { font-size: 1rem; font-weight: 800; color: var(--pv-highlight); }
a { color: var(--pv-red); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- NAVBAR --- */
.bar {
    height: 64px; background: var(--pv-panel); display: flex; align-items: center; gap: 26px;
    padding: 0 24px; border-bottom: 2px solid var(--pv-red); box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    position: sticky; top: 0; z-index: 100;
}
.bar__mark { font-size: 1.1rem; font-weight: 700; color: var(--pv-highlight); letter-spacing: 1px; text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
.bar__mark:hover { text-decoration: none; }
.bar__mark span { width: 8px; height: 8px; background: var(--pv-red); display: inline-block; }
.bar__nav { display: flex; gap: 20px; flex: 1; font-size: 0.85rem; }
.bar__nav a { color: var(--pv-text-muted); font-weight: 600; }
.bar__nav a:hover { color: #fff; text-decoration: none; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 28px 24px 70px; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.head__actions { display: flex; gap: 10px; }
.eyebrow { font-size: 0.68rem; font-weight: 800; color: var(--pv-text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.eyebrow a { color: var(--pv-text-muted); }
.hint { color: var(--pv-text-muted); font-size: 0.78rem; margin-top: 6px; }
.dim { color: var(--pv-text-muted); }
.num { text-align: right; }
.strong { font-weight: 700; color: var(--pv-highlight); }
.warn { color: var(--pv-red); }

/* --- BUTTONS --- */
.btn { display: inline-block; background: transparent; border: 1px solid #555; color: #fff; padding: 8px 16px; border-radius: 4px; cursor: pointer; font-size: 0.85rem; font-weight: 600; transition: 0.2s; }
.btn:hover { background: var(--pv-red); border-color: var(--pv-red); text-decoration: none; }
.btn--primary { background: var(--pv-red); border-color: var(--pv-red); color: #fff; font-weight: 700; }
.btn--primary:hover { background: #c11216; border-color: #c11216; }
.btn--ghost { color: var(--pv-text-muted); }
.btn--ghost:hover { color: #fff; }
.btn--tiny { padding: 5px 10px; font-size: 0.72rem; }
.btn--wide { width: 100%; }
.btn--danger { border-color: #5a2326; color: var(--pv-red); }
.btn--danger:hover { background: var(--pv-red); border-color: var(--pv-red); color: #fff; }

/* --- CARDS --- */
.card { background: var(--pv-panel); border: 1px solid var(--pv-border); border-radius: 8px; padding: 24px; }
.card__title { font-size: 0.8rem; font-weight: 800; color: var(--pv-text-muted); text-transform: uppercase; letter-spacing: 1px; border-bottom: 1px solid var(--pv-border); padding-bottom: 8px; margin-bottom: 16px; }
.cols { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; align-items: start; }
.card--aside { position: sticky; top: 84px; }

/* --- FORMS --- */
.lbl { display: block; margin-bottom: 16px; font-size: 0.8rem; font-weight: 600; color: #bbb; }
.lbl > span:first-child { display: block; margin-bottom: 6px; }
.lbl input, .lbl textarea, .lbl select {
    width: 100%; margin-top: 6px; background: #000; color: #fff; border: 1px solid var(--pv-border);
    padding: 10px 12px; border-radius: 6px; outline: none; font-size: 0.92rem; font-family: inherit;
}
.lbl input:focus, .lbl textarea:focus, .lbl select:focus { border-color: var(--pv-red); }
.lbl textarea { resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 14px; }
.check { display: flex; align-items: center; gap: 10px; margin: 12px 0; font-size: 0.85rem; cursor: pointer; color: #ccc; }
.check input { accent-color: var(--pv-red); width: 16px; height: 16px; }
.row-actions { display: flex; gap: 10px; margin-top: 18px; }
.opts { border: 1px solid var(--pv-border); border-radius: 6px; padding: 14px 16px; margin: 18px 0; }
.opts legend { padding: 0 8px; font-size: 0.68rem; font-weight: 800; color: var(--pv-text-muted); text-transform: uppercase; letter-spacing: 1px; }
.sep { margin: 16px 0; font-size: 0.68rem; font-weight: 800; color: var(--pv-text-muted); text-transform: uppercase; letter-spacing: 1px; }
.danger { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--pv-border); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.danger .hint { margin: 0; }

/* --- LOCATE MODE --- */
.locate { border: 1px solid var(--pv-border); border-radius: 8px; padding: 16px; margin-bottom: 16px; background: #0e0e0e; }
.locate__label { display: block; font-size: 0.68rem; font-weight: 800; color: var(--pv-text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; }
.locate .segmented-control { display: flex; background: #000; border-radius: 6px; padding: 4px; border: 1px solid var(--pv-border); margin-bottom: 14px; }
.locate .seg-btn { flex: 1; text-align: center; padding: 9px; cursor: pointer; font-size: 0.8rem; font-weight: 600; border-radius: 4px; color: #777; transition: 0.2s; }
.locate .seg-btn.active { background: #222; color: #fff; border: 1px solid var(--pv-red); }
.locate [data-pane] { display: none; }
.locate [data-pane].is-shown { display: block; }
.locate .grid2[data-pane].is-shown { display: grid; }
.locate__actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.locate__actions .hint { margin: 0; }

/* --- ALERTS --- */
.alert { padding: 12px 14px; margin-bottom: 18px; font-size: 0.85rem; border-radius: 6px; border-left: 4px solid; background: #000; }
.alert--ok { border-color: var(--ok); }
.alert--bad { border-color: var(--pv-red); }

/* --- TALLY --- */
.tally { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.tally div { background: var(--pv-panel); border: 1px solid var(--pv-border); border-left: 4px solid var(--pv-red); border-radius: 8px; padding: 14px 16px; }
.tally dt { font-size: 0.68rem; font-weight: 800; color: var(--pv-text-muted); text-transform: uppercase; letter-spacing: 1px; }
.tally dd { margin-top: 6px; font-size: 1.35rem; font-weight: 800; color: var(--pv-highlight); }

/* --- TABLE --- */
.table-wrap { background: var(--pv-panel); border: 1px solid var(--pv-border); border-radius: 8px; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.table th { text-align: left; padding: 12px 14px; font-size: 0.68rem; font-weight: 800; color: var(--pv-text-muted); text-transform: uppercase; letter-spacing: 1px; border-bottom: 1px solid var(--pv-border); }
.table td { padding: 10px 14px; border-bottom: 1px solid #222; vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #1a1a1a; }
.thumb-cell { width: 60px; }
.thumb-cell img { width: 46px; height: 34px; object-fit: cover; border-radius: 3px; display: block; }
.thumb-cell__none { display: block; width: 46px; height: 34px; border: 1px dashed #444; border-radius: 3px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.dot--ok { background: var(--ok); }
.dot--bad { background: var(--pv-red); }
.tag { display: inline-block; margin-left: 8px; padding: 2px 8px; border: 1px solid #444; border-radius: 3px; font-size: 0.65rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; color: var(--pv-text-muted); }
.tag--on { border-color: var(--pv-red); color: var(--pv-red); }

.empty { border: 1px dashed #444; border-radius: 8px; padding: 44px 24px; text-align: center; }
.empty h2 { margin-bottom: 8px; }
.empty p { color: var(--pv-text-muted); margin-bottom: 14px; }

/* --- UPLOADER --- */
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 30px 16px; border: 1px dashed #444; border-radius: 8px; cursor: pointer; text-align: center; margin-bottom: 14px; background: #000; transition: 0.2s; }
.drop:hover, .drop.is-over { border-color: var(--pv-red); background: #120a0a; }
.drop__text { font-size: 0.85rem; color: var(--pv-text-muted); }
.shots { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 20px; }
.shot { background: #000; border: 1px solid var(--pv-border); border-radius: 6px; overflow: hidden; }
.shot img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.shot__acts { display: flex; align-items: center; gap: 6px; padding: 8px; flex-wrap: wrap; }

/* --- IMPORT PROGRESS --- */
.meter { height: 6px; background: #1c1c1c; border-radius: 3px; margin: 20px 0 10px; overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: var(--pv-red); transition: width 0.3s; }
.log { list-style: none; margin-top: 12px; max-height: 320px; overflow-y: auto; font-size: 0.78rem; }
.log li { padding: 6px 0; border-bottom: 1px solid #222; display: flex; gap: 10px; }
.log b { font-weight: 800; min-width: 76px; text-transform: uppercase; font-size: 0.68rem; letter-spacing: 0.5px; padding-top: 2px; }
.log .s-created { color: var(--ok); }
.log .s-updated { color: #fff; }
.log .s-skipped { color: var(--pv-text-muted); }
.log .s-warning { color: #d99a2b; }
.log .s-error { color: var(--pv-red); }

.mini { width: 100%; border-collapse: collapse; font-size: 0.8rem; margin-top: 12px; }
.mini th { text-align: left; padding: 8px 10px 8px 0; font-weight: 700; color: var(--pv-highlight); white-space: nowrap; vertical-align: top; }
.mini td { padding: 8px 0; color: var(--pv-text-muted); vertical-align: top; }
.mini tr { border-bottom: 1px solid #222; }

/* --- LOGIN --- */
.login { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.card--login { width: 100%; max-width: 380px; border: 2px solid var(--pv-red); border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,0.9); }
.card--login h1 { font-size: 1.4rem; margin-bottom: 18px; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--pv-bg-main); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--pv-red); }

@media (max-width: 860px) {
    .cols { grid-template-columns: 1fr; }
    .card--aside { position: static; }
    .grid2, .grid3 { grid-template-columns: 1fr; }
    .tally { grid-template-columns: 1fr 1fr; }
    .bar { gap: 14px; padding: 0 14px; }
    .bar__nav { gap: 12px; font-size: 0.78rem; }
}
