/* ═══════════════════════════════════════
   Maschen mit Herz — Admin
   Soft/Warm Theme (finance-tracker Style)
   ═══════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;500;600;700&family=Libre+Baskerville:wght@400;700&display=swap');

:root {
    --bg: #faf7f2;
    --bg-card: #ffffff;
    --surface: #ffffff;
    --bg-sidebar: #2c2a26;
    --sidebar-bg: #2c2a26;

    --cream: #f0ebe1;

    --terracotta: #c4705a;
    --terracotta-light: rgba(196, 112, 90, 0.1);
    --terracotta-dark: #a85a46;

    --sage: #6b8f71;
    --sage-light: rgba(107, 143, 113, 0.12);
    --sage-dark: #4a7050;
    --sage-hover: #578060;

    --sand: #b8a992;
    --sand-light: rgba(184, 169, 146, 0.15);

    /* Alias: altes admin nannte terracotta „accent" */
    --accent: var(--terracotta);
    --accent-hover: var(--terracotta-dark);
    --accent-bg: var(--terracotta-light);
    --accent-border: rgba(196, 112, 90, 0.3);

    --text: #3a3632;
    --text-secondary: #7a756c;
    --text-muted: #7a756c;
    --text-dim: #b0a99e;

    --border: #e6e0d6;
    --input-bg: #faf7f2;
    --input-border: #e6e0d6;

    /* Zusatz-Akzente für Warn/Info */
    --warning: #d4a017;
    --warning-light: rgba(212, 160, 23, 0.14);
    --blue-muted: #6b8fad;
    --blue-light: rgba(107, 143, 173, 0.15);
    --purple-muted: #8f6bad;
    --purple-light: rgba(143, 107, 173, 0.15);

    /* Aliases für Legacy-Code */
    --surface: #ffffff;
    --card-bg: #ffffff;
    --bg-hover: #f0ebe1;
    --hover: #f0ebe1;
    --red: #c4705a;
    --red-bg: rgba(196, 112, 90, 0.12);
    --green: #6b8f71;
    --green-bg: rgba(107, 143, 113, 0.12);
    --blue: #6b8fad;
    --blue-bg: rgba(107, 143, 173, 0.14);
    --yellow: #d4a017;
    --yellow-bg: rgba(212, 160, 23, 0.14);
    --purple: #8f6bad;
    --purple-bg: rgba(143, 107, 173, 0.14);

    --shadow: 0 2px 12px rgba(58, 54, 50, 0.06);
    --shadow-hover: 0 4px 20px rgba(58, 54, 50, 0.1);

    --radius: 14px;
    --radius-sm: 10px;
    --sidebar-w: 250px;

    --font-body: 'Nunito', 'Segoe UI', sans-serif;
    --font-display: 'Libre Baskerville', Georgia, serif;
}

/* Reset */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-weight: 400;
    min-height: 100vh;
    display: flex;
    line-height: 1.5;
}

a { color: inherit; }

/* ── Sidebar ─────────────────────────────── */

.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-sidebar);
    padding: 16px 0 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    border-radius: 0 24px 24px 0;
    z-index: 100;
    overflow-y: auto;
    box-shadow: 4px 0 24px rgba(0,0,0,0.08);
}

.sidebar-logo {
    padding: 8px 24px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin: 0 0 12px;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 17px;
    color: #fff;
    line-height: 1.3;
}
.sidebar-logo span { color: var(--terracotta); }
.sidebar-logo small {
    display: block;
    color: rgba(255,255,255,0.35);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 4px;
    font-family: var(--font-body);
    font-weight: 600;
}

.env-banner {
    text-align: center;
    padding: 6px 0;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0 10px 8px;
    border-radius: 6px;
}
.env-staging { background: #d97706; color: #fff; }
.env-beta    { background: #7c3aed; color: #fff; }

nav {
    flex: 1;
    padding: 4px 0 12px;
    overflow-y: auto;
}
nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    margin: 1px 10px;
    border-radius: 8px;
    color: rgba(255,255,255,0.58);
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 500;
    transition: all 0.2s;
}
nav a:hover {
    color: rgba(255,255,255,0.9);
    background: rgba(255,255,255,0.06);
}
nav a.active {
    color: #fff;
    background: rgba(107, 143, 113, 0.28);
}
nav a .icon {
    font-size: 15px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}
nav .nav-section,
.nav-group-label {
    padding: 14px 20px 4px;
    font-size: 9px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.28);
    font-weight: 700;
}

.sidebar-footer {
    padding: 10px 10px 14px;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: auto;
}

/* User-Pill unten in Sidebar */
.user-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
}
.user-pill:hover { background: rgba(255,255,255,0.06); }

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--sage);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    font-family: var(--font-body);
}

.user-info { flex: 1; min-width: 0; }
.user-info .name {
    font-size: 13px;
    color: rgba(255,255,255,0.85);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-info .role {
    font-size: 10px;
    color: rgba(255,255,255,0.38);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* ── Main Content ────────────────────────── */

.main,
.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    padding: 32px 40px;
    min-height: 100vh;
    min-width: 0;
}

/* Page Header */
.page-header {
    margin-bottom: 28px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}
.page-header-left h1,
.page-header h1,
.page-header h2 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 26px;
    color: var(--text);
    line-height: 1.25;
}
.page-header-left p,
.page-header .page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Section Header (inside cards / groups) */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 16px;
}
.section-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 400;
    color: var(--text);
    line-height: 1.2;
}
.section-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    flex-shrink: 0;
    white-space: nowrap;
    background: var(--terracotta);
    color: #fff;
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 700;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    margin-left: 8px;
    vertical-align: middle;
    position: relative;
    top: -2px;
}
.section-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}
.section-action {
    font-size: 13px;
    font-weight: 600;
    color: var(--terracotta);
    text-decoration: none;
    transition: color 0.2s;
    white-space: nowrap;
}
.section-action:hover { color: var(--terracotta-dark); }

/* ── Buttons ─────────────────────────────── */

/* Baseline für alle nativen Buttons (damit rohes <button> auch schon
   ordentlich aussieht, wenn keine Klasse dran ist) */
button {
    font-family: var(--font-body);
    font-size: 14px;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

[hidden] { display: none !important; }

.btn,
button.btn-cancel,
button.btn-save,
button.btn-edit,
button.btn-delete,
button.btn-login,
button.btn-green,
button.btn-print,
button.btn-ship,
button.btn-finalize,
button.btn-problem,
button.btn-return,
button.btn-track,
button.btn-complete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1.2;
    white-space: nowrap;
}

/* .btn ohne Variante → Secondary-Look als Fallback */
.btn {
    background: var(--sand-light);
    color: var(--text);
}
.btn:hover { background: var(--cream); }

.btn-primary,
button.btn-save,
button.btn-login,
button.btn-complete,
button.btn-finalize,
button.btn-ship {
    background: var(--sage);
    color: #fff;
}
.btn-primary:hover,
button.btn-save:hover,
button.btn-login:hover,
button.btn-complete:hover,
button.btn-finalize:hover,
button.btn-ship:hover {
    background: var(--sage-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(107, 143, 113, 0.3);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary,
button.btn-cancel,
button.btn-edit,
button.btn-print,
button.btn-track,
button.btn-return {
    background: var(--sand-light);
    color: var(--text);
}
.btn-secondary:hover,
button.btn-cancel:hover,
button.btn-edit:hover,
button.btn-print:hover,
button.btn-track:hover,
button.btn-return:hover { background: var(--cream); }

.btn-danger,
button.btn-delete,
button.btn-problem {
    background: var(--terracotta-light);
    color: var(--terracotta);
}
.btn-danger:hover,
button.btn-delete:hover,
button.btn-problem:hover {
    background: var(--terracotta);
    color: #fff;
}

button.btn-green {
    background: var(--sage-light);
    color: var(--sage-dark);
}
button.btn-green:hover { background: var(--sage); color: #fff; }

/* Link-Button: schaut wie ein Link aus, kein Button-Background */
button.btn-link,
.btn-link {
    display: inline;
    background: none;
    border: none;
    padding: 0;
    color: var(--terracotta);
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}
button.btn-link:hover { color: var(--terracotta-dark); }

/* Remove/Close Button (kleines × in Formularen) */
button.btn-remove {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--terracotta-light);
    color: var(--terracotta);
    font-size: 14px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}
button.btn-remove:hover {
    background: var(--terracotta);
    color: #fff;
}

.btn-sm { padding: 7px 14px; font-size: 13px; }

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}
.btn-icon:hover {
    background: var(--cream);
    border-color: var(--sand);
    color: var(--text);
}

/* ── Stats Grid ──────────────────────────── */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px 24px;
    transition: box-shadow 0.2s, transform 0.2s;
}
.stat-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

/* Haekeln-Pattern: .label / .value / .sub inside .stat-card */
.stat-card .label {
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    font-weight: 700;
}
.stat-card .value {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.1;
}
.stat-card .sub {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 6px;
}
.stat-card.accent .value { color: var(--terracotta); }
.stat-card.success .value,
.stat-card .value.positive { color: var(--sage); }
.stat-card .value.negative { color: var(--terracotta); }

