/*
 * admin.css — Zentrales Stylesheet für alle Admin-Seiten
 * syreta Chatbot · Firmenfarben: #91b508 (Grün) / #377a1d (Dunkelgrün)
 */

/* ── Design-Tokens ── */
:root {
    /* Brand */
    --primary:       #91b508;
    --primary-dark:  #377a1d;
    --primary-rgb:   145, 181, 8;

    /* Status */
    --success:       #27ae60;
    --warning:       #f39c12;
    --danger:        #e74c3c;
    --danger-dark:   #c0392b;

    /* Surfaces & Text (Light = Default) */
    --page-bg:        #f0f2f5;
    --surface:        #ffffff;
    --surface-alt:    #fafbfc;  /* Tabellen-Header, Hover */
    --surface-sub:    #f8f9fa;  /* Inset / Hinweis-Boxen */
    --text:           #1a2332;
    --text-muted:     #5d6d7e;
    --text-hint:      #aab4be;
    --text-label:     #8a97a8;
    --border:         #dfe6e9;
    --border-light:   #e8ecf0;
    --border-strong:  #d5dde6;
    --shadow-sm:      0 1px 4px rgba(0,0,0,0.07);
    --shadow-md:      0 4px 16px rgba(0,0,0,0.10);
    --input-bg:       #ffffff;
    --code-bg:        #f4f6f8;

    /* Header-Gradient (im Light-Mode Marken-Grün) */
    --header-grad-a:  #91b508;
    --header-grad-b:  #377a1d;
}

/* ── Dark-Mode Overrides ── */
:root[data-theme="dark"] {
    --page-bg:        #0e1624;
    --surface:        #161f30;
    --surface-alt:    #1b2536;
    --surface-sub:    #111a2a;
    --text:           #e9eef4;
    --text-muted:     #a8b5c5;
    --text-hint:      #7f8b9c;
    --text-label:     #7f8b9c;
    --border:         #2a3546;
    --border-light:   #24303f;
    --border-strong:  #34415a;
    --shadow-sm:      0 1px 4px rgba(0,0,0,0.4);
    --shadow-md:      0 4px 16px rgba(0,0,0,0.5);
    --input-bg:       #1b2536;
    --code-bg:        #111a2a;

    /* Header-Gradient im Dark-Mode: gedämpftere Grün-Töne */
    --header-grad-a:  #1f3a0c;
    --header-grad-b:  #0e2408;
}

/* ── Utilities ── */
.ta-left   { text-align: left; }
.ta-right  { text-align: right; }
.ta-center { text-align: center; }

.text-hint    { color: var(--text-hint); }
.text-muted   { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger  { color: var(--danger); }

.text-xs { font-size: 11px; }
.text-sm { font-size: 12px; }
.text-md { font-size: 13px; }
.text-lg { font-size: 14px; }
.text-xl { font-size: 15px; }

.mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; }

.grid-span-all { grid-column: 1 / -1; }

.order-1 { order: 1; }
.order-2 { order: 2; }
.order-3 { order: 3; }
.order-4 { order: 4; }
.order-5 { order: 5; }
.order-6 { order: 6; }

/* Card mit Textarea, die Card-Höhe füllt */
.card-fill              { display: flex; flex-direction: column; }
.card-fill > .field     { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.card-fill textarea     { flex: 1; resize: vertical; min-height: 260px; }

.m-0  { margin: 0; }
.mt-0 { margin-top: 0; }
.mt-4 { margin-top: 4px; }
.mt-6 { margin-top: 6px; }
.mt-8 { margin-top: 8px; }
.mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: 4px; }
.mb-6 { margin-bottom: 6px; }
.mb-8 { margin-bottom: 8px; }
.mb-10 { margin-bottom: 10px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }

/* Layout-Helfer */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }

.row-center   { display: flex; align-items: center; gap: 10px; }
.row-center-sm{ display: flex; align-items: center; gap: 8px; }

/* Abgegrenzter Sub-Block innerhalb einer Card */
.subcard {
    border: 1px solid #e8ecf0;
    border-radius: 8px;
    padding: 16px;
}

