/* ── Reset & tokens ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    /* ── Campingpark Oase palette ── */
    --yellow:          #F5A800;
    --yellow-dark:     #D48A00;
    --yellow-light:    #FFF3CC;
    --yellow-pale:     #FFFBEE;

    --green:           #2D6A4F;
    --green-dark:      #1B4332;
    --green-mid:       #40916C;
    --green-light:     #D8F3DC;
    --green-pale:      #F0FAF3;

    /* ── Role aliases ── */
    --primary:         var(--green);
    --primary-dark:    var(--green-dark);
    --primary-light:   var(--green-light);
    --primary-pale:    var(--green-pale);
    --accent:          var(--yellow);
    --accent-dark:     var(--yellow-dark);
    --accent-light:    var(--yellow-light);

    --success:         #40916C;
    --danger:          #C0392B;
    --danger-light:    #FDECEA;
    --warning:         #F5A800;
    --info:            #2D6A4F;

    /* ── Surfaces (warm-toned) ── */
    --bg:              #F5F2EA;
    --surface:         #FFFFFF;
    --surface-2:       #EFEBE0;
    --surface-3:       #E8E3D6;

    /* ── Borders & text ── */
    --border:          #DDD6C5;
    --border-dark:     #C8BFA8;
    --text:            #1E1A10;
    --text-muted:      #6B6147;
    --text-light:      #9C9278;

    /* ── Layout ── */
    --sidebar-bg:      #1B4332;   /* separate var so sidebar stays green in dark mode */
    --sidebar-w:       256px;
    --topbar-h:        64px;
    --radius-xs:       4px;
    --radius-sm:       8px;
    --radius:          12px;
    --radius-lg:       18px;
    --radius-xl:       24px;

    /* ── Shadows ── */
    --shadow-xs:  0 1px 2px rgba(30,26,16,.06);
    --shadow-sm:  0 1px 4px rgba(30,26,16,.08), 0 1px 2px rgba(30,26,16,.05);
    --shadow:     0 4px 12px rgba(30,26,16,.10), 0 1px 3px rgba(30,26,16,.07);
    --shadow-md:  0 8px 20px rgba(30,26,16,.12), 0 2px 6px rgba(30,26,16,.07);
    --shadow-lg:  0 16px 40px rgba(30,26,16,.16), 0 4px 12px rgba(30,26,16,.09);

    --transition: .18s ease;
    font-family: 'Nunito', 'Segoe UI', system-ui, sans-serif;
}

body { background: var(--bg); color: var(--text); line-height: 1.55; min-height: 100vh; }

svg  { fill: none; stroke: currentColor; stroke-width: 1.8;
       stroke-linecap: round; stroke-linejoin: round;
       width: 18px; height: 18px; flex-shrink: 0; }

a    { text-decoration: none; color: inherit; }
input, select, button, textarea { font-family: inherit; font-size: inherit; }
button { cursor: pointer; }

/* ── Utilities ──────────────────────────────────────────────────────────── */
.hidden   { display: none !important; }
.sr-only  { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.truncate { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ════════════════════════════════════════════════════════════════════════
   LOGIN
════════════════════════════════════════════════════════════════════════ */
.login-overlay {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
    background: linear-gradient(160deg, var(--green-dark) 0%, var(--green) 55%, var(--green-mid) 100%);
}

/* Decorative nature circles */
.login-overlay::before,
.login-overlay::after {
    content: ''; position: absolute; border-radius: 50%;
    background: rgba(255,255,255,.05); pointer-events: none;
}
.login-overlay::before { width: 500px; height: 500px; top: -120px; right: -80px; }
.login-overlay::after  { width: 320px; height: 320px; bottom: -80px; left: -60px; }

.login-card {
    position: relative; z-index: 1;
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: 2.75rem 2.25rem 2.25rem;
    width: 100%; max-width: 400px;
    box-shadow: var(--shadow-lg);
    animation: slideUp .38s cubic-bezier(.22,.68,0,1.2);
}

.login-logo {
    display: flex; justify-content: center;
    margin-bottom: 1.25rem;
}
.login-logo img {
    height: 80px; width: auto;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,.15));
}

.login-divider {
    display: flex; align-items: center; gap: .75rem;
    margin: 1rem 0 1.5rem;
    color: var(--text-light); font-size: .8125rem;
}
.login-divider::before,
.login-divider::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}

.login-title    { text-align: center; font-size: 1.3rem; font-weight: 800; color: var(--text); margin-bottom: .2rem; }
.login-subtitle { text-align: center; color: var(--text-muted); font-size: .875rem; margin-bottom: 1.5rem; }

/* ════════════════════════════════════════════════════════════════════════
   FORMS
════════════════════════════════════════════════════════════════════════ */
.form-group  { display: flex; flex-direction: column; gap: .375rem; margin-bottom: 1rem; }
.form-label  {
    font-size: .8rem; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .05em;
}
.form-input {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .625rem .9rem;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
    outline: none; width: 100%; background: var(--surface); color: var(--text);
}
.form-input:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(45,106,79,.15);
}
.form-input.changed {
    border-color: var(--success);
    background: var(--green-pale);
}
.form-input.error  { border-color: var(--danger); }

.form-select {
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    padding: .5rem .9rem; outline: none; background: var(--surface); color: var(--text);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B6147' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right .7rem center; background-size: 16px;
    padding-right: 2.2rem;
}
.form-select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(45,106,79,.15); outline: none; }

