/* JuMa — Design-System */
/* Schrift: Manrope + JetBrains Mono */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    /* Warme Neutraltöne */
    --wt-bg:              #F7F6F3;
    --wt-surface:         #FFFFFF;
    --wt-surface-alt:     #F0EEE9;
    --wt-text:            #0E0D0B;
    --wt-text-muted:      #6B6862;
    --wt-text-subtle:     #97938C;
    --wt-border:          rgba(14,13,11,0.08);
    --wt-border-strong:   rgba(14,13,11,0.14);
    --wt-shadow-sm:       0 1px 2px rgba(14,13,11,0.04);
    --wt-shadow-md:       0 4px 14px rgba(14,13,11,0.06), 0 1px 2px rgba(14,13,11,0.04);
    --wt-shadow-lg:       0 12px 40px rgba(14,13,11,0.10), 0 2px 6px rgba(14,13,11,0.04);

    /* Feuerrot — Hauptakzent */
    --wt-red:             #D4263A;
    --wt-red-hover:       #BE1F32;
    --wt-red-soft:        #FBE7EA;
    --wt-red-tint:        rgba(212,38,58,0.08);
    --wt-red-ring:        rgba(212,38,58,0.22);

    /* Semantisch */
    --wt-ok:              #1F7A4D;
    --wt-ok-soft:         #E2F1EA;
    --wt-warn:            #B8650F;
    --wt-warn-soft:       #FBEEDC;

    /* Radien */
    --wt-r-sm:   8px;
    --wt-r-md:   12px;
    --wt-r-lg:   16px;
    --wt-r-xl:   22px;
    --wt-r-pill: 999px;

    /* Abstände */
    --wt-space-xs:  0.25rem;
    --wt-space-sm:  0.5rem;
    --wt-space-md:  1rem;
    --wt-space-lg:  1.5rem;
    --wt-space-xl:  2rem;
}

/* Dark Mode */
[data-theme="dark"] {
    --wt-bg:              #0B0A09;
    --wt-surface:         #161513;
    --wt-surface-alt:     #1F1D1A;
    --wt-text:            #F4F2EE;
    --wt-text-muted:      #A29D94;
    --wt-text-subtle:     #6E6A62;
    --wt-border:          rgba(255,250,240,0.08);
    --wt-border-strong:   rgba(255,250,240,0.16);
    --wt-shadow-sm:       0 1px 2px rgba(0,0,0,0.4);
    --wt-shadow-md:       0 4px 14px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
    --wt-shadow-lg:       0 12px 40px rgba(0,0,0,0.5), 0 2px 6px rgba(0,0,0,0.3);
    --wt-red:             #E84656;
    --wt-red-hover:       #F25664;
    --wt-red-soft:        #2A1217;
    --wt-red-tint:        rgba(232,70,86,0.12);
    --wt-red-ring:        rgba(232,70,86,0.32);
    --wt-ok:              #58C18C;
    --wt-ok-soft:         #11261C;
    --wt-warn:            #E6A256;
    --wt-warn-soft:       #2A1F11;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, h4, p, ul, ol, li, form, input, textarea, button, select { margin: 0; padding: 0; }
ul, ol { list-style: none; }

/* ---- Body ---- */
.wt_body {
    font-family: 'Manrope', system-ui, -apple-system, sans-serif;
    font-size: 16px;
    color: var(--wt-text);
    background: var(--wt-bg);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.wt_mono {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-feature-settings: 'tnum' 1, 'zero' 1;
}

/* ---- Typografie ---- */
.wt_eyebrow {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: var(--wt-text-subtle);
}
.wt_h1 { font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; }
.wt_h2 { font-size: 20px; line-height: 1.2;  font-weight: 700; letter-spacing: -0.015em; }
.wt_h3 { font-size: 15px; line-height: 1.3;  font-weight: 600; letter-spacing: -0.005em; }
.wt_body-text { font-size: 14.5px; line-height: 1.45; color: var(--wt-text-muted); }
.wt_caption   { font-size: 12px; line-height: 1.4; color: var(--wt-text-subtle); }

/* ---- Cards ---- */
.wt_card {
    background: var(--wt-surface);
    border: 1px solid var(--wt-border);
    border-radius: var(--wt-r-lg);
    box-shadow: var(--wt-shadow-sm);
}
.wt_card--hidden { display: none !important; }

/* ---- List rows ---- */
.wt_row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--wt-border);
}
.wt_row:last-child { border-bottom: 0; }
.wt_row__label { font-size: 14.5px; font-weight: 600; letter-spacing: -0.005em; }
.wt_row__sub   { font-size: 12px; color: var(--wt-text-subtle); font-weight: 500; margin-top: 2px; }

