/* ============================================================
   NumisTrack Theme – aufbauend auf Bootstrap 5.3
   Konzept: "Archiv & Münzgold" – Tinte-Dunkelblau, Münzgold,
   warmes Papierweiss. Schrift: Inter (lokal gebundelt).
   ============================================================ */

/* ---------- Schrift (lokal, kein CDN) ---------- */

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('vendor/fonts/inter-latin-400.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('vendor/fonts/inter-latin-500.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('vendor/fonts/inter-latin-600.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('vendor/fonts/inter-latin-700.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url('vendor/fonts/inter-latin-800.woff2') format('woff2');
}

/* ---------- Design-Token ---------- */

:root {
    --nt-ink: #1a2632;          /* Tinte – Navbar, Primär-Buttons */
    --nt-ink-hover: #223244;
    --nt-gold: #b8912e;         /* Münzgold – Akzente, CTA */
    --nt-gold-hover: #a37f24;
    --nt-gold-soft: #f4ead0;    /* Gold-Hauch für Hover/Hintergründe */
    --nt-paper: #f4f2ec;        /* warmes Papierweiss – Seitenhintergrund */
    --nt-surface: #ffffff;
    --nt-line: #e7e3d8;

    /* Bootstrap-Grundwerte übersteuern */
    --bs-body-font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    --bs-body-bg: var(--nt-paper);
    --bs-body-color: #232c35;
    --bs-border-color: var(--nt-line);
    --bs-border-radius: .625rem;
    --bs-border-radius-sm: .5rem;
    --bs-border-radius-lg: .875rem;
    --bs-link-color-rgb: 26, 38, 50;
    --bs-link-hover-color-rgb: 184, 145, 46;
}

body {
    font-optical-sizing: auto;
    letter-spacing: .005em;
}

h1, h2, h3, h4, .fw-bold, .fw-semibold {
    letter-spacing: -.015em;
}

/* Zahlen in Tabellen/Statistiken sauber untereinander */
.text-end, .stat-value {
    font-variant-numeric: tabular-nums;
}

/* ---------- Navbar ---------- */

.navbar-nt {
    background: var(--nt-ink);
    border-bottom: 3px solid var(--nt-gold);
}
.navbar-nt .navbar-brand {
    display: flex;
    align-items: center;
    gap: .55rem;
    font-weight: 800;
    letter-spacing: -.02em;
    color: #fff;
}
.navbar-nt .brand-mark { color: var(--nt-gold); flex-shrink: 0; }
.navbar-nt .nav-link {
    color: rgba(255, 255, 255, .72);
    font-weight: 500;
    padding: .55rem .9rem;
    border-radius: .5rem;
}
.navbar-nt .nav-link:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.navbar-nt .nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, .12);
    font-weight: 700;
}
.navbar-nt .nav-logout { color: rgba(255, 255, 255, .45); }
.navbar-nt .nav-logout:hover { color: #fff; }

/* ---------- Buttons ---------- */

.btn { font-weight: 600; }

.btn-primary {
    --bs-btn-bg: var(--nt-ink);
    --bs-btn-border-color: var(--nt-ink);
    --bs-btn-hover-bg: var(--nt-ink-hover);
    --bs-btn-hover-border-color: var(--nt-ink-hover);
    --bs-btn-active-bg: var(--nt-ink-hover);
    --bs-btn-active-border-color: var(--nt-ink-hover);
    --bs-btn-focus-shadow-rgb: 26, 38, 50;
}

/* Gold-CTA für die wichtigste Aktion pro Seite */
.btn-accent {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--nt-gold);
    --bs-btn-border-color: var(--nt-gold);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--nt-gold-hover);
    --bs-btn-hover-border-color: var(--nt-gold-hover);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--nt-gold-hover);
    --bs-btn-active-border-color: var(--nt-gold-hover);
    --bs-btn-focus-shadow-rgb: 184, 145, 46;
}

.btn-outline-secondary {
    --bs-btn-color: #5b6672;
    --bs-btn-border-color: #cfc9bb;
    --bs-btn-hover-bg: #efece3;
    --bs-btn-hover-color: #232c35;
    --bs-btn-hover-border-color: #cfc9bb;
    --bs-btn-active-bg: #efece3;
    --bs-btn-active-color: #232c35;
    --bs-btn-active-border-color: #cfc9bb;
}

/* ---------- Cards ---------- */

.card {
    --bs-card-border-color: var(--nt-line);
    box-shadow: 0 1px 2px rgba(26, 38, 50, .05), 0 6px 20px rgba(26, 38, 50, .05);
}
.card.shadow-sm, .card.shadow { box-shadow: 0 1px 2px rgba(26, 38, 50, .05), 0 6px 20px rgba(26, 38, 50, .05) !important; }

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--nt-ink);
    line-height: 1.2;
}
.stat-card .stat-label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: #8a8272;
    margin-top: .15rem;
}
.stat-card { border-top: 3px solid var(--nt-gold); }

