/* Navion Ticketsystem — Corporate Design Navion GmbH
 * Wordmark: schwarz + Markengrün-Punkt
 * Typo: Inter
 * Stil: modern, luftig, minimalistisch, pill-förmige CTAs
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    /* Markenfarben */
    --brand-black:       #000000;
    --brand-green:       #22C28A;   /* Logo-Punkt */
    --brand-green-dark:  #18A878;
    --brand-green-soft:  #E9F8F1;

    /* Text */
    --text:              #111827;
    --text-muted:        #6B7280;
    --text-light:        #9CA3AF;

    /* Flächen */
    --bg:                #FAFAFA;
    --card:              #FFFFFF;
    --border:            #ECECEC;
    --border-strong:     #D1D5DB;

    /* Status-Akzente (sanft) */
    --status-open-bg:      #F3F4F6;
    --status-open-fg:      #374151;
    --status-progress-bg:  #FEF3C7;
    --status-progress-fg:  #92400E;
    --status-done-bg:      #E9F8F1;
    --status-done-fg:      #0F7A56;
    --status-rejected-bg:  #FEE2E2;
    --status-rejected-fg:  #991B1B;

    --radius-sm: 8px;
    --radius:    12px;
    --radius-lg: 20px;
    --radius-pill: 999px;

    --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
    --shadow:    0 2px 8px rgba(0,0,0,.05);
    --shadow-lg: 0 8px 24px rgba(0,0,0,.08);

    --ease: cubic-bezier(.2,.8,.2,1);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
    letter-spacing: -0.02em;
    font-weight: 700;
    color: var(--text);
}

a { color: var(--text); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color .15s var(--ease); }
a:hover { border-bottom-color: var(--brand-green); }

/* ============================================
   Header / Wordmark
   ============================================ */
header.site {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 18px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: saturate(1.2);
}

.wordmark {
    display: inline-flex;
    align-items: center;
    gap: 0;
    border: none !important;
    text-decoration: none;
}
.wordmark .logo-img {
    display: block;
    height: 26px;
    width: auto;
}
.wordmark .tagline {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 13px;
    color: var(--text-muted);
    letter-spacing: 0;
    margin-left: 14px;
    padding-left: 14px;
    border-left: 1px solid var(--border);
}

header.site nav {
    display: flex;
    gap: 8px;
    align-items: center;
}
header.site nav a {
    color: var(--text);
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 500;
    border: none;
    transition: background .15s var(--ease);
}
header.site nav a:hover { background: #F3F4F6; }
header.site nav .admin-chip {
    background: var(--brand-green-soft);
    color: var(--status-done-fg);
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
}

/* ============================================
   Layout
   ============================================ */
main {
    max-width: 920px;
    margin: 36px auto 64px;
    padding: 0 24px;
}

.page-head {
    margin-bottom: 28px;
}
.page-head h1 {
    font-size: 32px;
    margin: 0 0 6px 0;
    letter-spacing: -0.03em;
}
.page-head .subtitle {
    color: var(--text-muted);
    font-size: 15px;
    margin: 0;
}

/* ============================================
   Cards
   ============================================ */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px 26px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
    transition: border-color .18s var(--ease), box-shadow .18s var(--ease), transform .18s var(--ease);
}
.card h2 { margin-top: 0; }

.ticket-card {
    cursor: pointer;
}
.ticket-card:hover {
    border-color: var(--brand-green);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}
.ticket-card .title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 8px;
}
.ticket-card h3 {
    margin: 0;
    font-size: 17px;
    line-height: 1.35;
    color: var(--text);
    font-weight: 700;
}
.ticket-card .meta {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 10px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}
.ticket-card .meta .dot-sep { color: var(--text-light); }
.ticket-card .summary {
    color: var(--text-muted);
    margin: 8px 0 0 0;
    font-size: 14.5px;
    line-height: 1.55;
}

/* ============================================
   Status-Badges
   ============================================ */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-pill);
    white-space: nowrap;
    letter-spacing: -0.005em;
}
.status-badge::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    display: inline-block;
    background: currentColor;
    opacity: .75;
}
.status-offen          { background: var(--status-open-bg);     color: var(--status-open-fg); }
.status-bearbeitung    { background: var(--status-progress-bg); color: var(--status-progress-fg); }
.status-umgesetzt      { background: var(--status-done-bg);     color: var(--status-done-fg); }
.status-abgelehnt      { background: var(--status-rejected-bg); color: var(--status-rejected-fg); }

/* Category-Chip (farbiger Punkt + Name) */
.cat-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px 2px 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text);
    background: #F8FAFC;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    white-space: nowrap;
}
.cat-chip .cat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