/* ---- Buttons ---- */
.wt_btn {
    appearance: none;
    border: 0;
    font-family: inherit;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.005em;
    border-radius: var(--wt-r-md);
    padding: 0 18px;
    height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: transform 80ms ease, background 120ms ease, box-shadow 120ms ease;
}
.wt_btn:active   { transform: scale(0.985); }
.wt_btn:disabled { opacity: .5; cursor: not-allowed; }

.wt_btn--primary {
    background: var(--wt-red);
    color: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.18);
}
.wt_btn--primary:hover:not(:disabled) { background: var(--wt-red-hover); }

.wt_btn--ghost {
    background: var(--wt-surface);
    color: var(--wt-text);
    border: 1px solid var(--wt-border-strong);
}
.wt_btn--ghost:hover:not(:disabled) { background: var(--wt-surface-alt); }

.wt_btn--text {
    background: transparent;
    color: var(--wt-red);
    height: 40px;
    padding: 0 12px;
    border: 0;
}

.wt_btn--block { width: 100%; }
.wt_btn--lg    { height: 56px; font-size: 16px; }
.wt_btn--sm    { height: 36px; font-size: 13px; padding: 0 12px; }

/* ---- Formulare ---- */
.wt_input, .wt_textarea, .wt_select {
    font-family: inherit;
    font-size: 14px;
    color: var(--wt-text);
    background: var(--wt-surface);
    border: 1px solid var(--wt-border-strong);
    border-radius: var(--wt-r-md);
    padding: 10px 14px;
    width: 100%;
    outline: none;
    transition: border-color .15s;
}
.wt_input:focus, .wt_textarea:focus { border-color: var(--wt-red); }
.wt_textarea { resize: vertical; line-height: 1.4; }
.wt_label    { font-size: 12px; font-weight: 700; color: var(--wt-text-subtle); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 6px; display: block; }

/* ---- Alerts ---- */
.wt_alert {
    padding: 10px 14px;
    border-radius: var(--wt-r-md);
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: var(--wt-space-md);
}
.wt_alert--error   { background: var(--wt-red-soft);  color: var(--wt-red);  border-left: 3px solid var(--wt-red); }
.wt_alert--success { background: var(--wt-ok-soft);   color: var(--wt-ok);   border-left: 3px solid var(--wt-ok); }
.wt_alert--warning { background: var(--wt-warn-soft); color: var(--wt-warn); border-left: 3px solid var(--wt-warn); }
.wt_alert--info    { background: var(--wt-surface-alt); color: var(--wt-text-muted); border-left: 3px solid var(--wt-border-strong); }

/* ---- Badges / Pills ---- */
.wt_badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--wt-r-pill);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.wt_badge--red    { background: var(--wt-red-tint); color: var(--wt-red); }
.wt_badge--ok     { background: var(--wt-ok-soft);  color: var(--wt-ok); }
.wt_badge--warn   { background: var(--wt-warn-soft);color: var(--wt-warn); }
.wt_badge--muted  { background: var(--wt-surface-alt); color: var(--wt-text-subtle); }

/* ---- Divider ---- */
.wt_divider { height: 1px; background: var(--wt-border); }

/* ---- Tabellen (Admin) ---- */
.wt_table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
.wt_table th, .wt_table td {
    padding: 11px 14px;
    text-align: left;
    border-bottom: 1px solid var(--wt-border);
}
.wt_table th {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--wt-text-subtle);
    background: var(--wt-surface-alt);
}
.wt_table tr:hover td { background: rgba(212,38,58,0.03); }
.wt_table .wt_mono    { font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 600; }

