/* =====================================================================
   Bewerbungsportal – Design
   ===================================================================== */
:root {
    --bg: #0b0d12;
    --bg-2: #0f1218;
    --panel: #141821;
    --panel-2: #1a1f2b;
    --text: #e8eaf0;
    --muted: #8d95a8;
    --accent: #5865f2;
    --accent-2: #7b86ff;
    --border: #262c3a;
    --success: #3ba55d;
    --danger: #ed4245;
    --warn: #f0a92e;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(900px 400px at 15% -10%, rgba(88, 101, 242, 0.14), transparent 60%),
        radial-gradient(700px 350px at 100% 0%, rgba(123, 134, 255, 0.08), transparent 60%),
        var(--bg);
    background-attachment: fixed;
    color: var(--text);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 30px; margin: 0 0 8px; }
h2 { font-size: 20px; margin: 0 0 12px; }
h3 { font-size: 16px; margin: 0 0 8px; }
a { color: var(--accent-2); }
p { margin-top: 0; }
hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
code {
    background: var(--panel-2);
    border: 1px solid var(--border);
    padding: 1px 6px;
    border-radius: 6px;
    font-size: 12.5px;
}
.muted { color: var(--muted); }

/* ---------- Navbar ---------- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 28px;
    background: rgba(15, 18, 24, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.navbar-left, .navbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.brand { color: var(--text); font-weight: 700; text-decoration: none; font-size: 17px; letter-spacing: -0.01em; }
.brand:hover { color: var(--accent-2); }
.user-chip { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.user-chip img { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border); }

/* ---------- Nutzer-Dropdown ---------- */
.user-menu { position: relative; }
.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 4px 10px 4px 6px;
    color: var(--muted);
    font: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.user-menu-btn:hover, .user-menu.open .user-menu-btn { background: var(--panel-2); border-color: var(--border); color: var(--text); }