/* Finance-tracker Pattern: .stat-icon + .stat-content */
.stat-card.has-icon {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.stat-icon.sage       { background: var(--sage-light); }
.stat-icon.terracotta { background: var(--terracotta-light); }
.stat-icon.sand       { background: var(--sand-light); }

.stat-content .stat-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.stat-content .stat-value {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin-top: 2px;
}
.stat-content .stat-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ── Cards ───────────────────────────────── */

.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    transition: box-shadow 0.2s;
    overflow: hidden;
}
.card:hover { box-shadow: var(--shadow-hover); }

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
}
.card-header h2,
.card-header h3 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 18px;
    color: var(--text);
    line-height: 1.2;
}

.card-body { padding: 24px; }
.card > table { margin: 0; }
.card.table-card { padding: 0; }

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

table {
    width: 100%;
    border-collapse: collapse;
}
table thead tr { background: rgba(240, 235, 225, 0.45); }
table th {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    padding: 13px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
table td {
    padding: 14px 20px;
    font-size: 14px;
    color: var(--text);
    border-bottom: 1px solid rgba(230, 224, 214, 0.5);
    vertical-align: middle;
}
table tbody tr { transition: background 0.15s; }
table tbody tr:hover { background: rgba(240, 235, 225, 0.5); }
table tbody tr:last-child td { border-bottom: none; }

/* Numerische Spalten (tabular-nums, rechtsbündig, fett) */
.amount,
table td.num,
table th.num {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}
.amount.positive { color: var(--sage); }
.amount.negative { color: var(--terracotta); }

/* Summary/Totals Row (tfoot oder tr.summary-row) */
table tfoot tr,
table tr.summary-row {
    background: rgba(240, 235, 225, 0.6);
    font-weight: 700;
}
table tfoot td,
table tr.summary-row td {
    padding: 14px 20px;
    border-bottom: none;
    border-top: 1px solid var(--border);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}
table tfoot td.num,
table tr.summary-row td.num {
    font-size: 14px;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

/* Section-Card mit farbigem Linken-Border-Akzent (finance-tracker Style) */
.section-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    border-left: 4px solid var(--sand);
    margin-bottom: 20px;
}
.section-card.sage       { border-left-color: var(--sage); }
.section-card.terracotta { border-left-color: var(--terracotta); }
.section-card.sand       { border-left-color: var(--sand); }
.section-card > .section-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 22px;
    background: rgba(240, 235, 225, 0.35);
    border-bottom: 1px solid var(--border);
}
.section-card > .section-bar h2,
.section-card > .section-bar h3 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 18px;
    color: var(--text);
    line-height: 1.2;
}
.section-card > .section-bar .section-bar-value {
    font-weight: 700;
    color: var(--terracotta);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}
.section-card > table { margin: 0; }

/* ── Filter Pills (Tabs/Pills) ──────────────
   Rows von umschaltbaren Pill-Buttons (Packstation, Monatsplan, etc.) */
.filter-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.filter-pills button,
.filter-pill {
    padding: 9px 18px;
    border-radius: 999px;
    border: 1.5px solid var(--border);
    background: var(--bg-card);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}
.filter-pills button:hover,
.filter-pill:hover {
    background: var(--cream);
    color: var(--text);
    border-color: var(--sand);
}
.filter-pills button.active,
.filter-pill.active {
    background: var(--terracotta);
    color: #fff;
    border-color: var(--terracotta);
}
.filter-pills button.active:hover,
.filter-pill.active:hover {
    background: var(--terracotta-dark);
    border-color: var(--terracotta-dark);
}

/* ── Stat Pills (kleine Inline-Statistik-Reihe) ── */
.stats-row {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.stat-pill {
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 20px;
    text-align: center;
    min-width: 100px;
    flex-shrink: 0;
    transition: box-shadow 0.15s;
}
.stat-pill:hover { box-shadow: var(--shadow); }
.stat-pill .num {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.1;
}
.stat-pill .lbl {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}

/* Stock-Badges */
.stock-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}
.stock-badge.ok    { background: var(--sage-light);       color: var(--sage-dark); }
.stock-badge.low   { background: var(--sand-light);       color: #8f7a54; }
.stock-badge.empty { background: var(--terracotta-light); color: var(--terracotta); }

/* Kleine Badges für "Bereich"-Spalten (Privat/Geschäftlich) */
.badge-privat {
    background: var(--sage-light);
    color: var(--sage-dark);
    display: inline-flex;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}
.badge-business {
    background: var(--terracotta-light);
    color: var(--terracotta);
    display: inline-flex;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

/* ── Badges ──────────────────────────────── */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.5;
}
.badge-green,
.badge-sage       { background: var(--sage-light); color: var(--sage-dark); }
.badge-red,
.badge-terracotta { background: var(--terracotta-light); color: var(--terracotta); }
.badge-yellow,
.badge-sand       { background: var(--sand-light); color: #8f7a54; }
.badge-blue       { background: rgba(107, 143, 173, 0.15); color: #4a6b8f; }

/* ── Forms ───────────────────────────────── */

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 0;
}
.form-group.full { grid-column: 1 / -1; }

label,
.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input, select, textarea {
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text);
    background: var(--bg-card);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    min-width: 0;
    max-width: 100%;
}
select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%237a756c' d='M6 8L0 0h12z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--sage);
    box-shadow: 0 0 0 3px var(--sage-light);
}
input::placeholder,
textarea::placeholder { color: var(--text-dim); }
textarea { resize: vertical; min-height: 80px; font-family: inherit; width: 100%; }

/* Full width in Form-Kontexten */
.form-group input,
.form-group select,
.form-group textarea,
.modal-body input[type="text"],
.modal-body input[type="email"],
.modal-body input[type="password"],
.modal-body input[type="number"],
.modal-body input[type="tel"],
.modal-body input[type="url"],
.modal-body input[type="date"],
.modal-body input[type="search"],
.modal-body select,
.modal-body textarea { width: 100%; }

input[type="checkbox"],
input[type="radio"] {
    width: auto;
    accent-color: var(--sage);
    min-width: 0;
    padding: 0;
    cursor: pointer;
}
input[type="checkbox"] { width: 16px; height: 16px; }
input[type="radio"]    { width: 16px; height: 16px; }

/* Search bar */
.search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}
.search-input { position: relative; flex: 1 1 220px; min-width: 200px; }
.search-input input { padding-left: 38px; width: 100%; }
.search-input::before {
    content: '🔍';
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    pointer-events: none;
    opacity: 0.6;
}
.search-bar > input,
.search-bar > select {
    flex: 0 0 auto;
    width: auto;
    min-width: 140px;
}

/* Kompakter Select (inline in Tabellen, Pills etc.) */
.select-sm,
table td select,
table td input[type="text"],
table td input[type="number"] {
    font-size: 12px;
    padding: 4px 24px 4px 8px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    background-color: var(--bg-card);
    max-width: 160px;
    width: auto;
    min-width: 0;
    background-position: right 8px center;
}
table td input[type="text"],
table td input[type="number"] {
    padding: 4px 8px;
    background-image: none;
}

/* Card-Header mit Filter-Leiste darin */
.card-header {
    flex-wrap: wrap;
}
.card-header > .search-bar { margin-right: auto; }

/* ── Modals / Dialogs ────────────────────── */

.modal-overlay,
.dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(44, 42, 38, 0.5);
    display: none;
    align-items: flex-start;
    justify-content: center;
    z-index: 10000;
    padding: 32px 16px;
    overflow-y: auto;
}
.modal-overlay.active,
.dialog-overlay.active { display: flex; animation: fadeIn 0.2s ease; }

.modal,
.modal-content,
.dialog-box {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: 0 12px 48px rgba(44, 42, 38, 0.25);
    width: 100%;
    max-width: 560px;
    margin: auto;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    animation: slideUp 0.25s ease;
}
.modal.modal-sm { max-width: 420px; }
.modal.modal-md { max-width: 640px; }
.modal.modal-lg { max-width: 880px; }
.modal.modal-xl { max-width: 1100px; }
.modal.modal-xs { max-width: 360px; }

/* Padding für Modals OHNE modal-header/body/footer Wrapper.
   Direkte Kinder (h3, form-row, etc.) bekommen horizontales Padding. */
.modal > h3:first-child,
.modal > h2:first-child {
    margin: 0;
    padding: 22px 28px 18px;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 20px;
    color: var(--text);
    border-bottom: 1px solid var(--border);
}
.modal > h3:first-child + *,
.modal > h2:first-child + * { margin-top: 20px; }

.modal > .form-row,
.modal > .form-row-inline,
.modal > .form-grid,
.modal > .upload-drop,
.modal > .file-row-list,
.modal > .gallery-grid,
.modal > p,
.modal > .alert,
.modal > .stats-grid,
.modal > .card-grid {
    margin-left: 28px;
    margin-right: 28px;
}
.modal > .modal-actions:last-child {
    margin-top: 22px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}
.modal-header h3,
.modal-header h2 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 18px;
    color: var(--text);
}
.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    font-size: 22px;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.modal-close:hover { background: var(--cream); color: var(--text); }

.modal-body { padding: 20px 24px; }
.modal-footer,
.modal-actions,
.dialog-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

/* ── Lightbox ───────────────────────────────── */

.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 20000;
}
.lightbox-overlay.active { display: flex; animation: fadeIn 0.2s ease; }

.lightbox-img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--radius);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 36px;
    cursor: pointer;
    line-height: 1;
    padding: 8px;
}
.lightbox-close:hover { color: #fff; }

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 48px;
    cursor: pointer;
    padding: 12px 18px;
    border-radius: var(--radius);
    line-height: 1;
    transition: background 0.15s;
}
.lightbox-prev:hover,
.lightbox-next:hover { background: rgba(255, 255, 255, 0.2); color: #fff; }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }

.lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 600;
}

