/**
 * © by www.GeRockt.net Dieser Code ist urheberrechtlich geschützt.
 * Datei: /css/style.css
 * Version: 0.9.0
 * Erstellt: 2026-07-25
 * Geändert: 2026-07-25
 * Beschreibung: KiAIra UI — Glasoptik, Menü, Lightboxen, Chat, Setup & Backend.
 */

@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;600;700&family=Source+Serif+4:opsz,wght@8..60,600;8..60,700&display=swap");

:root {
    --ink: #e8f3f7;
    --muted: #9db4bf;
    --ai: #3db8e8;
    --ai-deep: #1490c2;
    --ok: #5dcea0;
    --bad: #f07178;
    --warn: #e0b567;
    --bg0: #07141b;
    --bg1: #0d2430;
    --bg2: #123646;
    --glass: rgba(255, 255, 255, 0.08);
    --glass-strong: rgba(255, 255, 255, 0.12);
    --glass-border: rgba(255, 255, 255, 0.16);
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
    --radius: 18px;
    --radius-sm: 12px;
    --focus: 0 0 0 3px rgba(61, 184, 232, 0.28);
    --font-ui: "Manrope", "Segoe UI", sans-serif;
    --font-display: "Source Serif 4", Georgia, serif;
    --kai-menu-width: min(20rem, 86vw);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
    margin: 0;
    font-family: var(--font-ui);
    color: var(--ink);
    background:
        radial-gradient(900px 420px at 12% -8%, rgba(61, 184, 232, 0.22), transparent 55%),
        radial-gradient(700px 380px at 90% 10%, rgba(20, 144, 194, 0.18), transparent 50%),
        linear-gradient(155deg, var(--bg0), var(--bg1) 48%, var(--bg2));
    background-attachment: fixed;
}

a { color: var(--ai); text-decoration: none; }
a:hover { color: #7fd0f0; }

h1, h2, h3, .brand {
    font-family: var(--font-display);
    letter-spacing: -0.02em;
}

.brand span,
h1 span { color: var(--ai); }

.glass,
.glass-card,
.login-box,
.setup-card,
.panel,
.topbar,
.setup-progress a,
.summary-block,
.checkbox-list label {
    background: var(--glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
}

.glass-card,
.login-box,
.setup-card,
.panel {
    border-radius: var(--radius);
}

.kai-shell { min-height: 100vh; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.25rem;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-top: 0;
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.topbar-user { color: var(--muted); font-size: 0.95rem; }

.kai-menu-toggle {
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.28rem;
    cursor: pointer;
    padding: 0;
}

.kai-menu-toggle span {
    display: block;
    width: 1.1rem;
    height: 2px;
    border-radius: 2px;
    background: var(--ink);
}

.kai-content {
    min-width: 0;
    transition: margin-left 0.28s ease;
}

.kai-menu {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 90;
    width: var(--kai-menu-width);
    height: 100vh;
    margin: 0;
    border-radius: 0;
    border-left: 0;
    border-top: 0;
    border-bottom: 0;
    transform: translateX(-105%);
    transition: transform 0.28s ease;
    display: flex;
    flex-direction: column;
    padding: 1rem 0.9rem 1.25rem;
    overflow: hidden;
}

.kai-menu.is-open,
body.kai-menu-open .kai-menu { transform: translateX(0); }

.kai-menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0 0.35rem;
}

.kai-menu-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

.kai-menu-nav a {
    display: block;
    padding: 0.75rem 0.85rem;
    border-radius: 12px;
    color: var(--ink);
    text-decoration: none;
}

.kai-menu-nav a:hover,
.kai-menu-nav a.is-active {
    background: rgba(61, 184, 232, 0.14);
    color: #d7f3ff;
}

.kai-menu-foot {
    margin-top: auto;
    padding: 0.85rem 0.35rem 0.15rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.kai-menu-logout {
    display: block;
    padding: 0.75rem 0.85rem;
    border-radius: 12px;
    color: #ffd2d5 !important;
    text-decoration: none;
}

.kai-menu-logout:hover {
    background: rgba(240, 113, 120, 0.14);
}

.kai-menu-version {
    padding: 0.15rem 0.85rem 0.35rem;
    color: var(--muted);
    font-size: 0.82rem;
}

body.kai-menu-open .kai-content {
    margin-left: var(--kai-menu-width);
}

@media (max-width: 720px) {
    body.kai-menu-open .kai-content {
        margin-left: 0;
    }

    body.kai-menu-open .kai-content::before {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 85;
        background: rgba(4, 12, 18, 0.35);
        pointer-events: none;
    }
}

.topbar .brand {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--ink);
}

.topbar nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.page,
.setup-shell {
    max-width: 72rem;
    margin: 0 auto;
    padding: 1.75rem 1.25rem 3rem;
}

.login-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 2rem 1rem;
}

.login-box {
    width: min(100%, 26rem);
    padding: 1.85rem;
}

.login-box h1,
.setup-card h1,
.panel h1 {
    margin: 0 0 0.45rem;
    font-size: clamp(1.8rem, 4vw, 2.3rem);
}

.login-box p,
.setup-card .lead,
.panel p,
.muted { color: var(--muted); line-height: 1.55; }

label {
    display: block;
    margin: 0.85rem 0 0.35rem;
    font-size: 0.95rem;
}

label .req { color: var(--bad); margin-left: 0.15rem; }

input[type="text"],
input[type="password"],
input[type="email"],
input[type="url"],
input[type="number"],
input[type="time"],
select,
textarea {
    width: 100%;
    padding: 0.72rem 0.85rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: rgba(7, 20, 27, 0.45);
    color: var(--ink);
    font: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    box-shadow: var(--focus);
    border-color: rgba(61, 184, 232, 0.55);
}

.btn-primary,
.btn-secondary,
.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 1rem;
    padding: 0.72rem 1.05rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--ai), var(--ai-deep));
    color: #041018;
    width: 100%;
}