/* ---- Fortschrittsbalken ---- */
.wt_progress-track {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.wt_progress-step {
    flex: 1;
    height: 3px;
    border-radius: var(--wt-r-pill);
    background: var(--wt-border-strong);
    transition: background 200ms ease;
}
.wt_progress-step--active { background: var(--wt-red); }
.wt_progress-step--done   { background: var(--wt-text); }

/* ---- Stepper ---- */
.wt_stepper {
    display: inline-flex;
    align-items: center;
    background: var(--wt-surface-alt);
    border-radius: var(--wt-r-pill);
    padding: 3px;
}
.wt_stepper__btn {
    width: 32px; height: 32px;
    border: 0; background: transparent;
    font-size: 18px; font-weight: 600;
    color: var(--wt-text);
    border-radius: var(--wt-r-pill);
    cursor: pointer;
    font-family: inherit;
}
.wt_stepper__btn:hover:not(:disabled) { background: var(--wt-surface); }
.wt_stepper__btn:disabled { color: var(--wt-text-subtle); cursor: not-allowed; }
.wt_stepper__val {
    min-width: 36px;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 15px;
}

/* ---- Animations ---- */
.wt_fade-in  { animation: wtFadeIn 220ms ease-out; }
.wt_slide-in { animation: wtSlideIn 280ms cubic-bezier(0.4,0,0.2,1); }

@keyframes wtFadeIn  { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }
@keyframes wtSlideIn { from { opacity:0; transform:translateX(20px); } to { opacity:1; transform:none; } }

/* ---- Sync Overlay ---- */
.wt_sync-overlay {
    position: fixed;
    inset: 0;
    background: rgba(247,246,243,0.9);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 200;
    animation: wtFadeIn 200ms ease-out;
}
[data-theme="dark"] .wt_sync-overlay { background: rgba(11,10,9,0.9); }

.wt_sync-spinner {
    width: 56px; height: 56px;
    border: 3px solid var(--wt-border-strong);
    border-top-color: var(--wt-red);
    border-radius: 50%;
    animation: wtSpin 0.9s linear infinite;
}
@keyframes wtSpin { to { transform: rotate(360deg); } }

.wt_sync-check {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--wt-ok);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: wtPop 280ms cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes wtPop { from { transform:scale(0.4); opacity:0; } to { transform:scale(1); opacity:1; } }

/* ---- Seiten-Wrapper (zentriert, max-width) ---- */
.wt_page-wrap {
    max-width: 480px;
    margin: 0 auto;
    padding: var(--wt-space-xl) var(--wt-space-lg);
}

/* ---- Bewertungs-App: List rows ---- */
.wt_list-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--wt-border);
}
.wt_list-row:last-child { border-bottom: 0; }

.wt_row-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--wt-border);
}
.wt_row-line:last-child { border-bottom: 0; }
.wt_row-label { font-size: 14.5px; font-weight: 600; letter-spacing: -0.005em; }
.wt_row-sub   { font-size: 12px; color: var(--wt-text-subtle); font-weight: 500; margin-top: 2px; }

/* ---- Bewertungs-App: Sync-Dot ---- */
.wt_pulse { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.wt_pulse--online  { background: var(--wt-ok); animation: wtPulse 2.4s ease-in-out infinite; }
.wt_pulse--offline { background: var(--wt-warn); }
.wt_dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.25);
    flex-shrink: 0;
}
.wt_sep { width: 3px; height: 3px; border-radius: 50%; background: var(--wt-border-strong); display: inline-block; flex-shrink: 0; }

/* ---- Bewertungs-App: Check-Toggle OK/Fehler ---- */
.wt_check-toggle__ok,
.wt_check-toggle__fail {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 6px 12px;
    border-radius: var(--wt-r-pill);
    font-family: inherit;
    font-weight: 600;
    font-size: 12px;
    color: var(--wt-text-muted);
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease;
}
.wt_check-toggle__ok--active   { background: var(--wt-ok);  color: #fff; }
.wt_check-toggle__fail--active { background: var(--wt-red); color: #fff; }

/* ---- Bewertungs-App: Weitere Pills & Buttons ---- */
.wt_total-pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px;
    border-radius: var(--wt-r-pill);
    background: var(--wt-red-tint);
    color: var(--wt-red);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.wt_btn--dark { background: var(--wt-text); color: var(--wt-bg); }

/* ---- Flash-Nachrichten ---- */
.wt_flash {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    min-width: 260px;
    text-align: center;
    animation: wtFadeIn 200ms ease-out;
}

/* ---- Gruppen-Karte ---- */
.wt_group-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px; height: 44px;
    padding: 0 10px;
    border-radius: 12px;
    background: var(--wt-red-tint);
    color: var(--wt-red);
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px;
    font-weight: 600;
    flex-shrink: 0;
}
.wt_group-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    color: var(--wt-text-subtle);
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.02em;
    margin-top: 2px;
    flex-wrap: wrap;
}
.wt_group-meta__sep {
    width: 3px; height: 3px;
    border-radius: 50%;
    background: var(--wt-border-strong);
    flex-shrink: 0;
}