/* ── Toasts ──────────────────────────────── */

.toast-container,
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}
.toast {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    box-shadow: 0 6px 24px rgba(44, 42, 38, 0.18);
    padding: 14px 20px;
    font-size: 14px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideInRight 0.3s ease;
    border-left: 4px solid var(--sand);
}
.toast.success { border-left-color: var(--sage); }
.toast.error   { border-left-color: var(--terracotta); }
.toast.info    { border-left-color: var(--sand); }

/* ── Loading / Empty ─────────────────────── */

.loading {
    padding: 48px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

.empty {
    text-align: center;
    padding: 56px 20px;
    color: var(--text-muted);
}
.empty .empty-icon,
.empty-state .icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
    display: block;
}
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state h3 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.empty-state p {
    font-size: 14px;
    max-width: 400px;
    margin: 0 auto 20px;
}

.spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
}
.spinner::after {
    content: '';
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--sage);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ── Mobile Nav ──────────────────────────── */

.hamburger {
    display: none;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 200;
    background: var(--bg-sidebar);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    width: 42px;
    height: 42px;
    cursor: pointer;
    font-size: 18px;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.85);
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(44, 42, 38, 0.5);
    z-index: 99;
}
.sidebar-backdrop.active { display: block; }

/* ── Animations ──────────────────────────── */

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Reusable Micro-Components ───────────── */

/* Winziges Label (uppercase, letterspacing) — überall wo ein kleiner Titel über einer Zahl steht */
.micro-label {
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    margin-bottom: 6px;
}

/* Große Zahl für inline-Metriken (kleine Cards, Dashboard-Splits) */
.metric-value {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.1;
}
.metric-value.warning  { color: #d4a017; }
.metric-value.danger   { color: var(--terracotta); }
.metric-value.positive { color: var(--sage); }

/* Split-Card: 2 Spalten innerhalb einer Card */
.card-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Stack: Flex column — meist für Button-Listen */
.stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Two-column card grid (Dashboard-Sektionen) */
.two-col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}
@media (max-width: 900px) {
    .two-col-grid { grid-template-columns: 1fr; }
    .card-split   { grid-template-columns: 1fr; }
}

/* ── Utility ─────────────────────────────── */

.hidden { display: none !important; }

/* Text */
.text-left   { text-align: left; }
.text-right  { text-align: right; }
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.text-dim    { color: var(--text-dim); }
.text-red,
.text-terracotta { color: var(--terracotta); }
.text-green,
.text-sage       { color: var(--sage-dark); }
.text-blue       { color: var(--blue-muted); }
.text-yellow,
.text-warning    { color: var(--warning); }
.text-purple     { color: var(--purple-muted); }
.text-xs { font-size: 0.72em; }
.text-sm { font-size: 0.82em; }
.text-md { font-size: 0.9em; }
.text-lg { font-size: 1.1em; }
.text-nowrap { white-space: nowrap; }
.text-plain  { text-transform: none; letter-spacing: 0; font-weight: 400; }
.mono { font-family: var(--font-mono, ui-monospace, monospace); }

/* Flex / Layout */
.flex        { display: flex; }
.flex-col    { display: flex; flex-direction: column; }
.flex-row    { display: flex; flex-direction: row; }
.flex-wrap   { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }
.flex-1      { flex: 1; }
.flex-auto   { flex: 0 0 auto; }
.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.items-end     { align-items: flex-end; }
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end     { justify-content: flex-end; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center  { display: flex; align-items: center; gap: 8px; }
.grid-full-row { grid-column: 1 / -1; }

/* Gap */
.gap-3  { gap: 3px; }
.gap-4  { gap: 4px; }
.gap-6  { gap: 6px; }
.gap-8  { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }

/* Margin */
.m-0  { margin: 0; }
.mb-0  { margin-bottom: 0; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mb-28 { margin-bottom: 28px; }
.mt-4  { margin-top: 4px; }
.mt-6  { margin-top: 6px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }

/* Padding */
.p-0  { padding: 0; }
.p-8  { padding: 8px; }
.p-12 { padding: 12px; }
.p-16 { padding: 16px; }
.p-20 { padding: 20px; }
.px-8  { padding-left: 8px; padding-right: 8px; }
.px-12 { padding-left: 12px; padding-right: 12px; }
.py-8  { padding-top: 8px; padding-bottom: 8px; }
.py-12 { padding-top: 12px; padding-bottom: 12px; }

/* Width */
.w-auto  { width: auto; }
.w-full  { width: 100%; }
.w-40    { width: 40px; }
.w-60    { width: 60px; }
.w-70    { width: 70px; }
.w-80    { width: 80px; }
.w-100   { width: 100px; }
.w-220   { width: 220px; }
.min-w-0 { min-width: 0; }

/* Cursor / Misc */
.clickable,
.cursor-pointer { cursor: pointer; }
.block   { display: block; }
.inline-block { display: inline-block; }
.rounded-sm { border-radius: var(--radius-sm); }
.border-default { border: 1px solid var(--border); }

/* Modal Sizes */
.modal.modal-xs { max-width: 380px; }
.modal.modal-sm { max-width: 440px; }
.modal.modal-md { max-width: 520px; }
.modal.modal-lg { max-width: 640px; }
.modal.modal-xl { max-width: 780px; }

/* Empty/Hint Text Blocks */
.empty-hint {
    padding: 20px;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.9em;
}
.hint-row {
    color: var(--text-dim);
    font-size: 0.82em;
    margin-top: 4px;
}

/* Input-Size-Varianten (für schmale Tabellen-Inputs) */
.input-sm {
    padding: 6px 10px;
    font-size: 0.9em;
}
.input-xs {
    padding: 4px 8px;
    font-size: 0.85em;
}

/* ═══════════════════════════════════════════
   Extended Components — Page-spezifisch
   ═══════════════════════════════════════════ */

/* ── Tabs / Tab-Bars ──────────────────────── */
.tabs,
.tab-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.tab,
.tab-btn {
    padding: 10px 22px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    font-family: var(--font-body);
    transition: all 0.15s;
}
.tab:hover,
.tab-btn:hover { color: var(--text); }
.tab.active,
.tab-btn.active {
    color: var(--terracotta);
    border-bottom-color: var(--terracotta);
}
.tab-content,
.tab-panel { display: none; }
.tab-content.active,
.tab-panel.active { display: block; }

/* ── Modal Tabs (innerhalb Modal) ── */
.modal-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}
.modal-tab-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    font-family: var(--font-body);
    transition: all 0.15s;
}
.modal-tab-btn.active {
    color: var(--terracotta);
    border-bottom-color: var(--terracotta);
}
.modal-tab-panel { display: none; }
.modal-tab-panel.active { display: block; }

/* ── Toggle Switches ──────────────────────── */
.toggle-big {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: var(--terracotta-light);
    border: 1px solid var(--accent-border);
    border-radius: var(--radius);
    margin-bottom: 24px;
}
.toggle-big .toggle-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}
.toggle-big .toggle-sub {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 2px;
}
.switch,
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}
.switch input,
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.switch-slider,
.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--border);
    border-radius: 26px;
    cursor: pointer;
    transition: 0.3s;
}
.switch-slider::before,
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.switch input:checked + .switch-slider,
.toggle-switch input:checked + .toggle-slider {
    background: var(--sage);
}
.switch input:checked + .switch-slider::before,
.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(22px);
}

/* Info-Box (Hinweis/Erklär-Kasten) */
.info-box,
.hint-box {
    background: var(--cream);
    border-left: 3px solid var(--terracotta);
    padding: 16px 20px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--text);
    line-height: 1.6;
}
.info-box h3 {
    color: var(--terracotta);
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 16px;
    margin-bottom: 8px;
}
.info-box p { color: var(--text-muted); }