.btn-secondary {
    background: transparent;
    color: var(--ink);
    border-color: var(--glass-border);
    width: auto;
}

.btn-danger {
    background: rgba(240, 113, 120, 0.16);
    color: #ffd2d5;
    border-color: rgba(240, 113, 120, 0.35);
    width: auto;
}

.btn-primary:hover,
.btn-secondary:hover,
.btn-danger:hover { transform: translateY(-1px); }

.notice.warn {
    background: rgba(224, 181, 103, 0.14);
    border: 1px solid rgba(224, 181, 103, 0.35);
    color: #ffe2ad;
}

.notice {
    padding: 0.75rem 0.9rem;
    margin: 0 0 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.06);
}

.notice.error,
.notice.bad {
    color: #ffd0d3;
    border-color: rgba(240, 113, 120, 0.4);
    background: rgba(240, 113, 120, 0.12);
}

.notice.success,
.notice.ok {
    color: #c9f5e2;
    border-color: rgba(93, 206, 160, 0.4);
    background: rgba(93, 206, 160, 0.12);
}

.meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin: 1.2rem 0;
    font-size: 0.9rem;
}

.pill {
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.06);
}

.setup-progress {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.55rem;
    margin: 1.1rem 0 1.5rem;
}

.setup-progress a {
    text-decoration: none;
    color: inherit;
    border-radius: var(--radius-sm);
    padding: 0.7rem 0.65rem;
    min-height: 4.4rem;
    box-shadow: none;
}

.setup-progress a.active {
    border-color: rgba(61, 184, 232, 0.55);
    background: var(--glass-strong);
}

.setup-progress .num,
.setup-progress .state {
    display: block;
    font-size: 0.78rem;
    color: var(--muted);
}

.setup-progress .label {
    display: block;
    margin: 0.25rem 0;
    font-weight: 700;
}

.setup-progress .state.ok { color: var(--ok); }
.setup-progress .state.draft,
.setup-progress .state.ready { color: var(--warn); }

.setup-card { padding: 1.5rem; }
.setup-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem 1rem;
}
.setup-grid .full { grid-column: 1 / -1; }

.field-error {
    color: #ffd0d3;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.checkbox-list {
    display: grid;
    gap: 0.55rem;
}

.checkbox-list label {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    margin: 0;
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius-sm);
    box-shadow: none;
}

.setup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.4rem;
    align-items: center;
}

.setup-actions .btn-primary,
.setup-actions .btn-secondary {
    width: auto;
    margin-top: 0;
    min-width: 8rem;
}

.save-state {
    margin-left: auto;
    color: var(--muted);
    font-size: 0.9rem;
}
.save-state.saving { color: var(--ai); }
.save-state.saved { color: var(--ok); }
.save-state.error { color: var(--bad); }

.summary-block {
    margin: 0 0 1rem;
    padding: 0.95rem 1rem;
    border-radius: var(--radius-sm);
    box-shadow: none;
}

.summary-block h3 { margin: 0 0 0.5rem; font-size: 1.05rem; }
.summary-block dl {
    margin: 0;
    display: grid;
    grid-template-columns: 10rem 1fr;
    gap: 0.35rem 0.75rem;
}
.summary-block dt { color: var(--muted); }
.summary-block dd { margin: 0; }

.hours-table {
    width: 100%;
    border-collapse: collapse;
}

.hours-table th,
.hours-table td {
    padding: 0.55rem 0.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left;
    vertical-align: middle;
}

.hours-table input[type="time"] { min-width: 7rem; }

.nav-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 0.9rem;
    margin-top: 1.25rem;
}