/* Due-Date-Chip */
.due-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    font-size: 12.5px;
    font-weight: 600;
    color: #7C2D12;
    background: #FFF7ED;
    border: 1px solid #FED7AA;
    border-radius: var(--radius-pill);
    white-space: nowrap;
}
.due-chip.large {
    font-size: 13px;
    padding: 5px 12px;
}

/* Hidden-Badge (versteckte Tickets) */
.hidden-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: #F3F4F6;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-pill);
    white-space: nowrap;
}

/* Vote-Pill */
.vote-pill {
    background: #F3F4F6;
    color: var(--text);
    padding: 4px 11px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-pill);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.vote-pill.active {
    background: var(--brand-green-soft);
    color: var(--status-done-fg);
}

/* ============================================
   Buttons
   ============================================ */
button, .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--brand-black);
    color: #fff;
    border: none;
    padding: 11px 22px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-pill);
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    letter-spacing: -0.005em;
    transition: background .15s var(--ease), transform .08s var(--ease), box-shadow .15s var(--ease);
}
button:hover, .btn:hover {
    background: #1f1f1f;
    box-shadow: var(--shadow);
    border-color: transparent;
}
button:active, .btn:active { transform: translateY(1px); }

button.secondary, .btn.secondary {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border-strong);
}
button.secondary:hover, .btn.secondary:hover { background: #F9FAFB; border-color: var(--text); }

button.primary-green, .btn.primary-green {
    background: var(--brand-green);
}
button.primary-green:hover, .btn.primary-green:hover {
    background: var(--brand-green-dark);
}

button.danger, .btn.danger {
    background: #fff;
    color: #B91C1C;
    border: 1px solid #FCA5A5;
}
button.danger:hover, .btn.danger:hover {
    background: #FEF2F2;
    color: #991B1B;
    border-color: #EF4444;
}

button:disabled, .btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; }

.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-icon { padding: 9px 11px; }

/* ============================================
   Form-Controls
   ============================================ */
input[type=text], input[type=password], input[type=email],
input[type=search], input[type=url], input[type=tel],
input[type=number], input[type=date], textarea, select {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 15px;
    background: #fff;
    color: var(--text);
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--brand-green);
    box-shadow: 0 0 0 3px rgba(34,194,138,.18);
}
label {
    display: block;
    font-weight: 600;
    margin: 18px 0 7px 0;
    font-size: 13.5px;
    color: var(--text);
    letter-spacing: -0.005em;
}

/* ============================================
   Flash-Messages
   ============================================ */
.flash {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 14.5px;
    border: 1px solid transparent;
}
.flash.error { background: #FEF2F2; color: #991B1B; border-color: #FECACA; }
.flash.ok    { background: var(--brand-green-soft); color: var(--status-done-fg); border-color: #BBEAD5; }
.flash.info  { background: #F3F4F6; color: var(--text); border-color: var(--border); }

/* ============================================
   Login-Screen
   ============================================ */
.login-wrap {
    max-width: 420px;
    margin: 110px auto 40px;
}
.login-wrap .brand-large {
    text-align: center;
    margin-bottom: 28px;
}
.login-wrap .brand-large .logo-img-large {
    display: block;
    height: 58px;
    width: auto;
    margin: 0 auto;
}
.login-wrap .brand-large .tagline-below {
    display: block;
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 10px;
    font-weight: 500;
}
.login-wrap .card { padding: 32px; }

/* Microsoft-365-Login-Button */
.btn.sso-btn {
    background: #fff;
    color: #0F172A;
    border: 1px solid var(--border-strong);
    font-weight: 600;
    padding: 12px 18px;
}
.btn.sso-btn:hover {
    background: #F8FAFC;
    border-color: var(--text);
    box-shadow: var(--shadow);
}
.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0 18px 0;
    color: var(--text-light);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ============================================
   Filter-Bar (Übersicht)
   ============================================ */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.segmented {
    display: inline-flex;
    background: #F3F4F6;
    border-radius: var(--radius-pill);
    padding: 3px;
}
.segmented a {
    padding: 7px 16px;
    font-size: 13.5px;
    font-weight: 500;
    border-radius: var(--radius-pill);
    color: var(--text-muted);
    border: none;
    transition: all .15s var(--ease);
}
.segmented a:hover { color: var(--text); }
.segmented a.active {
    background: #fff;
    color: var(--text);
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}

.toggle-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-muted);
    user-select: none;
    cursor: pointer;
}
.toggle-row input[type=checkbox] {
    appearance: none;
    width: 36px; height: 20px;
    background: #D1D5DB;
    border-radius: 999px;
    position: relative;
    cursor: pointer;
    transition: background .2s var(--ease);
    margin: 0;
    border: none;
    padding: 0;
    box-shadow: none;
}
.toggle-row input[type=checkbox]::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 16px; height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s var(--ease);
    box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.toggle-row input[type=checkbox]:checked { background: var(--brand-green); }
.toggle-row input[type=checkbox]:checked::after { transform: translateX(16px); }
.toggle-row input[type=checkbox]:focus { box-shadow: 0 0 0 3px rgba(34,194,138,.25); }
.toggle-row .count-chip {
    background: #F3F4F6;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
}

/* Filter-Group (Label + Select zusammen) */
.filter-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.filter-group select {
    width: auto;
    min-width: 140px;
    padding: 7px 10px;
    font-size: 13.5px;
}
.filter-form {
    margin: 0;
    display: inline-flex;
    align-items: center;
}

/* Suchfeld */
.search-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
}
.search-input {
    flex: 1;
    font-size: 14.5px;
    padding: 11px 16px;
}