/* Dateiname/Pfad mit Ellipsis in einer Zeile */
.file-ellipsis {
    flex: 1;
    min-width: 0;
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Header-Back-Link-Slot (schiebt Folgendes nach rechts) */
.header-back {
    margin-left: auto;
    margin-right: 12px;
}

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

/* ── Base ── */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--page-bg);
    min-height: 100vh;
    color: var(--text);
    transition: background 0.25s, color 0.25s;
}

/* ── Page Wrapper ── */
.page      { max-width: 1200px; margin: 0 auto; padding: 32px 24px 60px; }
.container { max-width: 1200px; margin: 0 auto; padding: 24px; }

/* ── Header (Dashboard) ── */
.header {
    background: linear-gradient(
        120deg,
        var(--header-grad-a) 0%,
        var(--header-grad-b) 45%,
        var(--header-grad-a) 100%
    );
    background-size: 250% 250%;
    animation: headerGradient 12s ease-in-out infinite;
    color: #fff;
    padding: 20px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0,0,0,.15);
    overflow: hidden;
}
.header::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        115deg,
        transparent 0%,
        transparent 40%,
        rgba(255,255,255,0.18) 50%,
        transparent 60%,
        transparent 100%
    );
    background-size: 220% 100%;
    animation: headerShine 8s ease-in-out infinite;
    pointer-events: none;
}
a.header-left      { text-decoration: none; color: inherit; cursor: pointer; transition: opacity .15s; position: relative; z-index: 1; }
a.header-left:hover { opacity: .9; }
a.header-left:hover h1::before { animation: robotWave 0.8s ease-in-out; }
.header-left h1    { font-size: 26px; font-weight: 700; letter-spacing: -.3px; }
.header-left h1::before {
    content: "🤖 ";
    display: inline-block;
    transform-origin: 70% 70%;
}

@keyframes headerGradient {
    0%   { background-position:   0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position:   0% 50%; }
}
@keyframes headerShine {
    0%   { background-position: -60% 0; }
    55%  { background-position: 160% 0; }
    100% { background-position: 160% 0; }
}
@keyframes robotWave {
    0%, 100% { transform: rotate(0deg); }
    25%      { transform: rotate(-12deg); }
    50%      { transform: rotate( 10deg); }
    75%      { transform: rotate( -6deg); }
}