/* ── Project Tiles (Anleitungen, Produkt-Kacheln) ── */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.project-tile {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}
/* „NEU"-Ribbon — adaptiert vom Webshop-Warenkorb */
.tile-ribbon-new {
    position: absolute;
    top: -.5rem;
    left: -.4rem;
    font-family: var(--font-display);
    font-size: .7rem;
    font-weight: 700;
    font-style: italic;
    letter-spacing: .05em;
    color: #fff;
    background: linear-gradient(135deg, #7d9472 0%, #5e7255 100%);
    padding: .3rem .7rem .35rem .7rem;
    box-shadow: 0 3px 8px rgba(94, 114, 85, .25), 0 1px 2px rgba(0, 0, 0, .12);
    z-index: 3;
    pointer-events: none;
    opacity: .6;
}
.tile-ribbon-new::before {
    content: '';
    position: absolute;
    bottom: -.4rem;
    left: 0;
    width: .4rem; height: .4rem;
    background: #3f4c3a;
    clip-path: polygon(0 0, 100% 0, 100% 100%);
}
.project-tile-time {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 8px;
    font-style: italic;
    opacity: .65;
    text-align: left;
    line-height: 1;
}
@keyframes tile-pulse {
    0%   { opacity: 0.4; box-shadow: 0 0 0 4px var(--terracotta), 0 0 24px 4px rgba(201, 102, 77, .4); }
    100% { opacity: 1;   box-shadow: 0 0 0 0 transparent, 0 0 0 0 transparent; }
}
.project-tile.pulse-highlight {
    animation: tile-pulse 3s ease-out;
    animation-fill-mode: backwards;
}
.project-tile:hover {
    border-color: var(--sage);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}
.project-tile-name {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 16px;
    color: var(--text);
    margin-bottom: 5px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--border);
    line-height: 1.3;
}
.project-tile-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
    margin-bottom: 10px;
}
.project-tile-meta span {
    background: var(--cream);
    padding: 3px 10px;
    border-radius: 20px;
}
.project-tile-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-top: 8px;
}
.project-tile-desc.clickable {
    cursor: pointer;
}
.project-tile-desc.clickable:hover { color: var(--text); }
.project-tile-source {
    font-size: 12px;
    color: var(--terracotta);
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.project-tile-source a { color: var(--terracotta); text-decoration: none; }
.project-tile-source a:hover { text-decoration: underline; }
.project-tile-footer {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}
.project-tile-cover {
    aspect-ratio: 16/9;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin: -20px -20px 14px -20px;
    border-bottom: 1px solid var(--border);
    background: var(--cream);
}
.project-tile-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.project-tile-cover-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 44px;
    opacity: 0.5;
}
.project-tile-cover-date {
    background: rgba(255,255,255,0.85);
    color: var(--text);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    position: absolute;
    top: 10px;
    right: 10px;
}
.project-tile-pos-rel { position: relative; }
.tile-badge-group {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    gap: 5px;
}
.tile-badge {
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 10px;
    border-radius: 4px;
    line-height: 1.3;
    background: rgba(44, 42, 38, 0.75);
}
/* Typ-Badges */
.badge-video    { background: #2b7a4b; }
.badge-pdf      { background: #c0392b; }
.badge-book     { background: #8e6a3a; }
.badge-website  { background: #2471a3; }
.badge-other    { background: #7f8c8d; }
/* Plattform-Badges */
.badge-youtube  { background: #ff0000; }
.badge-tiktok   { background: #010101; }
.badge-instagram { background: #c13584; }
.badge-pinterest { background: #bd081c; }
.badge-vimeo    { background: #1ab7ea; }
.badge-etsy     { background: #f1641e; }
.badge-ravelry  { background: #ee6e62; }
.badge-amazon   { background: #ff9900; color: #111; }

/* File-Row für Tutorial-Files / Rechnungs-Files (Liste statt Thumbnails) */
.file-row-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.file-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--cream);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.file-row-icon {
    font-size: 24px;
    width: 40px;
    text-align: center;
    flex-shrink: 0;
}
.file-row-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
.file-row-name {
    font-size: 13px;
    color: var(--text);
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}
.file-row-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    letter-spacing: 0.01em;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
}
.file-row-meta > span { white-space: nowrap; }
.file-row-meta .meta-sep {
    margin: 0 8px;
    opacity: 0.4;
}
.file-row-meta .meta-dim { opacity: 0.45; font-size: 11px; }
.file-row-size {
    flex-shrink: 0;
    white-space: nowrap;
    margin-left: auto;
    font-size: 12px;
    color: var(--text-muted);
    opacity: 1;
}
.file-row-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.empty-sm {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 13px;
}

/* ── Gallery ──────────────────────────────── */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
.gallery-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid var(--border);
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--cream);
}
.gallery-item:hover { border-color: var(--sage); }
.gallery-item.selected {
    border-color: var(--terracotta);
    box-shadow: 0 0 0 2px var(--terracotta);
}
.gallery-item img,
.gallery-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.gallery-item-action {
    position: absolute;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: rgba(44,42,38,0.55);
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s;
}
.gallery-item:hover .gallery-item-action { opacity: 1; }
.gallery-item-action:hover { background: rgba(44,42,38,0.85); }
.gallery-item-action-tl { top: 6px; left: 6px; }
.gallery-item-action-tr { top: 6px; right: 6px; }
.flex-center-full {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}
.text-xxl { font-size: 44px; }
.gallery-item .vis-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    backdrop-filter: blur(4px);
}
.gallery-item .vis-badge.internal { background: rgba(107,143,173,0.85); color: #fff; }
.gallery-item .vis-badge.external { background: rgba(107,143,113,0.85); color: #fff; }
.gallery-item .vis-badge.both     { background: rgba(196,112,90,0.85); color: #fff; }
.gallery-item .select-check {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: rgba(44,42,38,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}
.gallery-item.selected .select-check {
    background: var(--terracotta);
    border-color: var(--terracotta);
}

/* Batch-Aktionsleiste */
.batch-bar {
    display: none;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--accent-border);
    border-left: 4px solid var(--terracotta);
    border-radius: var(--radius);
    margin-bottom: 20px;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 14px;
    color: var(--text);
    box-shadow: var(--shadow);
}
.batch-bar.active { display: flex; }
.batch-count {
    font-weight: 700;
    color: var(--terracotta);
    font-size: 16px;
}
.batch-bar-clear { margin-left: auto; }

/* ── Upload Drop Area ─────────────────────── */
.upload-drop {
    display: block;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 24px;
    background: var(--cream);
    color: var(--text-muted);
}
.upload-drop:hover,
.upload-drop.dragover {
    border-color: var(--sage);
    background: var(--sage-light);
    color: var(--text);
}
.upload-drop input[type="file"] { display: none; }
.upload-drop-icon {
    font-size: 36px;
    margin-bottom: 12px;
    opacity: 0.7;
}
.upload-drop-hint {
    font-size: 13px;
    color: var(--text-dim);
    margin-top: 6px;
}

/* ── Detail-Overlay (Slide-in Panel) ─────── */
.detail-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(44, 42, 38, 0.55);
    z-index: 1000;
}
.detail-overlay.active { display: flex; }
.detail-panel {
    background: var(--bg-card);
    width: 100%;
    max-width: 720px;
    margin-left: auto;
    height: 100vh;
    overflow-y: auto;
    padding: 28px 32px;
    border-left: 1px solid var(--border);
    box-shadow: -8px 0 32px rgba(44,42,38,0.18);
    animation: slideInRight 0.25s ease;
}
.detail-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
}
.detail-panel-header h2 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 20px;
    color: var(--text);
}
.detail-preview {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    background: var(--cream);
    margin-bottom: 20px;
}
.detail-meta {
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--text-muted);
    background: var(--cream);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
}
.detail-meta span { display: block; margin-bottom: 4px; }
.detail-meta span:last-child { margin-bottom: 0; }
.detail-form .form-group { margin-bottom: 16px; }
.detail-actions {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
}

/* Assign Tags */
.assign-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.assign-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    background: var(--sage-light);
    border: 1px solid rgba(107,143,113,0.25);
    color: var(--sage-dark);
    font-weight: 600;
}
.assign-tag button {
    background: none;
    border: none;
    color: var(--sage-dark);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0 0 0 2px;
}
.assign-tag button:hover { color: var(--terracotta); }
.assign-empty { color: var(--text-dim); font-size: 13px; }
.assign-add-btn { margin-top: 6px; }

/* Section-Title Wrap (Flex-column inside section-header) */
.section-title-wrap { display: flex; flex-direction: column; gap: 4px; }

/* Filter-Bar (kompakt, z.B. Worker Jobs, Galerie) */
.filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    align-items: center;
}
.filter-bar select,
.filter-bar input[type="text"] { width: auto; min-width: 140px; }
.filter-bar button {
    padding: 8px 16px;
    border-radius: 999px;
    border: 1.5px solid var(--border);
    background: var(--bg-card);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    font-family: var(--font-body);
    transition: all 0.15s;
}
.filter-bar button:hover {
    background: var(--cream);
    color: var(--text);
    border-color: var(--sand);
}
.filter-bar button.active {
    background: var(--terracotta);
    color: #fff;
    border-color: var(--terracotta);
}

/* ── Häkel-Studio ──────────────────────────── */
.studio-layout { display: flex; flex-direction: column; gap: 16px; }
.studio-project-picker { width: 100%; }
.studio-project-picker select { width: 100%; margin-bottom: 0; }
.studio-project-bar {
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.studio-project-bar-actions {
    display: flex;
    gap: 6px;
    margin-left: auto;
    flex-wrap: wrap;
}
.studio-card-header-wrap { flex-wrap: wrap; }
.studio-empty-inline {
    padding: 24px;
    text-align: center;
    color: var(--text-dim);
    font-size: 14px;
}
.studio-qty-input { font-size: 18px; text-align: center; }
.studio-matcheck-box {
    max-height: 300px;
    overflow-y: auto;
    margin: 8px 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px;
}
.studio-matcheck-actions { margin-top: 8px; }
.studio-matcheck-btn { flex: 1; }
.studio-form-spacer { margin-top: 12px; }
.studio-sticky-header {
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 1;
}
.studio-quickview-body { padding: 0; }

/* Projekt-Info Card */
.project-info-card { padding: 16px 22px; }
.project-info-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    font-size: 14px;
}
.project-info-notes {
    margin-top: 14px;
    padding: 12px 16px;
    background: var(--cream);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-muted);
    white-space: pre-wrap;
    line-height: 1.5;
}
.project-info-notes-label {
    font-weight: 700;
    color: var(--text);
    display: block;
    margin-bottom: 4px;
}

/* Timer (Studio + Produktions-Tracker) */
.timer-card {
    text-align: center;
    padding: 28px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}
.timer-piece-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 10px;
    font-weight: 600;
}
.timer-display {
    font-family: var(--font-display);
    font-size: 48px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 2px;
    color: var(--text);
    margin: 12px 0 20px;
    line-height: 1;
}
.timer-display.running { color: var(--sage); }
.timer-display.paused  { color: var(--warning); }
.timer-buttons,
.timer-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.timer-buttons .btn { min-width: 110px; }
.timer-meta,
.timer-total {
    margin-top: 12px;
    color: var(--text-muted);
    font-size: 13px;
}
.timer-stats {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 14px;
    font-size: 13px;
    color: var(--text-muted);
}
.timer-session-list {
    margin-top: 16px;
    text-align: left;
}

/* Section-Overview Item (Studio Anleitung-Liste) */
.section-overview-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s;
    min-height: 52px;
    gap: 12px;
}
.section-overview-item:last-child { border-bottom: none; }
.section-overview-item:hover { background: var(--cream); }
.section-overview-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}
.section-overview-meta {
    font-size: 12px;
    color: var(--text-muted);
    text-align: right;
    white-space: nowrap;
}

/* Photos Grid (Studio Fotos, Produkt-Fotos) */
.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    padding: 16px 22px;
}
.photo-thumb {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    background: var(--cream);
    border: 1px solid var(--border);
}
.photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.photo-thumb .delete-photo {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(44,42,38,0.75);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    cursor: pointer;
    font-size: 13px;
    display: none;
    align-items: center;
    justify-content: center;
}
.photo-thumb:hover .delete-photo { display: flex; }

