/* ============================================================
   PD Wirtschafts-Panel – Dark Dashboard CSS
   ============================================================ */

:root {
    --bg-base:      #0d1117;
    --bg-surface:   #161b22;
    --bg-elevated:  #1c2128;
    --bg-hover:     #21262d;
    --border:       #30363d;
    --border-light: #21262d;

    --text-primary:  #e6edf3;
    --text-secondary:#8b949e;
    --text-muted:    #6e7681;

    --accent:        #58a6ff;
    --accent-hover:  #79beff;
    --accent-dim:    #1f3a5f;

    --green:   #3fb950;
    --green-bg:#0d2c1a;
    --yellow:  #d29922;
    --yellow-bg:#2e2000;
    --red:     #f85149;
    --red-bg:  #3d1616;
    --blue:    #58a6ff;
    --blue-bg: #1f3a5f;
    --cyan:    #39d353;
    --cyan-bg: #0d2c1a;
    --orange:  #e3b341;
    --orange-bg:#2d1f00;
    --purple:  #bc8cff;
    --purple-bg:#2d1f50;
    --gray:    #8b949e;
    --gray-bg: #21262d;

    --sidebar-width: 240px;
    --topbar-height: 56px;

    --radius-sm:  4px;
    --radius:     8px;
    --radius-lg: 12px;

    --shadow: 0 1px 3px rgba(0,0,0,.4), 0 4px 12px rgba(0,0,0,.3);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

/* ─── Layout ─────────────────────────────────────────────── */

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

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

.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: width 0.2s ease;
    overflow-y: auto;
}

.sidebar.collapsed { width: 56px; }
.sidebar.collapsed .logo-title,
.sidebar.collapsed .logo-sub,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-item span:not(.nav-icon),
.sidebar.collapsed .user-details { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 0.6rem; }
.sidebar.collapsed .nav-icon { margin: 0; }

.sidebar-header {
    padding: 1rem 0.75rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 36px; height: 36px;
    background: var(--accent-dim);
    border-radius: var(--radius-sm);
    display: grid;
    place-items: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.logo-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
    line-height: 1.2;
}

.logo-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: block;
}

/* Nav */
.sidebar-nav {
    flex: 1;
    padding: 0.5rem 0;
    overflow-y: auto;
}

.nav-section {
    padding: 0.5rem 0;
}

.nav-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0.4rem 0.75rem 0.2rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    border-radius: 0;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    position: relative;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    text-decoration: none;
}

.nav-item.active {
    background: var(--accent-dim);
    color: var(--accent);
    font-weight: 500;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 2px;
    background: var(--accent);
}

.nav-badge {
    margin-left: auto;
    background: var(--accent-blue, #58a6ff);
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    line-height: 1;
    padding: .15rem .38rem;
    border-radius: 99px;
    min-width: 18px;
    text-align: center;
}

.nav-icon {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
}

/* ── Notification Bell ─────────────────────────────────────────────────────── */
.notif-wrapper {
    position: relative;
}
.notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #ef4444;
    color: #fff;
    font-size: .6rem;
    font-weight: 700;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 999px;
    pointer-events: none;
}
.notif-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
    z-index: 200;
    overflow: hidden;
}
.notif-dropdown.open { display: block; }
.notif-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .6rem .9rem;
    font-size: .8rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.notif-mark-all {
    background: none;
    border: none;
    color: var(--accent);
    font-size: .75rem;
    cursor: pointer;
    padding: 0;
}
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    padding: .65rem .9rem;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: background .15s;
}
.notif-item:hover { background: var(--surface-hover, color-mix(in srgb, var(--accent) 6%, transparent)); }
.notif-item--unread { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.notif-item-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: .1rem; }
.notif-item-body { flex: 1; min-width: 0; }
.notif-item-title { font-size: .85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-item--unread .notif-item-title { color: var(--accent); }
.notif-item-meta { font-size: .75rem; color: var(--text-muted); margin-top: .1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-item-time { font-size: .7rem; color: var(--text-muted); margin-top: .15rem; }
.notif-empty { padding: 1.5rem; text-align: center; color: var(--text-muted); font-size: .85rem; }
.notif-all-link {
    display: block;
    text-align: center;
    padding: .55rem;
    font-size: .8rem;
    color: var(--accent);
    text-decoration: none;
    border-top: 1px solid var(--border);
}
.notif-all-link:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }

/* Radio Frequency Banner */
.radio-frequency-banner {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0.75rem 0.75rem 0;
    padding: 0.55rem 0.75rem;
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
    border-radius: 8px;
    flex-shrink: 0;
}
.radio-frequency-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}
.radio-frequency-banner > div {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    overflow: hidden;
}
.radio-frequency-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    line-height: 1;
}
.radio-frequency-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar.collapsed .radio-frequency-banner {
    justify-content: center;
    padding: 0.55rem;
}
.sidebar.collapsed .radio-frequency-banner > div {
    display: none;
}

/* Footer */
.sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.user-avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
}

.user-avatar-sm  { width: 24px; height: 24px; border-radius: 50%; }
.user-avatar-lg  { width: 48px; height: 48px; border-radius: 50%; }

.user-details { min-width: 0; }
.user-name { display: block; font-size: 0.8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { display: block; font-size: 0.68rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.btn-logout {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    padding: 0.3rem 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: color .15s, border-color .15s;
}
.btn-logout:hover { color: var(--red); border-color: var(--red); }

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

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.2s ease;
}

.sidebar.collapsed ~ .main-content { margin-left: 56px; }

.topbar {
    height: var(--topbar-height);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.25rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.3rem;
    line-height: 1;
}

.topbar-title {
    font-size: 1rem;
    font-weight: 600;
    flex: 1;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.content-area {
    padding: 1.5rem;
    flex: 1;
}

.panel-footer {
    padding: 0.75rem 1.5rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    letter-spacing: 0.01em;
}

.panel-footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}

.panel-footer a:hover {
    color: var(--accent-hover);
    text-decoration: none;
}

/* ─── Alerts ─────────────────────────────────────────────── */

.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.875rem;
    border: 1px solid transparent;
}