/* Admin-Fields-Box in Formularen */
.admin-fields {
    margin: 22px 0 6px 0;
    padding: 18px 20px;
    background: #FAFAFA;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
}
.admin-fields-title {
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.admin-grid label { margin-top: 0; }
.check-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0 0 0;
    font-weight: 500;
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
}
.check-row input[type=checkbox] {
    width: auto;
    margin: 0;
}

/* Color-Picker + Swatches (Kategorieverwaltung) */
.color-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.color-input {
    width: 48px;
    height: 40px;
    padding: 2px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: #fff;
}
.color-swatches {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    max-width: 260px;
}
.color-swatches.compact {
    grid-template-columns: repeat(8, 1fr);
    max-width: 220px;
}
.color-swatches .swatch {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    padding: 0;
    border: 1px solid rgba(0,0,0,0.08);
    cursor: pointer;
    transition: transform .1s var(--ease), box-shadow .1s var(--ease);
}
.color-swatches .swatch:hover {
    transform: scale(1.15);
    box-shadow: 0 0 0 2px rgba(34,194,138,.3);
}

/* Kategorieverwaltung */
.cat-form-grid {
    display: grid;
    grid-template-columns: 1.2fr 1.6fr 0.8fr auto;
    gap: 16px;
    align-items: end;
}
.cat-form-grid label { margin-top: 0; }
.cat-form-submit { padding-bottom: 0; }

.cat-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
/* Einheitliches Spalten-Raster für Kopfzeile + Kategoriezeilen:
   Farbe | Name | Reihenfolge | Nutzung | Aktionen */
.cat-row {
    display: grid;
    grid-template-columns: 210px minmax(160px, 1fr) 100px 90px 200px;
    gap: 14px;
    align-items: center;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
}
.cat-row-head {
    padding: 6px 14px 2px 14px;
    border: none;
    background: transparent;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.cat-edit {
    display: contents; /* Formular-Felder übernehmen direkt die Grid-Spalten der Zeile. */
    margin: 0;
}
.cat-row input[type=text],
.cat-row input[type=number] {
    padding: 8px 10px;
    font-size: 14px;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
}
.cat-col-color {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
}
.cat-col-color .color-input {
    flex: 0 0 auto;
    width: 44px;
    height: 36px;
}
.cat-col-color .color-swatches {
    display: grid;
    grid-template-columns: repeat(8, 16px);
    gap: 4px;
    margin: 0;
    max-width: none;
}
.cat-col-color .swatch {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}
.cat-col-usage {
    font-size: 13px;
    white-space: nowrap;
}
.cat-col-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
}
.cat-delete {
    margin: 0;
}
.cat-delete-blocked {
    font-size: 12px;
    font-style: italic;
    color: var(--text-muted);
    white-space: nowrap;
    cursor: help;
}

/* Timeline */
.timeline-bucket { margin: 26px 0 14px 0; }
.timeline-bucket-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    margin: 0 0 14px 0;
    padding: 0 4px;
    color: var(--text);
}
.timeline-bucket-title .count-chip {
    background: var(--brand-green-soft);
    color: var(--status-done-fg);
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
}
.timeline-card { padding: 16px 20px; }
.timeline-card h3 { font-size: 16px; }

/* ============================================
   Ticket-Body (Rich-Text-Ausgabe)
   ============================================ */
