:root {
    --bg: #f3f5f9;
    --panel: #ffffff;
    --text: #172033;
    --muted: #687086;
    --line: #e2e6ef;
    --primary: #111827;
    --accent: #7c3aed;
    --success: #117a4b;
    --warning: #9a6700;
    --danger: #b42318;
    --radius: 14px;
    --shadow: 0 12px 34px rgba(23, 32, 51, 0.08);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); }
a { color: #4f46e5; text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
.topbar { height: 72px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; background: #0f172a; color: white; position: sticky; top: 0; z-index: 20; }
.brand { color: white; display: flex; gap: 12px; align-items: center; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand span:last-child { display: grid; }
.brand small { color: #cbd5e1; font-size: 12px; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; display: inline-grid; place-items: center; background: linear-gradient(135deg, #7c3aed, #2563eb); color: white; font-size: 24px; font-weight: 800; }
.topbar-user { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.topbar-user form { margin: 0; }
.app-shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: calc(100vh - 72px); }
.sidebar { background: #fff; border-right: 1px solid var(--line); padding: 24px 14px; }
.sidebar nav { display: grid; gap: 6px; position: sticky; top: 96px; }
.sidebar a { color: #394055; padding: 11px 13px; border-radius: 10px; font-weight: 650; }
.sidebar a:hover, .sidebar a.active { background: #eef2ff; color: #4338ca; text-decoration: none; }
.content { width: min(1440px, 100%); padding: 36px; }
.content-narrow { max-width: 860px; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.page-heading h1 { font-size: clamp(28px, 3vw, 40px); line-height: 1.1; margin: 4px 0 8px; }
.page-heading p { color: var(--muted); margin: 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 800; color: #6d5bd0 !important; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 24px; }
.panel h2 { margin-top: 0; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.panel-heading h2, .panel-heading p { margin: 0; }
.panel-heading p { color: var(--muted); margin-top: 5px; }
.metric-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.metric { background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); display: grid; gap: 8px; }
.metric span { color: var(--muted); font-size: 13px; }
.metric strong { font-size: 30px; }
.metric-attention { border-color: #f7cfc9; background: #fff8f7; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.customer-card { display: block; padding: 18px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: #fbfcff; }
.customer-card:hover { border-color: #a5b4fc; text-decoration: none; transform: translateY(-1px); }
.customer-card h3 { margin: 0 0 14px; }
.customer-card dl { margin: 0; display: grid; gap: 8px; }
.customer-card dl div { display: flex; justify-content: space-between; }
.customer-card dt { color: var(--muted); }
.customer-card dd { margin: 0; font-weight: 750; }
.button { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 9px; padding: 10px 14px; font-weight: 750; cursor: pointer; text-decoration: none; }
.button:hover { text-decoration: none; filter: brightness(.97); }
.button-primary { background: var(--primary); color: white; }
.button-secondary { background: #eef0f5; color: #273044; }
.button-danger { background: #fee4e2; color: var(--danger); }
.button-ghost { background: transparent; color: white; border: 1px solid #475569; }
.button-block { width: 100%; }
.alert { border-radius: 10px; padding: 13px 15px; margin-bottom: 18px; font-weight: 650; }
.alert-success { background: #e9f8f0; color: var(--success); border: 1px solid #b8e7cf; }
.alert-error { background: #fff1f0; color: var(--danger); border: 1px solid #f2c2bd; }
.table-panel { padding: 0; overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.data-table th { text-align: left; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; background: #fafbfe; }
.data-table th, .data-table td { padding: 15px 17px; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table td strong, .data-table td small { display: block; }
.data-table td small { color: var(--muted); margin-top: 4px; }
.actions { text-align: right; white-space: nowrap; }
.status { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 9px; background: #eef0f5; color: #475467; font-size: 12px; font-weight: 800; }
.status-large { padding: 8px 12px; font-size: 13px; }
.status-success { background: #dcfce7; color: var(--success); }
.status-warning { background: #fff4cc; color: var(--warning); }
.status-danger { background: #fee4e2; color: var(--danger); }
.status-muted { background: #eef0f5; color: #667085; }
.form-panel { max-width: 1000px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-stack { display: grid; gap: 16px; }
.form-grid label, .form-stack label, .inline-form label, .filter-bar label { display: grid; gap: 7px; font-weight: 700; font-size: 14px; }
input, select, textarea { width: 100%; border: 1px solid #cfd5e1; border-radius: 9px; background: white; color: var(--text); padding: 10px 11px; }
input:focus, select:focus, textarea:focus { outline: 3px solid #e0e7ff; border-color: #818cf8; }
textarea { resize: vertical; line-height: 1.55; }
.field-wide { grid-column: 1 / -1; }
.checkbox-field { display: flex !important; align-items: center; gap: 9px !important; }
.checkbox-field input { width: auto; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; }
.field-error { color: var(--danger); }
label small { color: var(--muted); font-weight: 500; }
.inline-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 14px; align-items: end; margin-bottom: 18px; }
.list-stack { display: grid; gap: 10px; }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); }
.list-row:hover { background: #fafbff; text-decoration: none; }
.list-row span { display: grid; gap: 3px; }
.list-row small { color: var(--muted); }
.credential-list .list-row { grid-template-columns: 1fr auto auto; display: grid; }
.secret-box { background: #f5f3ff; border: 2px solid #8b5cf6; border-radius: 14px; padding: 20px; margin-bottom: 24px; }
.secret-box h2 { margin-top: 0; }
.secret-box code { display: block; overflow-wrap: anywhere; background: #1e1b4b; color: white; border-radius: 8px; padding: 14px; margin: 14px 0; }
.filter-bar { display: grid; grid-template-columns: repeat(3, minmax(140px, .7fr)) minmax(220px, 1.4fr) auto auto; gap: 12px; align-items: end; background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 18px; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 18px; }
.ticket-heading { align-items: center; }
.back-link { display: inline-block; margin-bottom: 12px; }
.ticket-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.conversation { display: grid; gap: 14px; }
.message { border: 1px solid var(--line); border-radius: 12px; padding: 16px; max-width: 88%; }
.message-customer { background: #fff; justify-self: start; }
.message-platform { background: #eef2ff; border-color: #c7d2fe; justify-self: end; }
.message-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; color: var(--muted); font-size: 12px; }
.message-meta strong { color: var(--text); font-size: 14px; }
.message-meta time { margin-left: auto; }
.message p { white-space: pre-wrap; line-height: 1.6; margin-bottom: 0; }
.ticket-side { position: sticky; top: 92px; }
.ticket-facts dl { display: grid; gap: 10px; }
.ticket-facts dl div { display: flex; justify-content: space-between; gap: 12px; }
.ticket-facts dd { margin: 0; text-align: right; }
.announcement-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.announcement-card { display: grid; gap: 13px; margin: 0; }
.announcement-card h2, .announcement-card p { margin: 0; }
.announcement-text { white-space: pre-wrap; line-height: 1.6; color: #394055; }
.empty-state { text-align: center; padding: 40px 22px; }
.empty-state p, .empty-cell { color: var(--muted); }
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at top, #312e81, #0f172a 52%); }
.login-card { width: min(440px, 100%); background: white; border-radius: 18px; box-shadow: 0 28px 70px rgba(0,0,0,.3); padding: 30px; }
.login-brand { display: flex; gap: 14px; align-items: center; margin-bottom: 26px; }
.login-brand h1, .login-brand p { margin: 0; }
.login-brand p { color: var(--muted); margin-top: 3px; }
.error-card { text-align: center; }
.error-card .brand-mark { margin: 0 auto 15px; }
[hidden] { display: none !important; }
@media (max-width: 1100px) { .metric-grid { grid-template-columns: repeat(3, 1fr); } .filter-bar { grid-template-columns: repeat(2, 1fr); } .ticket-layout { grid-template-columns: 1fr; } .ticket-side { position: static; } }
@media (max-width: 760px) { .topbar { height: auto; min-height: 68px; padding: 12px 16px; } .topbar-user > span { display: none; } .app-shell { grid-template-columns: 1fr; } .sidebar { border-right: 0; border-bottom: 1px solid var(--line); padding: 10px; overflow-x: auto; } .sidebar nav { position: static; display: flex; min-width: max-content; } .content { padding: 22px 14px; } .page-heading { display: grid; } .metric-grid { grid-template-columns: repeat(2, 1fr); } .form-grid, .inline-form, .filter-bar { grid-template-columns: 1fr; } .field-wide { grid-column: auto; } .credential-list .list-row { grid-template-columns: 1fr; } .message { max-width: 100%; } }

/* =========================================================
 * Mitteilungsübersicht und Mitteilungsdetails
 * ========================================================= */
.announcement-table-title {
    min-width: 320px;
    max-width: 620px;
}

.announcement-table-title strong,
.announcement-table-title small {
    overflow-wrap: anywhere;
}

.announcement-detail-page {
    max-width: 1440px;
}

.announcement-detail-heading {
    align-items: center;
}

.announcement-detail-statuses {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.announcement-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 22px;
    align-items: start;
}

.announcement-detail-message-panel {
    min-width: 0;
    padding: 30px;
}

.announcement-detail-message {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.75;
    color: #273044;
}

.announcement-detail-side {
    display: grid;
    gap: 18px;
    position: sticky;
    top: 92px;
}

.announcement-detail-side .panel {
    margin-bottom: 0;
}

.announcement-detail-facts dl {
    display: grid;
    gap: 14px;
    margin: 0;
}

.announcement-detail-facts dl div {
    display: grid;
    gap: 5px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.announcement-detail-facts dl div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.announcement-detail-facts dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.announcement-detail-facts dd {
    display: grid;
    gap: 3px;
    margin: 0;
}

.announcement-detail-facts dd small,
.announcement-detail-help {
    color: var(--muted);
}

.announcement-recipient-list {
    display: grid;
    gap: 10px;
}

.announcement-recipient {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fafbff;
}

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

    .announcement-detail-side {
        position: static;
    }
}

@media (max-width: 760px) {
    .announcement-detail-statuses {
        justify-content: flex-start;
    }

    .announcement-detail-message-panel {
        padding: 20px;
    }
}
