/* =====================================================================
 *  SALIERI'S KASSE - Stylesheet
 *  Dunkles Ristorante-Design in Schwarz, Gold und Bordeaux
 * ===================================================================== */

:root {
    --bg:         #0a0a0c;
    --bg-soft:    #121216;
    --panel:      #16161b;
    --panel-2:    #1d1d23;
    --line:       #2a2a32;
    --gold:       #d4af37;
    --gold-soft:  #e8cf8a;
    --gold-dark:  #8a6f1f;
    --wine:       #6d1118;
    --wine-soft:  #8d1a22;
    --text:       #ece7dc;
    --muted:      #8d8778;
    --green:      #4f9d69;
    --red:        #c0392b;
    --radius:     10px;
    --font-serif: Georgia, "Times New Roman", "Palatino Linotype", serif;
    --font-sans:  "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.5;
}

a { color: var(--gold-soft); text-decoration: none; }
a:hover { color: var(--gold); }

h1, h2, h3 { font-family: var(--font-serif); margin: 0; letter-spacing: .04em; }

.muted  { color: var(--muted); }
.small  { font-size: .82rem; }
.strong { font-weight: 700; }
.gold   { color: var(--gold); }
.right  { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mono   { font-family: "Consolas", "Courier New", monospace; font-size: .88rem; }
.hidden-form { display: none; }

/* ------------------------------------------------------------------ */
/* Grundlayout                                                         */
/* ------------------------------------------------------------------ */
.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 262px;
    flex: 0 0 262px;
    background: linear-gradient(180deg, #121216 0%, #0c0c0f 100%);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    padding: 18px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 6px 18px;
    border-bottom: 1px solid var(--line);
}

.brand-logo {
    width: 46px;
    height: 46px;
    object-fit: cover;
    border-radius: 50%;
    border: 1px solid var(--gold-dark);
    background: #000;
}

.brand-text { display: flex; flex-direction: column; }
.brand-name { font-family: var(--font-serif); font-size: 1.1rem; color: var(--gold); letter-spacing: .12em; }
.brand-sub  { font-size: .72rem; color: var(--muted); letter-spacing: .18em; text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 3px; margin-top: 18px; flex: 1; }

.nav-section {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .18em;
    color: var(--muted);
    margin: 14px 8px 6px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: var(--text);
    border: 1px solid transparent;
    transition: background .15s, border-color .15s, color .15s;
}

.nav-link:hover { background: var(--panel-2); color: var(--gold-soft); }

.nav-link.is-active {
    background: linear-gradient(90deg, rgba(212,175,55,.16), rgba(212,175,55,.02));
    border-color: var(--gold-dark);
    color: var(--gold);
}

.nav-icon { color: var(--gold-dark); font-size: .8rem; }

.sidebar-foot { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }

.user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--panel);
}
.user-card:hover { border-color: var(--gold-dark); }

.avatar {
    width: 36px; height: 36px;
    flex: 0 0 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gold-dark), #3a2f10);
    color: #ffeeb6;
    font-family: var(--font-serif);
    font-size: .9rem;
    border: 1px solid var(--gold-dark);
}
.avatar-small { width: 30px; height: 30px; flex-basis: 30px; font-size: .78rem; }

.user-info { display: flex; flex-direction: column; overflow: hidden; }
.user-name { font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: .72rem; color: var(--muted); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 26px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(109,17,24,.18), transparent);
}

.page-title { font-size: 1.5rem; color: var(--gold-soft); }
.clock { color: var(--muted); font-size: .85rem; letter-spacing: .08em; }

.content { padding: 20px 26px; flex: 1; display: flex; flex-direction: column; gap: 18px; }

.footer {
    padding: 16px 26px 24px;
    text-align: center;
    color: var(--muted);
    font-family: var(--font-serif);
    font-size: .82rem;
    letter-spacing: .14em;
}

/* ------------------------------------------------------------------ */
/* Panels, Tabellen, Formulare                                         */
/* ------------------------------------------------------------------ */
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--line);
}
.panel-head h2 { font-size: 1.1rem; color: var(--gold-soft); }

.empty { color: var(--muted); padding: 18px 4px; text-align: center; }

.table-wrap { overflow-x: auto; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
    text-align: left;
    font-size: .72rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
    font-weight: 600;
}
.data-table td { padding: 10px; border-bottom: 1px solid rgba(42,42,50,.6); vertical-align: middle; }
.data-table tbody tr:hover { background: rgba(212,175,55,.04); }
.data-table.compact td { padding: 6px 8px; }
.data-table tr.is-inactive { opacity: .45; }