.alert-success { background: var(--green-bg); border-color: var(--green); color: var(--green); }
.alert-error   { background: var(--red-bg);   border-color: var(--red);   color: var(--red); }
.alert-info    { background: var(--blue-bg);   border-color: var(--blue);  color: var(--blue); }
.alert-warning { background: var(--yellow-bg); border-color: var(--yellow);color: var(--yellow); }

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

.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 1.25rem;
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border);
    background: var(--bg-elevated);
}

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

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

.stats-grid--5 { grid-template-columns: repeat(5, 1fr); }

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-icon { font-size: 1.4rem; margin-bottom: 0.25rem; }
.stat-icon--yellow { filter: hue-rotate(10deg); }
.stat-icon--red    { filter: hue-rotate(180deg); }
.stat-icon--green  {}
.stat-icon--blue   {}

.stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: 0.78rem; color: var(--text-secondary); }

/* ─── Table ──────────────────────────────────────────────── */

.table-wrapper {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table th {
    padding: 0.6rem 1rem;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.table tbody tr:hover { background: var(--bg-hover); }
.table tbody tr:last-child td { border-bottom: none; }
.table--compact td { padding: 0.45rem 0.75rem; }
.row--deleted { opacity: 0.5; }
.actions-cell { white-space: nowrap; }

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

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 2rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: .03em;
    white-space: nowrap;
}

.badge--xs  { font-size: 0.65rem; padding: 0.1rem 0.4rem; }
.badge--gray   { background: var(--gray-bg);   color: var(--gray); }
.badge--blue   { background: var(--blue-bg);   color: var(--blue); }
.badge--green  { background: var(--green-bg);  color: var(--green); }
.badge--yellow { background: var(--yellow-bg); color: var(--yellow); }
.badge--red    { background: var(--red-bg);    color: var(--red); }
.badge--orange { background: var(--orange-bg); color: var(--orange); }
.badge--purple { background: var(--purple-bg); color: var(--purple); }
.badge--cyan   { background: var(--cyan-bg);   color: var(--cyan); }

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, border-color .15s, color .15s;
    white-space: nowrap;
}

.btn:hover { text-decoration: none; }

.btn-primary {
    background: var(--accent);
    color: #0d1117;
    border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #0d1117; }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-danger {
    background: var(--red-bg);
    color: var(--red);
    border-color: var(--red);
}
.btn-danger:hover { background: var(--red); color: #fff; }

.btn-warning {
    background: var(--yellow-bg);
    color: var(--yellow);
    border-color: var(--yellow);
}
.btn-warning:hover { background: var(--yellow); color: #0d1117; }

.btn-success {
    background: var(--green-bg);
    color: var(--green);
    border-color: var(--green);
}
.btn-success:hover { background: var(--green); color: #0d1117; }

.btn-sm  { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-xs  { padding: 0.2rem 0.5rem;  font-size: 0.72rem; }
.btn-full { width: 100%; }
.btn-icon { padding: 0.35rem 0.5rem; }
.btn-text { background: none; border: none; color: var(--accent); cursor: pointer; font-size: 0.875rem; }

/* Steam-Button */
.btn-steam {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.8rem 1.5rem;
    background: #1b2838;
    color: #c7d5e0;
    border: 1px solid #2a475e;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s;
    margin: 1.25rem 0;
}
.btn-steam:hover { background: #2a475e; text-decoration: none; color: #fff; }
.steam-icon { width: 24px; height: 24px; fill: currentColor; }

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

.form { display: flex; flex-direction: column; gap: 0; }

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

.form-section { margin-bottom: 1.5rem; }
.form-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.form-group { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 1rem; }
.form-group--grow { flex: 1; }
.form-group--qty  { width: 100px; }
.form-group--price { width: 120px; }
.form-group--action { width: auto; flex-shrink: 0; }

.form-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.form-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-input, .form-select, .form-textarea {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-family: inherit;
    width: 100%;
    transition: border-color .15s;
    outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--accent);
}

.form-input.is-error, .form-select.is-error,
.form-input.is-invalid, .form-select.is-invalid { border-color: var(--red); }
.form-input--sm { padding: 0.35rem 0.6rem; font-size: 0.8rem; }
.form-select--sm { padding: 0.35rem 0.6rem; font-size: 0.8rem; }

.form-textarea { resize: vertical; min-height: 80px; }
.form-error { font-size: 0.75rem; color: var(--red); }
.form-checkbox { width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent); }

.form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    margin-top: 0.5rem;
}

.required { color: var(--red); }

/* Radio Cards */
.radio-group { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.radio-card {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: var(--bg-elevated);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color .15s, background .15s;
    flex: 1;
    min-width: 140px;
}

.radio-card input { display: none; }
.radio-card.selected, .radio-card:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-dim);
}
.radio-card:hover { border-color: var(--text-secondary); }
.radio-icon { font-size: 1.2rem; }
.radio-label { font-weight: 500; font-size: 0.9rem; }

/* ─── Filter Bar ─────────────────────────────────────────── */

.filter-bar { margin-bottom: 1rem; }
.filter-form { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

/* ─── Detail Layout ──────────────────────────────────────── */

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.25rem;
    align-items: start;
}

.detail-main  { display: flex; flex-direction: column; }
.detail-sidebar { display: flex; flex-direction: column; }

.detail-meta { display: flex; flex-direction: column; gap: 0; }
.meta-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-light);
    gap: 1rem;
}
.meta-row:last-child { border-bottom: none; }
.meta-row--block { flex-direction: column; align-items: flex-start; }
.meta-label { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }

