/* ============================================================================
   Office-Tech ERP - Web Edition
   Stylesheet v0.1
   ============================================================================ */

:root {
    --bg:           #f5f6f8;
    --surface:      #ffffff;
    --surface-2:    #fafbfc;
    --border:       #e3e6ea;
    --border-strong: #c8ced6;
    --text:         #1a2230;
    --text-muted:   #6b7585;
    --text-light:   #9aa3b1;

    --primary:        #2563eb;
    --primary-hover:  #1d4ed8;
    --primary-soft:   #eff4fe;

    --sidebar-bg:     #0f172a;
    --sidebar-bg-2:   #1e293b;
    --sidebar-text:   #cbd5e1;
    --sidebar-text-active: #ffffff;
    --sidebar-section: #64748b;

    --success: #15803d;
    --success-soft: #dcfce7;
    --warning: #b45309;
    --warning-soft: #fef3c7;
    --danger:  #b91c1c;
    --danger-soft: #fee2e2;
    --info:    #1e40af;
    --info-soft: #dbeafe;

    --radius:    6px;
    --radius-sm: 4px;
    --shadow:    0 1px 2px rgba(0,0,0,.04), 0 1px 1px rgba(0,0,0,.03);
    --shadow-lg: 0 4px 12px rgba(0,0,0,.08);

    --sidebar-w: 240px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.link-strong { color: var(--text); font-weight: 600; }
.link-strong a { color: var(--text); }
.mono { font-family: ui-monospace, SFMono-Regular, "SF Mono", Monaco, Menlo, monospace; font-size: .92em; }
.small { font-size: 12px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

h1, h2, h3 { color: var(--text); margin: 0 0 .5rem 0; line-height: 1.25; font-weight: 600; }
h1 { font-size: 22px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }

/* ============================================================================
   LAYOUT
   ============================================================================ */

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 1.25rem 1.25rem 1rem 1.25rem;
    border-bottom: 1px solid var(--sidebar-bg-2);
}

.brand-link {
    display: flex;
    align-items: center;
    gap: .6rem;
    color: var(--sidebar-text-active);
    text-decoration: none;
}
.brand-link:hover { text-decoration: none; }

.brand-mark {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    display: grid;
    place-items: center;
    font-family: ui-monospace, SFMono-Regular, monospace;
}
.brand-mark.large { width: 56px; height: 56px; font-size: 32px; border-radius: 12px; }

.brand-text {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -.01em;
}
.brand-text em { font-weight: 400; font-style: normal; opacity: .75; }

.sidebar-nav {
    flex: 1;
    padding: .5rem 0 1rem 0;
    overflow-y: auto;
}

.nav-section {
    padding: .75rem 0 .25rem 0;
    border-top: 1px solid var(--sidebar-bg-2);
    margin-top: .5rem;
}
.nav-section:first-of-type { border-top: none; margin-top: 0; }

.nav-section-label {
    display: block;
    padding: 0 1.25rem .25rem 1.25rem;
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--sidebar-section);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .45rem 1.25rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 13px;
    border-left: 3px solid transparent;
    transition: background .12s, color .12s;
}
.nav-link:hover {
    background: var(--sidebar-bg-2);
    color: var(--sidebar-text-active);
    text-decoration: none;
}
.nav-link.active {
    background: var(--sidebar-bg-2);
    color: var(--sidebar-text-active);
    border-left-color: var(--primary);
    font-weight: 500;
}
.nav-link.disabled {
    color: #4a5568;
    cursor: not-allowed;
    pointer-events: none;
}
.nav-icon {
    width: 16px;
    text-align: center;
    opacity: .8;
}