/* Material List (Studio) */
.material-item {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px 22px;
    border-bottom: 1px solid var(--border);
}
.material-item:last-child { border-bottom: none; }
.material-type {
    min-width: 32px;
    text-align: center;
    font-size: 18px;
}
.material-info { flex: 1; }
.material-info .name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}
.material-info .detail {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Meta-Grid (2-Spalten) */
.meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 20px 22px;
}

/* Upload-Area (Studio) */
.upload-area {
    padding: 20px 22px;
    text-align: center;
}
.upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    background: var(--cream);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    color: var(--text);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}
.upload-btn:hover {
    border-color: var(--sage);
    color: var(--sage-dark);
    background: var(--sage-light);
}
.upload-btn input[type="file"] { display: none; }

/* ── Produktions-Tracker ──────────────────── */
.prod-cards {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.prod-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 22px;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s;
}
.prod-card:hover { box-shadow: var(--shadow-hover); }
.prod-card-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 16px;
    color: var(--text);
    margin-bottom: 4px;
}
.prod-card-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.prod-progress-wrap { margin: 12px 0 8px; }
.prod-progress,
.prod-progress-bg {
    background: var(--cream);
    border-radius: 6px;
    height: 8px;
    overflow: hidden;
}
.prod-progress-bar,
.prod-progress-fill {
    height: 100%;
    background: var(--sage);
    border-radius: 6px;
    transition: width 0.3s;
}
.prod-progress-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}
.prod-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
}
.prod-card-title .prod-qty {
    font-weight: 400;
    color: var(--text-dim);
}

/* Collapsible Card Headers + Toggle-Label */
.guide-card-header.clickable { cursor: pointer; }
.toggle-label {
    margin-left: auto;
    font-size: 0.8em;
    color: var(--text-dim);
}

/* Kleine Section-Labels in Modals */
.section-label {
    font-size: 0.82em;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}
.section-label.mt-12 { margin-top: 12px; }

/* Material-Check Liste */
.check-list-box {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    font-size: 0.88em;
}
.check-loading { padding: 10px; color: var(--text-dim); }
.check-item {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 8px;
    font-size: 0.85em;
}
.check-item:last-child { border-bottom: none; }
.check-item .check-detail { font-size: 0.8em; color: var(--text-dim); }
.check-item .missing-warn { color: var(--terracotta); }

/* Form-Group inline Checkbox */
.form-group.inline-checkbox {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}
.form-group.inline-checkbox input[type="checkbox"] { width: auto; }
.form-group.inline-checkbox label {
    text-transform: none;
    letter-spacing: 0;
}

/* Guide "keine Runden"-Fallback */
.guide-empty-sm {
    padding: 8px 20px;
    font-size: 0.85em;
    color: var(--text-dim);
}

/* Packaging-Item-Row (Preset-Verwaltung) */
.pkg-item-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}
.pkg-item-row input { padding: 8px 10px; font-size: 0.9em; }
.pkg-item-row .pkg-name-input  { flex: 2; }
.pkg-item-row .pkg-cents-input { flex: 1; }
.pkg-item-row .ct-unit {
    font-size: 0.8em;
    color: var(--text-dim);
    white-space: nowrap;
}

/* Work Header + Piece Dots */
.work-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.work-header h2 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 18px;
    flex: 1;
    color: var(--text);
}
.piece-dots {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}
.piece-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--border);
    border: 2px solid var(--border);
}
.piece-dot.done {
    background: var(--sage);
    border-color: var(--sage);
}
.piece-dot.current {
    background: transparent;
    border-color: var(--terracotta);
}

/* Guide-Card (Anleitung in Produktions-Tracker) */
.guide-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.guide-card-header {
    padding: 14px 22px;
    border-bottom: 1px solid var(--border);
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    background: var(--cream);
}
.guide-section-title {
    padding: 10px 22px 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    background: rgba(240, 235, 225, 0.5);
    border-bottom: 1px solid var(--border);
}
.guide-row {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    gap: 10px;
    padding: 10px 22px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.1s;
    align-items: start;
}
.guide-row:last-child { border-bottom: none; }
.guide-row:hover { background: var(--cream); }
.guide-row.highlighted { background: var(--warning-light); }
.guide-row-num {
    color: var(--text-dim);
    font-size: 13px;
    padding-top: 1px;
    font-variant-numeric: tabular-nums;
}
.guide-row-text { line-height: 1.5; color: var(--text); }
.guide-row-count {
    color: var(--text-muted);
    font-size: 12px;
    white-space: nowrap;
    padding-top: 2px;
    font-variant-numeric: tabular-nums;
}
.guide-row-note {
    grid-column: 2 / -1;
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
}
.guide-empty {
    padding: 28px;
    text-align: center;
    color: var(--text-dim);
    font-size: 13px;
}

/* Times-Card + Chips */
.times-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 16px;
    overflow: hidden;
}
.times-card-header {
    padding: 14px 22px;
    border-bottom: 1px solid var(--border);
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 15px;
    color: var(--text);
    background: var(--cream);
}
.times-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 22px;
}
.time-chip {
    background: var(--cream);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 5px 14px;
    font-size: 12px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* Status-Badges (Produktion) */
.badge-todo        { background: var(--warning-light); color: #8f6d17; }
.badge-reserved    { background: var(--terracotta-light); color: var(--terracotta); }
.badge-in-progress { background: var(--blue-light); color: #3a5d7f; }
.badge-done        { background: var(--sage-light); color: var(--sage-dark); }
.badge-sold        { background: var(--purple-light); color: #5c3d7a; }

/* Kalkulation-Rows */
.calc-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}
.calc-row:last-child { border-bottom: none; }
.calc-row .label { color: var(--text-muted); }
.calc-row .value { font-weight: 600; color: var(--text); }
.calc-row.total {
    font-weight: 700;
    font-size: 15px;
    border-top: 2px solid var(--border);
    margin-top: 8px;
    padding-top: 12px;
}
.calc-row.highlight {
    color: var(--terracotta);
    font-size: 16px;
    font-weight: 700;
}
.calc-section {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-dim);
    margin: 14px 0 6px;
}
.calc-section:first-child { margin-top: 0; }
.calc-detail {
    font-size: 12px;
    color: var(--text-dim);
    padding: 2px 0 2px 12px;
}

/* ── Packstation ──────────────────────────── */
.pack-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}
@media (min-width: 900px) { .pack-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1400px) { .pack-grid { grid-template-columns: 1fr 1fr 1fr; } }

.pack-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s, transform 0.15s;
}
.pack-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-1px);
}
.pack-card.problem {
    border-color: var(--terracotta);
    border-width: 2px;
}
.pack-card.done { opacity: 0.6; }
.pack-header {
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    background: var(--cream);
}
.pack-header .order-num {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 16px;
    color: var(--text);
}
.pack-header .order-date {
    font-size: 12px;
    color: var(--text-muted);
}
.pack-customer {
    padding: 12px 18px;
    background: rgba(240, 235, 225, 0.25);
    font-size: 13px;
    border-bottom: 1px solid var(--border);
}
.pack-customer .name { font-weight: 700; color: var(--text); }
.pack-customer .address {
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.4;
}
.pack-items { padding: 14px 18px; }
.pack-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.pack-item:last-child { border-bottom: none; }
.pack-item img {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--cream);
}
.pack-item .item-name {
    flex: 1;
    font-size: 13px;
    color: var(--text);
}
.pack-item .item-qty {
    font-weight: 700;
    font-size: 14px;
    min-width: 36px;
    text-align: center;
    color: var(--text);
}
.pack-item .stock-ok       { color: var(--sage); }
.pack-item .stock-missing  { color: var(--terracotta); font-weight: 700; }