/* ─── List Items ─────────────────────────────────────────── */

.list-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
}
.list-item:last-child { border-bottom: none; }
.list-item-main { display: flex; align-items: center; gap: 0.5rem; flex: 1; min-width: 0; }
.list-item-meta { font-size: 0.78rem; color: var(--text-secondary); }
.order-number   { font-family: monospace; font-weight: 600; }

/* ─── Catalog ────────────────────────────────────────────── */

.catalog-section { margin-bottom: 2rem; }
.catalog-category {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.catalog-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    transition: border-color .15s, box-shadow .15s;
}

.catalog-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }

.catalog-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 56px;
    margin-bottom: 0.1rem;
}
.catalog-icon img {
    max-height: 48px;
    max-width: 100%;
    object-fit: contain;
}

.catalog-card-header { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.catalog-name { font-size: 0.95rem; font-weight: 600; }
.catalog-unit { font-size: 0.75rem; color: var(--text-muted); }
.catalog-desc { font-size: 0.8rem; color: var(--text-secondary); }

.price-section { margin-top: auto; }
.price-base { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.3rem; }
.price-label { font-size: 0.75rem; color: var(--text-muted); }
.price-value { font-size: 1rem; font-weight: 700; color: var(--accent); }

.price-tiers { margin-top: 0.4rem; }
.price-tiers-label { font-size: 0.7rem; color: var(--text-muted); display: block; margin-bottom: 0.25rem; }
.tier-list { display: flex; flex-direction: column; gap: 0.15rem; }
.tier-item { display: flex; justify-content: space-between; font-size: 0.75rem; }
.tier-price { color: var(--green); font-weight: 600; }

.catalog-actions { margin-top: 0.25rem; display: flex; gap: .5rem; }

/* ─── Activity Feed ──────────────────────────────────────── */
.activity-feed-entry { display: flex; align-items: flex-start; gap: .75rem; padding: .6rem 1.25rem; border-bottom: 1px solid var(--border); }
.activity-feed-entry:last-child { border-bottom: none; }
.activity-feed-icon { font-size: 1rem; width: 1.5rem; text-align: center; flex-shrink: 0; margin-top: .1rem; }
.activity-feed-body { flex: 1; min-width: 0; }
.activity-feed-event { font-size: .8rem; font-weight: 600; color: var(--text-secondary); font-family: var(--font-mono, monospace); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-feed-meta { font-size: .75rem; color: var(--text-muted); margin-top: .15rem; display: flex; gap: .4rem; }

/* ─── Job Comments ───────────────────────────────────────── */
.job-comments-list { padding: .25rem 0; }
.job-comment { padding: .75rem 1.25rem; border-bottom: 1px solid var(--border); }
.job-comment:last-child { border-bottom: none; }
.job-comment-meta { display: flex; gap: .5rem; align-items: center; margin-bottom: .3rem; }
.job-comment-author { font-size: .8rem; font-weight: 600; }
.job-comment-text { font-size: .875rem; line-height: 1.5; }

/* ─── Order Form ─────────────────────────────────────────── */

.order-item-row {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    background: var(--bg-elevated);
}

.item-row-grid {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.price-display {
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--accent);
    font-weight: 600;
    min-height: 36px;
    display: flex;
    align-items: center;
}

.order-summary {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.summary-total { font-size: 1.3rem; color: var(--accent); }

/* ─── Delivery Items ─────────────────────────────────────── */

.delivery-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: var(--bg-elevated);
    transition: border-color .15s;
}

.delivery-item--done {
    border-color: var(--green);
    background: var(--green-bg);
    opacity: 0.8;
}

.delivery-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.delivery-check-label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.delivery-material { font-weight: 600; }
.delivery-qty-info { display: flex; gap: 0.4rem; }

.qty-badge {
    padding: 0.15rem 0.5rem;
    border-radius: 2rem;
    font-size: 0.7rem;
    font-weight: 600;
}
.qty-badge--target    { background: var(--gray-bg);   color: var(--gray); }
.qty-badge--done      { background: var(--green-bg);  color: var(--green); }
.qty-badge--remaining { background: var(--yellow-bg); color: var(--yellow); }

.delivery-item-form { margin-top: 0.5rem; }

/* ─── Misc ───────────────────────────────────────────────── */

.empty-state {
    text-align: center;
    padding: 2.5rem;
    color: var(--text-muted);
}
.empty-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }

.font-mono  { font-family: 'Consolas', 'Monaco', monospace; }
.font-bold  { font-weight: 700; }
.text-muted { color: var(--text-muted) !important; }
.text-accent { color: var(--accent) !important; }
.text-right { text-align: right; }
.text-xs    { font-size: 0.72rem; }
.text-sm    { font-size: 0.8rem; }

.error-list { list-style: disc; margin-left: 1.25rem; }
.event-code { background: var(--bg-elevated); padding: 0.1rem 0.3rem; border-radius: 3px; font-size: 0.75rem; }

/* Audit */
.audit-details { margin-top: 0.5rem; display: flex; flex-direction: column; gap: 0.5rem; }
.code-block {
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    font-size: 0.7rem;
    overflow-x: auto;
    white-space: pre;
    color: var(--text-secondary);
    max-height: 200px;
    overflow-y: auto;
}

/* History */
.history-item { padding: 0.5rem 0; border-bottom: 1px solid var(--border-light); }
.history-meta { display: flex; justify-content: space-between; margin-bottom: 0.2rem; }
.price-old { color: var(--red); text-decoration: line-through; }
.price-new { color: var(--green); font-weight: 600; }

/* Auth */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }

.auth-container { width: 100%; max-width: 420px; padding: 1rem; }

.auth-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.auth-logo { text-align: center; margin-bottom: 1.5rem; }
.auth-logo-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.auth-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 0.25rem; }
.auth-subtitle { color: var(--text-secondary); font-size: 0.85rem; }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    margin: 1.25rem 0 0;
}
.auth-divider::before,
.auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.auth-info { font-size: 0.78rem; color: var(--text-muted); text-align: center; margin-top: 0.5rem; }
.auth-footer { text-align: center; margin-top: 1.5rem; color: var(--text-muted); font-size: 0.75rem; }

/* Pagination (Laravel default override) */
.pagination { display: flex; gap: 0.25rem; list-style: none; }
.pagination li a,
.pagination li span {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: var(--bg-elevated);
    text-decoration: none;
}
.pagination li.active span,
.pagination li span[aria-current="page"] {
    background: var(--accent);
    border-color: var(--accent);
    color: #0d1117;
}

/* ─── Einnahmen-Chart ────────────────────────────────────── */

.revenue-chart-card { margin-bottom: 1.25rem; }

.period-btns {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.period-btn {
    border-radius: var(--radius-sm) !important;
    transition: background .15s, color .15s, border-color .15s;
}

.period-btn.active {
    background: var(--accent-dim) !important;
    color: var(--accent) !important;
    border-color: var(--accent) !important;
    font-weight: 600;
}

.chart-summary {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.chart-total {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--accent);
}

.chart-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.chart-wrap {
    position: relative;
    height: 220px;
}

/* ─── Rollenverwaltung ───────────────────────────────────── */

.role-form-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1.25rem;
    align-items: start;
}

.role-name-badge {
    font-family: 'Consolas', monospace;
    font-size: 0.85rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.15rem 0.5rem;
    color: var(--accent);
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    justify-content: flex-end;
}
.table-actions .form-inline { display: contents; }

/* Permission groups */
.permission-groups {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.permission-group {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.permission-group-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
}

.permission-group-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-secondary);
    flex: 1;
}

.permission-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0;
}

.permission-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.75rem;
    cursor: pointer;
    transition: background .1s;
    border-bottom: 1px solid var(--border-light);
}

.permission-check:hover { background: var(--bg-hover); }

.permission-check input[type="checkbox"] {
    accent-color: var(--accent);
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.perm-name {
    font-family: 'Consolas', monospace;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.permission-check:has(input:checked) .perm-name {
    color: var(--text-primary);
    font-weight: 600;
}

/* Permission list page */
.perm-section { border-bottom: 1px solid var(--border); }
.perm-section:last-child { border-bottom: none; }

.perm-section-header {
    padding: 0.45rem 1rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-muted);
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
}

.perm-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--border-light);
}
.perm-row:last-child { border-bottom: none; }
.perm-row .perm-name { flex: 1; }

/* Role stats mini */
.role-stats {
    display: flex;
    gap: 1rem;
}

.stat-mini {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem 1rem;
    min-width: 70px;
}

.stat-mini-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent);
}

.stat-mini-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Misc helpers */
.divider { border: none; border-top: 1px solid var(--border); margin: 0; }
.w-full { width: 100%; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.d-inline { display: inline; }

@media (max-width: 900px) {
    .role-form-grid { grid-template-columns: 1fr; }
}

/* ─── Auftragsverwaltung / Deadline-Farbkodierung ───────── */

/* Tabellenzeile Hintergrund */
.deadline-row.deadline-danger  { background: rgba(248, 81, 73, .06); }
.deadline-row.deadline-warning { background: rgba(210, 153, 34, .06); }
.deadline-row.deadline-caution { background: rgba(88, 166, 255, .04); }
.deadline-row.deadline-ok      { }
.deadline-row.deadline-done    { opacity: 0.65; }

/* Deadline-Zelle mit Punkt-Indikator */
.deadline-cell {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.85rem;
}

.deadline-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.deadline-danger  .deadline-dot  { background: var(--red); box-shadow: 0 0 6px var(--red); }
.deadline-warning .deadline-dot  { background: var(--yellow); box-shadow: 0 0 6px var(--yellow); }
.deadline-caution .deadline-dot  { background: var(--orange); }
.deadline-ok      .deadline-dot  { background: var(--green); }
.deadline-done    .deadline-dot  { background: var(--gray); }

.deadline-cell.deadline-danger  { color: var(--red); }
.deadline-cell.deadline-warning { color: var(--yellow); }
.deadline-cell.deadline-caution { color: var(--orange); }
.deadline-cell.deadline-ok      { color: var(--green); }
.deadline-cell.deadline-done    { color: var(--gray); }

.deadline-label {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.1rem 0.4rem;
    border-radius: 2rem;
    background: currentColor;
    color: var(--bg-base) !important;
    opacity: 0.85;
}

/* Deadline-Badge in der Detail-Ansicht */
.deadline-badge {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.3rem 0.65rem;
    border-radius: var(--radius);
}
.deadline-badge.deadline-danger  { background: var(--red-bg);    color: var(--red);    border: 1px solid var(--red); }
.deadline-badge.deadline-warning { background: var(--yellow-bg); color: var(--yellow); border: 1px solid var(--yellow); }
.deadline-badge.deadline-caution { background: var(--orange-bg); color: var(--orange); border: 1px solid var(--orange); }
.deadline-badge.deadline-ok      { background: var(--green-bg);  color: var(--green);  border: 1px solid var(--green); }
.deadline-badge.deadline-done    { background: var(--gray-bg);   color: var(--gray);   border: 1px solid var(--gray); }

/* User-Chip (Mitarbeiter-Anzeige) */
.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
}
.chip-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
}

