/* TagScans Web: same dark, high-contrast look as the Windows app (big text for a warehouse floor). */
:root {
    --bg: #0D1117;
    --panel: #161B22;
    --line: #21262D;
    --border: #30363D;
    --text: #F0F6FC;
    --muted: #9DA7B3;
    --faint: #6E7681;
    --blue: #58A6FF;
    --blue-btn: #1F6FEB;
    --green: #3FB950;
    --amber: #E3A008;
    --red: #F85149;
    color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

.page {
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px 28px 6px;
    gap: 12px;
}

/* ---------- header ---------- */
.top {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.file-label {
    flex: 1 1 320px;
    min-width: 0;
    font-size: 26px;
    font-weight: 600;
    white-space: pre;
    overflow: hidden;
    text-overflow: ellipsis;
}
.save-warn { color: var(--amber); font-size: 16px; margin-left: 16px; }
.buttons { display: flex; gap: 8px; flex-wrap: wrap; }

/* Same as the exe: flat dark buttons, blue for the main one, slightly see-through on hover. */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    border: 0;
    border-radius: 8px;
    background: #30363D;
    color: #fff;
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}
.btn:hover { opacity: .85; }
.btn:active { opacity: .65; }
.btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.btn.primary { background: var(--blue-btn); }
.btn.record { background: var(--blue-btn); font-size: 20px; padding: 6px 26px; }

.hidden-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* ---------- scan box ---------- */
.scanrow { display: flex; gap: 12px; margin-top: 2px; }
.scanbox {
    flex: 1;
    min-width: 0;
    min-height: 50px;
    padding: 4px 12px;
    background: var(--bg);
    color: #fff;
    caret-color: #fff;
    border: 3px solid var(--blue-btn);
    border-radius: 0;
    font-family: Consolas, "Cascadia Mono", Menlo, monospace;
    font-size: 24px;
    text-transform: uppercase;
}
.scanbox::placeholder { text-transform: none; color: var(--faint); font-family: "Segoe UI", system-ui, sans-serif; font-size: 20px; }
.scanbox:focus { outline: none; border-color: var(--blue); }

/* ---------- banner ---------- */
.banner {
    min-height: 84px;
    padding: 8px 20px;
    border-radius: 12px;
    background: var(--panel);
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.banner-title { font-size: 34px; font-weight: 700; color: #fff; white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.banner-detail { font-size: 19px; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.banner.good { background: #1B7F37; } .banner.good .banner-detail { color: #E6FFED; }
.banner.bad  { background: #B62324; } .banner.bad  .banner-detail { color: #FFE9E9; }
.banner.warn { background: #9A6700; } .banner.warn .banner-detail { color: #FFF4D6; }

/* ---------- counts ---------- */
.counts { display: grid; text-align: center; }
.counts.five { grid-template-columns: repeat(5, 1fr); }
.counts.two { grid-template-columns: repeat(2, 1fr); max-width: 900px; width: 100%; margin: 0 auto; }
.big { font-size: 46px; font-weight: 700; line-height: 1.1; }
.lbl { font-size: 16px; color: var(--muted); }
.progress { height: 12px; background: var(--line); border-radius: 6px; overflow: hidden; }
.progress .bar { height: 100%; background: var(--green); transition: width .15s; }
.progress-label { text-align: center; font-size: 14px; color: var(--muted); margin-top: -6px; }
.audit-hint { text-align: center; font-size: 18px; font-weight: 600; }

.blue { color: var(--blue); } .green { color: var(--green); } .amber { color: var(--amber); } .red { color: var(--red); }

/* ---------- lists ---------- */
.lists {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr 1fr;
    gap: 16px;
}
.audit .lists { grid-template-columns: minmax(0, 900px); }
.col { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.col h2 { margin: 0; font-size: 24px; font-weight: 700; }
.sub { font-size: 16px; color: var(--muted); margin-bottom: 8px; }
.list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-bottom: 1px solid var(--line);
}
.row-main { flex: 1; min-width: 0; }
.tag { font-family: Consolas, "Cascadia Mono", Menlo, monospace; font-size: 15px; display: flex; align-items: center; overflow-wrap: anywhere; }
.dot { flex: none; width: 12px; height: 12px; border-radius: 50%; margin-right: 10px; background: currentColor; }
.dot.blue { color: var(--blue); } .dot.green { color: var(--green); } .dot.amber { color: var(--amber); } .dot.red { color: var(--red); }
.detail { margin-left: 22px; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.count { font-size: 26px; font-weight: 700; }

.foot { font-size: 12px; color: var(--faint); display: flex; gap: 6px; flex-wrap: wrap; }
.foot a { color: var(--blue); }
.signout {
    font: inherit;
    font-size: 14px;
    color: var(--blue);
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2px 10px;
    margin-left: 4px;
    cursor: pointer;
}

/* ---------- sign-in screen ---------- */
.signin { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.signin-box { width: min(480px, 100%); text-align: center; }
.signin-box h1 { font-size: 44px; margin: 0 0 12px; }
.signin-text { font-size: 22px; color: var(--muted); margin: 0 0 28px; }
.signin-text b { color: var(--text); }
.google-button { display: flex; justify-content: center; min-height: 44px; }
.signin-error { font-size: 19px; color: var(--red); margin: 22px 0 0; }
.signin-hint { font-size: 16px; color: var(--faint); margin: 28px 0 0; }

/* ---------- drag & drop ---------- */
.drop-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(13, 17, 23, .88);
    border: 6px dashed var(--blue);
    align-items: center;
    justify-content: center;
}
body.dragging .drop-overlay { display: flex; }
.drop-text { font-size: 40px; font-weight: 700; color: var(--blue); pointer-events: none; }
.drop-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: copy; }

/* ---------- dialogs ---------- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(0, 0, 0, .6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.modal {
    width: min(640px, 100%);
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
}
.modal h3 { margin: 0 0 10px; font-size: 26px; }
.modal-text { font-size: 18px; color: var(--muted); margin: 0 0 18px; }
.modal-buttons { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.modal-buttons .btn { justify-content: flex-start; text-align: left; padding: 11px 16px; }
.field { display: block; font-size: 15px; color: var(--muted); margin-bottom: 14px; }
.field .text {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 8px 10px;
    font: inherit;
    font-size: 20px;
    font-family: Consolas, "Cascadia Mono", Menlo, monospace;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
}
.radios { display: flex; gap: 22px; margin-top: 6px; font-size: 17px; color: var(--text); }
.filename { font-family: Consolas, "Cascadia Mono", Menlo, monospace; font-size: 17px; color: var(--text); margin-top: 4px; overflow-wrap: anywhere; }
.hint { font-size: 14px; color: var(--faint); }

/* ---------- smaller screens: stack the lists and let the page scroll ---------- */
@media (max-width: 1000px) {
    .page { height: auto; min-height: 100vh; padding: 12px 16px; }
    .lists { grid-template-columns: 1fr; }
    .list { max-height: 50vh; }
    .counts.five { grid-template-columns: repeat(3, 1fr); row-gap: 8px; }
    .big { font-size: 36px; }
    .banner-title { font-size: 26px; white-space: normal; }
}

/* ---------- Blazor loading / error UI ---------- */
.loading { display: flex; height: 100vh; align-items: center; justify-content: center; font-size: 24px; color: var(--muted); }
#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 12px 20px;
    background: #B62324;
    color: #fff;
    font-size: 18px;
}
#blazor-error-ui a { color: #fff; font-weight: 700; margin-left: 12px; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 16px; top: 10px; }
#blazor-error-ui .error-reason { margin-top: 6px; font-family: Consolas, monospace; font-size: 13px; white-space: pre-wrap; max-height: 30vh; overflow: auto; }