.pack-info {
    padding: 10px 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    border-top: 1px solid var(--border);
}
.pack-info .tag {
    padding: 4px 12px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 11px;
}
.tag-paid    { background: var(--sage-light); color: var(--sage-dark); }
.tag-unpaid  { background: var(--terracotta-light); color: var(--terracotta); }
.tag-box     { background: var(--blue-light); color: #3a5d7f; }
.tag-notes   { background: var(--warning-light); color: #8f6d17; }

.pack-steps {
    padding: 12px 18px;
    border-top: 1px solid var(--border);
}
.step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}
.step:last-child { border-bottom: none; }
.step-check {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
    background: var(--bg-card);
    transition: all 0.15s;
}
.step-check.done {
    background: var(--sage);
    border-color: var(--sage);
    color: #fff;
}
.step-label {
    flex: 1;
    font-size: 14px;
    color: var(--text);
}
.step-label.done {
    text-decoration: line-through;
    color: var(--text-dim);
}

.pack-actions {
    padding: 14px 18px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    border-top: 1px solid var(--border);
}
.pack-actions button {
    flex: 1;
    min-width: 120px;
}

.tracking-input {
    display: flex;
    gap: 8px;
    padding: 0 18px 14px;
    align-items: center;
}
.tracking-input select,
.tracking-input input {
    padding: 9px 12px;
    font-size: 13px;
}
.tracking-input input { flex: 1; }

.return-panel {
    padding: 14px 18px;
    background: var(--warning-light);
    border-top: 2px solid var(--warning);
}
.return-panel h4 {
    font-size: 13px;
    font-weight: 700;
    color: #8f6d17;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Versand / Shipments ──────────────────── */
.search-big {
    width: 100%;
    padding: 14px 18px;
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    font-size: 16px;
    background: var(--bg-card);
    color: var(--text);
    margin-bottom: 20px;
    font-family: var(--font-body);
}
.search-big:focus {
    border-color: var(--sage);
    box-shadow: 0 0 0 3px var(--sage-light);
    outline: none;
}

.shipment-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.shipment-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 22px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--sand);
    transition: box-shadow 0.2s;
}
.shipment-card:hover { box-shadow: var(--shadow-hover); }
.shipment-card.warning   { border-left-color: var(--warning); }
.shipment-card.problem   { border-left-color: var(--terracotta); }
.shipment-card.delivered { border-left-color: var(--sage); }
.shipment-card.return    { border-left-color: var(--purple-muted); }

.ship-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}
.ship-top .order-num {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 16px;
    color: var(--text);
}
.ship-top .ship-status {
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.ship-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    font-size: 13px;
}
@media (min-width: 700px) {
    .ship-details { grid-template-columns: 1fr 1fr 1fr 1fr; }
}
.ship-details .detail-label {
    color: var(--text-dim);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 700;
}
.ship-details .detail-value {
    font-weight: 600;
    margin-top: 2px;
    color: var(--text);
}

.ship-timeline {
    display: flex;
    gap: 0;
    margin: 16px 0 12px;
    align-items: center;
}
.tl-step {
    flex: 1;
    text-align: center;
    position: relative;
}
.tl-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--border);
    margin: 0 auto 6px;
    transition: all 0.2s;
}
.tl-dot.active { background: var(--sage); }
.tl-dot.current {
    background: var(--terracotta);
    box-shadow: 0 0 0 4px var(--terracotta-light);
}
.tl-line {
    height: 2px;
    background: var(--border);
    flex: 1;
}
.tl-line.active { background: var(--sage); }
.tl-label {
    font-size: 11px;
    color: var(--text-dim);
    font-weight: 600;
}
.tl-label.active {
    color: var(--sage-dark);
    font-weight: 700;
}

.ship-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
}

/* ── Worker Jobs ──────────────────────────── */
.job-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 22px;
    margin-bottom: 14px;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s;
}
.job-card:hover { box-shadow: var(--shadow-hover); }
.job-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    gap: 12px;
    flex-wrap: wrap;
}
.job-url {
    font-size: 13px;
    color: var(--text-muted);
    word-break: break-all;
    margin-bottom: 10px;
}
.job-url a { color: var(--terracotta); text-decoration: none; }
.job-url a:hover { text-decoration: underline; }
.job-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: var(--text-dim);
}
.job-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}
.job-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.status-pending      { background: var(--warning-light); color: #8f6d17; }
.status-downloading,
.status-uploading,
.status-extracting,
.status-saving       { background: var(--blue-light); color: #3a5d7f; }
.status-analyzing    { background: var(--purple-light); color: #5c3d7a; }
.status-done         { background: var(--sage-light); color: var(--sage-dark); }
.status-error        { background: var(--terracotta-light); color: var(--terracotta); }
.status-cancelled    { background: var(--cream); color: var(--text-dim); }

.priority-select {
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
}
.raw-result {
    max-height: 200px;
    overflow-y: auto;
    background: var(--cream);
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    margin-top: 10px;
    color: var(--text);
    display: none;
}

/* ── Tickets / Chat ──────────────────────── */
.ticket-row td { vertical-align: middle; }
.sender-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}
.sender-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--terracotta-light);
    border: 1.5px solid rgba(196,112,90,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: var(--terracotta);
    flex-shrink: 0;
    font-family: var(--font-body);
}
.sender-name {
    font-weight: 700;
    line-height: 1.3;
    color: var(--text);
}
.sender-email {
    font-size: 12px;
    color: var(--text-dim);
}

.ticket-sender-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}
.ticket-sender-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--terracotta-light);
    border: 2px solid rgba(196,112,90,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: var(--terracotta);
    flex-shrink: 0;
    font-family: var(--font-body);
}
.ticket-sender-info { flex: 1; min-width: 0; }
.ticket-sender-info strong {
    display: block;
    font-size: 16px;
    color: var(--text);
}
.ticket-sender-info a {
    font-size: 13px;
    color: var(--terracotta);
    text-decoration: none;
}
.ticket-sender-info a:hover { text-decoration: underline; }

.ticket-meta {
    display: flex;
    gap: 14px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: flex-end;
}
.ticket-meta > div {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.ticket-meta label {
    font-size: 11px;
    color: var(--text-dim);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Chat-Bubbles */
.msg-list {
    max-height: 420px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    padding: 6px;
}
.msg-bubble {
    display: flex;
    flex-direction: column;
}
.msg-bubble.admin    { align-items: flex-end; }
.msg-bubble.customer { align-items: flex-start; }
.msg-inner {
    border-radius: var(--radius);
    padding: 12px 16px;
    max-width: 82%;
    line-height: 1.5;
}
.msg-bubble.admin .msg-inner {
    background: var(--terracotta-light);
    border: 1px solid rgba(196,112,90,0.2);
    color: var(--text);
}
.msg-bubble.customer .msg-inner {
    background: var(--cream);
    border: 1px solid var(--border);
    color: var(--text);
}
.msg-meta {
    font-size: 11px;
    color: var(--text-dim);
    margin-bottom: 6px;
    font-weight: 600;
}
.msg-text {
    white-space: pre-wrap;
    font-size: 14px;
    line-height: 1.5;
}

.ai-summary {
    background: var(--terracotta-light);
    border: 1px solid rgba(196,112,90,0.2);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--text);
    line-height: 1.5;
}
.ai-summary strong { color: var(--terracotta); }

.reply-area {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.reply-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.template-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}
.template-chip {
    padding: 5px 14px;
    border-radius: 999px;
    font-size: 12px;
    cursor: pointer;
    border: 1.5px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    font-weight: 600;
    transition: all 0.15s;
}
.template-chip:hover {
    border-color: var(--terracotta);
    background: var(--terracotta-light);
    color: var(--terracotta);
}
.tpl-manage-row {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.tpl-manage-row:last-child { border-bottom: none; }
.tpl-manage-row .tpl-title {
    flex: 1;
    font-weight: 600;
    color: var(--text);
}
.tpl-manage-row .tpl-cat {
    font-size: 12px;
    color: var(--text-dim);
    min-width: 90px;
}

/* ── Material-Liste (Wolle/Nadeln/Zubehör) ── */
.yarn-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
    padding: 18px 22px;
}
.yarn-grid-grouped {
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 18px 22px;
}
.yarn-group-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 0 2px 6px;
    margin-top: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border);
    font-weight: 300;
    font-size: 115%;
    color: var(--text-muted, var(--text));
}
.yarn-grid-inner {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}
/* Kompakte Filterleiste (Wolle) — Selects/Inputs kleiner, damit mehr in eine Zeile passt */
#tab-yarn .card-header input {
    font-size: 0.8em;
    padding: 5px 8px;
    height: auto;
}
#tab-yarn .card-header select {
    font-size: 0.85em;
    padding: 5px 26px 5px 10px; /* rechts Platz für den Chevron */
    height: auto;
}
#tab-yarn #yarn-sort-dir {
    min-width: 140px;
}
#tab-yarn .card-header .btn {
    font-size: 0.8em;
    padding: 5px 10px;
}
.needle-grid {
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 18px 22px;
}
.needle-group-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 0 2px 6px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.95em;
    color: var(--text-muted, var(--text));
}
.needle-grid-inner {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

/* Multiselect-Dropdown (Wolle-Material-Filter) */
.multiselect { position: relative; display: inline-block; }
.multiselect-btn {
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 5px 26px 5px 10px;
    font-size: 0.85em;
    font-family: inherit;
    color: var(--text);
    cursor: pointer;
    position: relative;
    min-width: 140px;
    text-align: left;
}
.multiselect-btn.multiselect-active {
    background: var(--accent-bg);
    border-color: var(--accent-border);
    color: var(--accent);
}
.multiselect-chev { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 0.9em; }
.multiselect-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 50;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-top: 4px;
    padding: 6px;
    min-width: 180px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    max-height: 280px;
    overflow-y: auto;
}
.multiselect-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
}
.multiselect-option:hover { background: var(--input-bg); }
.multiselect-option input { margin: 0; }