/* card-header flex layout */
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--border);
}

/* form-hint */
.form-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.4rem; }

/* utility */
.hidden { display: none !important; }

/* required asterisk */
.required { color: var(--red); }

/* pre-wrap text */
.pre-wrap { white-space: pre-wrap; }

/* ml-2 */
.ml-2 { margin-left: 0.5rem; }

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

@media (max-width: 1024px) {
    .detail-grid { grid-template-columns: 1fr; }
    .stats-grid--5 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.mobile-open { transform: translateX(0); }
    .main-content { margin-left: 0 !important; }
    .stats-grid--5 { grid-template-columns: repeat(2, 1fr); }
    .catalog-grid { grid-template-columns: 1fr; }
    .item-row-grid { flex-direction: column; }
    .form-group--qty, .form-group--price { width: 100%; }
    .form-grid-2 { grid-template-columns: 1fr; }
}

/* ─── Balance Widget (Dashboard) ────────────────────────────── */

.balance-widget {
    margin-bottom: 1.25rem;
}

.balance-widget__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.balance-widget__label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
}

.balance-widget__body {
    padding: 1.25rem 1.25rem 1rem;
    display: flex;
    align-items: baseline;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.balance-widget__amount {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.balance-positive { color: var(--green); }
.balance-negative { color: var(--red); }

.balance-widget__meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    flex-wrap: wrap;
}

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

.balance-widget__recent {
    border-top: 1px solid var(--border-light);
    padding: 0.5rem 0;
}

.balance-tx {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 1.25rem;
    font-size: 0.82rem;
    transition: background .1s;
}

.balance-tx:hover { background: var(--bg-hover); }

.balance-tx__dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-green { background: var(--green); }
.dot-red   { background: var(--red); }

.balance-tx__desc { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.balance-tx__date { color: var(--text-muted); flex-shrink: 0; }
.balance-tx__amount { font-weight: 600; flex-shrink: 0; }

/* ─── Finance Page ──────────────────────────────────────────── */

.finance-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1.25rem;
    align-items: start;
}

.stats-grid--3 { grid-template-columns: repeat(3, 1fr); }

.stat-card--balance {
    background: linear-gradient(135deg, var(--bg-elevated), var(--bg-surface));
    border-color: var(--border);
}

.stat-value--balance {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0.25rem 0;
}

.stat-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.stat-card--alert { border-color: var(--red); background: rgba(239,68,68,.04); }
.stat-card--link { display:block; text-decoration:none; color:inherit; cursor:pointer; transition:border-color .15s,transform .1s; }
.stat-card--link:hover { border-color: var(--accent); transform: translateY(-1px); }

.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.text-yellow { color: var(--yellow); }
.text-orange { color: var(--orange); }

.finance-amount { font-weight: 600; font-variant-numeric: tabular-nums; }

/* Type-Toggle (Einnahme / Ausgabe Radio) */
.type-toggle {
    display: flex;
    gap: 0.5rem;
}

.type-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background .15s, border-color .15s, color .15s;
}

.type-option input { display: none; }

.type-option--income:has(input:checked)  { background: var(--green-bg);  border-color: var(--green);  color: var(--green); }
.type-option--expense:has(input:checked) { background: var(--red-bg);    border-color: var(--red);    color: var(--red); }
.type-option:not(:has(input:checked))    { color: var(--text-secondary); }
.type-option:hover                       { background: var(--bg-hover); }

.w-full { width: 100%; }
.mb-4   { margin-bottom: 1.25rem; }

@media (max-width: 900px) {
    .finance-layout { grid-template-columns: 1fr; }
    .stats-grid--3  { grid-template-columns: 1fr; }
}

/* ─── Job Recurrence Controls ───────────────────────────────── */

.btn-group-stack {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.text-sm { font-size: 0.82rem; }
.mb-3    { margin-bottom: 0.75rem; }
.ml-2    { margin-left: 0.5rem; }

/* ─── Permission Descriptions ───────────────────────────────── */

.perm-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.perm-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 400;
    line-height: 1.3;
}

.permission-check {
    align-items: flex-start;
}

.permission-check input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
}

.perm-row-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

/* ─── Chart Summary (Einnahmen & Ausgaben) ──────────────────── */

.chart-sub-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

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

/* ─── Job Detail Layout ──────────────────────────────────────── */

.job-detail-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 1.25rem;
    align-items: start;
}

.job-detail-sidebar { display: flex; flex-direction: column; gap: 1.25rem; }
.job-detail-main    { display: flex; flex-direction: column; gap: 1.25rem; }

.meta-list { display: flex; flex-direction: column; }

.meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    gap: 1rem;
}
.meta-row:last-child { border-bottom: none; }
.meta-row--block     { flex-direction: column; align-items: flex-start; gap: 0.25rem; }

.meta-label { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; min-width: 120px; }
.meta-value { font-size: 0.875rem; text-align: right; }
.meta-row--block .meta-value { text-align: left; }

.badge--lg { font-size: 0.8rem; padding: 0.3rem 0.75rem; }

/* ─── Warehouse ──────────────────────────────────────────────── */

.warehouse-detail-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 1.25rem;
    align-items: start;
}

.warehouse-stock-display {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.warehouse-stock-value {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1;
}

.warehouse-stock-unit {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-secondary);
}

.warehouse-stock-meta { text-align: right; }

.warehouse-stock { font-weight: 600; font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
    .job-detail-layout       { grid-template-columns: 1fr; }
    .warehouse-detail-layout { grid-template-columns: 1fr; }
}

/* ─── Icon Picker ─────────────────────────────────────────── */

/* Material-Icon in Tabelle */
.material-name-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.material-icon-thumb {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 3px;
    flex-shrink: 0;
}