.user-menu-btn img { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border); }
.user-menu-caret { font-size: 11px; opacity: 0.8; }
.user-menu-list {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 190px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    padding: 6px;
    display: none;
    z-index: 60;
}
.user-menu.open .user-menu-list { display: block; }
.user-menu-list a { display: block; padding: 9px 12px; border-radius: 6px; color: var(--text); text-decoration: none; font-size: 14px; font-weight: 600; }
.user-menu-list a:hover { background: var(--panel-2); }
.user-menu-list a.danger:hover { color: #ff8a8c; }

/* ---------- Schalter (Einstellungen) ---------- */
.switch-row { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.switch-row:first-of-type { padding-top: 0; }
.switch { position: relative; width: 46px; height: 26px; flex-shrink: 0; display: inline-block; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: #2d3446; border-radius: 999px; cursor: pointer; transition: background 0.18s ease; }
.switch .slider::before { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform 0.18s ease; }
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(20px); }
.switch input:focus-visible + .slider { box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.35); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    color: var(--text);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 4px 14px rgba(88, 101, 242, 0.35); }
.btn-primary:hover { box-shadow: 0 6px 20px rgba(88, 101, 242, 0.5); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: var(--panel-2); border-color: #363e52; }
.btn-admin { background: var(--danger); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-sm { padding: 5px 11px; font-size: 13px; }

/* ---------- Formulare ---------- */
label { font-size: 14px; color: var(--text); }
input[type="text"], input[type="url"], input[type="number"], input[type="date"],
input[type="email"], input[type="search"], input[type="password"], select, textarea {
    background: var(--bg-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font: inherit;
    font-size: 14.5px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
input::placeholder, textarea::placeholder { color: #566076; }
input:hover, select:hover, textarea:hover { border-color: #363e52; }
input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.25);
    background: #0d1017;
}
textarea { resize: vertical; min-height: 44px; }
select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 34px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238d95a8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}
option { background: var(--panel); color: var(--text); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 16px; height: 16px; }
input[type="file"] { color: var(--muted); font-size: 13.5px; }
input[type="file"]::file-selector-button {
    background: var(--panel-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 7px 14px;
    margin-right: 12px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}
input[type="file"]::file-selector-button:hover { background: #232a3a; }
fieldset { border-color: var(--border) !important; }
legend { color: var(--muted); }
small { color: var(--muted); }

/* ---------- Layout ---------- */
.container { max-width: 1040px; margin: 0 auto; padding: 36px 24px 64px; }
.container-wide { max-width: 1680px; margin: 0 auto; padding: 18px 24px 16px; }

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
}
.card + .card { margin-top: 20px; }
.card h2:first-child { margin-top: 0; }
.section-title { display: flex; align-items: baseline; gap: 10px; margin: 36px 0 16px; }
.section-title h2 { margin: 0; }

.alert {
    background: rgba(240, 169, 46, 0.1);
    border: 1px solid rgba(240, 169, 46, 0.35);
    color: #f6cf85;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
}
.alert-success { background: rgba(59, 165, 93, 0.12) !important; border-color: rgba(59, 165, 93, 0.4) !important; color: #8fe0a9 !important; }
.alert-error { background: rgba(237, 66, 69, 0.1); border-color: rgba(237, 66, 69, 0.4); color: #ff9c9e; }
.closure-alert { font-size: 16px; font-weight: 700; padding: 16px 20px; border-width: 2px; margin: 14px 0 0; }
.closure-tag {
    display: inline-block; margin-top: 6px; padding: 3px 9px; border-radius: 6px;
    background: rgba(237, 66, 69, 0.14); border: 1px solid rgba(237, 66, 69, 0.45);
    color: #ff9c9e; font-size: 12px; font-weight: 700; max-width: 380px;
}

/* ---------- Tabellen ---------- */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 12px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
th, td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; background: var(--panel-2); }
tbody tr:last-child td { border-bottom: none; }
tbody tr[onclick] { transition: background 0.12s ease; }
tbody tr[onclick]:hover { background: var(--panel-2); }

/* ---------- Badges ---------- */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
    background: var(--panel-2);
    border: 1px solid var(--border);
    color: var(--muted);
    white-space: nowrap;
}
.badge-waiting_staff { background: rgba(240, 169, 46, 0.13); border-color: rgba(240, 169, 46, 0.4); color: #f6c765; }
.badge-waiting_applicant { background: rgba(88, 101, 242, 0.14); border-color: rgba(88, 101, 242, 0.45); color: #a3abff; }
.badge-accepted { background: rgba(59, 165, 93, 0.14); border-color: rgba(59, 165, 93, 0.45); color: #7fdc9d; }
.badge-rejected { background: rgba(237, 66, 69, 0.13); border-color: rgba(237, 66, 69, 0.45); color: #ff8a8c; }
.badge-unlisted { background: rgba(240, 169, 46, 0.13); border-color: rgba(240, 169, 46, 0.4); color: #f6c765; margin-left: 8px; }

/* ---------- Job-Karten / Logos ---------- */
.job-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.job-grid[hidden], .card[hidden] { display: none; }
.job-card {
    display: flex;
    flex-direction: column;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.job-card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(88, 101, 242, 0.3); }
.job-card-banner {
    aspect-ratio: 3 / 1;
    background-color: var(--panel-2);
    background-size: cover;
    background-position: center;
    background-image: linear-gradient(135deg, #1b2140, #2a2f6b 55%, #3a3f9a);
}
.job-card-body { padding: 0 18px 18px; margin-top: -26px; position: relative; }
.job-card-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 10px; }
.job-card-head h2 { margin: 0 0 4px; font-size: 18px; }
.job-card p { color: var(--muted); font-size: 14px; margin: 0; }

.job-logo {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    object-fit: cover;
    background: var(--panel-2);
    border: 3px solid var(--panel);
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}
.job-logo-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 22px;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.job-logo-lg { width: 64px; height: 64px; border-radius: 14px; font-size: 26px; }
.job-logo-sm { width: 32px; height: 32px; border-radius: 8px; border-width: 2px; font-size: 14px; box-shadow: none; }

.job-hero { position: relative; margin-bottom: 64px; }
.job-hero-banner {
    aspect-ratio: 3 / 1;
    border-radius: var(--radius);
    background-color: var(--panel-2);
    background-size: cover;
    background-position: center;
    background-image: linear-gradient(135deg, #1b2140, #2a2f6b 55%, #3a3f9a);
    border: 1px solid var(--border);
}
.job-hero-title { position: absolute; left: 24px; bottom: -44px; display: flex; align-items: flex-end; gap: 16px; }
.job-hero-title .job-logo { width: 88px; height: 88px; border-radius: 18px; border-width: 4px; }
.job-hero-title h1 { margin: 0 0 6px; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6); }

/* ---------- Job-Panel ---------- */
.jp-head { margin-bottom: 26px; }
.jp-title { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.jp-title h1 { margin: 0; }
.jp-vis { margin-left: auto; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab {
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.tab:hover { background: var(--panel-2); }
.tab.active { background: rgba(88, 101, 242, 0.16); border-color: var(--accent); color: #c3c8ff; }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 4px; }

.person { display: flex; align-items: center; gap: 12px; }
.person img { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); }
.person-sub { color: var(--muted); font-size: 12.5px; }

/* ---------- Bewerbungs-Ansicht: Chat breit statt hoch, kein Seiten-Scrollen ---------- */
.app-head h1 { font-size: 24px; margin: 0 0 2px; }
.app-layout {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 20px;
    align-items: stretch;
    height: calc(100dvh - 190px);
    min-height: 460px;
    margin-top: 14px;
}
.app-side { display: flex; flex-direction: column; gap: 16px; overflow-y: auto; min-height: 0; padding-right: 2px; }
.app-side .card { padding: 18px; }
.app-side .card + .card { margin-top: 0; }
.kv { display: flex; flex-direction: column; gap: 16px; }
.kv-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 700; margin-bottom: 3px; }
.kv-value { word-break: break-word; }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); font-size: 13.5px; margin-top: 10px; }
.action-stack { display: flex; flex-direction: column; gap: 10px; }
.action-row { display: flex; gap: 10px; }
.action-row .btn { flex: 1; }

/* ---------- Chat ---------- */
.chat-panel {
    display: flex;
    flex-direction: column;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    height: 100%;
    min-height: 0;
    overflow: hidden;
}
.chat-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; border-bottom: 1px solid var(--border); background: var(--panel-2); }
.chat-header h2 { margin: 0; font-size: 17px; }
.chat-conn { font-size: 12.5px; color: var(--muted); }
.chat-conn.on { color: #7fdc9d; }
.chat-messages { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 22px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.chat-empty { margin: auto; color: var(--muted); }
.msg { position: relative; max-width: 68%; padding: 10px 14px; border-radius: 14px; word-break: break-word; }
.msg.theirs { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg.mine { align-self: flex-end; background: linear-gradient(135deg, var(--accent), #6d78ff); color: #fff; border-bottom-right-radius: 4px; }
.msg-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; opacity: 0.85; margin-bottom: 3px; font-weight: 600; }
.msg-team { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; background: rgba(255, 255, 255, 0.14); padding: 1px 6px; border-radius: 4px; }
.msg.theirs .msg-team { background: rgba(88, 101, 242, 0.2); color: #b3b9ff; }
.msg-body { white-space: pre-wrap; }
.msg-time { font-size: 11px; opacity: 0.65; margin-top: 4px; text-align: right; }

.msg-actions { position: absolute; top: -12px; right: 10px; display: none; gap: 4px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 2px 4px; box-shadow: var(--shadow); }
.msg:hover .msg-actions, .msg-system:hover .msg-actions { display: flex; }
.msg-actions button { background: transparent; border: none; color: var(--text); font: inherit; font-size: 12px; padding: 3px 8px; border-radius: 6px; cursor: pointer; }
.msg-actions button:hover { background: var(--panel-2); color: var(--accent-2); }
.msg-actions button:last-child:hover { color: #ff8a8c; }
.msg-editor { margin: 4px 0 2px; }
.msg-editor textarea { width: 100%; color: var(--text); min-height: 60px; }
.msg-editor-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

.msg-system { position: relative; align-self: center; text-align: center; font-size: 12.5px; color: var(--muted); background: var(--bg-2); border: 1px dashed var(--border); border-radius: 999px; padding: 5px 16px; display: flex; gap: 10px; align-items: center; }
.msg-system .msg-time { margin: 0; }

.chat-file {
    display: block;
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.22);
    color: inherit;
    text-decoration: none;
    font-size: 13.5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.chat-file:hover { background: rgba(0, 0, 0, 0.35); }
.chat-img { display: block; margin-top: 8px; line-height: 0; }
.chat-img img { max-width: 260px; max-height: 190px; width: auto; height: auto; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.12); cursor: zoom-in; object-fit: cover; }
.chat-img:hover img { filter: brightness(1.08); }

.chat-form { padding: 12px 16px 12px; border-top: 1px solid var(--border); background: var(--panel-2); }
.chat-input-row { display: flex; align-items: flex-end; gap: 10px; }
.chat-input-row textarea { flex: 1; resize: none; max-height: 160px; }
.chat-attach {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-2);
    color: var(--muted);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.chat-attach:hover { background: var(--panel); border-color: var(--accent); color: var(--text); }
.chat-files { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chat-files:empty { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px 4px 3px 12px; font-size: 13px; }
.chip-x { border: none; background: var(--panel); color: var(--muted); width: 20px; height: 20px; border-radius: 50%; cursor: pointer; line-height: 1; }
.chip-x:hover { background: var(--danger); color: #fff; }
.chat-notice { padding: 16px 20px; border-top: 1px solid var(--border); background: var(--panel-2); color: var(--muted); }
.chat-error { color: #ff8a8c; font-size: 13px; margin: 0; padding: 0 20px; min-height: 0; }
.chat-error:not(:empty) { padding-bottom: 10px; }

/* Anhang-Fenster */
.att-backdrop { position: fixed; inset: 0; background: rgba(4, 6, 10, 0.78); z-index: 150; display: flex; align-items: center; justify-content: center; padding: 20px; }
.att-backdrop[hidden] { display: none; }
.att-modal { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; width: min(520px, 100%); box-shadow: var(--shadow); }
.att-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 16px; }
.att-drop { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 28px 16px; border: 2px dashed #3a4256; border-radius: var(--radius); color: var(--muted); cursor: pointer; text-align: center; transition: border-color 0.15s ease, background 0.15s ease; }
.att-drop:hover, .att-drop.over { border-color: var(--accent); background: rgba(88, 101, 242, 0.08); color: var(--text); }
.att-hint { font-size: 12.5px; color: var(--muted); margin: 10px 0; }
.att-list { display: flex; flex-direction: column; gap: 6px; }
.att-row { display: flex; justify-content: space-between; align-items: center; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 10px; font-size: 13.5px; }

/* ---------- Zugriff verweigert ---------- */
.deny-overlay { position: fixed; inset: 0; z-index: 500; background: rgba(4, 6, 10, 0.94); display: flex; align-items: center; justify-content: center; padding: 24px; }
.deny-box { background: var(--panel); border: 1px solid rgba(237, 66, 69, 0.5); border-radius: var(--radius); padding: 32px; max-width: 480px; text-align: center; box-shadow: var(--shadow); }
.deny-box h2 { color: #ff8a8c; font-size: 24px; }
.deny-box strong { color: var(--text); font-size: 18px; }

/* ---------- Gesperrt-Listen ---------- */
.block-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; margin: 12px 0 0; }
.block-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; }
.block-list form { margin: 0; }

/* ---------- Bild-Upload / Cropper ---------- */
.img-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.img-box .img-preview {
    border: 1px dashed #3a4256;
    border-radius: var(--radius-sm);
    background: var(--bg-2) center / cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 10px;
}
.img-preview.banner { aspect-ratio: 3 / 1; }
.img-preview.logo { aspect-ratio: 1 / 1; max-width: 180px; }
.img-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(4, 6, 10, 0.78); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop[hidden] { display: none; }
.modal { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; width: min(760px, 100%); box-shadow: var(--shadow); }
.crop-area { height: min(60vh, 460px); background: #05070a; border-radius: var(--radius-sm); overflow: hidden; }
.crop-area img { display: block; max-width: 100%; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }

.check-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.check-pill { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-2); border: 1px solid var(--border); padding: 6px 12px; border-radius: 999px; cursor: pointer; transition: border-color 0.15s ease; }
.check-pill:hover { border-color: var(--accent); }

/* ---------- Datei-Vorschau-Modal ---------- */
.fp-backdrop { position: fixed; inset: 0; background: rgba(4, 6, 10, 0.85); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px; }
.fp-backdrop[hidden] { display: none; }
.fp-modal { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); width: min(900px, 100%); max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow); }
.fp-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--panel-2); }
.fp-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.fp-close { background: transparent; border: none; color: var(--muted); font-size: 26px; line-height: 1; cursor: pointer; padding: 0 4px; }
.fp-close:hover { color: var(--text); }
.fp-body { flex: 1; overflow: auto; display: flex; background: #05070a; min-height: 200px; }
.fp-body img { max-width: 100%; max-height: 80vh; margin: auto; display: block; }
.fp-body iframe { width: 100%; height: 78vh; border: none; }
.fp-text { margin: 0; padding: 18px; color: var(--text); font-size: 13px; white-space: pre-wrap; word-break: break-word; }
.fp-unsupported { margin: auto; text-align: center; color: var(--muted); padding: 40px; }
.fp-unsupported p { margin-bottom: 16px; }
a.file-link { display: inline-block; }

/* ---------- Farbauswahl ---------- */
.color-field { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.color-field input[type="color"] { width: 44px; height: 38px; padding: 2px; cursor: pointer; }
.color-swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border); cursor: pointer; padding: 0; }
.swatch:hover { border-color: var(--accent); transform: scale(1.08); }
.swatch-reset { width: auto; height: 26px; border-radius: 6px; padding: 0 10px; font-size: 12px; color: var(--muted); background: var(--bg-2); }

/* ---------- Suchleiste ---------- */
.search-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 6px 0 4px; }
.search-row input[type="text"] { min-width: 200px; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
    .app-layout { grid-template-columns: 1fr; height: auto; }
    .app-side { overflow: visible; }
    .chat-panel { height: 75vh; }
    .msg { max-width: 88%; }
    .img-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .navbar { padding: 10px 14px; }
    .container, .container-wide { padding: 22px 14px 48px; }
    h1 { font-size: 24px; }
    .job-hero-title .job-logo { width: 64px; height: 64px; }
    .job-hero { margin-bottom: 52px; }
    th:nth-child(4), td:nth-child(4) { display: none; }
}

/* ---------- Hinweisboxen blenden sich nach der persönlichen Dauer aus (Standard 3 s) ---------- */
@keyframes alertOut {
    from { opacity: 1; max-height: 200px; }
    to   { opacity: 0; max-height: 0; padding-top: 0; padding-bottom: 0; margin-top: 0; margin-bottom: 0; border-width: 0; }
}
.alert:not(.closure-alert) {
    overflow: hidden;
    animation: alertOut 0.5s ease calc(var(--alert-seconds, 3) * 1s) forwards;
}

/* ---------- Chat: Eingabe/Hinweis live ein- und ausblenden ---------- */
.chat-form[hidden], .chat-notice[hidden] { display: none; }

/* ---------- Logs ---------- */
.log-table td { vertical-align: top; }
.log-table .log-time { white-space: nowrap; color: var(--muted); font-size: 13px; }
.log-type {
    display: inline-block; padding: 2px 9px; border-radius: 6px; font-size: 12px; font-weight: 700;
    background: rgba(88, 101, 242, 0.14); border: 1px solid rgba(88, 101, 242, 0.4); color: #a3abff;
}
.pager { display: flex; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }

/* ---------- Chat: Aktionsleiste (Bearbeiten / Löschen) immer nebeneinander, unabhängig von der Nachrichtengröße ---------- */
.msg-actions { width: max-content; white-space: nowrap; flex-wrap: nowrap; z-index: 5; }
.msg-actions button { white-space: nowrap; flex-shrink: 0; }
.msg.theirs .msg-actions { left: 10px; right: auto; }
.msg.mine .msg-actions { right: 10px; left: auto; }