/* Sort-Gruppe (Sortierung visuell abgesetzt) */
.sort-group {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px 2px 10px;
    border-left: 1px dashed var(--border);
    border-right: 1px dashed var(--border);
    background: rgba(0,0,0,0.02);
    border-radius: 4px;
}

/* Dual-Range-Slider für Nadelgrößenfilter (Nadel-Tab + Wolle-Tab) */
.needle-size-filter,
.yarn-size-filter {
    display: flex;
    align-items: center;
    gap: 8px;
}
.needle-size-filter .dual-range,
.yarn-size-filter .dual-range {
    position: relative;
    width: 160px;
    height: 22px;
}
.needle-size-filter .dual-range input[type="range"],
.yarn-size-filter .dual-range input[type="range"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    height: 22px;
    margin: 0;
}
.needle-size-filter .dual-range input[type="range"]::-webkit-slider-runnable-track,
.yarn-size-filter .dual-range input[type="range"]::-webkit-slider-runnable-track {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
}
.needle-size-filter .dual-range input[type="range"]::-moz-range-track,
.yarn-size-filter .dual-range input[type="range"]::-moz-range-track {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
}
.needle-size-filter .dual-range input[type="range"]::-webkit-slider-thumb,
.yarn-size-filter .dual-range input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--sage, #8aa88a);
    border: 2px solid var(--bg-card);
    pointer-events: auto;
    cursor: pointer;
    margin-top: -6px;
    position: relative;
    z-index: 2;
}
.needle-size-filter .dual-range input[type="range"]::-moz-range-thumb,
.yarn-size-filter .dual-range input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--sage, #8aa88a);
    border: 2px solid var(--bg-card);
    pointer-events: auto;
    cursor: pointer;
}
.needle-size-filter #needle-size-min-label,
.needle-size-filter #needle-size-max-label,
.yarn-size-filter #yarn-size-min-label,
.yarn-size-filter #yarn-size-max-label {
    min-width: 38px;
    font-variant-numeric: tabular-nums;
    text-align: center;
}
.yarn-card,
.needle-card {
    background: linear-gradient(160deg, rgba(107,143,113,0.11) 0%, rgba(107,143,113,0.03) 70%, var(--bg-card) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    position: relative;
    box-shadow: 0 2px 8px rgba(58,54,50,0.07), 0 1px 3px rgba(58,54,50,0.05);
}
.yarn-card:hover,
.needle-card:hover {
    border-color: var(--sage);
    box-shadow: var(--shadow-hover);
}
.yarn-card.low-stock { border-color: var(--warning); }
.yarn-card.yarn-card--new {
    background: linear-gradient(160deg, var(--sage-light, rgba(107,143,113,0.12)) 0%, var(--bg-card) 55%);
    border-color: rgba(107,143,113,0.35);
    box-shadow: 0 4px 14px rgba(107,143,113,0.18), 0 1px 3px rgba(0,0,0,0.06);
}
.yarn-color-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border);
    flex-shrink: 0;
}
.yarn-name {
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    cursor: pointer;
    user-select: none;
}
.yarn-toggle {
    font-size: 11px;
    color: var(--text-dim);
    transition: transform 0.2s;
    display: inline-block;
    flex-shrink: 0;
}
.yarn-toggle.open { transform: rotate(90deg); }
.yarn-details { display: none; }
.yarn-details.open { display: block; }
.yarn-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}
.yarn-label {
    font-weight: 700;
    color: var(--text-dim);
    display: block;
    margin-bottom: 2px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.yarn-stock {
    font-size: 14px;
    font-weight: 700;
    margin-top: 10px;
}
.yarn-stock.empty { color: var(--terracotta); }
.yarn-stock.low   { color: var(--warning); }
.yarn-stock.ok    { color: var(--sage); }

.low-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--warning);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.needle-card { text-align: center; }
.needle-size {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    color: var(--terracotta);
    line-height: 1;
}
.needle-type {
    font-size: 11px;
    color: var(--text-dim);
    margin: 6px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}
.needle-qty {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
}
.needle-qty.zero { color: var(--terracotta); }

/* Material Chips (Wolle-Material-Checkboxes) */
.mat-cb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
    cursor: pointer;
    color: var(--text);
}
.mat-cb-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.mat-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    background: var(--terracotta);
    color: #fff;
    border-radius: 999px;
    padding: 4px 10px 4px 12px;
    font-weight: 600;
}
.mat-chip button {
    background: none;
    border: none;
    color: rgba(255,255,255,0.85);
    cursor: pointer;
    font-size: 13px;
    padding: 0;
    line-height: 1;
}
.mat-chip button:hover { color: #fff; }
.mat-pct {
    width: 46px !important;
    padding: 3px 6px !important;
    font-size: 12px !important;
    text-align: center !important;
}

.supply-low   { background: var(--warning-light); }
.supply-empty { background: var(--terracotta-light); }

/* ── Rechner ──────────────────────────────── */
.calc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
@media (max-width: 900px) { .calc-grid { grid-template-columns: 1fr; } }

.calc-input {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}
.calc-input label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 700;
}
.calc-input input,
.calc-input select { width: 100%; }
.calc-input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.result-card {
    background: var(--cream);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}
.result-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.result-row:last-child { border-bottom: none; }
.result-row .label { color: var(--text-muted); }
.result-row .value {
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}
.result-highlight {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    color: var(--terracotta);
    text-align: center;
    padding: 18px 0;
    line-height: 1.2;
}
.result-highlight small {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 6px;
    font-family: var(--font-body);
}
.result-divider {
    border-top: 2px solid var(--border);
    margin: 10px 0;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.checkbox-row label {
    font-size: 14px;
    color: var(--text);
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
}

.price-table { width: 100%; margin-top: 16px; }

/* Profit-Marker (Preiskalkulation) */
.profit-red    { color: var(--terracotta); }
.profit-yellow { color: var(--warning); }
.profit-green  { color: var(--sage); }

/* ── Bestellungen-Intern ──────────────────── */
.order-number {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 15px;
    color: var(--terracotta);
}
.order-supplier {
    color: var(--text-muted);
    font-size: 13px;
}
.order-total {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}
.order-meta {
    font-size: 12px;
    color: var(--text-dim);
}
.action-btns {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    white-space: nowrap;
}
.action-btns button,
.action-btns .btn {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
}

/* Status-Badges Bestellungen */
.badge-draft     { background: var(--cream); color: var(--text-muted); }
.badge-ordered   { background: var(--blue-light); color: #3a5d7f; }
.badge-partial   { background: var(--warning-light); color: #8f6d17; }
.badge-received  { background: var(--sage-light); color: var(--sage-dark); }
.badge-cancelled { background: var(--terracotta-light); color: var(--terracotta); }
.badge-paid      { background: var(--sage-light); color: var(--sage-dark); }
.badge-unpaid    { background: var(--warning-light); color: #8f6d17; }
.badge-active    { background: var(--sage-light); color: var(--sage-dark); padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; display: inline-block; }
.badge-inactive  { background: var(--terracotta-light); color: var(--terracotta); padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; display: inline-block; }

/* Warenannahme */
.receive-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 16px;
    overflow: hidden;
    background: var(--bg-card);
    box-shadow: var(--shadow);
}
.receive-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--cream);
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}
.receive-card-header:hover { background: rgba(240, 235, 225, 0.8); }
.receive-card-header .toggle-icon {
    color: var(--text-dim);
    transition: transform 0.2s;
    font-size: 14px;
}
.receive-card-header.expanded .toggle-icon { transform: rotate(90deg); }
.receive-card-body {
    display: none;
    border-top: 1px solid var(--border);
}
.receive-card-body.open { display: block; }
.receive-item-row {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 14px;
    align-items: center;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
}
.receive-item-row:last-child { border-bottom: none; }
.receive-item-name { font-size: 14px; color: var(--text); }
.receive-item-qty { font-size: 12px; color: var(--text-dim); }
.receive-item-input {
    width: 80px;
    padding: 6px 10px !important;
    font-size: 13px !important;
}
.receive-item-unit {
    font-size: 12px;
    color: var(--text-muted);
    min-width: 42px;
}
.receive-all-row {
    display: flex;
    justify-content: flex-end;
    padding: 12px 18px;
    gap: 10px;
    background: var(--cream);
}
.receive-header-info { flex: 1; min-width: 0; }
.receive-header-info .rh-title {
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
}
.receive-header-info .rh-meta {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 2px;
}

/* Lieferanten Grid */
.supplier-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.supplier-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    position: relative;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s;
}
.supplier-card:hover { box-shadow: var(--shadow-hover); }
.supplier-card.inactive { opacity: 0.55; }
.supplier-name {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 16px;
    color: var(--text);
    margin-bottom: 6px;
}
.supplier-url {
    font-size: 12px;
    color: var(--terracotta);
    word-break: break-all;
    margin-bottom: 4px;
}
.supplier-contact {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.supplier-notes {
    font-size: 12px;
    color: var(--text-dim);
    font-style: italic;
}
.supplier-actions {
    position: absolute;
    top: 14px;
    right: 14px;
    display: flex;
    gap: 6px;
}
.inactive-badge {
    display: inline-block;
    font-size: 10px;
    background: var(--terracotta-light);
    color: var(--terracotta);
    padding: 2px 10px;
    border-radius: 999px;
    margin-left: 6px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Bestellung-Modal Items-Liste */
.order-items-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 10px;
}
.order-item-row + .order-item-row {
    border-top: 1px solid var(--border);
    margin-top: 14px;
    padding-top: 14px;
}
.order-item-row {
    display: grid;
    grid-template-columns: 18px 100px 1fr 110px 80px 80px 24px;
    gap: 8px;
    align-items: start;
}
.order-item-row select,
.order-item-row input {
    font-size: 12px;
    padding: 6px 8px;
}
.order-items-header {
    display: grid;
    grid-template-columns: 18px 100px 1fr 110px 80px 80px 24px;
    gap: 8px;
    font-size: 10px;
    color: var(--text-dim);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 0 6px;
}
.sort-btns {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding-top: 2px;
}
.sort-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 11px;
    padding: 1px;
    line-height: 1;
}
.sort-btn:hover { color: var(--text); }
.item-name-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.item-url-inline {
    font-size: 11px;
    padding: 3px 6px;
    opacity: 0.8;
}
.qty-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.qty-cell .item-qty { width: 100%; }
.grams-label {
    display: none;
    font-size: 11px;
    color: var(--text-dim);
    white-space: nowrap;
    align-items: center;
    gap: 4px;
}
.grams-label input {
    width: 52px;
    padding: 4px 6px;
    font-size: 11px;
}
.remove-item-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 16px;
    padding: 4px 2px;
    line-height: 1;
}
.remove-item-btn:hover { color: var(--terracotta); }
.order-total-line {
    text-align: right;
    font-weight: 700;
    font-size: 15px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

/* Form-Rows: Label oben, Input darunter. form-row-inline legt mehrere
   form-rows nebeneinander in ein 2/3-Spalten-Grid. */
.form-row {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px;
    margin-bottom: 14px;
}
.form-row > label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin: 0;
}
.form-row > input,
.form-row > select,
.form-row > textarea {
    width: 100%;
    box-sizing: border-box;
}
.form-row > label small { text-transform: none; font-weight: 400; letter-spacing: 0; }
.form-row-inline {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 14px;
}
.form-row-inline.triple { grid-template-columns: 1fr 1fr 1fr; }
.form-row-inline > .form-row { margin-bottom: 0; }
@media (max-width: 600px) {
    .form-row-inline,
    .form-row-inline.triple { grid-template-columns: 1fr; }
    .order-item-row,
    .order-items-header { grid-template-columns: 1fr; gap: 6px; }
    .order-items-header { display: none; }
    .receive-item-row { grid-template-columns: 1fr auto; }
}