.form-grid  { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.span-2     { grid-column: span 2; }

.input-wrap { position: relative; }
.input-wrap .form-input { padding-right: 2.6rem; }
.toggle-pw {
    position: absolute; right: .65rem; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: var(--text-muted); padding: 0;
    display: flex; align-items: center; transition: color var(--transition);
}
.toggle-pw:hover { color: var(--green); }

/* Image preview */
.img-preview-wrap { margin-top: .5rem; }
.img-preview {
    width: 80px; height: 80px; border-radius: var(--radius-sm);
    object-fit: cover; border: 2px solid var(--border);
    display: block;
}

/* ════════════════════════════════════════════════════════════════════════
   BUTTONS
════════════════════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex; align-items: center; gap: .5rem;
    border: none; border-radius: var(--radius-sm);
    padding: .5625rem 1.1rem;
    font-size: .875rem; font-weight: 700;
    transition: all var(--transition); white-space: nowrap;
    letter-spacing: .01em;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }

.btn-primary {
    background: var(--green); color: #fff;
    box-shadow: 0 2px 6px rgba(45,106,79,.35);
}
.btn-primary:hover:not(:disabled) {
    background: var(--green-dark);
    box-shadow: 0 4px 12px rgba(45,106,79,.45);
    transform: translateY(-1px);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); }

.btn-accent {
    background: var(--yellow); color: var(--green-dark);
    box-shadow: 0 2px 6px rgba(245,168,0,.4);
}
.btn-accent:hover:not(:disabled) {
    background: var(--yellow-dark); color: #fff;
    box-shadow: 0 4px 12px rgba(245,168,0,.5);
    transform: translateY(-1px);
}

.btn-danger  { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled)  { background: #a93226; transform: translateY(-1px); }

.btn-ghost   { background: transparent; color: var(--text-muted); border: 1.5px solid var(--border); }
.btn-ghost:hover:not(:disabled)   { background: var(--surface-2); color: var(--text); border-color: var(--border-dark); }

.btn-outline-green {
    background: transparent; color: var(--green);
    border: 1.5px solid var(--green);
}
.btn-outline-green:hover:not(:disabled) { background: var(--green); color: #fff; }

.btn-sm    { padding: .375rem .8rem; font-size: .8125rem; }
.btn-icon  { padding: .5rem; border-radius: var(--radius-sm); border: none; }
.btn-icon.btn-ghost { border: 1.5px solid var(--border); }
.btn-full  { width: 100%; justify-content: center; padding: .8rem; font-size: .9375rem; }

.btn-spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff; border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin     { to { transform: rotate(360deg); } }
@keyframes slideUp  { from { opacity:0; transform:translateY(28px); } to { opacity:1; transform:none; } }
@keyframes fadeIn   { from { opacity:0; } to { opacity:1; } }
@keyframes popIn    { from { opacity:0; transform:scale(.94); } to { opacity:1; transform:scale(1); } }
@keyframes slideInRight { from { opacity:0; transform:translateX(20px); } to { opacity:1; transform:none; } }

/* ════════════════════════════════════════════════════════════════════════
   ALERTS & BADGES
════════════════════════════════════════════════════════════════════════ */
.alert {
    padding: .625rem .9rem; border-radius: var(--radius-sm);
    font-size: .875rem; margin-bottom: 1rem;
    display: flex; align-items: flex-start; gap: .5rem;
}
.alert-error   { background: var(--danger-light); color: #7B241C; border: 1px solid #F1948A; }
.alert-success { background: var(--green-light);  color: var(--green-dark); border: 1px solid #95DEB5; }
.alert-info    { background: var(--yellow-light);  color: #7D5800; border: 1px solid #F5C842; }

.badge {
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 20px; font-size: .72rem; font-weight: 700;
    padding: 2px 8px; white-space: nowrap;
}
.badge-important { background: var(--yellow-light); color: #7D5800; }
.badge-green     { background: var(--green-light);  color: var(--green-dark); }
.badge-red       { background: var(--danger-light); color: #7B241C; }
.badge-gray      { background: var(--surface-2);    color: var(--text-muted); }

/* ════════════════════════════════════════════════════════════════════════
   TOGGLE SWITCH
════════════════════════════════════════════════════════════════════════ */
.toggle-label { display: flex; align-items: center; gap: .625rem; cursor: pointer; user-select: none; font-size: .9rem; }
.toggle-input { display: none; }
.toggle-track {
    width: 42px; height: 24px; background: var(--border); border-radius: 12px;
    position: relative; transition: background var(--transition); flex-shrink: 0;
}
.toggle-track::after {
    content: ''; position: absolute; top: 3px; left: 3px;
    width: 18px; height: 18px; border-radius: 50%; background: #fff;
    transition: transform var(--transition); box-shadow: var(--shadow-xs);
}
.toggle-input:checked + .toggle-track { background: var(--green); }
.toggle-input:checked + .toggle-track::after { transform: translateX(18px); }

/* ════════════════════════════════════════════════════════════════════════
   CHIPS
════════════════════════════════════════════════════════════════════════ */
.filter-chips { display: flex; gap: .375rem; flex-wrap: wrap; }
.chip {
    padding: .375rem .9rem; border-radius: 20px;
    border: 1.5px solid var(--border);
    background: var(--surface); color: var(--text-muted);
    font-size: .8125rem; font-weight: 700;
    transition: all var(--transition);
}
.chip:hover  { border-color: var(--green); color: var(--green); }
.chip.active { background: var(--green); border-color: var(--green); color: #fff; box-shadow: 0 2px 6px rgba(45,106,79,.3); }
.chip.accent-chip.active { background: var(--yellow); border-color: var(--yellow); color: var(--green-dark); }

/* ════════════════════════════════════════════════════════════════════════
   APP SHELL
════════════════════════════════════════════════════════════════════════ */
.app-shell { display: flex; height: 100vh; overflow: hidden; }

/* ── Sidebar ─────────────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    display: flex; flex-direction: column;
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
    transition: transform var(--transition);
    box-shadow: 2px 0 12px rgba(0,0,0,.15);
}

.sidebar-brand {
    display: flex; align-items: center; justify-content: center;
    padding: 1.25rem 1rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,.12);
}
.sidebar-brand img {
    height: 68px; width: auto;
    filter: brightness(0) invert(1) drop-shadow(0 1px 3px rgba(0,0,0,.3));
}

.sidebar-section-label {
    font-size: .7rem; font-weight: 800; letter-spacing: .1em;
    text-transform: uppercase; color: rgba(255,255,255,.55);
    padding: .875rem 1rem .375rem;
}

.sidebar-nav { flex: 1; padding: .5rem .625rem; display: flex; flex-direction: column; gap: .2rem; overflow-y: auto; }

.nav-item {
    display: flex; align-items: center; gap: .75rem;
    padding: .625rem .875rem; border-radius: var(--radius-sm);
    color: rgba(255,255,255,.82); font-size: .875rem; font-weight: 600;
    transition: all var(--transition);
}
.nav-item svg { stroke: rgba(255,255,255,.70); transition: stroke var(--transition); }
.nav-item:hover { background: rgba(255,255,255,.12); color: #fff; }
.nav-item:hover svg { stroke: #fff; }
.nav-item.active {
    background: var(--yellow);
    color: #1B4332; /* hardcoded — var(--green-dark) becomes light in dark mode */
    box-shadow: 0 2px 8px rgba(245,168,0,.4);
}
.nav-item.active svg { stroke: #1B4332; }

.sidebar-footer {
    padding: .875rem 1rem; border-top: 1px solid rgba(255,255,255,.12);
    display: flex; align-items: center; gap: .5rem;
}
.user-pill { display: flex; align-items: center; gap: .625rem; flex: 1; min-width: 0; }
.user-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--yellow); color: var(--green-dark);
    display: flex; align-items: center; justify-content: center;
    font-size: .875rem; font-weight: 800; flex-shrink: 0;
}
.user-info   { min-width: 0; }
.user-name   { display: block; font-size: .8125rem; font-weight: 700; color: #fff; }
.user-role   { display: block; font-size: .72rem; color: rgba(255,255,255,.65); text-transform: capitalize; }
.btn-logout, .btn-pw {
    background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
    color: rgba(255,255,255,.7); border-radius: var(--radius-sm);
    padding: .45rem; display: flex; align-items: center;
    transition: all var(--transition); flex-shrink: 0;
}
.btn-logout:hover, .btn-pw:hover { background: rgba(255,255,255,.2); color: #fff; }
.btn-logout svg, .btn-pw svg { width: 15px; height: 15px; }

/* ── Theme switcher ─────────────────────────────────────────────────────── */
.theme-switcher {
    display: flex; align-items: center;
    background: rgba(0,0,0,.22); border-radius: 20px;
    padding: 3px; margin: 0 .75rem .5rem;
}
.theme-btn {
    flex: 1; background: transparent; border: none; border-radius: 18px;
    padding: .4rem .3rem;
    color: rgba(255,255,255,.45);
    display: flex; align-items: center; justify-content: center;
    transition: all .15s ease; cursor: pointer; gap: .3rem;
}
.theme-btn:hover { color: rgba(255,255,255,.82); }
.theme-btn.active {
    background: rgba(255,255,255,.18);
    color: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.theme-btn svg { width: 13px; height: 13px; }
.theme-btn-label { font-size: .65rem; font-weight: 700; line-height: 1; white-space: nowrap; }

/* Sidebar version label */
.sidebar-version {
    padding: .25rem 1rem .5rem;
    font-size: .67rem; letter-spacing: .03em;
    color: rgba(255,255,255,.3);
    text-align: center;
}

/* ── Main content ────────────────────────────────────────────────────── */
.main-content {
    flex: 1; margin-left: var(--sidebar-w);
    display: flex; flex-direction: column;
    height: 100vh;          /* feste Höhe = einziger vertikaler Scroll-Container */
    overflow-y: auto;       /* main-content scrollt, nicht body */
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* ── Topbar ──────────────────────────────────────────────────────────── */
.topbar {
    height: var(--topbar-h); background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 1rem;
    padding: 0 1.5rem; position: sticky; top: 0; z-index: 50;
    box-shadow: var(--shadow-xs);
}
.topbar-title { font-size: 1.05rem; font-weight: 800; flex: 1; color: var(--text); }
.topbar-badge {
    display: inline-flex; align-items: center; gap: .375rem;
    background: var(--yellow-light); color: var(--yellow-dark);
    border: 1px solid #F5C842; border-radius: 20px;
    font-size: .78rem; font-weight: 700; padding: .25rem .75rem;
}
.topbar-badge svg { width: 13px; height: 13px; stroke: var(--yellow-dark); }
.topbar-actions { display: flex; gap: .5rem; align-items: center; }
.sidebar-toggle { display: none; }

/* Season toggle in topbar */
.season-toggle {
    display: flex; align-items: center; background: var(--surface-2);
    border-radius: 20px; padding: 3px; gap: 2px;
    border: 1.5px solid var(--border);
}
.season-btn {
    padding: .3rem .85rem; border-radius: 16px; border: none;
    font-size: .8rem; font-weight: 700; transition: all var(--transition);
    background: transparent; color: var(--text-muted);
}
.season-btn.active {
    background: var(--green); color: #fff;
    box-shadow: 0 1px 4px rgba(45,106,79,.35);
}

/* ── Dashboard stats bar ─────────────────────────────────────────────── */
.stats-bar {
    display: flex; gap: 1rem; flex-wrap: wrap;
    padding: 1rem 1.5rem 0;
}
.stat-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: .875rem 1.25rem;
    display: flex; align-items: center; gap: .875rem;
    flex: 1; min-width: 160px; box-shadow: var(--shadow-xs);
    transition: box-shadow var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-sm); }
.stat-icon {
    width: 42px; height: 42px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stat-icon svg { width: 20px; height: 20px; }
.stat-icon--green  { background: var(--green-light);  }
.stat-icon--green svg  { stroke: var(--green); }
.stat-icon--yellow { background: var(--yellow-light); }
.stat-icon--yellow svg { stroke: var(--yellow-dark); }
.stat-icon--red    { background: var(--danger-light); }
.stat-icon--red svg    { stroke: var(--danger); }
.stat-info  { min-width: 0; }
.stat-value { font-size: 1.4rem; font-weight: 800; line-height: 1.1; color: var(--text); }
.stat-label { font-size: .78rem; color: var(--text-muted); font-weight: 600; margin-top: .1rem; }

/* ── Tab panels ──────────────────────────────────────────────────────── */
.tab-panel { display: none; flex-direction: column; gap: 1rem; padding: 1rem 1.5rem 2rem; animation: fadeIn .2s ease; }
.tab-panel.active { display: flex; }

/* ── Toolbar ─────────────────────────────────────────────────────────── */
.panel-toolbar {
    display: flex; align-items: center; gap: .875rem; flex-wrap: wrap;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: .875rem 1.125rem;
    box-shadow: var(--shadow-xs);
}
.toolbar-left  { display: flex; align-items: center; gap: .75rem; flex: 1; flex-wrap: wrap; }
.toolbar-right { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.filter-group  { display: flex; align-items: center; gap: .5rem; }
.filter-label  { font-size: .78rem; font-weight: 700; color: var(--text-muted); white-space: nowrap; text-transform: uppercase; letter-spacing: .04em; }

/* Search input */
.search-input-wrap { position: relative; }
.search-input-wrap svg {
    position: absolute; left: .7rem; top: 50%; transform: translateY(-50%);
    width: 14px; height: 14px; stroke: var(--text-muted); pointer-events: none;
}
.search-input {
    border: 1.5px solid var(--border); border-radius: 20px;
    padding: .4rem .8rem .4rem 2.1rem;
    font-size: .8125rem; outline: none; background: var(--bg);
    width: 190px; transition: all var(--transition); color: var(--text);
}
.search-input:focus { border-color: var(--green); background: var(--surface); box-shadow: 0 0 0 3px rgba(45,106,79,.12); width: 220px; }

/* ── Status bar ──────────────────────────────────────────────────────── */
.status-bar {
    display: flex; align-items: center; gap: .5rem;
    font-size: .8rem; color: var(--text-muted); font-weight: 600;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: .5rem 1rem;
}
.status-dot {
    width: 8px; height: 8px; border-radius: 50%; background: var(--success); flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(64,145,108,.2);
}

/* Sticky save button */
.sticky-save {
    position: sticky; bottom: 1.5rem; align-self: flex-end;
    z-index: 40; margin-top: auto;
}
.sticky-save .btn {
    box-shadow: var(--shadow-md);
    padding: .75rem 1.5rem;
}

/* ── Progress bar ────────────────────────────────────────────────────── */
.progress-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .875rem 1.25rem; }
.progress-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; }
.progress-title { font-size: .8rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.progress-pct   { font-size: .875rem; font-weight: 800; color: var(--green); }
.progress-bar   { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.progress-fill  { height: 100%; background: linear-gradient(90deg, var(--green-mid), var(--green)); border-radius: 4px; transition: width .5s ease; }

/* ── Tables ──────────────────────────────────────────────────────────── */
.table-wrap {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: auto; box-shadow: var(--shadow-xs);
}
.data-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.data-table thead th {
    padding: .75rem 1rem; text-align: left;
    background: var(--surface-2);
    font-size: .72rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: .06em; color: var(--text-muted);
    border-bottom: 1px solid var(--border); white-space: nowrap;
}
.data-table thead th:first-child { border-radius: var(--radius) 0 0 0; }
.data-table thead th:last-child  { border-radius: 0 var(--radius) 0 0; }
.data-table tbody tr { border-bottom: 1px solid var(--border); transition: background var(--transition); }
.data-table tbody tr:last-child  { border-bottom: none; }
.data-table tbody tr:hover       { background: var(--green-pale); }
.data-table td { padding: .75rem 1rem; vertical-align: middle; }

.col-num    { text-align: right; width: 90px; }
.col-center { text-align: center; width: 80px; }

/* Product image */
.product-img {
    width: 44px; height: 44px; border-radius: var(--radius-sm);
    object-fit: cover; border: 2px solid var(--border);
}
.product-img-placeholder {
    width: 44px; height: 44px; border-radius: var(--radius-sm);
    background: var(--surface-2); border: 2px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-light);
}

.product-name { font-weight: 700; color: var(--text); }

.market-tag {
    display: inline-block; background: var(--green-light); color: var(--green-dark);
    border-radius: var(--radius-xs); font-size: .72rem; padding: 2px 8px; font-weight: 700;
}
.market-tag--more {
    background: var(--surface-2); color: var(--text-muted);
}

/* ── Important star icon (replaces text badge) ──────────────────────────── */
.important-icon {
    display: inline-block;
    width: 13px; height: 13px;
    fill: var(--yellow);
    stroke: var(--yellow-dark);
    stroke-width: 1.5;
    vertical-align: text-top;
    margin-left: .25rem;
    flex-shrink: 0;
}

/* Stock input */
.stock-input {
    width: 72px; text-align: right;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    padding: .4rem .6rem; font-size: .875rem; font-weight: 700;
    transition: all var(--transition); background: var(--surface);
}
.stock-input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(45,106,79,.15); }
.stock-input.changed { border-color: var(--success); background: var(--green-pale); color: var(--green-dark); }

/* ── Shopping list ───────────────────────────────────────────────────── */
.data-table tbody tr.row-checked { background: var(--green-pale); }
.data-table tbody tr.row-checked:hover { background: var(--green-light); }
.product-name.line-through { text-decoration: line-through; opacity: .55; }

.check-btn {
    width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--border);
    background: var(--surface); display: flex; align-items: center; justify-content: center;
    transition: all var(--transition); margin: 0 auto; color: transparent;
}
.check-btn.checked { background: var(--green); border-color: var(--green); color: #fff; }
.check-btn:hover:not(.checked) { border-color: var(--green); color: var(--green); }
.check-btn svg { width: 14px; height: 14px; stroke-width: 2.5; }

.miss-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 34px; height: 26px; border-radius: 13px;
    background: var(--danger-light); color: var(--danger);
    font-weight: 800; font-size: .8125rem; padding: 0 7px;
}

/* ── Manage / order buttons ──────────────────────────────────────────── */
.order-btns { display: flex; gap: .25rem; }
.order-btn {
    width: 30px; height: 30px; border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); background: var(--surface);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); transition: all var(--transition);
}
.order-btn:hover:not(:disabled) { background: var(--green); border-color: var(--green); color: #fff; }
.order-btn:disabled { opacity: .35; cursor: not-allowed; }
.order-btn svg { width: 12px; height: 12px; }

.action-btns { display: flex; gap: .375rem; }

/* ── Empty states ────────────────────────────────────────────────────── */
.empty-state {
    display: flex; flex-direction: column; align-items: center; gap: 1rem;
    padding: 3.5rem 1.5rem; color: var(--text-muted); text-align: center;
}
.empty-state svg   { width: 52px; height: 52px; stroke: var(--text-light); }
.empty-state p     { font-size: .9375rem; max-width: 300px; line-height: 1.5; }
.empty-state .btn  { margin-top: .5rem; }

/* ── Modals ──────────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0; z-index: 500;
    background: rgba(27,67,50,.45); backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center;
    padding: 1rem; animation: fadeIn .15s ease;
}
.modal {
    background: var(--surface); border-radius: var(--radius-lg);
    width: 100%; max-width: 540px; box-shadow: var(--shadow-lg);
    animation: popIn .25s cubic-bezier(.22,.68,0,1.2);
}
.modal--sm { max-width: 400px; }
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border);
    background: var(--surface-2); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.modal-title  { font-size: 1rem; font-weight: 800; color: var(--text); }
.modal-body   { padding: 1.5rem; }
.modal-footer {
    padding: 1rem 1.5rem; border-top: 1px solid var(--border);
    display: flex; justify-content: flex-end; gap: .625rem;
}

/* ── Toasts ──────────────────────────────────────────────────────────── */
.toast-container {
    position: fixed; bottom: 1.5rem; right: 1.5rem;
    display: flex; flex-direction: column; gap: .5rem; z-index: 1000;
}
.toast {
    padding: .75rem 1.1rem; border-radius: var(--radius);
    font-size: .875rem; font-weight: 600; box-shadow: var(--shadow-md);
    animation: slideInRight .25s ease; display: flex; align-items: center; gap: .5rem;
    max-width: 320px; min-width: 200px;
}
.toast svg { width: 16px; height: 16px; flex-shrink: 0; }
.toast-success { background: var(--green-light);  color: var(--green-dark); border-left: 4px solid var(--green); }
.toast-success svg { stroke: var(--green); }
.toast-error   { background: var(--danger-light); color: #7B241C; border-left: 4px solid var(--danger); }
.toast-error svg { stroke: var(--danger); }
.toast-info    { background: var(--yellow-light); color: #7D5800; border-left: 4px solid var(--yellow); }
.toast-info svg { stroke: var(--yellow-dark); }

/* ── Unsaved changes banner ──────────────────────────────────────────── */
.unsaved-banner {
    position: sticky; top: var(--topbar-h); z-index: 45;
    background: var(--yellow-light); border: 1px solid #F5C842;
    border-radius: 0; padding: .6rem 1.5rem;
    display: flex; align-items: center; gap: .75rem;
    font-size: .875rem; font-weight: 600; color: #7D5800;
    animation: slideUp .2s ease;
}
.unsaved-banner svg { stroke: var(--yellow-dark); }

/* ── Section divider (Verwaltung) ───────────────────────────────────────── */
.section-divider {
    display: flex; align-items: center; gap: .625rem;
    font-size: .8rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: .07em; color: var(--text-muted);
    padding: .25rem 0;
}
.section-divider::before,
.section-divider::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}
.section-divider svg { width: 15px; height: 15px; stroke: var(--text-muted); flex-shrink: 0; }

/* ── Role info box in user modal ────────────────────────────────────────── */
.role-info-box {
    border-radius: var(--radius-sm); padding: .625rem .875rem;
    font-size: .8125rem; line-height: 1.5;
    display: flex; gap: .5rem; align-items: flex-start;
}
.role-info-box svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 2px; }
.role-info-box--viewer { background: var(--green-pale); color: var(--green-dark); border: 1px solid var(--green-light); }
.role-info-box--viewer svg { stroke: var(--green); }
.role-info-box--admin  { background: var(--yellow-pale); color: #7D5800; border: 1px solid #F5C842; }
.role-info-box--admin svg { stroke: var(--yellow-dark); }

/* ── User role badges (table) ───────────────────────────────────────────── */
.badge-admin  { background: var(--yellow-light); color: #7D5800; }
.badge-viewer { background: var(--green-light);  color: var(--green-dark); }

/* ── Perm list (table cell) ─────────────────────────────────────────────── */
.perm-list { display: flex; flex-wrap: wrap; gap: .25rem; }
.perm-chip {
    display: inline-flex; align-items: center; gap: .25rem;
    font-size: .72rem; font-weight: 600; padding: 2px 7px; border-radius: 10px;
    background: var(--surface-2); color: var(--text-muted);
}
.perm-chip.allowed { background: var(--green-light); color: var(--green-dark); }
.perm-chip svg { width: 11px; height: 11px; }

/* ── Field hint ─────────────────────────────────────────────────────────── */
.field-hint { font-size: .78rem; color: var(--text-muted); margin-top: .25rem; }

/* ── Self badge ─────────────────────────────────────────────────────────── */
.self-badge {
    display: inline-flex; align-items: center; gap: .25rem;
    font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 10px;
    background: var(--primary-light); color: var(--primary);
    vertical-align: middle; margin-left: .4rem;
}

/* ── Complete-shop action bar ────────────────────────────────────────────── */
.complete-bar {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
    gap: .75rem;
    background: var(--green-light);
    border: 1.5px solid var(--green-mid);
    border-radius: var(--radius);
    padding: .875rem 1.125rem;
    animation: slideUp .22s ease;
}
.complete-bar-left {
    display: flex; align-items: center; gap: .625rem;
    font-weight: 700; font-size: .9375rem; color: var(--green-dark);
}
.complete-bar-actions { display: flex; align-items: center; gap: .5rem; }
.complete-bar-badge {
    display: inline-flex; align-items: center; justify-content: center;
    background: #fff; color: var(--green-dark);
    border-radius: 12px; min-width: 22px; height: 22px;
    font-size: .78rem; font-weight: 800; padding: 0 6px; margin-left: .25rem;
}

/* ── Complete-shop modal summary pill ──────────────────────────────────── */
.complete-summary-pill {
    display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
    background: var(--green-pale); border: 1px solid var(--green-light);
    border-radius: var(--radius-sm); padding: .875rem 1.125rem;
}
.summary-stat { display: flex; flex-direction: column; align-items: center; gap: .15rem; }
.summary-stat-value { font-size: 1.5rem; font-weight: 900; color: var(--green); line-height: 1; }
.summary-stat-label { font-size: .75rem; color: var(--text-muted); font-weight: 600; white-space: nowrap; }
.summary-divider { width: 1px; height: 36px; background: var(--border); flex-shrink: 0; }

/* ── Add-count badge ────────────────────────────────────────────────────── */
.add-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 34px; height: 26px; border-radius: 13px;
    background: var(--green-light); color: var(--green-dark);
    font-weight: 800; font-size: .8125rem; padding: 0 7px;
}

/* ── Complete-shop quantity input ───────────────────────────────────────── */
.complete-qty-input { font-weight: 800; }
.complete-qty-input.changed {
    border-color: var(--yellow-dark);
    background: var(--yellow-pale);
    color: var(--yellow-dark);
}

/* ── Image upload row ───────────────────────────────────────────────────── */
.img-upload-row {
    display: flex; gap: .5rem; align-items: center;
}
.img-upload-row .form-input { flex: 1; min-width: 0; }

.upload-label {
    display: inline-flex; align-items: center; gap: .375rem;
    white-space: nowrap; flex-shrink: 0; cursor: pointer;
    font-size: .8125rem; font-weight: 700;
    padding: .5rem .875rem;
}

.img-preview-wrap { position: relative; display: inline-block; margin-top: .5rem; }
.img-preview-remove {
    position: absolute; top: -6px; right: -6px;
    width: 20px; height: 20px; border-radius: 50%;
    background: var(--danger); color: #fff; border: none;
    font-size: .875rem; line-height: 1; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; padding: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,.25);
    transition: background var(--transition), transform var(--transition);
}
.img-preview-remove:hover { background: #a93226; transform: scale(1.1); }

/* ── Multi-select market widget ─────────────────────────────────────────── */
.ms-wrap {
    position: relative;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.ms-wrap:focus-within {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(45,106,79,.15);
}

.ms-tags {
    display: flex; flex-wrap: wrap; gap: .35rem;
    padding: .5rem .625rem .35rem;
    min-height: 0;
}
.ms-tags:empty { padding: 0; }

.ms-tag {
    display: inline-flex; align-items: center; gap: .3rem;
    background: var(--green-light); color: var(--green-dark);
    border-radius: var(--radius-xs); font-size: .78rem; font-weight: 700;
    padding: 3px 6px 3px 8px;
}
.ms-tag button {
    background: none; border: none; color: var(--green-dark);
    cursor: pointer; font-size: .875rem; line-height: 1;
    padding: 0 1px; opacity: .65;
    display: flex; align-items: center;
    transition: opacity var(--transition);
}
.ms-tag button:hover { opacity: 1; }

.ms-toggle {
    width: 100%; background: none; border: none; text-align: left;
    padding: .5rem .875rem .5rem .625rem;
    color: var(--text-muted); font-size: .875rem;
    display: flex; align-items: center; justify-content: space-between;
    cursor: pointer; transition: color var(--transition);
    min-height: 38px;
}
.ms-toggle:hover { color: var(--text); }

.ms-dropdown {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    z-index: 200;
    max-height: 220px; overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.ms-item {
    display: flex; align-items: center; gap: .625rem;
    padding: .625rem .875rem;
    cursor: pointer;
    font-size: .875rem; color: var(--text);
    transition: background var(--transition);
    border-bottom: 1px solid var(--border);
}
.ms-item:last-child { border-bottom: none; }
.ms-item:hover  { background: var(--green-pale); }
.ms-item.checked { background: var(--green-pale); color: var(--green-dark); font-weight: 700; }

.ms-item input[type="checkbox"] {
    width: 16px; height: 16px; accent-color: var(--green);
    flex-shrink: 0; cursor: pointer;
}

.ms-empty {
    padding: .875rem; font-size: .8125rem; color: var(--text-muted);
    text-align: center; font-style: italic;
}

/* ════════════════════════════════════════════════════════════════════════
   RESPONSIVE — Tablet-first
   Breakpoints:
     > 1100px  → Desktop     (sidebar always visible)
     768–1100px → Tablet     (sidebar overlay, primary target)
     480–767px  → Mobile     (phone landscape / large phone)
     < 480px   → Mobile-SM  (small phone)
════════════════════════════════════════════════════════════════════════ */

/* ── Touch baseline: min tap targets 44px everywhere ────────────────── */
.btn, .nav-item, .chip, .order-btn, .check-btn,
.form-input, .form-select, .search-input, .stock-input {
    min-height: 44px;
}
/* Compact overrides where height was intentionally smaller */
.btn-sm     { min-height: 38px; }
.btn-icon   { min-height: 40px; min-width: 40px; }
.chip       { min-height: 36px; display: inline-flex; align-items: center; }
.order-btn  { min-height: 36px; min-width: 36px; }

/* ── iOS momentum scrolling — nur für echte Scroll-Container ────────── */
/* main-content: bereits oben gesetzt                                    */
.sidebar-nav {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
.modal-body {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
/* table-wrap: KEIN overscroll-behavior + KEIN -webkit-overflow-scrolling:
   Die Tabelle wächst auf volle Inhaltshöhe → kein eigener Scroll-Bereich.
   Scroll-Events steigen sauber zu .main-content auf.
   overflow:auto bleibt für horizontales Scrollen bei breiten Tabellen.  */

/* ── Sidebar backdrop (tablet / mobile) ─────────────────────────────── */
.sidebar-backdrop {
    display: none;
    position: fixed; inset: 0; z-index: 99;
    background: rgba(27,67,50,.45);
    backdrop-filter: blur(1px);
    animation: fadeIn .18s ease;
}
.sidebar-backdrop.visible { display: block; }

/* ══════════════════════════════════════════════════════════════════════
   ≤ 1100px — TABLET (sidebar becomes overlay)
══════════════════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
    /* Sidebar: hidden off-screen, slides in as overlay */
    .sidebar {
        transform: translateX(-100%);
        z-index: 200;
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }
    .main-content { margin-left: 0; }
    .sidebar-toggle { display: flex; }

    /* Topbar: more breathing room */
    .topbar { padding: 0 1rem; gap: .75rem; }
    .topbar-title { font-size: .9375rem; }

    /* Season toggle compact label */
    .season-btn { padding: .3rem .6rem; font-size: .75rem; }

    /* Tab panels: less horizontal padding */
    .tab-panel  { padding: 1rem 1rem 2rem; }
    .stats-bar  { padding: .875rem 1rem 0; }

    /* Toolbar: wrap to two rows naturally */
    .panel-toolbar { gap: .625rem; }
    .toolbar-left  { gap: .5rem; }

    /* Search input stays reasonable width */
    .search-input       { width: 160px; }
    .search-input:focus { width: 200px; }
}

/* ══════════════════════════════════════════════════════════════════════
   768–1100px — TABLET PORTRAIT/LANDSCAPE (primary target)
══════════════════════════════════════════════════════════════════════ */
@media (min-width: 768px) and (max-width: 1100px) {

    /* Stats: 2×2 grid for better tablet layout */
    .stats-bar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: .75rem;
    }
    /* Progress-card spans full width on bottom */
    .stats-bar .stat-card:last-child { grid-column: span 2; }

    /* Stat cards: larger, more touchable */
    .stat-card  { padding: 1rem 1.25rem; min-width: unset; }
    .stat-icon  { width: 46px; height: 46px; }
    .stat-value { font-size: 1.5rem; }
    .stat-label { font-size: .8rem; }

    /* Tables: comfortable row height for touch */
    .data-table td       { padding: .875rem 1rem; }
    .data-table thead th { padding: .8rem 1rem; }

    /* Stock input: larger for finger input */
    .stock-input        { width: 80px; font-size: .9375rem; padding: .5rem .625rem; }
    .complete-qty-input { width: 80px; font-size: .9375rem; }

    /* Check button: bigger touch area */
    .check-btn { width: 40px; height: 40px; }

    /* Action buttons: larger */
    .action-btns .btn-icon { padding: .625rem; }

    /* Complete bar: better tablet layout */
    .complete-bar { padding: 1rem 1.25rem; }
    .complete-bar-left { font-size: 1rem; }

    /* Modals: good size for tablet */
    .modal          { max-width: 580px; }
    .modal--sm      { max-width: 440px; }
    .modal-body     { padding: 1.25rem 1.5rem; }

    /* Login card: optimal for tablet */
    .login-card     { max-width: 420px; padding: 3rem 2.5rem 2.5rem; }
}

/* ══════════════════════════════════════════════════════════════════════
   ≤ 900px — NARROW TABLET / LARGE PHONE
══════════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {

    /* Toolbar: split into rows */
    .panel-toolbar     { flex-direction: column; align-items: stretch; gap: .625rem; }
    .toolbar-left      { flex-wrap: wrap; }
    .toolbar-right     { justify-content: flex-end; }
    .panel-toolbar .btn { /* don't auto-stretch */ }

    /* Status bar moves below toolbar naturally */
    .status-bar { font-size: .78rem; }

    /* Season toggle: move from topbar to shopping toolbar */
    .season-toggle-topbar { display: none; }

    /* Unsaved banner: compact */
    .unsaved-banner { padding: .5rem 1rem; font-size: .8125rem; }
}

/* ══════════════════════════════════════════════════════════════════════
   ≤ 767px — MOBILE (phone)
══════════════════════════════════════════════════════════════════════ */
@media (max-width: 767px) {

    /* Topbar */
    .topbar          { height: 56px; padding: 0 .875rem; gap: .5rem; }
    .topbar-title    { font-size: .875rem; }
    .topbar-badge    { display: none; }
    .season-toggle   { display: none; }

    /* Tab panels */
    .tab-panel  { padding: .75rem .75rem 5rem; }
    .stats-bar  { padding: .625rem .75rem 0; }

    /* ── Stats: 3 mini cards + full-width progress bar ─────────────────
       First 3 cards sit in one row; last card (progress) spans all 3.
       Icons hidden, very compact text.
    ────────────────────────────────────────────────────────────────── */
    .stats-bar {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: .375rem;
    }
    .stats-bar .stat-card:last-child { grid-column: span 3; }

    .stat-card  { padding: .5rem .625rem; gap: .375rem; min-width: 0; }
    .stat-icon  { display: none; }
    .stat-value { font-size: 1rem; line-height: 1.1; }
    .stat-label { font-size: .65rem; line-height: 1.25; color: var(--text-muted); }

    /* Progress card: keep it slim */
    .stats-bar .stat-card:last-child .stat-info { width: 100%; }
    .stats-bar .stat-card:last-child .progress-header { margin-bottom: .35rem; }

    /* Forms */
    .form-grid { grid-template-columns: 1fr; }
    .span-2    { grid-column: span 1; }

    /* Search */
    .search-input       { width: 130px; }
    .search-input:focus { width: 160px; }

    /* ── Tables ──────────────────────────────────────────────────────── */

    /* Image column: visible again, but compact */
    .data-table .col-img,
    .data-table th.col-img { display: table-cell; }

    .product-img,
    .product-img-placeholder { width: 32px; height: 32px; }

    /* Tighter cell padding on mobile */
    .data-table td       { padding: .5rem .5rem; }
    .data-table thead th { padding: .5rem .5rem; }

    /* Number columns narrower */
    .col-num { width: 52px; }

    /* Stock input narrower */
    .stock-input        { width: 56px; font-size: .8125rem; padding: .35rem .4rem; }
    .complete-qty-input { width: 56px; }

    /* Hide Soll column (stock + shopping + manage + complete-shop) */
    .data-table .col-soll,
    .data-table th.col-soll { display: none; }

    /* Hide Reihenfolge column (manage table) */
    .data-table .col-reorder,
    .data-table th.col-reorder { display: none; }

    /* Modals: full-width on mobile */
    .modal-overlay { padding: .5rem; align-items: flex-end; }
    .modal     { max-width: 100%; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
    .modal--sm { max-width: 100%; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
    .modal-body { padding: 1.25rem 1rem; max-height: 65vh; overflow-y: auto; }

    /* Complete bar: stack vertically */
    .complete-bar         { flex-direction: column; align-items: stretch; gap: .625rem; }
    .complete-bar-actions { justify-content: space-between; }
    .complete-bar-actions .btn { flex: 1; justify-content: center; }

    /* Login */
    .login-card { padding: 2rem 1.25rem 1.75rem; border-radius: var(--radius-lg); }
    .login-logo img { height: 64px; }

    /* Multi-select: dropdown becomes inline on mobile (avoids overflow:auto clipping) */
    .ms-dropdown {
        position: relative;
        top: auto; left: auto; right: auto;
        margin-top: 4px;
    }

    /* Upload row: stack on very small screens */
    .img-upload-row { flex-wrap: wrap; }
    .upload-label   { font-size: .75rem; padding: .45rem .75rem; }
}

/* ══════════════════════════════════════════════════════════════════════
   ≤ 480px — SMALL PHONE
══════════════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {

    /* Stats: keep 3-column layout (cards are already compact); progress spans all 3 */
    /* No override — ≤767px rules are sufficient */

    /* Table: hide market column on very small screens */
    .data-table .col-market,
    .data-table th.col-market { display: none; }

    /* Topbar */
    .topbar-title { font-size: .8125rem; }

    /* Toolbar buttons: icon only (text hidden) */
    .btn-label-hide { display: none; }

    /* Action buttons closer together */
    .action-btns { gap: .25rem; }

    /* Even tighter table cells on very small phones */
    .data-table td       { padding: .4rem .375rem; }
    .data-table thead th { padding: .4rem .375rem; }
    .col-num { width: 46px; }
    .stock-input        { width: 48px; }
    .complete-qty-input { width: 48px; }
}

/* ══════════════════════════════════════════════════════════════════════
   DARK MODE
   Driven by the .dark class on <html>, applied by ThemeManager in app.js.
   An inline <script> in <head> adds the class before first paint (no FOUC).
   The sidebar always keeps its dark-green via --sidebar-bg;
   --green-dark is repurposed as a light text colour on dark surfaces.
══════════════════════════════════════════════════════════════════════ */

/* ── Custom property overrides ─────────────────────────────────────────── */
html.dark {
    --bg:        #0F1117;
    --surface:   #1A1D27;
    --surface-2: #22263A;
    --surface-3: #2A2F45;

    --border:      #2E3247;
    --border-dark: #3E4560;
    --text:        #E8EAF0;
    --text-muted:  #9EA3B8;
    --text-light:  #6B7190;

    --green:       #52B788;
    --green-mid:   #74C69D;
    --green-dark:  #95DEB5;   /* light text on dark bg — see nav-item.active fix below */
    --green-light: #162C22;
    --green-pale:  #0D1C16;

    --yellow-light: #3D2E00;
    --yellow-pale:  #2A2000;

    --danger-light: #3D0F0C;

    /* --sidebar-bg intentionally unchanged — sidebar stays dark green */

    --shadow-xs: 0 1px 2px rgba(0,0,0,.4);
    --shadow-sm: 0 1px 4px rgba(0,0,0,.45), 0 1px 2px rgba(0,0,0,.3);
    --shadow:    0 4px 12px rgba(0,0,0,.5),  0 1px 3px rgba(0,0,0,.35);
    --shadow-md: 0 8px 20px rgba(0,0,0,.55), 0 2px 6px rgba(0,0,0,.35);
    --shadow-lg: 0 16px 40px rgba(0,0,0,.6), 0 4px 12px rgba(0,0,0,.4);
}

/* ── Form inputs ───────────────────────────────────────────────────────── */
html.dark .form-input,
html.dark .form-select     { background: var(--surface-2); color: var(--text); border-color: var(--border); }
html.dark .form-input:focus { background: var(--surface); }
html.dark .search-input    { background: var(--surface-2); color: var(--text); }
html.dark .search-input:focus { background: var(--surface); }
html.dark .stock-input     { background: var(--surface-2); color: var(--text); }
html.dark .stock-input.changed { background: var(--green-pale); color: var(--green-dark); }

/* ── Login ─────────────────────────────────────────────────────────────── */
html.dark .login-overlay {
    background: linear-gradient(160deg, #0A1E12 0%, #163825 55%, #1F5236 100%);
}

/* ── Sidebar nav — keep active chip readable despite dark --green-dark ── */
html.dark .nav-item.active     { color: #1B4332; }
html.dark .nav-item.active svg { stroke: #1B4332; }
html.dark #shoppingBadge       { color: #1B4332; }

/* ── Stat icons ────────────────────────────────────────────────────────── */
html.dark .stat-icon--green  { background: #162C22; }
html.dark .stat-icon--yellow { background: #3D2E00; }
html.dark .stat-icon--red    { background: #3D0F0C; }

/* ── Tables ────────────────────────────────────────────────────────────── */
html.dark .data-table tbody tr:hover        { background: var(--green-pale); }
html.dark .data-table tbody tr.row-checked  { background: var(--green-pale); }
html.dark .data-table tbody tr.row-checked:hover { background: #162C22; }
html.dark .product-img-placeholder          { background: var(--surface-2); }

/* ── Badges & tags ─────────────────────────────────────────────────────── */
html.dark .badge-green       { background: var(--green-light); color: var(--green-dark); }
html.dark .badge-admin       { background: var(--yellow-light); color: #D4A500; }
html.dark .badge-viewer      { background: var(--green-light); color: var(--green-dark); }
html.dark .market-tag        { background: var(--green-light); color: var(--green-dark); }
html.dark .market-tag--more  { background: var(--surface-2);  color: var(--text-muted); }
html.dark .ms-tag            { background: var(--green-light); color: var(--green-dark); }
html.dark .ms-tag button     { color: var(--green-dark); }
html.dark .perm-chip.allowed { background: var(--green-light); color: var(--green-dark); }
html.dark .self-badge        { background: var(--green-light); color: var(--green-dark); }

/* ── Alerts ────────────────────────────────────────────────────────────── */
html.dark .alert-error   { background: #3D0F0C; color: #F1948A; border-color: #7B241C; }
html.dark .alert-success { background: var(--green-light); color: var(--green-dark); border-color: #2D6A4F; }
html.dark .alert-info    { background: #3D2E00; color: #D4A500; border-color: #7D5800; }

/* ── Toasts ────────────────────────────────────────────────────────────── */
html.dark .toast-success { background: var(--green-light); color: var(--green-dark); }
html.dark .toast-error   { background: #3D0F0C;            color: #F1948A; }
html.dark .toast-info    { background: #3D2E00;            color: #D4A500; }

/* ── Misc ──────────────────────────────────────────────────────────────── */
html.dark .miss-badge        { background: #3D0F0C; color: #E74C3C; }
html.dark .unsaved-banner    { background: #3D2E00; border-color: #7D5800; color: #D4A500; }
html.dark .check-btn         { background: var(--surface-2); }
html.dark .order-btn         { background: var(--surface-2); }
html.dark .complete-bar      { background: var(--green-light); border-color: #2D6A4F; }
html.dark .complete-bar-badge { background: var(--surface); color: var(--green-dark); }
html.dark .role-info-box--viewer     { background: var(--green-pale); color: var(--green-dark); border-color: var(--green-light); }
html.dark .role-info-box--viewer svg { stroke: var(--green); }
html.dark .role-info-box--admin      { background: #3D2E00; color: #D4A500; border-color: #7D5800; }
html.dark .role-info-box--admin svg  { stroke: var(--yellow-dark); }
html.dark .ms-item.checked  { background: var(--green-pale); color: var(--green-dark); }
html.dark .ms-item:hover    { background: var(--green-pale); }
html.dark .complete-qty-input.changed { background: #3D2E00; color: #D4A500; border-color: #D48A00; }