@media (prefers-reduced-motion: reduce) {
    .header,
    .header::after,
    a.header-left:hover h1::before { animation: none; }
}
.header-left p     { font-size: 14px; opacity: .8; margin-top: 4px; }
.header-right      { display: flex; gap: 10px; position: relative; z-index: 1; }
.header-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 18px; border-radius: 8px; font-size: 13px; font-weight: 600;
    text-decoration: none; transition: all .2s; cursor: pointer;
}
.header-btn-primary              { background: #fff; color: var(--primary); }
.header-btn-primary:hover        { background: #f5f5f5; }
.header-btn-ghost                { background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.3); }
.header-btn-ghost:hover          { background: rgba(255,255,255,.25); }
.header-btn-icon                 { padding: 9px 11px; }
.header-btn-icon svg             { display: block; width: 16px; height: 16px; }

.header-user {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255,255,255,.85);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background .15s, color .15s;
}
a.header-user:hover { background: rgba(255,255,255,.12); color: #fff; }
.header-user::before { content: "👤"; font-size: 14px; }

/* ── Admin-Tabs (unter Header, je Seite aktiv) ── */
.admin-tabs-wrap {
    background: var(--surface);
    border-bottom: 1px solid var(--border-light);
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.admin-tabs {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    gap: 4px;
    align-items: center;
}
.admin-tabs-right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.admin-tab-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: var(--primary);
    text-decoration: none;
    transition: background .15s;
}
.admin-tab-action:hover { background: var(--primary-dark); }
.admin-tab-action svg   { display: block; width: 14px; height: 14px; }

.admin-tab-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #5d6d7e;
    background: #f0f2f5;
    text-decoration: none;
    transition: background .15s, color .15s;
}
.admin-tab-link:hover { background: #e4e8ee; color: #2d3748; }

/* Tenant-Switcher-Dropdown in der Tab-Bar */
.tenant-switch { position: relative; }
.tenant-switch-btn {
    border: none;
    font: inherit;
    cursor: pointer;
}
.tenant-switch-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 220px;
    max-height: 60vh;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e8ecf0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    padding: 4px;
    z-index: 50;
}
.tenant-switch.open .tenant-switch-menu { display: block; }
.tenant-switch-item {
    display: block;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 13px;
    color: #2d3748;
    text-decoration: none;
    transition: background .12s;
}
.tenant-switch-item:hover         { background: #f0f2f5; }
.tenant-switch-item.active        { background: var(--primary); color: #fff; font-weight: 600; }
.admin-tab {
    position: relative;
    padding: 14px 22px;
    font-size: 14px;
    font-weight: 600;
    color: #7f8c8d;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    transition: color .15s, border-color .15s, background .15s;
}
.admin-tab:hover { color: #2d3748; background: #f7f9fb; }
.admin-tab.active {
    color: var(--primary-dark);
    border-bottom-color: var(--primary);
}
@media (max-width: 720px) {
    .admin-tabs   { padding: 0 12px; overflow-x: auto; justify-content: flex-start; }
    .admin-tab    { padding: 12px 14px; font-size: 13px; white-space: nowrap; }
}

/* ── Statistics: Filter-Bar + Chart-Container ── */
.filter-bar         { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.filter-bar label   { font-size: 12px; color: #aab4be; margin-right: 4px; }
.filter-bar .seg    { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.filter-bar .seg a  {
    padding: 8px 16px; border-radius: 6px;
    font-size: 13px; font-weight: 600;
    text-decoration: none; transition: all .15s;
    background: #f0f2f5; color: #2c3e50;
}
.filter-bar .seg a:hover  { background: #e4e8ee; }
.filter-bar .seg a.active { background: #1a2332; color: #fff; }

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

/* ── Headings ── */
h1           { font-size: 26px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.subtitle    { color: var(--text-muted); font-size: 14px; margin-bottom: 28px; }
.section-title {
    font-size: 12px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .8px; color: var(--text-label); margin-bottom: 14px;
}

/* ── Card ── */
.card,
.info-section {
    background: var(--surface);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}
.card h2,
.info-section h2 {
    font-size: 16px; font-weight: 700; color: var(--text);
    margin-bottom: 18px; padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
}

/* ── Status Bar (Dashboard) ── */
.status-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 36px;
}
.status-card {
    background: var(--surface); border-radius: 12px; padding: 18px 20px;
    box-shadow: var(--shadow-sm);
    display: flex; flex-direction: column; gap: 4px;
}
.status-card .sc-label { font-size: 11px; font-weight: 700; color: var(--text-label); text-transform: uppercase; letter-spacing: .5px; }
.status-card .sc-value { font-size: 22px; font-weight: 700; color: var(--text); }
.status-card .sc-value.sc-value-inline { font-size: 15px; font-weight: 600; letter-spacing: 0; }
.status-card .sc-sub   { font-size: 12px; color: var(--text-hint); }
.status-card.ok    { border-top: 3px solid var(--success); }
.status-card.warn  { border-top: 3px solid var(--warning); }
.status-card.error { border-top: 3px solid var(--danger); }
.status-card.info  { border-top: 3px solid var(--primary); }

/* ── Stats Grid (admin.cfm) ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}
.stats-grid .stat-card {
    background: var(--surface); border-radius: 12px; padding: 22px 24px;
    box-shadow: var(--shadow-sm);
}
.stats-grid .stat-card h3 {
    font-size: 11px; font-weight: 700; color: var(--text-label);
    text-transform: uppercase; letter-spacing: .5px; margin-bottom: 10px;
}
.stat-value                    { font-size: 34px; font-weight: 700; color: var(--text); }
.stat-card.primary .stat-value { color: var(--primary); }
.stat-card.success .stat-value { color: var(--success); }
.stat-card.warning .stat-value { color: var(--warning); }
.stat-card.danger  .stat-value { color: var(--danger); }

/* ── Stats (pdf_to_vectorstore — horizontale Kacheln) ── */
.stats          { display: flex; gap: 16px; margin-bottom: 30px; flex-wrap: wrap; }
.stats .stat-card {
    border-radius: 10px; padding: 20px 28px; min-width: 130px;
    text-align: center; box-shadow: var(--shadow-sm); background: var(--surface);
}
.stats .stat-card .num { font-size: 34px; font-weight: 700; }
.stats .stat-card .lbl { font-size: 12px; color: var(--text-muted); text-transform: uppercase; margin-top: 4px; }
.stats .stat-card.blue .num   { color: #3498db; }
.stats .stat-card.green .num  { color: var(--success); }
.stats .stat-card.orange .num { color: #e67e22; }
.stats .stat-card.red .num    { color: var(--danger); }

/* ── Nav Grid (Dashboard) ── */
.nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 36px;
}
.nav-card {
    background: var(--surface); border-radius: 14px; padding: 24px;
    box-shadow: var(--shadow-sm);
    text-decoration: none; color: inherit;
    display: flex; flex-direction: column; gap: 10px;
    border: 2px solid transparent; transition: all .2s;
    position: relative; overflow: hidden;
}
.nav-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0;
    height: 3px; background: var(--card-color, var(--primary));
}
.nav-card:hover {
    border-color: var(--card-color, var(--primary));
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    transform: translateY(-2px);
}
.nav-card-icon {
    width: 44px; height: 44px; border-radius: 11px;
    background: var(--card-bg, #f0f4e8);
    display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.nav-card-title  { font-size: 16px; font-weight: 700; color: var(--text); }
.nav-card-desc   { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.nav-card-meta   {
    display: flex; align-items: center; gap: 8px;
    margin-top: 4px; padding-top: 12px;
    border-top: 1px solid var(--border-light);
    font-size: 12px; color: var(--text-hint);
}
.nav-card.danger                  { --card-color: var(--danger); --card-bg: #fdecea; }
.nav-card.danger .nav-card-title  { color: var(--danger-dark); }

/* ── Buttons ── */
.btn {
    display: inline-block; padding: 10px 22px; border-radius: 7px;
    font-size: 14px; font-weight: 600; cursor: pointer;
    text-decoration: none; border: none; transition: all .2s;
}
.btn-primary         { background: var(--primary); color: #fff; }
.btn-primary:hover   { background: var(--primary-dark); }
.btn-secondary       { background: #ecf0f1; color: #5d6d7e; }
.btn-secondary:hover { background: #dfe6e9; }
.btn-danger          { background: var(--danger); color: #fff; }
.btn-danger:hover    { background: var(--danger-dark); }
.btn-sm              { padding: 5px 12px; font-size: 12px; border-radius: 5px; }

.small-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 7px 14px; border-radius: 7px; font-size: 12px; font-weight: 600;
    text-decoration: none; border: none; cursor: pointer; transition: all .2s;
}
.small-btn-primary       { background: var(--primary); color: #fff; }
.small-btn-primary:hover { background: var(--primary-dark); }
.small-btn-ghost         { background: #f0f2f5; color: #6b7c93; }
.small-btn-ghost:hover   { background: #e4e8ee; }

.actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }

/* ── Badges & Pills ── */
.badge, .pill {
    display: inline-block; padding: 3px 10px;
    border-radius: 20px; font-size: 11px; font-weight: 600;
}
.badge-green,  .pill-green  { background: #d4edda; color: #155724; }
.badge-orange, .pill-orange { background: #fff3cd; color: #856404; }
.badge-blue,   .pill-blue, .badge-skipped { background: #d1ecf1; color: #0c5460; }
.badge-red,    .pill-red,  .badge-error   { background: #f8d7da; color: #721c24; }
.badge-success              { background: #d4edda; color: #155724; }

/* ── Alerts ── */
.alert         { padding: 14px 18px; border-radius: 8px; margin-bottom: 20px; font-size: 14px; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-info    { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }

/* ── Tables ── */
table          { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
    text-align: left; padding: 9px 12px;
    background: var(--surface-sub); color: var(--text-label);
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
}
th:first-child { border-radius: 8px 0 0 8px; }
th:last-child  { border-radius: 0 8px 8px 0; }
td             { padding: 10px 12px; border-top: 1px solid var(--border-light); vertical-align: middle; color: var(--text); }
tr:hover td    { background: var(--surface-alt); }
.fileid        { font-family: monospace; font-size: 11px; color: var(--text-hint); }

/* ── Info Rows (admin.cfm) ── */
.info-row              { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border-light); }
.info-row:last-child   { border-bottom: none; }
.info-label            { font-weight: 600; color: var(--text-label); font-size: 14px; }
.info-value            { color: var(--text); font-size: 14px; }

/* ── Info Box ── */
.info-box {
    background: var(--surface); border-radius: 12px; padding: 20px 24px;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary);
    font-size: 13px; color: var(--text-muted); line-height: 1.7;
}
.info-box strong { color: var(--text); }

/* ── Code ── */
code {
    background: var(--code-bg); padding: 1px 6px;
    border-radius: 4px; font-size: 12px; color: var(--primary);
}

/* ── Log Viewer ── */
.log-viewer {
    background: #1a2332; color: #ecf0f1; padding: 20px; border-radius: 8px;
    font-family: 'Courier New', monospace; font-size: 12px;
    max-height: 400px; overflow-y: auto; white-space: pre-wrap; line-height: 1.6;
}
.refresh-info { color: #8a97a8; font-size: 13px; margin-top: 20px; }

/* ── Forms (chatbot_settings) ── */
.grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.field     { margin-bottom: 18px; }
label {
    display: block; font-size: 12px; font-weight: 700; color: var(--text-label);
    margin-bottom: 6px; text-transform: uppercase; letter-spacing: .5px;
}
.hint { font-size: 12px; color: var(--text-hint); margin-top: 4px; font-weight: normal; text-transform: none; letter-spacing: 0; }

/* Info-Tip Icon (?) mit Tooltip via title-Attribut */
.info-tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px; height: 15px;
    border-radius: 50%;
    background: #cdd6df;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    cursor: help;
    margin-left: 4px;
    vertical-align: 1px;
    transition: background .15s;
}
.info-tip:hover { background: #5d6d7e; }

/* Launcher-Icon-Picker: prominentes Hauptfeld + proportionale Presets */
.icon-picker {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    flex-wrap: wrap;
}
.icon-picker-main {
    width: 64px !important;
    height: 64px;
    font-size: 30px !important;
    text-align: center;
    line-height: 1;
    flex-shrink: 0;
    border-radius: 10px;
}
.icon-presets {
    display: grid;
    grid-template-columns: repeat(11, 32px);
    grid-auto-rows: 32px;
    gap: 5px;
}
.icon-preset {
    padding: 0;
    border: 1px solid #dfe6e9;
    border-radius: 6px;
    background: #fff;
    font-size: 18px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .1s;
}
.icon-preset:hover  { background: #f4fbdf; border-color: var(--primary); }
.icon-preset:active { transform: scale(0.90); }

input[type=text],
input[type=email],
input[type=tel],
input[type=number],
input[type=url],
input[type=password],
select,
textarea {
    width: 100%; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 7px;
    font-size: 14px; color: var(--text); background: var(--input-bg);
    transition: border-color .2s, background .25s, color .25s; font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }
textarea { resize: vertical; min-height: 80px; }

.radio-group                              { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.radio-option                             { flex: 1; min-width: 90px; }
.radio-option input[type=radio]           { display: none; }
.radio-option label {
    display: block; text-align: center; padding: 9px 12px;
    border: 1.5px solid #dfe6e9; border-radius: 7px; cursor: pointer;
    font-size: 13px; font-weight: 600; color: #5d6d7e;
    text-transform: none; letter-spacing: 0; transition: all .2s;
}
.radio-option input[type=radio]:checked + label { border-color: var(--primary); background: var(--primary); color: #fff; }
.radio-option label:hover                       { border-color: var(--primary); }

/* ── Chat-Mode Cards ── */
.radio-group-cards                        { flex-direction: column; gap: 8px; }
.radio-option-card                        { width: 100%; }
.radio-option-card input[type=radio]      { display: none; }
.radio-option-card label {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 12px 16px; border: 1.5px solid #dfe6e9; border-radius: 10px;
    cursor: pointer; background: #fff; transition: all .2s;
}
.radio-option-card label:hover            { border-color: var(--primary); background: #f8fdf0; }
.radio-option-card input[type=radio]:checked + label {
    border-color: var(--primary); background: #f4fbdf; box-shadow: 0 0 0 3px rgba(var(--primary-rgb),.12);
}
.radio-option-card .mode-icon             { font-size: 22px; line-height: 1; flex-shrink: 0; margin-top: 2px; }
.radio-option-card strong                 { display: block; font-size: 14px; color: #1a2332; margin-bottom: 3px; }
.radio-option-card .mode-desc            { font-size: 12px; color: #5d6d7e; font-weight: 400; line-height: 1.4; }

/* ── Toggle Switch ── */
.toggle-row          { display: flex; align-items: center; gap: 12px; margin-top: 6px; cursor: pointer; }
.toggle-label        { font-size: 13px; color: #5d6d7e; cursor: pointer; }
.toggle-switch       { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; inset: 0; background: #cdd6df; border-radius: 24px;
    cursor: pointer; transition: .2s;
}
.toggle-slider::before {
    content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%;
    background: #fff; left: 3px; top: 3px; transition: .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle-switch input:checked + .toggle-slider            { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before    { transform: translateX(20px); }

.slider-row                    { display: flex; align-items: center; gap: 12px; }
.slider-row input[type=range]  { flex: 1; accent-color: var(--primary); }
.slider-val { font-weight: 700; font-size: 16px; color: var(--primary); min-width: 34px; text-align: right; }

.preview-box {
    background: #f8f9fa; border: 1.5px dashed #bdc3c7; border-radius: 8px;
    padding: 16px; font-size: 13px; color: #5d6d7e; line-height: 1.6; white-space: pre-wrap;
}

/* ── PDF Table (Dashboard) ── */
.pdf-table-card   { background: #fff; border-radius: 14px; padding: 24px; box-shadow: 0 1px 4px rgba(0,0,0,.07); margin-bottom: 36px; }
.pdf-table-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; gap: 12px; }
.pdf-table-header h2 { font-size: 15px; font-weight: 700; color: #1a2332; border: none; padding: 0; margin: 0; }
.pdf-name         { font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 8px; }
.pdf-icon         { font-size: 16px; }

/* ── Empty States ── */
.empty-state            { text-align: center; padding: 40px 20px; color: #aab4be; font-size: 14px; }
.empty-state .es-icon   { font-size: 36px; margin-bottom: 10px; }
.empty-state a          { color: var(--primary); font-weight: 600; text-decoration: none; }
.empty                  { color: #7f8c8d; text-align: center; padding: 30px; font-size: 14px; }

/* ── Danger Zone ── */
.danger-zone    { background: #fff5f5; border: 1.5px solid var(--danger); border-radius: 10px; padding: 20px; margin-bottom: 20px; }
.danger-zone h3 { color: var(--danger); margin-bottom: 10px; font-size: 15px; }
.danger-zone p  { font-size: 13px; color: #5d6d7e; margin-bottom: 14px; }

/* ── Konsole / Reset-Log ── */
.reset-log {
    background: #1a2332; color: #ecf0f1; padding: 14px; border-radius: 6px;
    font-family: monospace; font-size: 12px; line-height: 1.7; margin-bottom: 20px;
}

/* ── Sticky Footer ── */
body { padding-bottom: 44px; }

.site-footer {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: #1a2332;
    color: #fff;
    text-align: center;
    padding: 11px 20px;
    font-size: 12px;
    letter-spacing: .3px;
    z-index: 200;
}
.site-footer a { color: #8a97a8; text-decoration: none; }
.site-footer a:hover { color: #fff; }

/* ── Responsive ── */
@media (max-width: 800px) { .grid-2col { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
    .header      { padding: 24px 20px 20px; }
    .page        { padding: 20px 14px 40px; }
    .header-right { display: none; }
    .nav-grid    { grid-template-columns: 1fr; }
}

/* ── Dark-Mode: Feinjustierungen für Stellen mit hartcodierten Farben ── */
:root[data-theme="dark"] .btn-secondary       { background: #2a3546; color: #c8d2e0; }
:root[data-theme="dark"] .btn-secondary:hover { background: #344158; }
:root[data-theme="dark"] .small-btn-ghost     { background: #2a3546; color: #c8d2e0; }
:root[data-theme="dark"] .small-btn-ghost:hover { background: #344158; }
:root[data-theme="dark"] .admin-tab           { color: #a8b5c5; }
:root[data-theme="dark"] .admin-tab:hover     { color: #e9eef4; background: #1b2536; }
:root[data-theme="dark"] .admin-tab.active    { color: var(--primary); }
:root[data-theme="dark"] .admin-tab-link      { background: #2a3546; color: #c8d2e0; }
:root[data-theme="dark"] .admin-tab-link:hover{ background: #344158; color: #e9eef4; }
:root[data-theme="dark"] .filter-bar .seg a   { background: #2a3546; color: #c8d2e0; }
:root[data-theme="dark"] .filter-bar .seg a:hover  { background: #344158; }
:root[data-theme="dark"] .filter-bar .seg a.active { background: #e9eef4; color: #1a2332; }
:root[data-theme="dark"] .tenant-switch-menu  { background: #1b2536; border-color: #2a3546; }
:root[data-theme="dark"] .tenant-switch-item        { color: #e9eef4; }
:root[data-theme="dark"] .tenant-switch-item:hover  { background: #2a3546; }
:root[data-theme="dark"] .info-tip            { background: #344158; color: #e9eef4; }
:root[data-theme="dark"] .icon-preset         { background: #1b2536; border-color: #2a3546; color: #e9eef4; }
:root[data-theme="dark"] .icon-preset:hover   { background: #2a3546; border-color: var(--primary); }
:root[data-theme="dark"] .alert-success       { background: rgba(39,174,96,0.12); color: #86ffb3; border-color: rgba(39,174,96,0.3); }
:root[data-theme="dark"] .alert-error         { background: rgba(231,76,60,0.12); color: #ffaea5; border-color: rgba(231,76,60,0.3); }
:root[data-theme="dark"] .alert-info          { background: rgba(52,152,219,0.12); color: #9ed4ff; border-color: rgba(52,152,219,0.3); }
:root[data-theme="dark"] .alert-warning       { background: rgba(243,156,18,0.12); color: #ffd48a; border-color: rgba(243,156,18,0.3); }
:root[data-theme="dark"] a:not(.btn):not(.btn-primary):not(.btn-secondary):not(.btn-danger):not(.header-btn):not(.header-btn-ghost):not(.header-btn-primary):not(.header-btn-icon):not(.header-user):not(.header-left):not(.admin-tab):not(.admin-tab-link):not(.admin-tab-action):not(.scene-tab) { color: #a8e050; }
:root[data-theme="dark"] a:not(.btn):not(.btn-primary):not(.btn-secondary):not(.btn-danger):not(.header-btn):not(.header-btn-ghost):not(.header-btn-primary):not(.header-btn-icon):not(.header-user):not(.header-left):not(.admin-tab):not(.admin-tab-link):not(.admin-tab-action):not(.scene-tab):hover { color: #c8ff6e; }