.ticket-body { font-size: 15.5px; color: var(--text); }
.ticket-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: 12px 0;
    border: 1px solid var(--border);
}
.ticket-body h2, .ticket-body h3, .ticket-body h4 { color: var(--text); margin-top: 22px; }
.ticket-body p { margin: 10px 0; }
.ticket-body blockquote {
    border-left: 3px solid var(--brand-green);
    margin: 16px 0;
    padding: 6px 16px;
    color: var(--text-muted);
    background: #FAFAFA;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.ticket-body pre {
    background: #F3F4F6;
    padding: 14px;
    border-radius: var(--radius);
    overflow-x: auto;
    font-size: 13.5px;
}
.ticket-body a { color: var(--brand-green-dark); border-bottom: 1px solid transparent; }
.ticket-body a:hover { border-bottom-color: var(--brand-green); }

/* ============================================
   Comments
   ============================================ */
.comment {
    border-top: 1px solid var(--border);
    padding: 16px 0;
}
.comment:first-of-type { border-top: none; padding-top: 4px; }
.comment .ch {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 6px;
}
.comment .ch strong { color: var(--text); font-weight: 600; }
.comment .cb { white-space: pre-wrap; font-size: 14.5px; }

.detail-meta {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 22px;
    align-items: center;
}
.detail-meta strong { color: var(--text); font-weight: 600; }

.actions-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 22px;
}

/* ============================================
   Quill-Editor – CI anpassen
   ============================================ */
.ql-toolbar.ql-snow {
    border: 1px solid var(--border-strong);
    border-bottom: none;
    border-top-left-radius: var(--radius);
    border-top-right-radius: var(--radius);
    background: #FAFAFA;
    padding: 10px 12px;
}
.ql-container.ql-snow {
    border: 1px solid var(--border-strong);
    border-bottom-left-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
    font-family: inherit;
    font-size: 15px;
}
#editor { min-height: 260px; background: #fff; }
.ql-editor { padding: 16px 18px; line-height: 1.6; }
.ql-editor.ql-blank::before { color: var(--text-light); font-style: normal; }
.ql-snow .ql-stroke { stroke: var(--text); }
.ql-snow .ql-fill   { fill: var(--text); }
.ql-snow .ql-picker { color: var(--text); }
.ql-snow.ql-toolbar button:hover .ql-stroke,
.ql-snow.ql-toolbar button.ql-active .ql-stroke { stroke: var(--brand-green-dark); }
.ql-snow.ql-toolbar button:hover .ql-fill,
.ql-snow.ql-toolbar button.ql-active .ql-fill { fill: var(--brand-green-dark); }

/* Emoji-Button in der Quill-Toolbar */
.ql-snow.ql-toolbar button.ql-emoji {
    font-size: 17px;
    line-height: 1;
    width: 28px;
    padding: 0;
}
.ql-snow.ql-toolbar button.ql-emoji::before {
    content: '😊';
}

/* Emoji-Popover */
.emoji-popover {
    position: absolute;
    z-index: 30;
    background: #fff;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 10px;
    width: 288px;
    max-height: 260px;
    overflow-y: auto;
    display: none;
}
.emoji-popover.open { display: block; }
.emoji-popover .emoji-group-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin: 6px 4px 4px;
}
.emoji-popover .emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
}
.emoji-popover button.emoji-btn {
    background: transparent;
    color: inherit;
    border: none;
    border-radius: 8px;
    padding: 4px 0;
    font-size: 20px;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: none;
    transition: background .1s var(--ease);
}
.emoji-popover button.emoji-btn:hover {
    background: var(--brand-green-soft);
    transform: none;
    box-shadow: none;
}

/* ============================================
   Utilities
   ============================================ */
.muted     { color: var(--text-muted); font-size: 13px; }
.small     { font-size: 13px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}
.empty-state h3 { color: var(--text); margin: 12px 0 6px 0; }

/* ============================================
   Login: Pulse-Wordmark
   ============================================ */
.login-wrap .brand-large .brand-name-large {
    display: block;
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-top: 14px;
    color: var(--text);
}
.login-wrap .brand-large .brand-name-large::before {
    content: '🧠 ';
    margin-right: 4px;
    font-size: 28px;
}

/* ============================================
   Ticket-Typ: Idee/Problem
   ============================================ */

