/* Inter vom eigenen Server (wie Tymera): Variable Font, alle Gewichte in einer Datei. */
@font-face {
    font-family: 'Inter';
    src: url('../fonts/InterVariable.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* ── OrderHero im Tymera-Look: ruhig und hell wie Mews. Weiße Sidebar auf weißem Grund,
      der Inhalt liegt in einem abgerundeten Panel; fast-schwarze Buttons, Indigo nur für
      Auswahl/Links, Pastell-Chips für Status. ── */
:root {
    --bg: #F1F1F3;
    --surface: #FFFFFF;
    --surface-2: #F8F8FA;
    --surface-3: #F1F1F4;
    --line: #E1E2E6;
    --line-soft: #ECEDF0;
    --line-strong: #C9CBD1;
    --ink: #1D1E23;
    --ink-2: #3A3B42;
    --muted: #6E717A;
    --accent: #1D1E23;
    --accent-hover: #3A3B42;
    --accent-soft: #ECEDFA;
    --link: #4A4DB5;
    --focus: rgba(74, 77, 181, .22);
    --warn: #B8641A;
    --green-fg: #1E7F45; --green-bg: #E4F4EA;
    --red-fg: #B8322C;   --red-bg: #FBEAE9;
    --amber-fg: #8A5300; --amber-bg: #FCF1DC;
    --gray-fg: #3A3B42;  --gray-bg: #ECEDF0;
    --blue-fg: #4A4DB5;  --blue-bg: #EEEFFB;
    --violet-fg: #6B3FA0; --violet-bg: #F3ECFA;
    --radius: 10px;
    --shadow: 0 12px 32px rgba(29, 30, 35, .12);
    --bs-body-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
html, body {
    background: var(--surface);
    color: var(--ink);
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif !important;
    font-size: 14px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: var(--ink); }
h1, h2, h3, h4, h5, .h1, .h2, .h3, .h4, .h5 { font-family: inherit; }

/* ── Shell: weiße Sidebar links, Inhalt im abgerundeten Panel (wie Tymera) ── */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; background: var(--surface); }
.shell-main { min-width: 0; }
.shell-panel {
    margin: 8px 8px 8px 0; height: calc(100vh - 16px); overflow-y: auto;
    background: var(--bg); border: 1px solid var(--line); border-radius: 18px;
}
.page { padding: 22px 28px 48px; max-width: 1480px; }
.page-header { margin-bottom: 18px; }
.page-header h1 { font-size: 26px; font-weight: 600; letter-spacing: -.02em; margin: 0; }
.page-header h1 i { display: none; } /* ruhige Köpfe: Text statt Icon-Parade */

/* ── Sidebar ── */
.sidebar {
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
    display: flex; flex-direction: column; gap: 10px;
    padding: 18px 14px; background: var(--surface); z-index: 30;
}
.sidebar .brand { padding: 0 6px 2px; display: block; }
.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side-nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 10px; border-radius: 9px; text-decoration: none;
    color: var(--ink-2); font-weight: 600; font-size: 13.5px;
}
.side-nav a i { font-size: 15px; color: var(--muted); width: 18px; text-align: center; }
.side-nav a:hover { background: var(--surface-3); color: var(--ink); }
.side-nav a.active { background: var(--accent-soft); color: var(--accent-hover); font-weight: 700; }
.side-nav a.active i { color: var(--link); }

/* Auf-/zuklappbare Bereiche */
.side-group {
    width: 100%; border: 0; background: none; text-align: left; cursor: pointer;
    display: flex; align-items: center; gap: 6px; font-family: inherit;
    font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    color: var(--muted); padding: 10px 10px 3px;
}
.side-group:hover { color: var(--ink); }
.side-group .chev { margin-left: auto; transition: transform .15s ease; font-size: 12px; }
.side-group.collapsed .chev { transform: rotate(-90deg); }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group.collapsed { display: none; }

/* Standort-Wechsler */
.tenant-switch select {
    width: 100%; height: 36px; font-weight: 600; font-size: 13.5px; font-family: inherit;
    border: 1px solid var(--line-strong); border-radius: 10px;
    background: var(--surface); color: var(--ink); padding: 0 8px;
}
.tenant-switch select:focus { outline: 3px solid var(--focus); border-color: var(--ink); }
.tenant-static {
    padding: 8px 10px; border-radius: 10px;
    background: var(--surface-3); font-weight: 700; font-size: 13.5px;
}

.side-bottom { border-top: 1px solid var(--line-soft); padding-top: 10px; font-size: 12.5px; }
.side-user {
    display: flex; align-items: center; gap: 10px; text-decoration: none;
    padding: 8px 8px; border-radius: 10px; margin-bottom: 2px;
}
.side-user:hover { background: var(--surface-2); }
.side-avatar {
    width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent-soft); color: var(--link);
    font-weight: 700; font-size: 13px; letter-spacing: .3px;
}
.side-user-txt { min-width: 0; display: flex; flex-direction: column; }
.side-user-name {
    color: var(--ink); font-weight: 700; font-size: 13.5px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.side-user-sub {
    color: var(--muted); font-size: 12px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.side-logout {
    display: flex; align-items: center; gap: 10px; width: 100%;
    border: 0; background: none; padding: 8px 8px; border-radius: 10px;
    color: var(--ink); font-weight: 600; font-size: 13.5px; cursor: pointer; text-align: left;
}
.side-logout:hover { background: var(--surface-2); }
.side-logout .bi { font-size: 15px; }

/* ── Mobile ── */
#mobile-topbar  { display: none; }
.sidebar-backdrop { display: none; }
@media (max-width: 991.98px) {
    .shell { grid-template-columns: minmax(0, 1fr); background: var(--bg); }
    .shell-panel { margin: 0; border: 0; border-radius: 0; height: auto; overflow: visible; }
    .page { padding: 1rem; padding-top: 4.5rem; }
    .sidebar {
        position: fixed; left: 0; top: 0; width: 264px; height: 100vh;
        transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow);
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-backdrop.show {
        display: block; position: fixed; inset: 0; border: 0;
        background: rgba(29, 30, 35, .36); z-index: 25;
    }
    #mobile-topbar {
        display: flex; align-items: center; gap: .5rem;
        position: fixed; top: 0; left: 0; right: 0; height: 3.5rem; z-index: 20;
        background: var(--surface); border-bottom: 1px solid var(--line); padding: 0 .75rem;
    }
    .page-header h1 { font-size: 1.3rem; }
    .page-header.d-flex { flex-wrap: wrap; gap: .5rem; }
}

/* ── Bootstrap-Komponenten im Tymera-Gewand ── */
.card, .stat-card {
    border: 1px solid var(--line) !important; border-radius: 16px;
    box-shadow: none !important; background: var(--surface);
}
.card-header {
    background: var(--surface) !important; border-bottom: 1px solid var(--line-soft);
    border-radius: 16px 16px 0 0 !important; font-weight: 600; padding-top: .7rem; padding-bottom: .7rem;
}
.card-header i { color: var(--muted) !important; }
.stat-card .icon { width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; font-size: 1.4rem; }
.accent-border-start { border-left: 4px solid var(--link) !important; }

.btn {
    font-weight: 700; border-radius: var(--radius);
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:not(.btn-sm):not(.btn-lg):not(.btn-link) { min-height: 38px; }
.btn-sm { min-height: 32px; border-radius: 9px; font-size: 13px; }
.btn-accent, .btn-primary { background: var(--accent); border: 0; color: #fff; }
.btn-accent:hover, .btn-accent:focus, .btn-accent:active,
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background: var(--accent-hover) !important; color: #fff;
}
.btn-secondary { background: var(--gray-bg); border: 0; color: var(--gray-fg); }
.btn-secondary:hover { background: var(--line-soft); color: var(--ink); }
.btn-outline-secondary { color: var(--ink); border-color: var(--line-strong); background: var(--surface); }
.btn-outline-secondary:hover, .btn-outline-secondary:focus {
    background: var(--surface-3); color: var(--ink); border-color: var(--line-strong);
}
.btn-outline-primary { color: var(--link); border-color: var(--line-strong); background: var(--surface); }
.btn-outline-primary:hover { background: var(--blue-bg); color: var(--blue-fg); border-color: var(--line-strong); }
.btn-outline-danger { color: var(--red-fg); border-color: var(--line-strong); background: var(--surface); }
.btn-outline-danger:hover { background: var(--red-bg); color: var(--red-fg); border-color: var(--line-strong); }
.btn-danger { background: var(--red-bg); border: 0; color: var(--red-fg); }
.btn-danger:hover { background: #F6DBD9; color: var(--red-fg); }
.btn-success { background: var(--green-bg); border: 0; color: var(--green-fg); }
.btn-success:hover { background: #D3ECDD; color: var(--green-fg); }
.btn-link { color: var(--link); }
.btn:focus-visible { box-shadow: 0 0 0 3px var(--focus); }

.form-control, .form-select {
    border: 1px solid var(--line-strong); border-radius: 10px; color: var(--ink);
    font-family: inherit;
}
.form-control:not(.form-control-sm), .form-select:not(.form-select-sm) { min-height: 40px; }
.form-control:focus, .form-select:focus {
    border-color: var(--ink); box-shadow: 0 0 0 3px var(--focus);
}
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.form-check-input:focus { box-shadow: 0 0 0 3px var(--focus); border-color: var(--ink); }
.form-label { font-weight: 600; color: var(--ink-2); }
.input-group-text { border-color: var(--line-strong); background: var(--surface-2); border-radius: 10px; }

.table th {
    font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
    color: var(--muted); background: var(--surface-2) !important;
    border-bottom: 1px solid var(--line); font-weight: 700;
}
.table td { border-color: var(--line-soft); }
.table-light th { background: var(--surface-2) !important; }
.table-hover tbody tr:hover td { background: var(--surface-2); }

/* Badges → Pastell-Chips */
.badge { font-weight: 700; border-radius: 999px; padding: .32em .7em; }
.badge.bg-success  { background: var(--green-bg) !important; color: var(--green-fg) !important; }
.badge.bg-danger   { background: var(--red-bg) !important;   color: var(--red-fg) !important; }
.badge.bg-warning  { background: var(--amber-bg) !important; color: var(--amber-fg) !important; }
.badge.bg-info     { background: var(--blue-bg) !important;  color: var(--blue-fg) !important; }
.badge.bg-primary  { background: var(--blue-bg) !important;  color: var(--blue-fg) !important; }
.badge.bg-secondary{ background: var(--gray-bg) !important;  color: var(--gray-fg) !important; }
.badge.bg-light    { background: var(--gray-bg) !important;  color: var(--gray-fg) !important; }
.badge.bg-dark     { background: var(--ink) !important; color: #fff !important; }
.badge-source { font-size: .7rem; }

.alert { border: 0; border-radius: 14px; font-weight: 600; }
.alert-success { background: var(--green-bg); color: var(--green-fg); }
.alert-danger  { background: var(--red-bg); color: var(--red-fg); }
.alert-warning { background: var(--amber-bg); color: var(--amber-fg); }
.alert-info    { background: var(--blue-bg); color: var(--blue-fg); }

.modal-content { border: 0; border-radius: 18px; box-shadow: var(--shadow); }
.modal-header { border-bottom: 1px solid var(--line-soft); }
.modal-footer { border-top: 1px solid var(--line-soft); }
.dropdown-menu { border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.dropdown-item { font-weight: 600; color: var(--ink-2); }
.dropdown-item:hover { background: var(--surface-3); color: var(--ink); }
.text-muted { color: var(--muted) !important; }
.nav-tabs { border-color: var(--line); }
.nav-tabs .nav-link { color: var(--ink-2); font-weight: 600; border-radius: 10px 10px 0 0; }
.nav-tabs .nav-link.active { color: var(--ink); border-color: var(--line) var(--line) var(--bg); background: var(--bg); }
.list-group-item { border-color: var(--line-soft); }
.pagination .page-link { color: var(--ink-2); border-color: var(--line); font-weight: 600; }
.pagination .page-item.active .page-link { background: var(--accent); border-color: var(--accent); }

@media print {
    .sidebar, #mobile-topbar, .sidebar-backdrop, .no-print { display: none !important; }
    .shell { display: block; background: #fff; }
    .shell-panel { margin: 0; border: 0; background: #fff; height: auto; overflow: visible; }
}

/* ── Formulare im Tymera-Look (Werte aus Tymera.Web app.css) ──────────────── */
.form-control, .form-select {
    height: 42px;
    border: 1px solid #C9CBD1;
    border-radius: 10px;
    padding: 0 12px;
    background: #fff;
    color: #1D1E23;
    font-size: 14px;
    box-shadow: none;
}
textarea.form-control { height: auto; min-height: 84px; padding: 10px 12px; }
.form-control-sm, .form-select-sm { height: 34px; border-radius: 9px; padding: 0 10px; font-size: 13px; }
.input-group-sm > .form-control, .input-group-sm > .form-select { height: 34px; }
.form-control:focus, .form-select:focus {
    outline: 3px solid rgba(74, 77, 181, .22);
    outline-offset: 0;
    border-color: #1D1E23;
    box-shadow: none;
}
.form-control::placeholder { color: #9A9DA6; }
.form-label, .form-check-label { color: #3A3B42; }
.form-label.small, label.form-label { font-size: 12.5px; font-weight: 700; }
.form-check-input {
    width: 18px; height: 18px; margin-top: .1em;
    border: 1px solid #C9CBD1; border-radius: 6px;
}
.form-check-input:checked { background-color: #1D1E23; border-color: #1D1E23; }
.form-check-input:focus { box-shadow: 0 0 0 3px rgba(74, 77, 181, .22); border-color: #1D1E23; }
.form-text { color: #6E717A; font-size: 12.5px; }
.input-group > .form-control:focus, .input-group > .form-select:focus { z-index: 3; }

/* ── Kategorie-Chips: Checkboxen als klickbare Pillen (KDS, konsistent für Formulare) ── */
.chip-group { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-check { position: relative; margin: 0; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check span {
    display: inline-block; padding: 4px 12px; border-radius: 999px; cursor: pointer;
    background: var(--surface); border: 1px solid var(--line); color: var(--ink-2);
    font-size: 12.5px; user-select: none;
}
.chip-check span:hover { border-color: var(--line-strong); }
.chip-check input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip-check input:focus-visible + span { box-shadow: 0 0 0 3px var(--focus); }

/* ── Anker-Seitenleiste für lange Seiten (Tymera-Stil, per Layout-JS eingefügt) ── */
.page.has-anchor-rail {
    display: grid; grid-template-columns: 190px minmax(0, 1fr);
    column-gap: 28px; align-items: start;
}
.page.has-anchor-rail > .anchor-rail { order: -1; position: sticky; top: 16px; }
.anchor-rail { display: flex; flex-direction: column; gap: 4px; padding-top: 64px; }
.anchor-rail a {
    padding: 7px 12px; border-radius: 9px; text-decoration: none;
    color: var(--ink-2); font-size: 13.5px; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.anchor-rail a:hover { background: var(--surface); color: var(--ink); }
.anchor-rail a.on { background: var(--accent-soft); color: var(--link); font-weight: 700; }

/* ── Bootstrap-Tabs im Tymera-Stil: Pillen statt Karteireiter (z.B. Artikel bearbeiten) ── */
.nav-tabs { border-bottom: 0; gap: 4px; margin-bottom: 16px !important; }
.nav-tabs .nav-item { margin: 0; }
.nav-tabs .nav-link {
    border: 0 !important; border-radius: 999px; padding: 7px 15px;
    color: var(--ink-2); font-size: 13.5px; font-weight: 600; background: none;
}
.nav-tabs .nav-link i { display: none; }                 /* ruhige Tabs: Text statt Icons */
.nav-tabs .nav-link:hover { background: var(--surface-2); color: var(--ink); }
.nav-tabs .nav-link.active { background: var(--accent); color: #fff; }
.nav-tabs .nav-link .badge {
    background: var(--surface-3) !important; color: var(--ink-2) !important;
    border-radius: 999px; font-size: 11px; vertical-align: 1px;
}
.nav-tabs .nav-link.active .badge { background: rgba(255,255,255,.22) !important; color: #fff !important; }

/* ── Einstellungen: Unterpunkte als Tab-Leiste oben (Tymera-Stil) ── */
.settings-tabs {
    display: flex; flex-wrap: wrap; gap: 4px;
    margin-bottom: 18px; padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.settings-tabs a {
    padding: 6px 13px; border-radius: 999px; text-decoration: none;
    color: var(--ink-2); font-size: 13px; font-weight: 500; white-space: nowrap;
}
.settings-tabs a:hover { background: var(--surface-2); color: var(--ink); }
.settings-tabs a.active { background: var(--accent); color: #fff; }