.material-icon-placeholder {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* ─── Icon Picker ─────────────────────────────────────────── */

.icon-picker {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

/* Vorschau + Clear in einer Zeile */
.icon-picker-preview {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.icon-picker-preview img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid var(--border);
    padding: 2px;
    background: var(--bg);
    flex-shrink: 0;
}

.icon-picker-empty {
    font-size: 0.775rem;
    color: var(--text-muted);
    font-style: italic;
}

.icon-picker-clear {
    margin-left: auto;
    flex-shrink: 0;
    background: none;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 2px);
    color: var(--text-muted);
    font-size: 0.7rem;
    padding: 0.15rem 0.45rem;
    cursor: pointer;
    line-height: 1.5;
    transition: border-color 0.15s, color 0.15s;
}
.icon-picker-clear:hover { border-color: var(--red); color: var(--red); }

/* Tab-Leiste */
.icon-tabs {
    display: flex;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.icon-tab {
    flex: 1;
    padding: 0.4rem 0.25rem;
    background: none;
    border: none;
    border-top: 2px solid transparent;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 0.775rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.icon-tab:hover { color: var(--text); }
.icon-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: var(--bg);
}

/* Tab-Inhalt */
.icon-tab-panel {
    padding: 0.625rem 0.75rem;
    background: var(--bg);
}

/* Bibliotheks-Raster */
.icon-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
    gap: 0.375rem;
    max-height: 180px;
    overflow-y: auto;
}

.icon-library-item {
    aspect-ratio: 1;
    padding: 4px;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.icon-library-item:hover  { border-color: var(--accent); }
.icon-library-item.selected { border-color: var(--accent); background: var(--accent-dim); }
.icon-library-item img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* ─── Background image – glass morphism ──────────────────── */

body.has-bg .topbar {
    background: rgba(22, 27, 34, 0.72);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom-color: rgba(48, 54, 61, 0.45);
}

body.has-bg .card,
body.has-bg .balance-widget,
body.has-bg .stat-card {
    background: rgba(22, 27, 34, 0.78);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-color: rgba(48, 54, 61, 0.55);
}

/* ─── Settings / Webhook-Inputs ─────────────────────────── */

.settings-webhook-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.webhook-input-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.webhook-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    width: 28px;
    text-align: center;
}

.form-error {
    color: var(--red);
    font-size: 0.78rem;
    margin-top: 0.25rem;
}

/* ─── Background image – glass morphism ──────────────────── */

body.has-bg .panel-footer {
    background: rgba(22, 27, 34, 0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top-color: rgba(48, 54, 61, 0.45);
}

/* ─── Kommentar-Thread ───────────────────────────────────── */

.comment-thread {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    max-height: 480px;
    overflow-y: auto;
}

.comment-empty {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
    padding: 1rem 0;
}

.comment {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.6rem 0.85rem;
    max-width: 85%;
}

.comment--mine {
    align-self: flex-end;
    background: var(--accent-dim);
    border-color: rgba(88,166,255,.25);
}

.comment--internal {
    border-left: 3px solid var(--yellow);
    background: var(--yellow-bg);
    opacity: 0.92;
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}

.comment-author {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.comment-time {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-left: auto;
}

.comment-body {
    font-size: 0.875rem;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.5;
}

.badge--xs {
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
}

/* ─── Dashboard Charts-Row ───────────────────────────────── */

.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.chart-card .card-body.chart-body {
    padding: 1rem 1.25rem;
    height: 260px;
    position: relative;
}

@media (max-width: 900px) {
    .charts-row { grid-template-columns: 1fr; }
}

/* ─── Ankündigungen ──────────────────────────────────────── */

.announcements-stack {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin-bottom: 1rem;
}

.announcement-banner {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .7rem 1rem;
    border-radius: var(--radius);
    border-left: 4px solid currentColor;
    font-size: .875rem;
}

.announcement-banner--blue   { background: var(--blue-bg);   color: var(--blue);   border-color: var(--blue); }
.announcement-banner--yellow  { background: var(--yellow-bg); color: var(--yellow); border-color: var(--yellow); }
.announcement-banner--red     { background: var(--red-bg);    color: var(--red);    border-color: var(--red); }
.announcement-banner--green   { background: var(--green-bg);  color: var(--green);  border-color: var(--green); }
.announcement-banner--pinned  { border-left-width: 3px; font-weight: 500; }

.announcement-icon  { font-size: 1.1rem; flex-shrink: 0; margin-top: .05rem; }
.announcement-title { font-weight: 600; color: var(--text-primary); }
.announcement-body  { display: block; color: var(--text-secondary); margin-top: .15rem; }
.announcement-expires { font-size: .75rem; white-space: nowrap; margin-left: auto; padding-top:.1rem; }

/* ─── Light-Mode Overrides ───────────────────────────────── */

html.light {
    --bg-base:      #f0f2f5;
    --bg-surface:   #ffffff;
    --bg-elevated:  #f8f9fb;
    --bg-hover:     #eef0f3;
    --border:       #d0d7de;
    --border-light: #e8eaed;

    --text-primary:   #1f2328;
    --text-secondary: #57606a;
    --text-muted:     #8c959f;

    --accent:      #0969da;
    --accent-hover:#0550ae;
    --accent-dim:  #ddf4ff;

    --green:    #1a7f37;
    --green-bg: #d1f0da;
    --yellow:   #9a6700;
    --yellow-bg:#fff8c5;
    --red:      #cf222e;
    --red-bg:   #ffd8d8;
    --blue:     #0969da;
    --blue-bg:  #ddf4ff;
    --orange:   #bc4c00;
    --orange-bg:#fff1e5;
    --purple:   #8250df;
    --purple-bg:#fbefff;
    --gray:     #57606a;
    --gray-bg:  #eaeef2;

    --shadow: 0 1px 3px rgba(0,0,0,.1), 0 4px 12px rgba(0,0,0,.07);
}

html.light .sidebar   { background: var(--bg-surface); border-right-color: var(--border); }
html.light .topbar    { background: var(--bg-surface); border-bottom-color: var(--border); }
html.light .nav-item:hover { background: var(--bg-hover); }
html.light .nav-item.active { background: var(--accent-dim); }
html.light body.has-bg .card,
html.light body.has-bg .balance-widget,
html.light body.has-bg .stat-card {
    background: rgba(255,255,255,.85);
}
html.light body.has-bg .topbar {
    background: rgba(255,255,255,.82);
}

/* ─── Stats-Grid 4 Spalten ───────────────────────────────── */
.stats-grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .stats-grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .stats-grid--4 { grid-template-columns: 1fr; } }

/* ─── Sidebar Logo Image ─────────────────────────────────── */

.sidebar-logo-img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

/* ─── Progress Bar ───────────────────────────────────────── */

.progress-bar {
    height: 8px;
    background: var(--bg-elevated);
    border-radius: 99px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.progress-fill {
    height: 100%;
    background: var(--green);
    border-radius: 99px;
    transition: width .3s ease;
}

.progress-fill--yellow { background: var(--yellow); }
.progress-fill--red    { background: var(--red); }

/* ─── Topbar Schnellsuche ────────────────────────────────── */

.topbar-search {
    position: relative;
}

.search-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 340px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 200;
    overflow: hidden;
}

.search-result {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem .85rem;
    text-decoration: none;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
    transition: background .12s;
}

.search-result:last-child { border-bottom: none; }
.search-result:hover { background: var(--bg-hover); }

.search-result-icon { font-size: 1rem; flex-shrink: 0; }

.search-result-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.search-result-label {
    font-size: .875rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-meta {
    font-size: .72rem;
    color: var(--text-muted);
}

.search-empty {
    padding: .75rem 1rem;
    color: var(--text-muted);
    font-size: .85rem;
    text-align: center;
}

/* ── Catalog Detail ─────────────────────────────────────────── */
.catalog-detail-header {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}
.catalog-detail-icon {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 12px;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--border);
}
.catalog-detail-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.catalog-detail-category {
    font-size: .8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: .25rem;
}
.catalog-detail-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 .5rem;
}
.catalog-detail-desc {
    color: var(--text-secondary);
    font-size: .9rem;
    line-height: 1.6;
    margin: 0;
}
.price-calc-row {
    display: flex;
    gap: 1.5rem;
    align-items: flex-end;
    flex-wrap: wrap;
}
.price-calc-result {
    flex: 1;
    min-width: 160px;
    padding: .75rem 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 6px;
}
.calc-price-unit {
    font-size: .85rem;
    color: var(--text-secondary);
}
.calc-price-total {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
    margin-top: .2rem;
}

/* ── Filter Row ─────────────────────────────────────────────── */
.filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}
.filter-row .form-input,
.filter-row .form-input--sm,
.filter-row .form-select,
.filter-row .form-select--sm {
    flex-shrink: 0;
}