/* Pill-Toggle (im Formular) */
.type-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 4px;
}
.type-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 14px 16px;
    background: #fff;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color .15s var(--ease), background .15s var(--ease), box-shadow .15s var(--ease);
    margin: 0;
    font-weight: 500;
}
.type-option input[type=radio] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0; height: 0;
}
.type-option:hover { border-color: var(--text); background: #FAFAFA; }
.type-option .type-label {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}
.type-option .type-hint {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
    font-weight: 400;
}

/* Aktiv-Zustand farbkodiert pro Typ */
.type-option.type-idee.is-active {
    border-color: var(--brand-green);
    background: var(--brand-green-soft);
    box-shadow: 0 0 0 3px rgba(34,194,138,.18);
}
.type-option.type-problem.is-active {
    border-color: #F59E0B;
    background: #FFFBEB;
    box-shadow: 0 0 0 3px rgba(245,158,11,.18);
}

/* Type-Badge (in Listen + Detail) */
.type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 700;
    border-radius: var(--radius-pill);
    white-space: nowrap;
    letter-spacing: -0.005em;
    line-height: 1.4;
}
.type-badge.type-idee {
    background: var(--brand-green-soft);
    color: var(--status-done-fg);
    border: 1px solid #BBEAD5;
}
.type-badge.type-problem {
    background: #FFFBEB;
    color: #92400E;
    border: 1px solid #FDE68A;
}

/* Akzent-Strich links an der Karte je Ticket-Typ */
.ticket-card.type-accent-idee     { border-left: 3px solid var(--brand-green); }
.ticket-card.type-accent-problem  { border-left: 3px solid #F59E0B; }

/* Type-Segmented (Filter in Übersicht/Timeline) */
.type-segmented a.active {
    background: #fff;
    color: var(--text);
}

/* ============================================
   Form-Grid-2 (Name + Mail nebeneinander)
   ============================================ */
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.form-grid-2 > div > label:first-child { margin-top: 18px; }

/* ============================================
   Ablehnungs-Box (Detail-Ansicht)
   ============================================ */
.rejection-box {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-left: 4px solid #DC2626;
    border-radius: var(--radius);
    padding: 14px 18px;
    margin: 18px 0;
}
.rejection-head {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
    color: #991B1B;
    font-size: 13.5px;
}
.rejection-head strong { color: #991B1B; font-weight: 700; }
.rejection-head .muted { color: #B91C1C; opacity: .8; }
.rejection-reason {
    color: #7F1D1D;
    font-size: 14.5px;
    line-height: 1.55;
    white-space: pre-wrap;
}

/* SSO-Identity-Panel (ersetzt Name/Mail-Felder, wenn via M365 angemeldet) */
.sso-identity {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 18px 0 6px 0;
    padding: 12px 16px;
    background: var(--brand-green-soft);
    border: 1px solid #BBEAD5;
    border-radius: var(--radius);
}
.sso-identity-name {
    font-weight: 700;
    color: var(--text);
    font-size: 14.5px;
    line-height: 1.2;
}
.sso-identity-mail {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 2px;
}
.sso-identity-chip {
    margin-left: auto;
    background: #fff;
    color: var(--status-done-fg);
    border: 1px solid #BBEAD5;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* Avatar (M365-Profilbild oder Initialen-Fallback) */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    object-fit: cover;
    background: #E5E7EB;
    color: #374151;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
    overflow: hidden;
    user-select: none;
}
.avatar-sm  { width: 22px; height: 22px; font-size: 10px; }
.avatar-md  { width: 40px; height: 40px; font-size: 15px; }
.avatar-fallback {
    background: var(--brand-green-soft);
    color: var(--status-done-fg);
}

/* User-Chip im Header (nur bei SSO sichtbar) */
header.site nav .user-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #F3F4F6;
    color: var(--text);
    padding: 3px 12px 3px 4px;
    border-radius: var(--radius-pill);
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1;
}
header.site nav .user-chip .avatar { box-shadow: 0 0 0 1px #fff; }
.user-chip-name {
    white-space: nowrap;
}

/* Reject-Form: kompakte Ticket-Zusammenfassung über dem Formular */
.reject-summary {
    padding: 14px 16px;
    background: #FAFAFA;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    margin-bottom: 18px;
}
.reject-summary h3 { color: var(--text); }

/* Responsive */
@media (max-width: 640px) {
    header.site { padding: 14px 18px; flex-wrap: wrap; gap: 10px; }
    .wordmark .tagline { display: none; }
    main { padding: 0 16px; margin: 20px auto 40px; }
    .page-head h1 { font-size: 26px; }
    .filter-bar { flex-direction: column; align-items: stretch; }
    .segmented { justify-content: center; }
    .type-toggle { grid-template-columns: 1fr; }
    .form-grid-2 { grid-template-columns: 1fr; gap: 0; }
    .form-grid-2 > div > label:first-child { margin-top: 18px; }
}