.nav-cards a {
    display: block;
    padding: 1.1rem 1.15rem;
    border-radius: var(--radius);
    color: var(--ink);
    background: var(--glass);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(14px);
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.nav-cards a:hover {
    border-color: rgba(61, 184, 232, 0.5);
    transform: translateY(-2px);
}

.nav-cards strong { display: block; margin-bottom: 0.3rem; }
.nav-cards span { color: var(--muted); font-size: 0.92rem; }

/* Lightbox */
body.kai-lightbox-open { overflow: hidden; }

.kai-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
}

.kai-lightbox.is-open { display: block; }

.kai-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 12, 18, 0.62);
    backdrop-filter: blur(6px);
}

.kai-lightbox-dialog {
    position: relative;
    z-index: 1;
    width: min(34rem, calc(100% - 2rem));
    margin: 10vh auto 0;
    padding: 1.4rem 1.4rem 1.2rem;
    border-radius: var(--radius);
    background: rgba(13, 36, 48, 0.88);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.kai-lightbox-dialog h2 {
    margin: 0 0 0.6rem;
    font-size: 1.4rem;
}

.kai-lightbox-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
    margin-top: 1.1rem;
}

.kai-lightbox-actions .btn-primary,
.kai-lightbox-actions .btn-secondary,
.kai-lightbox-actions .btn-danger {
    width: auto;
    margin-top: 0;
}

.btn-small {
    width: auto;
    margin: 0;
    padding: 0.35rem 0.7rem;
    font-size: 0.85rem;
}

.faq-section { margin-top: 1.25rem; }
.faq-section-head h3 { margin: 0 0 0.35rem; font-size: 1.1rem; }
.faq-section-head p { margin: 0 0 0.85rem; }

.faq-list {
    display: grid;
    gap: 0.85rem;
}

.faq-item {
    padding: 1rem 1.05rem;
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.04);
}

.faq-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.faq-item label { display: block; margin-bottom: 0.7rem; }
.faq-item label.inline-check {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0;
}

.faq-actions { margin: 0.9rem 0 0; }

.page-wide { max-width: 72rem; }

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.btn-inline {
    width: auto;
    margin-top: 0;
}

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

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 0.75rem 0.55rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left;
    vertical-align: top;
}

.data-table th {
    color: var(--muted);
    font-weight: 600;
    font-size: 0.88rem;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: flex-end;
}

.inline-form { display: inline; margin: 0; }

.status-badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.82rem;
    border: 1px solid var(--glass-border);
}

.status-active {
    color: #b8f0d2;
    background: rgba(61, 184, 120, 0.14);
    border-color: rgba(61, 184, 120, 0.35);
}

.status-blocked {
    color: #ffd2d5;
    background: rgba(240, 113, 120, 0.14);
    border-color: rgba(240, 113, 120, 0.35);
}

.status-invited {
    color: #d7e9ff;
    background: rgba(61, 140, 232, 0.14);
    border-color: rgba(61, 140, 232, 0.35);
}

.pill-soft {
    margin-left: 0.35rem;
    font-size: 0.75rem;
}

.small { font-size: 0.88rem; }

.role-fieldset {
    margin: 1.1rem 0 0;
    padding: 0;
    border: 0;
}

.role-fieldset legend {
    margin-bottom: 0.55rem;
    font-weight: 600;
}

.code-block {
    margin: 0;
    padding: 0.85rem 0.95rem;
    border-radius: var(--radius-sm);
    background: rgba(4, 12, 18, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.86rem;
    line-height: 1.45;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.chat-panel {
    max-width: 48rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1rem 1.1rem 1.1rem;
}

.chat-log {
    min-height: 22rem;
    max-height: min(60vh, 34rem);
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    padding: 0.35rem 0.15rem;
}

.chat-bubble {
    max-width: min(85%, 34rem);
    padding: 0.75rem 0.9rem;
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
}

.chat-user {
    align-self: flex-end;
    background: rgba(61, 184, 232, 0.14);
}

.chat-assistant {
    align-self: flex-start;
}

.chat-bubble.is-pending { opacity: 0.7; }

.chat-role {
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 0.25rem;
}

.chat-content { white-space: normal; line-height: 1.45; }

.chat-compose {
    display: flex;
    gap: 0.65rem;
    align-items: flex-end;
}

.chat-compose textarea {
    flex: 1;
    min-height: 3.2rem;
    resize: vertical;
}

.chat-compose .btn-primary {
    width: auto;
    margin-top: 0;
}

@media (max-width: 1100px) {
    .setup-progress { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
    .setup-progress { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .setup-grid { grid-template-columns: 1fr; }
    .summary-block dl { grid-template-columns: 1fr; }
    .hours-table,
    .hours-table tbody,
    .hours-table tr,
    .hours-table td {
        display: block;
        width: 100%;
    }
    .hours-table thead { display: none; }
}