/* ── Marketing Charts ─────────────────────── */
.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 140px;
    margin: 24px 0;
    padding: 0 12px;
}
.bar {
    flex: 1;
    background: var(--terracotta);
    border-radius: 6px 6px 0 0;
    min-height: 4px;
    position: relative;
    cursor: default;
    transition: opacity 0.2s;
}
.bar:hover { opacity: 0.8; }
.bar-label {
    font-size: 11px;
    color: var(--text-dim);
    text-align: center;
    margin-top: 6px;
    font-weight: 600;
}
.bar-tooltip {
    position: absolute;
    top: -32px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: var(--shadow);
    color: var(--text);
    font-weight: 600;
}
.progress-bar {
    height: 10px;
    background: var(--cream);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 6px;
}
.progress-fill {
    height: 100%;
    background: var(--terracotta);
    border-radius: 999px;
    transition: width 0.3s;
}

/* ── Kategorien (cat-table) ──────────────── */
.cat-table { width: 100%; border-collapse: collapse; }
.cat-table th,
.cat-table td {
    padding: 14px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.cat-table th {
    font-weight: 700;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    background: rgba(240, 235, 225, 0.45);
}
.cat-table tr:hover td { background: rgba(240, 235, 225, 0.35); }
.emoji-cell {
    font-size: 22px;
    text-align: center;
    width: 60px;
}
.drag-handle {
    cursor: grab;
    color: var(--text-dim);
    font-size: 18px;
    user-select: none;
    transition: color 0.2s;
}
.drag-handle:hover { color: var(--text); }
.drag-handle:active { cursor: grabbing; }
.cat-table tr.drag-over td { border-top: 2px solid var(--sage); }
.cat-table tr[draggable="true"] { cursor: grabbing; }

/* ── Responsive ──────────────────────────── */

@media (max-width: 1100px) {
    .form-grid.cols-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .hamburger { display: flex; }
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 150;
        border-radius: 0;
    }
    .sidebar.open { transform: translateX(0); }
    .main,
    .main-content {
        margin-left: 0;
        padding: 24px 20px 32px;
        padding-top: 72px;
    }
    .page-header { margin-bottom: 22px; }
    .page-header-left h1,
    .page-header h1,
    .page-header h2 { font-size: 22px; }
    .form-grid,
    .form-grid.cols-3 { grid-template-columns: 1fr; }
    .card-header { padding: 16px 18px; }
    .card-body { padding: 18px; }
    table th, table td { padding: 12px 14px; font-size: 13px; }
    .modal-header, .modal-body { padding: 16px 18px; }
    .modal-footer, .modal-actions { padding: 14px 18px; }
}

/* ── TreeFilter ── */
.tree-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 0;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
    align-self: flex-start;
    position: sticky;
    top: 16px;
}
.tree-list, .tree-children {
    list-style: none;
    margin: 0;
    padding: 0;
}
.tree-children {
    margin-left: 28px;
}
.tree-node {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    cursor: pointer;
    font-size: 13px;
    border-radius: 0;
    transition: background 0.15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tree-node:hover { background: var(--bg-hover, rgba(255,255,255,0.05)); }
.tree-node--active {
    background: rgba(231,111,81,0.15);
    color: var(--primary, #e76f51);
    font-weight: 600;
}
.tree-node--child {
    font-size: 12px;
    opacity: 0.85;
    position: relative;
}
/* vertikale Linie: letztes Kind nur bis Mitte, alle anderen durchgehend */
.tree-node--child::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 50%;
    width: 1px;
    background: var(--border);
}
.tree-node--child:not(:last-child)::before {
    bottom: 0;
}
/* horizontaler Knick für alle */
.tree-node--child::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 14px;
    height: 1px;
    background: var(--border);
}
.tree-node-icon { font-size: 14px; flex-shrink: 0; }
.tree-node-label { overflow: hidden; text-overflow: ellipsis; }

/* Layout: Tree links + Grid rechts */
.gallery-split {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}
.gallery-split .card-grid { flex: 1; min-width: 0; }

/* ── Stacked Tiles ── */
.tile-stack-wrap {
    position: relative;
}
.tile-stack-wrap .project-tile:nth-child(1) {
    transform: rotate(-4deg) translateY(-4px);
    z-index: 1;
}
.tile-stack-wrap .project-tile:nth-child(2) {
    transform: rotate(-1deg);
    z-index: 2;
}
.tile-stack-wrap .project-tile:nth-child(3) {
    transform: none;
    z-index: 3;
    position: relative;
}
.tile-stack-wrap .project-tile:nth-child(1),
.tile-stack-wrap .project-tile:nth-child(2) {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.tile-stack-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--primary, #e76f51);
    color: #fff;
    border-radius: 999px;
    padding: 2px 9px;
    font-size: 11px;
    font-weight: 700;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    pointer-events: none;
}

/* ── Fächer-Modal ── */
.fan-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10,10,15,0.6);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}
.fan-modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px 28px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.5);
    max-width: 700px;
    width: 90%;
    position: relative;
}
.fan-modal-title { font-size: 16px; font-weight: 600; margin: 0 0 4px; }
.fan-modal-sub   { font-size: 12px; opacity: 0.55; margin-bottom: 18px; }
.fan-cards-row   { display: flex; gap: 14px; flex-wrap: wrap; }
.fan-card {
    flex: 1;
    min-width: 140px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    cursor: pointer;
    text-align: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s;
}
.fan-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(231,111,81,0.4);
    border-color: var(--primary, #e76f51);
}
.fan-card-img {
    height: 80px;
    border-radius: 6px;
    margin-bottom: 8px;
    background: var(--bg-hover, rgba(255,255,255,0.06));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.fan-card-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }
.fan-card-label { font-size: 12px; font-weight: 600; }
.fan-card-sub   { font-size: 10px; opacity: 0.55; margin-top: 2px; }
.fan-close {
    position: absolute;
    top: 14px; right: 16px;
    background: none; border: none;
    color: var(--text-dim, rgba(255,255,255,0.5));
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
}
.fan-close:hover { color: var(--text); }

/* ── Gruppen-Auswahl-Checkboxen ── */
.tile-select-check {
    position: absolute;
    top: 8px; left: 8px;
    width: 18px; height: 18px;
    z-index: 5;
    opacity: 0.25;
    transition: opacity 0.15s;
    cursor: pointer;
    accent-color: var(--primary, #e76f51);
}
.project-tile:hover .tile-select-check,
.tile-select-check:checked { opacity: 1; }

.group-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(231,111,81,0.1);
    border: 1px solid rgba(231,111,81,0.3);
    border-radius: 8px;
    margin-bottom: 14px;
    animation: fadeIn 0.2s ease;
}
}