/* ---------- Tabelle ---------- */

.table {
    --bs-table-hover-bg: #faf7ef;
}
.table thead.thead-nt th {
    background: #f1eee6;
    color: #6d6552;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    border-bottom: 2px solid var(--nt-line);
    white-space: nowrap;
}
.table td { border-color: #efece4; }

.coin-link { color: var(--nt-ink); text-decoration: none; font-weight: 700; }
.coin-link:hover { color: var(--nt-gold-hover); }

/* Badges dezenter (weiche Flächen statt Vollfarbe) */
.badge.text-bg-success  { background: #e2f2e6 !important; color: #22713d !important; }
.badge.text-bg-warning  { background: #f7ecd2 !important; color: #8a6416 !important; }
.badge.text-bg-danger   { background: #f9e3e0 !important; color: #a13327 !important; }
.badge.text-bg-secondary{ background: #ecebe6 !important; color: #7a7668 !important; }
.badge { font-weight: 600; letter-spacing: .01em; }

/* ---------- Formulare ---------- */

.form-control, .form-select {
    border-color: #d7d2c4;
}
.form-control:focus, .form-select:focus {
    border-color: var(--nt-gold);
    box-shadow: 0 0 0 .25rem rgba(184, 145, 46, .18);
}
.form-label { font-weight: 600; color: #4d5762; }

/* ---------- Bilder ---------- */

.thumbnail {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--nt-line);
    display: block;
    background: var(--bs-secondary-bg);
}
.img-cell { width: 64px; }

.coin-photo {
    max-height: 380px;
    object-fit: contain;
    background: #f3f1ea;
}

kbd {
    font-family: inherit;
    font-size: .78em;
    background: rgba(0, 0, 0, .35);
    border-radius: .3rem;
    padding: .1em .45em;
}

/* ---------- Login ---------- */

.login-bg {
    background:
        radial-gradient(ellipse 70% 55% at 50% -10%, rgba(184, 145, 46, .22), transparent),
        linear-gradient(165deg, #1a2632 0%, #101922 100%);
}
.login-card { width: min(430px, 92vw); border: none; }
.login-card .brand-mark { color: var(--nt-gold); }

/* ============================================================
   Schnellerfassung (dunkle Seite, data-bs-theme="dark")
   ============================================================ */

[data-bs-theme="dark"] body,
body.capture-body {
    background: #121a23;
}
[data-bs-theme="dark"] .card {
    --bs-card-bg: #1b2530;
    --bs-card-border-color: #2a3644;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .35);
}
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background: #141d26;
    border-color: #33404f;
}
[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    border-color: var(--nt-gold);
    box-shadow: 0 0 0 .25rem rgba(184, 145, 46, .22);
}
[data-bs-theme="dark"] .list-group {
    --bs-list-group-bg: transparent;
    --bs-list-group-border-color: #2a3644;
}

/* Kamera-Bühne */

.camera-stage {
    position: relative;
    overflow: hidden;
    background: black;
    aspect-ratio: 16 / 9;
}
.camera-stage video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.guide-circle {
    position: absolute;
    top: 50%; left: 50%;
    width: min(62%, 62vh);
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    border: 2px dashed rgba(206, 168, 74, .8);
    border-radius: 50%;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, .18);
    cursor: move;
    touch-action: none;   /* Pointer-Events auch auf Touch-Geräten */
}
.flash {
    position: absolute;
    inset: 0;
    background: white;
    opacity: 0;
    pointer-events: none;
    transition: opacity .1s;
}
.flash.on { opacity: .85; }

.step-badge {
    position: absolute;
    top: .8rem; left: .8rem;
    font-weight: 700;
}
.step-badge.step-avers  { background: var(--nt-ink) !important; color: #fff; }
.step-badge.step-revers { background: var(--nt-gold) !important; color: #fff; }

.res-badge {
    position: absolute;
    bottom: .7rem; right: .8rem;
    opacity: .85;
    font-weight: 500;
}
.preview-slot {
    position: absolute;
    bottom: .7rem; left: .8rem;
    display: flex;
    align-items: center;
    gap: .5rem;
    background: rgba(0, 0, 0, .55);
    padding: .35rem .65rem .35rem .35rem;
    border-radius: .5rem;
}
.preview-slot img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: .4rem;
}

/* Sitzungs-Panel */

.session-panel {
    position: sticky;
    top: 76px;
    max-height: calc(100vh - 100px);
}
.session-thumb {
    width: 46px;
    height: 46px;
    object-fit: cover;
    background: var(--bs-secondary-bg);
}
#emptyHint[hidden] { display: none; }

/* Toast */

.toast-simple {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translate(-50%, 20px);
    background: var(--nt-ink);
    color: white;
    padding: .7rem 1.5rem;
    border-radius: 50rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, transform .2s;
    z-index: 1100;
    font-size: .95rem;
    font-weight: 600;
}
.toast-simple.show { opacity: 1; transform: translate(-50%, 0); }
.toast-simple.error { background: #a13327; }

/* ============================================================
   Erfassungs-Wizard: Schritte, Live-Qualität, Waage
   ============================================================ */

/* Schritt-Anzeige */

.wizard-steps {
    display: flex;
    gap: .5rem;
}
.wstep {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .5rem .75rem;
    border-radius: .5rem;
    background: rgba(255, 255, 255, .05);
    color: #77828e;
    font-weight: 600;
    font-size: .9rem;
    border: 1px solid transparent;
}
.wstep .wnum {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.45rem;
    height: 1.45rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
    font-size: .8rem;
    font-weight: 700;
}
.wstep.active {
    background: rgba(184, 145, 46, .16);
    border-color: rgba(184, 145, 46, .5);
    color: #e8d9ae;
}
.wstep.active .wnum { background: var(--nt-gold); color: #fff; }
.wstep.done { color: #7ec492; }
.wstep.done .wnum { background: #2c5d3c; color: #c9ecd3; }

/* Live-Qualitäts-Chips */

.quality-chips {
    position: absolute;
    top: .8rem; right: .8rem;
    display: flex;
    flex-direction: column;
    gap: .35rem;
    align-items: flex-end;
}
.qchip {
    font-size: .74rem;
    font-weight: 600;
    padding: .18rem .6rem;
    border-radius: 50rem;
    background: rgba(0, 0, 0, .55);
    color: #9aa5b1;
}
.qchip.ok   { color: #8fe3a8; }
.qchip.warn { color: #ffb3a7; background: rgba(90, 20, 10, .6); }

.guide-circle.good { border-color: rgba(120, 220, 150, .85); }

/* Waagen-Overlay (Schritt 3) */

.scale-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(10, 15, 21, .82);
    text-align: center;
    padding: 1rem;
}
.scale-overlay[hidden] { display: none; }
.weight-display {
    font-size: 3.2rem;
    font-weight: 800;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
    color: #e8d9ae;
    line-height: 1.1;
    margin-bottom: .35rem;
}

/* ============================================================
   Bericht (Bildschirm + Druck)
   ============================================================ */

.report-wrap { max-width: 920px; }

.report-sheet {
    background: #fff;
    border: 1px solid var(--nt-line);
    border-radius: var(--bs-border-radius-lg);
    box-shadow: 0 1px 2px rgba(26, 38, 50, .05), 0 6px 20px rgba(26, 38, 50, .05);
    padding: 2.2rem 2.4rem;
}

.report-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    border-bottom: 3px solid var(--nt-gold);
    padding-bottom: .9rem;
    margin-bottom: 1.2rem;
}
.report-head .brand-mark { color: var(--nt-gold); }
.report-title {
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--nt-ink);
    line-height: 1.2;
}
.report-meta {
    text-align: right;
    font-size: .8rem;
    color: #6c757d;
    line-height: 1.5;
}

.report-table { font-size: .875rem; }
.report-img {
    width: 46px;
    height: 46px;
    object-fit: cover;
    border-radius: 50%;
    border: 1px solid var(--nt-line);
    background: #f3f1ea;
}
.report-total td {
    border-top: 2px solid var(--nt-ink);
    border-bottom: none;
    font-weight: 700;
    padding-top: .6rem;
}

.report-note {
    margin-top: 1.4rem;
    font-size: .78rem;
    color: #6c757d;
    line-height: 1.6;
}

.sign-row {
    display: flex;
    gap: 3rem;
    margin-top: 3rem;
}
.sign {
    flex: 1;
    border-top: 1px solid var(--nt-ink);
    padding-top: .3rem;
    font-size: .8rem;
    color: #6c757d;
}

@media print {
    @page { margin: 14mm; }
    body { background: #fff !important; }
    .report-wrap { max-width: none; margin: 0 !important; }
    .report-sheet {
        border: none;
        border-radius: 0;
        box-shadow: none !important;
        padding: 0;
    }
    .report-table tr { break-inside: avoid; }
    .report-img { border-radius: 4px; }   /* runde Ausschnitte sparen Druckertinte nicht – dezent eckig */
}

/* ============================================================
   Lightbox (Foto-Grossansicht)
   ============================================================ */

.zoomable { cursor: zoom-in; }

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(10, 15, 21, .92);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox img {
    max-width: 100%;
    max-height: 100%;
    border-radius: .5rem;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
    background: #1b2530;
}