/* ── Order Timeline ─────────────────────────────────────────── */
.order-timeline {
    position: relative;
    padding-left: 1.5rem;
}
.order-timeline::before {
    content: '';
    position: absolute;
    left: .45rem;
    top: .5rem;
    bottom: .5rem;
    width: 2px;
    background: var(--border);
}
.timeline-entry {
    position: relative;
    padding: .75rem 0 .75rem 1rem;
}
.timeline-dot {
    position: absolute;
    left: -1.07rem;
    top: 1rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg-surface);
}
.timeline-content {
    display: flex;
    flex-direction: column;
    gap: .2rem;
}
.timeline-status {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}
.timeline-actor {
    font-size: .8rem;
    color: var(--text-muted);
}
.timeline-desc {
    font-size: .85rem;
    color: var(--text-secondary);
}
.timeline-note {
    font-size: .85rem;
    color: var(--text-secondary);
    font-style: italic;
    padding: .3rem .6rem;
    background: var(--bg-elevated);
    border-left: 2px solid var(--border);
    border-radius: 0 4px 4px 0;
}
.timeline-time {
    font-size: .78rem;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════
   LIVE-WIDGET: Mitarbeiter-Chat + Bestellungs-Toasts
   ═══════════════════════════════════════════════════════════════ */

/* ─── Chat Widget Container ─────────────────────────────────── */
.chat-widget {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 900;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .6rem;
    pointer-events: none;
}
.chat-widget > * { pointer-events: all; }

/* ─── Toggle Button ──────────────────────────────────────────── */
.chat-toggle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 18px rgba(0,0,0,.4);
    position: relative;
    transition: background .15s, transform .12s;
    flex-shrink: 0;
}
.chat-toggle:hover { background: var(--accent-hover); transform: scale(1.06); }

/* ─── Unread Badge ───────────────────────────────────────────── */
.chat-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    background: var(--red);
    color: #fff;
    font-size: .62rem;
    font-weight: 700;
    min-width: 17px;
    height: 17px;
    border-radius: 99px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    border: 2px solid var(--bg-base);
}

/* ─── Chat Panel ─────────────────────────────────────────────── */
.chat-panel {
    display: none;
    flex-direction: column;
    width: 320px;
    height: 440px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 30px rgba(0,0,0,.45);
    overflow: hidden;
    order: -1;
}
.chat-widget--open .chat-panel { display: flex; }