.person { display: flex; align-items: center; gap: 10px; }

.field { display: flex; flex-direction: column; gap: 4px; }
.field-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.field-grow { flex: 1 1 220px; }
.field-wide { grid-column: span 2; }
.field-check { flex-direction: row; align-items: center; gap: 8px; padding-top: 18px; }

input[type="text"], input[type="password"], input[type="number"], input[type="date"],
input[type="search"], select, textarea {
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    padding: 9px 11px;
    font-family: inherit;
    font-size: .92rem;
    width: 100%;
    min-width: 0;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--gold-dark);
    box-shadow: 0 0 0 2px rgba(212,175,55,.12);
}
input:disabled { color: var(--muted); }
textarea { resize: vertical; }

.input-inline { padding: 5px 8px; font-size: .86rem; }

.stack-form { display: flex; flex-direction: column; gap: 12px; max-width: 420px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.inline-form .field { min-width: 150px; }

.filterbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
}
.filterbar .field { min-width: 130px; }

/* Buttons ----------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--panel-2);
    color: var(--text);
    font-family: inherit;
    font-size: .9rem;
    cursor: pointer;
    transition: all .15s ease;
    text-align: center;
}
.btn:hover { border-color: var(--gold-dark); color: var(--gold-soft); }

.btn-gold {
    background: linear-gradient(180deg, var(--gold) 0%, #a9842a 100%);
    border-color: var(--gold);
    color: #1a1403;
    font-weight: 700;
    letter-spacing: .04em;
}
.btn-gold:hover { filter: brightness(1.08); color: #1a1403; }

.btn-ghost { background: transparent; }

.btn-danger { background: transparent; border-color: #5a1d1d; color: #e08b84; }
.btn-danger:hover { background: rgba(192,57,43,.14); border-color: var(--red); color: #ffb3ab; }

.btn-block { width: 100%; }
.btn-small { padding: 5px 10px; font-size: .8rem; }
.btn-large { padding: 14px 18px; font-size: 1rem; }

/* Flash-Meldungen --------------------------------------------------- */
.flashes { padding: 0 26px; display: flex; flex-direction: column; gap: 8px; }
.flash {
    border-radius: var(--radius);
    padding: 11px 14px;
    border: 1px solid var(--line);
    background: var(--panel);
    font-size: .92rem;
}
.flash-success { border-color: #2f6b45; background: rgba(79,157,105,.12); color: #bfe8cd; }
.flash-error   { border-color: #7a2b24; background: rgba(192,57,43,.12);  color: #f3c3bd; }
.flash-info    { border-color: var(--gold-dark); background: rgba(212,175,55,.1); color: var(--gold-soft); }

/* Status & Chips ---------------------------------------------------- */
.status {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: .74rem;
    letter-spacing: .06em;
    border: 1px solid var(--line);
}
.status-bezahlt   { color: #bfe8cd; border-color: #2f6b45; background: rgba(79,157,105,.12); }
.status-offen     { color: var(--gold-soft); border-color: var(--gold-dark); background: rgba(212,175,55,.1); }
.status-storniert { color: #f3c3bd; border-color: #7a2b24; background: rgba(192,57,43,.12); }

.quality-chip {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: .74rem;
    border: 1px solid var(--line);
}
.quality-chip.q-grau  { color: #d7d7d7; border-color: #6d6d6d; background: rgba(160,160,160,.12); }
.quality-chip.q-gruen { color: #a9e6c0; border-color: #2f7a52; background: rgba(47,122,82,.14); }
.quality-chip.q-lila  { color: #d9b4f0; border-color: #6b3b8a; background: rgba(107,59,138,.16); }
.quality-chip.q-gold  { color: #f2d98a; border-color: var(--gold-dark); background: rgba(212,175,55,.14); }

/* ------------------------------------------------------------------ */
/* Kasse                                                               */
/* ------------------------------------------------------------------ */
.kasse {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(360px, .9fr);
    gap: 18px;
    align-items: start;
}

.search-input { max-width: 230px; }

.category-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tab {
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    padding: 6px 14px;
    font-family: var(--font-serif);
    font-size: .85rem;
    letter-spacing: .06em;
    cursor: pointer;
}
.tab:hover { color: var(--gold-soft); border-color: var(--gold-dark); }
.tab.is-active { background: rgba(212,175,55,.14); border-color: var(--gold); color: var(--gold); }

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 10px;
}

.product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
    padding: 12px 13px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: linear-gradient(160deg, var(--panel-2), #131318);
    color: var(--text);
    cursor: pointer;
    min-height: 92px;
    transition: transform .12s ease, border-color .15s, box-shadow .15s;
}
.product-card:hover {
    border-color: var(--gold-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,.45);
}
.product-card:active { transform: translateY(0); }

.product-name  { font-family: var(--font-serif); font-size: .98rem; color: var(--gold-soft); }
.product-card.has-quality .product-name { padding-right: 62px; }
.product-desc  { font-size: .74rem; color: var(--muted); line-height: 1.35; }
.product-price { margin-top: auto; font-weight: 700; color: var(--gold); }
.quality-flag {
    position: absolute;
    top: 8px; right: 8px;
    font-size: .6rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--gold-dark);
    border: 1px solid var(--gold-dark);
    border-radius: 999px;
    padding: 1px 6px;
}

.free-item { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.free-item h3 { font-size: .95rem; color: var(--gold-soft); margin-bottom: 8px; }
.free-item .hint { font-size: .72rem; color: var(--muted); font-family: var(--font-sans); }
.free-item-row { display: flex; gap: 8px; flex-wrap: wrap; }
.free-item-row input[type="text"] { flex: 2 1 200px; }
.free-item-row input[type="number"] { flex: 1 1 110px; }

.today-box {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    border-top: 1px solid var(--line);
    padding-top: 14px;
    flex-wrap: wrap;
}
.today-item {
    flex: 1 1 120px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
}
.today-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.today-value { font-family: var(--font-serif); font-size: 1.15rem; color: var(--gold); }

/* Warenkorb --------------------------------------------------------- */
.cart-panel { position: sticky; top: 18px; }

.cart-list { display: flex; flex-direction: column; }

.cart-line {
    padding: 9px 2px;
    border-bottom: 1px solid rgba(42,42,50,.6);
}

.cl-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.cl-body { display: flex; align-items: center; gap: 8px; margin-top: 7px; }
.cl-sum { margin-left: auto; font-weight: 700; color: var(--gold); white-space: nowrap; }

.qty-box { display: flex; align-items: center; flex: 0 0 auto; }

.cart-name { font-family: var(--font-serif); font-size: .95rem; overflow-wrap: anywhere; }
.cart-unit { font-size: .74rem; color: var(--muted); white-space: nowrap; }
.cart-empty { color: var(--muted); text-align: center; padding: 22px 6px; font-size: .9rem; }

.quality-select { padding: 4px 6px; font-size: .78rem; flex: 1 1 120px; min-width: 90px; max-width: 170px; }

.qty-btn {
    width: 26px; height: 26px;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: var(--panel-2);
    color: var(--gold-soft);
    cursor: pointer;
    font-size: .95rem;
    line-height: 1;
}
.qty-btn:hover { border-color: var(--gold-dark); }
.qty-input {
    width: 54px !important;
    text-align: center;
    padding: 4px 2px;
    display: inline-block;
    margin: 0 3px;
    -moz-appearance: textfield;
    appearance: textfield;
}
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.remove-btn {
    background: transparent;
    border: none;
    color: #8d4b45;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 4px;
}
.remove-btn:hover { color: var(--red); }

.cart-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 16px 0;
}

.totals { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.total-row { display: flex; justify-content: space-between; font-size: .92rem; color: var(--muted); }
.total-grand {
    font-family: var(--font-serif);
    font-size: 1.45rem;
    color: var(--gold);
    border-top: 1px dashed var(--gold-dark);
    padding-top: 10px;
    margin-top: 6px;
}
.totals-detail { max-width: 340px; margin-left: auto; }

#submitOrder { margin-top: 14px; }

.recent { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.recent h3 { font-size: .9rem; color: var(--gold-soft); margin-bottom: 8px; }
.recent-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.recent-list a {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 7px;
    border: 1px solid transparent;
    color: var(--text);
    font-size: .84rem;
}
.recent-list a:hover { border-color: var(--line); background: var(--bg-soft); }
.recent-no { font-family: "Consolas", monospace; color: var(--muted); }
.recent-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-total { color: var(--gold); font-weight: 700; }

/* ------------------------------------------------------------------ */
/* Kennzahlen & Statistik                                              */
/* ------------------------------------------------------------------ */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
    gap: 12px;
}

.kpi {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.kpi-gold {
    border-color: var(--gold-dark);
    background: linear-gradient(160deg, rgba(212,175,55,.14), var(--panel));
}
.kpi-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.kpi-value { font-family: var(--font-serif); font-size: 1.6rem; color: var(--gold); }
.kpi-sub   { font-size: .76rem; color: var(--muted); }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 18px;
}

.bar {
    height: 8px;
    border-radius: 999px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    overflow: hidden;
}
.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold-dark), var(--gold));
    border-radius: 999px;
}
.bar-value { font-size: .74rem; color: var(--muted); }

.col-rank { width: 64px; }
.col-bar  { width: 180px; }

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px; height: 30px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--bg-soft);
    font-family: var(--font-serif);
    font-size: .9rem;
}
.leaderboard tr.is-top .rank-badge { border-color: var(--gold-dark); background: rgba(212,175,55,.12); }
.leaderboard tr.is-me { background: rgba(212,175,55,.06); }

.rank-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.rank-list-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 5px; font-size: .9rem; }

.chart {
    display: flex;
    align-items: flex-end;
    gap: 5px;
    height: 190px;
    padding-top: 10px;
    overflow-x: auto;
}
.chart-col {
    flex: 1 0 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    gap: 5px;
}
.chart-bar {
    width: 100%;
    max-width: 30px;
    border-radius: 4px 4px 0 0;
    background: linear-gradient(180deg, var(--gold), var(--gold-dark));
    min-height: 3px;
}
.chart-label { font-size: .62rem; color: var(--muted); white-space: nowrap; }

.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.page-link {
    padding: 5px 11px;
    border-radius: 7px;
    border: 1px solid var(--line);
    color: var(--text);
    font-size: .85rem;
}
.page-link:hover { border-color: var(--gold-dark); }
.page-link.is-active { background: rgba(212,175,55,.16); border-color: var(--gold); color: var(--gold); }
.page-gap { color: var(--muted); padding: 5px 2px; }

/* ------------------------------------------------------------------ */
/* Detailseiten & Verwaltung                                           */
/* ------------------------------------------------------------------ */
.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(290px, .8fr);
    gap: 18px;
    align-items: start;
}