/* ---- Station-Chip ---- */
.wt_station-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 30px;
    padding: 0 12px 0 10px;
    border-radius: var(--wt-r-pill);
    background: var(--wt-red);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.18);
}
.wt_station-chip__dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.25);
}

/* ---- Sync-Pill ---- */
.wt_sync-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 26px;
    padding: 0 10px;
    border-radius: var(--wt-r-pill);
    background: var(--wt-surface);
    border: 1px solid var(--wt-border);
    font-size: 11px;
    font-weight: 600;
    color: var(--wt-text-muted);
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.02em;
}
.wt_sync-pill__dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--wt-ok);
}
.wt_sync-pill__dot--offline { background: var(--wt-warn); }
.wt_sync-pill__dot--online  { animation: wtPulse 2.4s ease-in-out infinite; }
@keyframes wtPulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(31,122,77,0); }
    50%      { box-shadow: 0 0 0 6px rgba(31,122,77,0.25); }
}

/* ---- Check-Toggle ---- */
.wt_check-toggle {
    display: inline-flex;
    background: var(--wt-surface-alt);
    border-radius: var(--wt-r-pill);
    padding: 3px;
    gap: 0;
}
.wt_check-toggle__btn {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 6px 12px;
    border-radius: var(--wt-r-pill);
    color: var(--wt-text-muted);
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 12px;
    transition: background 120ms ease, color 120ms ease;
}
.wt_check-toggle__btn--ok.wt_check-toggle__btn--active   { background: var(--wt-ok);  color: #fff; }
.wt_check-toggle__btn--fail.wt_check-toggle__btn--active { background: var(--wt-red); color: #fff; }

/* ---- Fehlerpunkte-Gesamtanzeige ---- */
.wt_fp-total {
    font-family: 'JetBrains Mono', monospace;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #fff;
}

/* ---- QR-Viewfinder ---- */
.wt_viewfinder {
    position: relative;
    aspect-ratio: 1;
    border-radius: 24px;
    overflow: hidden;
    background:
        radial-gradient(ellipse 60% 60% at 50% 50%, rgba(0,0,0,0), rgba(0,0,0,0.45)),
        repeating-linear-gradient(135deg, #1a1816 0 12px, #1f1d1a 12px 24px);
}
.wt_viewfinder__corner {
    position: absolute;
    width: 36px; height: 36px;
    border: 3px solid #fff;
    border-radius: 6px;
}
.wt_viewfinder__corner--tl { top:14%;    left:14%;  border-right:0; border-bottom:0; border-top-left-radius:12px; }
.wt_viewfinder__corner--tr { top:14%;    right:14%; border-left:0;  border-bottom:0; border-top-right-radius:12px; }
.wt_viewfinder__corner--bl { bottom:14%; left:14%;  border-right:0; border-top:0;    border-bottom-left-radius:12px; }
.wt_viewfinder__corner--br { bottom:14%; right:14%; border-left:0;  border-top:0;    border-bottom-right-radius:12px; }
.wt_viewfinder__scanline {
    position: absolute;
    left:14%; right:14%; top:14%;
    height: 2px;
    background: linear-gradient(to right, transparent, #fff, transparent);
    box-shadow: 0 0 16px rgba(255,255,255,0.6);
    animation: wtScan 2.4s ease-in-out infinite;
}
@keyframes wtScan {
    0%,100% { transform:translateY(0);    opacity:0.9; }
    50%      { transform:translateY(280%); opacity:0.95; }
}
.wt_viewfinder__success {
    position: absolute;
    inset: 0;
    background: rgba(31,122,77,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
}