.chat-panel-header {
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    padding: .65rem 1rem;
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-shrink: 0;
}
.chat-online-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    flex-shrink: 0;
    animation: chatPulse 2s infinite;
}
@keyframes chatPulse {
    0%,100% { opacity: 1; }
    50%      { opacity: .45; }
}
.chat-panel-title { font-weight: 600; font-size: .88rem; flex: 1; color: var(--text-primary); }
.chat-volume {
    display: flex;
    align-items: center;
    gap: .3rem;
    flex-shrink: 0;
}
.chat-volume-icon {
    font-size: .82rem;
    line-height: 1;
    cursor: default;
    user-select: none;
}
.chat-volume-slider {
    width: 56px;
    height: 3px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border);
    border-radius: 99px;
    outline: none;
    cursor: pointer;
    transition: background .15s;
}
.chat-volume-slider:hover { background: var(--text-muted); }
.chat-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
}
.chat-volume-slider::-moz-range-thumb {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    cursor: pointer;
}

.chat-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    padding: 0 .15rem;
    transition: color .12s;
}
.chat-close-btn:hover { color: var(--text-primary); }

/* ─── Message Area ───────────────────────────────────────────── */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: .75rem;
    display: flex;
    flex-direction: column;
    gap: .55rem;
    scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

.chat-loading {
    text-align: center;
    color: var(--text-muted);
    font-size: .82rem;
    padding: 1rem 0;
}

/* ─── Message Bubbles ────────────────────────────────────────── */
.chat-msg {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    max-width: 88%;
    align-self: flex-start;
}
.chat-msg--mine { align-self: flex-end; }
.chat-msg--in { animation: msgIn .18s ease; }
@keyframes msgIn {
    from { opacity: 0; transform: translateY(5px); }
    to   { opacity: 1; transform: none; }
}

.chat-msg-meta {
    display: flex;
    align-items: center;
    gap: .3rem;
    font-size: .7rem;
    color: var(--text-muted);
}
.chat-msg--mine .chat-msg-meta { flex-direction: row-reverse; }

.chat-avatar-img {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.chat-avatar-init {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: .6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.chat-msg-author { font-weight: 500; }
.chat-msg-time   { opacity: .75; }

.chat-bubble {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 2px 10px 10px 10px;
    padding: .4rem .65rem;
    font-size: .84rem;
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-wrap;
    color: var(--text-primary);
}
.chat-msg--mine .chat-bubble {
    background: var(--accent);
    border-color: transparent;
    border-radius: 10px 2px 10px 10px;
    color: #fff;
}

/* ─── Input Area ─────────────────────────────────────────────── */
.chat-input-area {
    border-top: 1px solid var(--border);
    padding: .55rem .65rem;
    display: flex;
    gap: .4rem;
    flex-shrink: 0;
    background: var(--bg-elevated);
}
.chat-input {
    flex: 1;
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .4rem .65rem;
    font-size: .83rem;
    color: var(--text-primary);
    outline: none;
    font-family: inherit;
    transition: border-color .15s;
}
.chat-input:focus { border-color: var(--accent); }
.chat-input::placeholder { color: var(--text-muted); }
.chat-send-btn {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    width: 34px;
    height: 34px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .15s;
}
.chat-send-btn:hover { background: var(--accent-hover); }

/* ─── Order Toasts ───────────────────────────────────────────── */
.toast-container {
    position: fixed;
    top: 4.5rem;
    right: 1rem;
    z-index: 950;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    pointer-events: none;
}
.order-toast {
    background: var(--bg-surface);
    border: 1px solid var(--accent);
    border-radius: var(--radius-lg);
    padding: .7rem .9rem;
    display: flex;
    align-items: center;
    gap: .65rem;
    box-shadow: 0 6px 24px rgba(0,0,0,.4);
    pointer-events: all;
    animation: toastIn .22s ease;
    max-width: 320px;
    min-width: 260px;
}
@keyframes toastIn {
    from { opacity: 0; transform: translateX(16px); }
    to   { opacity: 1; transform: none; }
}
.order-toast-icon  { font-size: 1.3rem; flex-shrink: 0; }
.order-toast-body  { flex: 1; min-width: 0; }
.order-toast-title { font-weight: 700; font-size: .82rem; color: var(--accent); }
.order-toast-sub   {
    font-size: .76rem;
    color: var(--text-muted);
    margin-top: .1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.order-toast-cta { flex-shrink: 0; }
.order-toast-x {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0;
    flex-shrink: 0;
    line-height: 1;
    transition: color .12s;
}
.order-toast-x:hover { color: var(--text-primary); }

/* ── Widget-Konfiguration Modal ── */
.widget-modal {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0;
    min-width: 300px;
    max-width: 420px;
    width: 100%;
    color: var(--text-primary);
    box-shadow: 0 8px 32px rgba(0,0,0,.6);
}
.widget-modal::backdrop {
    background: rgba(0,0,0,.55);
}
.widget-modal-inner {
    display: flex;
    flex-direction: column;
}
.widget-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .875rem 1.25rem;
    border-bottom: 1px solid var(--border);
}
.widget-modal-header h3 {
    font-size: .9375rem;
    font-weight: 600;
    margin: 0;
}
.widget-modal-header > button {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: .2rem .5rem;
    border-radius: var(--radius-sm);
    line-height: 1;
    transition: background .12s, color .12s;
}
.widget-modal-header > button:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.widget-modal-list {
    padding: .75rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .25rem;
}
.widget-modal-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .5rem .625rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background .12s;
    font-size: .875rem;
    user-select: none;
}
.widget-modal-item:hover {
    background: var(--bg-hover);
}
.widget-modal-item input[type="checkbox"] {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: var(--accent);
    flex-shrink: 0;
}
.widget-modal-footer {
    display: flex;
    gap: .75rem;
    justify-content: flex-end;
    padding: .75rem 1.25rem;
    border-top: 1px solid var(--border);
}