.definition { display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; margin: 0; }
.definition dt { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.definition dd { margin: 0; }

.action-stack { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.action-stack form { margin: 0; }

.product-admin-list { display: flex; flex-direction: column; gap: 10px; }
.product-admin {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
    background: var(--bg-soft);
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.product-admin.is-inactive { opacity: .55; }
.product-admin-form { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.pa-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.pa-row .field { min-width: 120px; }
.quality-row { border-top: 1px dashed var(--line); padding-top: 10px; }
.quality-field input { max-width: 120px; }
.quality-field.q-grau  .field-label { color: #c9c9c9; }
.quality-field.q-gruen .field-label { color: #8fd6ad; }
.quality-field.q-lila  .field-label { color: #c9a0e0; }
.quality-field.q-gold  .field-label { color: var(--gold); }
.pa-delete { margin: 0; }

.pw-row { display: none; }
.pw-row.is-open { display: table-row; }

/* Benutzerkarten ---------------------------------------------------- */
.user-list { display: flex; flex-direction: column; gap: 12px; }

.user-card {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: flex-start;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-soft);
    padding: 14px;
}
.user-card.is-inactive { opacity: .6; }

.user-card-main { flex: 1 1 520px; display: flex; flex-direction: column; gap: 10px; }
.user-card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.user-card-title { display: flex; flex-direction: column; line-height: 1.25; }
.user-card-title strong { font-family: var(--font-serif); font-size: 1.02rem; color: var(--gold-soft); }
.user-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.user-card-stats {
    flex: 0 1 230px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    border-left: 1px dashed var(--line);
    padding-left: 14px;
}
.user-card-stats > div { display: flex; flex-direction: column; min-width: 92px; }

/* ------------------------------------------------------------------ */
/* Fraktionen                                                          */
/* ------------------------------------------------------------------ */
.faction-chip {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: .76rem;
    border: 1px solid var(--gold-dark);
    background: rgba(212,175,55,.1);
    color: var(--gold-soft);
}

.faction-list { display: flex; flex-direction: column; gap: 12px; }

.faction-card {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: flex-start;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-soft);
    padding: 12px 14px 12px 20px;
    overflow: hidden;
}
.faction-card.is-inactive { opacity: .55; }

.faction-badge {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 6px;
}

.faction-form { flex: 1 1 520px; display: flex; flex-direction: column; gap: 10px; }

.faction-stats {
    flex: 0 1 230px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
    border-left: 1px dashed var(--line);
    padding-left: 14px;
}
.faction-stats > div { display: flex; flex-direction: column; min-width: 92px; }
.faction-stats form { margin-top: 4px; }

.field-color input[type="color"] {
    width: 54px;
    height: 36px;
    padding: 2px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
}

/* ------------------------------------------------------------------ */
/* SweetAlert2 im Salieri's-Stil                                       */
/* ------------------------------------------------------------------ */
.swal2-container { z-index: 9999; }

.swal2-popup.swal-salieri {
    background: linear-gradient(170deg, #17171c, #0e0e12);
    border: 1px solid var(--gold-dark);
    border-radius: 14px;
    color: var(--text);
    box-shadow: 0 18px 50px rgba(0,0,0,.65);
}

.swal-salieri .swal2-title {
    font-family: var(--font-serif);
    color: var(--gold-soft);
    letter-spacing: .04em;
}
.swal-salieri .swal2-html-container,
.swal-salieri .swal2-content { color: var(--text); }
.swal-salieri .swal2-actions { gap: 10px; }
.swal-salieri .swal2-timer-progress-bar { background: var(--gold); }
.swal-salieri .swal2-close { color: var(--muted); }
.swal-salieri .swal2-close:hover { color: var(--gold); }

.swal-salieri.swal-toast {
    padding: 12px 14px;
    border-radius: 10px;
}
.swal-toast .swal2-title { font-size: .95rem; font-family: var(--font-sans); margin: 0; }

.swal-text { margin: 0 0 12px; font-size: .92rem; }

.swal-password {
    font-family: "Consolas", "Courier New", monospace;
    font-size: 1.25rem;
    letter-spacing: .12em;
    color: var(--gold);
    background: var(--bg-soft);
    border: 1px dashed var(--gold-dark);
    border-radius: 8px;
    padding: 12px;
    user-select: all;
    word-break: break-all;
}

/* ------------------------------------------------------------------ */
/* Anmeldung & Installation                                            */
/* ------------------------------------------------------------------ */
.login-body {
    background:
        radial-gradient(circle at 50% 0%, rgba(109,17,24,.35), transparent 55%),
        radial-gradient(circle at 50% 100%, rgba(212,175,55,.08), transparent 45%),
        var(--bg);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 16px;
}

.login-wrap { width: 100%; max-width: 410px; }
.install-wrap { max-width: 560px; }

.login-card {
    background: linear-gradient(170deg, #17171c, #0e0e12);
    border: 1px solid var(--gold-dark);
    border-radius: 14px;
    padding: 30px 28px 26px;
    text-align: center;
    box-shadow: 0 18px 50px rgba(0,0,0,.6);
}

.login-logo { width: 92px; height: 92px; object-fit: cover; border-radius: 50%; border: 2px solid var(--gold-dark); background: #000; }
.login-title { font-size: 1.9rem; color: var(--gold); letter-spacing: .22em; margin-top: 12px; }
.login-sub { color: var(--muted); font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; margin: 4px 0 18px; }
.login-form { display: flex; flex-direction: column; gap: 12px; text-align: left; margin-top: 10px; }
.login-form .btn { margin-top: 6px; }
.login-foot { margin-top: 18px; color: var(--muted); font-family: var(--font-serif); font-size: .82rem; letter-spacing: .1em; }
.login-hint {
    font-size: .86rem;
    color: var(--muted);
    background: rgba(212,175,55,.07);
    border: 1px solid var(--gold-dark);
    border-radius: var(--radius);
    padding: 10px 12px;
    margin: 0 0 14px;
    text-align: left;
}
.login-hint strong { color: var(--gold-soft); }
.login-foot-link { display: inline-block; margin-top: 14px; font-size: .82rem; color: var(--muted); }
.login-foot-link:hover { color: var(--gold-soft); }

.install-section {
    font-size: .95rem;
    color: var(--gold-soft);
    border-bottom: 1px solid var(--line);
    padding-bottom: 6px;
    margin-top: 10px;
}
.install-card code { color: var(--gold-soft); font-size: .86rem; }

/* ------------------------------------------------------------------ */
/* Beleg                                                               */
/* ------------------------------------------------------------------ */
.receipt-body {
    background:
        radial-gradient(circle at 50% 0%, rgba(109,17,24,.28), transparent 55%),
        var(--bg);
    min-height: 100vh;
    padding: 26px 16px 50px;
}

.receipt-actions {
    max-width: 430px;
    margin: 0 auto 16px;
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.receipt {
    max-width: 430px;
    margin: 0 auto;
    background: linear-gradient(175deg, #15151a, #0d0d10);
    border: 1px solid var(--gold-dark);
    border-radius: 12px;
    padding: 26px 26px 30px;
    box-shadow: 0 18px 50px rgba(0,0,0,.6);
}

.receipt-head { text-align: center; }
.receipt-logo { width: 74px; height: 74px; object-fit: cover; border-radius: 50%; border: 1px solid var(--gold-dark); background: #000; }
.receipt-head h1 { font-size: 1.6rem; color: var(--gold); letter-spacing: .2em; margin-top: 8px; }
.receipt-slogan { color: var(--muted); font-size: .74rem; letter-spacing: .18em; text-transform: uppercase; margin: 2px 0; }
.receipt-address { color: var(--muted); font-size: .76rem; margin: 2px 0 0; }

.receipt-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-dark), transparent);
    margin: 16px 0;
}

.receipt-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 14px; font-size: .8rem; }
.receipt-meta > div { display: flex; flex-direction: column; }
.receipt-meta span { color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; }
.receipt-meta .status { align-self: flex-start; margin-top: 2px; }

.receipt-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.receipt-table th {
    text-align: left;
    font-size: .66rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--muted);
    padding-bottom: 6px;
    border-bottom: 1px solid var(--line);
}
.receipt-table td { padding: 6px 0; border-bottom: 1px dotted rgba(138,111,31,.3); vertical-align: top; }
.receipt-table .right { text-align: right; }

.receipt-quality { display: block; font-size: .68rem; color: var(--muted); }
.receipt-quality.q-gold  { color: var(--gold-soft); }
.receipt-quality.q-lila  { color: #c9a0e0; }
.receipt-quality.q-gruen { color: #8fd6ad; }
.receipt-quality.q-grau  { color: #b5b5b5; }

.receipt-totals { display: flex; flex-direction: column; gap: 5px; font-size: .9rem; }
.rt-row { display: flex; justify-content: space-between; color: var(--muted); }
.rt-grand {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    color: var(--gold);
    border-top: 1px dashed var(--gold-dark);
    padding-top: 8px;
    margin-top: 5px;
}

.receipt-note { margin-top: 12px; font-size: .8rem; color: var(--muted); }
.receipt-note span { color: var(--gold-soft); }

.receipt-cancelled {
    margin-top: 14px;
    text-align: center;
    border: 1px dashed var(--red);
    color: #f3c3bd;
    letter-spacing: .3em;
    padding: 8px;
    border-radius: 8px;
}

.receipt-footer { text-align: center; font-family: var(--font-serif); color: var(--gold-soft); font-size: .85rem; margin: 10px 0 0; }
.receipt-ornament { text-align: center; color: var(--gold-dark); letter-spacing: .4em; margin: 6px 0 0; }

/* Druckausgabe ------------------------------------------------------ */
@media print {
    @page { margin: 10mm; }
    body.receipt-body { background: #fff; padding: 0; }
    .no-print { display: none !important; }
    .receipt {
        max-width: 100%;
        border: none;
        box-shadow: none;
        background: #fff;
        color: #000;
        padding: 0;
    }
    .receipt h1, .receipt .rt-grand, .receipt-footer { color: #000; }
    .receipt-slogan, .receipt-address, .receipt-meta span, .rt-row, .receipt-table th, .muted { color: #444 !important; }
    .receipt-divider { background: #000; }
    .receipt-table td { border-bottom: 1px dotted #999; }
    .receipt-logo { filter: grayscale(100%); }
}

/* ------------------------------------------------------------------ */
/* Mobil                                                               */
/* ------------------------------------------------------------------ */
@media (max-width: 1100px) {
    .kasse, .detail-grid { grid-template-columns: 1fr; }
    .cart-panel { position: static; }
}

@media (max-width: 820px) {
    .layout { flex-direction: column; }
    .sidebar { width: 100%; flex: none; height: auto; position: static; flex-direction: column; }
    .nav { flex-direction: row; flex-wrap: wrap; margin-top: 10px; }
    .nav-section { display: none; }
    .nav-link { flex: 1 1 140px; justify-content: center; }
    .content, .topbar, .flashes { padding-left: 14px; padding-right: 14px; }
    .cart-fields { grid-template-columns: 1fr; }
    .field-wide { grid-column: span 1; }
    .definition { grid-template-columns: 1fr; }
    .definition dd { margin-bottom: 6px; }
}