.sidebar-footer {
    padding: .75rem 1.25rem 1rem 1.25rem;
    border-top: 1px solid var(--sidebar-bg-2);
    background: var(--sidebar-bg);
}
.user-info { margin-bottom: .5rem; }
.user-name { color: var(--sidebar-text-active); font-weight: 600; font-size: 13px; }
.user-role { color: var(--sidebar-section); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.logout-form { margin: 0; }
.logout-btn {
    background: transparent;
    border: 1px solid var(--sidebar-bg-2);
    color: var(--sidebar-text);
    padding: .35rem .75rem;
    font-size: 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    width: 100%;
}
.logout-btn:hover { background: var(--sidebar-bg-2); color: #fff; }

.main-content {
    flex: 1;
    padding: 1.5rem 2rem;
    min-width: 0;
    max-width: 1600px;
}

/* ============================================================================
   PAGE HEADER
   ============================================================================ */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.page-subtitle { color: var(--text-muted); margin: .25rem 0 0 0; }
.page-actions { display: flex; gap: .5rem; align-items: center; }
.breadcrumb { font-size: 12px; color: var(--text-muted); margin-bottom: .25rem; }
.breadcrumb a { color: var(--text-muted); }

/* ============================================================================
   FLASH / ALERTS
   ============================================================================ */

.flash-container { margin-bottom: 1rem; }
.flash {
    padding: .65rem .9rem;
    border-radius: var(--radius);
    margin-bottom: .5rem;
    border: 1px solid;
    font-size: 13px;
}
.flash-success { background: var(--success-soft); border-color: #86efac; color: var(--success); }
.flash-error   { background: var(--danger-soft);  border-color: #fca5a5; color: var(--danger); }
.flash-warning { background: var(--warning-soft); border-color: #fcd34d; color: var(--warning); }
.flash-info    { background: var(--info-soft);    border-color: #93c5fd; color: var(--info); }

.info-banner {
    background: var(--info-soft);
    border-left: 4px solid var(--info);
    color: var(--info);
    padding: .75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 13px;
}
.info-banner-warn {
    background: var(--warning-soft);
    border-left-color: var(--warning);
    color: var(--warning);
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .5rem .9rem;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.2;
    transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #991b1b; color: #fff; }
.btn-block { width: 100%; }
.btn-right { margin-left: auto; }

.btn-icon {
    display: inline-block;
    padding: .25rem .6rem;
    font-size: 12px;
    color: var(--primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
}
.btn-icon:hover { background: var(--primary-soft); border-color: var(--primary); text-decoration: none; }

.btn-icon-danger {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--danger);
    width: 26px;
    height: 26px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}
.btn-icon-danger:hover { background: var(--danger-soft); }

/* ============================================================================
   CARDS
   ============================================================================ */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: -.25rem 0 .75rem 0;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--border);
}
.card-header h2 { margin: 0; }
.card-action { font-size: 12px; color: var(--primary); }
.card-meta { color: var(--text-muted); font-size: 12px; }

/* ============================================================================
   STATS GRID
   ============================================================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stats-compact { margin-bottom: 1rem; }

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    text-decoration: none;
    color: var(--text);
    transition: border-color .12s, transform .12s;
    display: block;
}
.stat-card:hover { border-color: var(--primary); text-decoration: none; }
.stat-label { color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; font-weight: 500; }
.stat-value { font-size: 28px; font-weight: 600; margin: .25rem 0; color: var(--text); line-height: 1.1; }
.stat-meta { color: var(--text-light); font-size: 12px; }

/* ============================================================================
   DASHBOARD GRID
   ============================================================================ */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 1rem;
}

/* ============================================================================
   FILTER BAR
   ============================================================================ */

.filter-bar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .65rem .85rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}
.filter-form {
    display: flex;
    gap: .5rem;
    align-items: center;
    width: 100%;
}
.search-input {
    flex: 1;
    min-width: 200px;
    padding: .4rem .65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--surface-2);
}
.search-input:focus { border-color: var(--primary); outline: none; background: #fff; }

.filter-tabs { display: flex; gap: .25rem; }
.filter-tab {
    padding: .35rem .75rem;
    font-size: 13px;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    text-decoration: none;
}
.filter-tab:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.filter-tab.active { background: var(--primary-soft); color: var(--primary); font-weight: 500; }

/* ============================================================================
   TABLES
   ============================================================================ */

.table-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.data-table th {
    text-align: left;
    padding: .55rem .75rem;
    background: var(--surface-2);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .03em;
    border-bottom: 1px solid var(--border);
}
.data-table td {
    padding: .65rem .75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface-2); }
.data-table.compact td, .data-table.compact th { padding: .4rem .6rem; font-size: 12px; }

.row-actions { text-align: right; }
.empty-state {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* ============================================================================
   PAGINATION
   ============================================================================ */

.pagination {
    display: flex;
    gap: .25rem;
    justify-content: center;
    padding: 1rem;
    border-top: 1px solid var(--border);
}
.page-link {
    padding: .35rem .65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
}
.page-link:hover { background: var(--surface-2); }
.page-link.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ============================================================================
   FORMS
   ============================================================================ */

.entity-form { max-width: 1100px; }
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.form-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin: 0;
}
.form-section-wide { grid-column: 1 / -1; }
.form-section legend {
    padding: 0 .35rem;
    margin-left: -.35rem;
    font-weight: 600;
    color: var(--text);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.form-row { display: flex; gap: .75rem; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 140px; }
.form-row .form-group.small { flex: 0 0 110px; }
.form-row .form-group.flex-2 { flex: 2; }

.form-group { margin-bottom: .75rem; }
.form-group label {
    display: block;
    margin-bottom: .25rem;
    font-weight: 500;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .02em;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: .45rem .65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-size: 13px;
    font-family: inherit;
    color: var(--text);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}
.form-group textarea { resize: vertical; }

.radio-group, .checkbox-group { display: flex; gap: 1rem; flex-wrap: wrap; padding: .25rem 0; }
.radio, .checkbox {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    cursor: pointer;
    font-size: 13px;
    color: var(--text);
    text-transform: none;
    letter-spacing: 0;
}
.radio input, .checkbox input { margin: 0; }

.form-actions {
    display: flex;
    gap: .5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    align-items: center;
}

/* ============================================================================
   DETAIL VIEWS
   ============================================================================ */

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}
.grid-span-2 { grid-column: span 2; }

.detail-list {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: .35rem .75rem;
    margin: 0;
}
.detail-list > div { display: contents; }
.detail-list dt { color: var(--text-muted); font-size: 12px; padding-top: .15rem; }
.detail-list dd { margin: 0; font-size: 13px; }

.text-block { white-space: pre-wrap; font-size: 13px; line-height: 1.6; }

/* ============================================================================
   BADGES
   ============================================================================ */

.badge {
    display: inline-block;
    padding: .15rem .55rem;
    font-size: 11px;
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--text-muted);
    border: 1px solid var(--border);
    font-weight: 500;
    text-transform: capitalize;
    letter-spacing: .02em;
}
.badge-kunde       { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge-lieferant   { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge-interessent { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.badge-inaktiv     { background: #f3f4f6; color: #6b7280; border-color: transparent; }
.badge-primary     { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.badge-internal    { background: #f3e8ff; color: #7e22ce; border-color: transparent; }
.badge-time        { background: var(--info-soft); color: var(--info); border-color: transparent; }
.role-badges { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .25rem; }

.priority-badge {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-light);
    flex-shrink: 0;
}
.priority-badge.prio-niedrig  { background: #94a3b8; }
.priority-badge.prio-normal   { background: #60a5fa; }
.priority-badge.prio-hoch     { background: #f59e0b; }
.priority-badge.prio-dringend { background: #dc2626; }
.priority-badge.prio-kritisch { background: #dc2626; box-shadow: 0 0 0 3px rgba(220, 38, 38, .25); }

.status-badge {
    display: inline-block;
    padding: .15rem .6rem;
    font-size: 11px;
    border-radius: 10px;
    font-weight: 500;
    text-transform: capitalize;
    letter-spacing: .02em;
    background: var(--surface-2);
    color: var(--text-muted);
    border: 1px solid var(--border);
    white-space: nowrap;
}
.status-badge.large { padding: .35rem .85rem; font-size: 13px; }
.status-neu, .status-offen        { background: var(--info-soft); color: var(--info); border-color: transparent; }
.status-in_bearbeitung            { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.status-wartet_kunde, .status-wartet_intern { background: #f3e8ff; color: #7e22ce; border-color: transparent; }
.status-geloest, .status-bezahlt, .status-erledigt { background: var(--success-soft); color: var(--success); border-color: transparent; }
.status-geschlossen, .status-storniert, .status-verworfen { background: #f3f4f6; color: #6b7280; border-color: transparent; }
.status-entwurf                   { background: #f3f4f6; color: #6b7280; border-color: transparent; }
.status-teilweise_bezahlt         { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.status-mahnung_1, .status-mahnung_2, .status-mahnung_3 { background: var(--danger-soft); color: var(--danger); border-color: transparent; }

/* ============================================================================
   LISTS (task / contact / phone)
   ============================================================================ */

.task-list { list-style: none; padding: 0; margin: 0; }
.task-item {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem .25rem;
    border-bottom: 1px solid var(--border);
}
.task-item:last-child { border-bottom: none; }
.task-body { flex: 1; min-width: 0; }
.task-title { color: var(--text); font-weight: 500; text-decoration: none; display: block; font-size: 13px; }
.task-title:hover { color: var(--primary); }
.task-meta { color: var(--text-muted); font-size: 11px; margin-top: .15rem; }
.task-due { color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.ticket-nr { font-family: ui-monospace, monospace; font-size: 11px; color: var(--text-muted); margin-right: .35rem; }

.contact-list { list-style: none; padding: 0; margin: 0; }
.contact-list li { padding: .65rem 0; border-bottom: 1px solid var(--border); }
.contact-list li:last-child { border-bottom: none; }
.contact-name { font-weight: 500; }
.contact-position { font-size: 12px; color: var(--text-muted); }
.contact-meta { font-size: 12px; color: var(--text-muted); margin-top: .25rem; }
.contact-meta span { margin-right: .75rem; }

.phone-list { list-style: none; padding: 0; margin: 0; }
.phone-list li { padding: .5rem 0; border-bottom: 1px solid var(--border); display: flex; gap: .65rem; align-items: baseline; }
.phone-list li:last-child { border-bottom: none; }
.phone-meta { font-size: 11px; color: var(--text-muted); display: flex; gap: .5rem; flex-shrink: 0; }
.phone-thema { color: var(--text); font-size: 13px; flex: 1; text-decoration: none; }
.phone-thema:hover { color: var(--primary); }
.phone-dir.phone-eingehend { color: var(--success); font-weight: 600; }
.phone-dir.phone-ausgehend { color: var(--info); font-weight: 600; }

/* ============================================================================
   TICKETS
   ============================================================================ */

.status-form { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.comment-list { list-style: none; padding: 0; margin: 0 0 1rem 0; }
.comment-item { padding: .75rem 0; border-bottom: 1px solid var(--border); }
.comment-item:last-child { border-bottom: none; }
.comment-internal { background: #fefce8; padding: .75rem; border-radius: var(--radius-sm); margin-bottom: .5rem; }
.comment-head { display: flex; gap: .5rem; align-items: center; margin-bottom: .35rem; flex-wrap: wrap; }
.comment-author { font-weight: 600; font-size: 13px; }
.comment-time { font-size: 12px; color: var(--text-muted); }
.comment-body { font-size: 13px; white-space: pre-wrap; }
.comment-form { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.comment-form .form-row { align-items: flex-end; }

/* ============================================================================
   FAKTURA / INVOICE LAYOUT
   ============================================================================ */

.positionen-table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; font-size: 13px; }
.positionen-table th { text-align: left; padding: .35rem .5rem; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: 11px; text-transform: uppercase; color: var(--text-muted); }
.positionen-table th.small { width: 80px; }
.positionen-table td { padding: .25rem; border-bottom: 1px solid var(--border); }
.positionen-table input { width: 100%; }
.pos-summe { padding: .5rem !important; min-width: 90px; }

.invoice-document { max-width: 800px; }
.invoice-head { display: flex; justify-content: space-between; margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.invoice-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .35rem; margin-bottom: 1.5rem; font-size: 13px; }
.invoice-subject { margin: 1rem 0; font-size: 18px; }
.invoice-table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 13px; }
.invoice-table th { text-align: left; padding: .5rem; background: var(--surface-2); border-bottom: 2px solid var(--border-strong); }
.invoice-table td { padding: .55rem .5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.invoice-table tfoot td { padding: .35rem .5rem; border-bottom: none; }
.invoice-table tfoot tr.total td { border-top: 2px solid var(--border-strong); padding-top: .65rem; font-size: 15px; }
.invoice-footer { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--border); color: var(--text-muted); }

/* ============================================================================
   AUTH (Login Page)
   ============================================================================ */

.auth-body {
    background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1rem;
}
.auth-container {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.auth-brand { text-align: center; margin-bottom: 2rem; }
.auth-brand h1 { font-size: 20px; margin: 1rem 0 .25rem 0; }
.auth-brand h1 em { font-weight: 400; font-style: normal; color: var(--text-muted); }
.auth-subtitle { color: var(--text-muted); font-size: 13px; margin: 0; }
.auth-brand .brand-mark { margin: 0 auto; }
.auth-form { display: flex; flex-direction: column; gap: 1rem; }

/* ============================================================================
   ERROR PAGES
   ============================================================================ */

.error-body { background: var(--bg); min-height: 100vh; display: grid; place-items: center; padding: 2rem; }
.error-container { text-align: center; max-width: 480px; }
.error-code { font-size: 120px; font-weight: 700; color: var(--primary); line-height: 1; margin-bottom: 1rem; }
.error-container h1 { font-size: 24px; margin-bottom: .5rem; }
.error-container p { color: var(--text-muted); margin-bottom: 1.5rem; }

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 900px) {
    .app-shell { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: relative; }
    .sidebar-nav { max-height: 50vh; }
    .form-grid { grid-template-columns: 1fr; }
    .grid-span-2 { grid-column: span 1; }
    .main-content { padding: 1rem; }
}

/* ============================================================================
   BRANDING (Logo) + Benutzerverwaltung-Helfer
   ============================================================================ */

.brand-logo {
    display: block;
    width: 100%;
    max-width: 190px;
    height: auto;
}

.auth-logo-panel {
    display: inline-block;
    background: var(--sidebar-bg);
    border-radius: var(--radius);
    padding: 1.5rem 1.75rem;
}
.auth-logo-panel img {
    display: block;
    width: 100%;
    max-width: 240px;
    height: auto;
    margin: 0 auto;
}

.badge-success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge-danger  { background: var(--danger-soft);  color: var(--danger);  border-color: transparent; }
.badge-warning { background: var(--warning-soft); color: var(--warning); border-color: transparent; }

.text-muted { color: var(--text-muted); }

.form-hint {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
    margin-top: .25rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-weight: 500;
}
.checkbox-label input { width: auto; margin: 0; }

/* ============================================================================
   HELP-TOGGLE (ⓘ-Aufklappbox je Modul, natives <details>)
   ============================================================================ */

.hilfe { margin: -.25rem 0 1.25rem; }

.hilfe-toggle {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    width: max-content;
    cursor: pointer;
    list-style: none;
    user-select: none;
    font-size: 12px;
    font-weight: 600;
    color: var(--info);
    background: var(--info-soft);
    border: 1px solid #93c5fd;
    border-radius: 999px;
    padding: .3rem .8rem;
}
.hilfe-toggle::-webkit-details-marker { display: none; }
.hilfe-toggle::before { content: "\24D8"; font-size: 14px; line-height: 1; } /* ⓘ */
.hilfe-toggle:hover { filter: brightness(.97); }
.hilfe[open] .hilfe-toggle { border-radius: var(--radius) var(--radius) 0 0; }

.hilfe-box {
    max-width: 920px;
    background: var(--info-soft);
    border: 1px solid #93c5fd;
    border-top: none;
    border-radius: 0 var(--radius) var(--radius) var(--radius);
    padding: 1rem 1.1rem;
    font-size: 13px;
    line-height: 1.55;
    color: #1e3a8a;
}
.hilfe-box h4 { margin: 0 0 .5rem; font-size: 13px; color: var(--info); }
.hilfe-box p { margin: .4rem 0; }
.hilfe-box p:last-child { margin-bottom: 0; }
.hilfe-box code { background: #fff; padding: .05rem .3rem; border-radius: 3px; font-size: 12px; }

/* Angebots-Status-Badges (ergänzend zu den bestehenden .status-*) */
.status-versendet  { background: var(--info-soft);    color: var(--info);    border-color: transparent; }
.status-angenommen { background: var(--success-soft); color: var(--success); border-color: transparent; }
.status-abgelehnt  { background: var(--danger-soft);  color: var(--danger);  border-color: transparent; }
.status-abgelaufen { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
