* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(180deg, #f5f7ff, #e4e8f8);
    color: #1b1f2b;
    min-height: 100vh;
}

a {
    color: #0a6cf1;
    text-decoration: none;
}

.btn {
    display: inline-block;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 1.1rem;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1.2;
}

.btn.primary {
    background: linear-gradient(135deg, #3f69ff, #7c3bff);
    color: #fff;
    box-shadow: 0 10px 20px rgba(63, 105, 255, 0.3);
}

.btn.secondary {
    background: rgba(255, 255, 255, 0.7);
    color: #111;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.btn.link {
    background: transparent;
    color: #0a6cf1;
    padding: 0.5rem;
}

.btn.small {
    font-size: 0.85rem;
    padding: 0.3rem 0.6rem;
}

.btn.full {
    width: 100%;
    text-align: center;
}

.sidebar {
    position: fixed;
    top: 1rem;
    left: 1rem;
    bottom: 1rem;
    width: 250px;
    color: #fff;
    display: flex;
    flex-direction: column;
    z-index: 20;
}

.sidebar-inner {
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 1rem;
    border-radius: 24px;
    background: rgba(11, 18, 38, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 25px 60px rgba(10, 16, 30, 0.35);
    backdrop-filter: blur(18px);
}

.sidebar-logo {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0.85;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.65rem 0.9rem;
    border-radius: 14px;
    color: #d7def4;
    font-weight: 500;
    transition: background 0.2s, transform 0.2s;
}

.sidebar-link .icon {
    font-size: 1.2rem;
}

.sidebar-link.active {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.12));
    color: #131a2e;
    box-shadow: 0 10px 25px rgba(15, 18, 34, 0.35);
    transform: translateX(4px);
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.15);
}

.sidebar-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.user-chip {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

.user-chip .avatar {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    max-width: 42px;
    max-height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f86ff, #6b5bff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    overflow: hidden;
    flex-shrink: 0;
}

.user-chip .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    max-width: 100%;
    max-height: 100%;
}

.container {
    max-width: 1100px;
    margin: 1.5rem auto;
    padding: 0 1rem;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(7, 10, 20, 0.55);
    z-index: 15;
    display: none;
}

.sidebar-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 14px;
    width: 46px;
    height: 46px;
    font-size: 1.3rem;
    display: none;
    z-index: 30;
    box-shadow: 0 10px 20px rgba(34, 42, 70, 0.15);
}

.container.with-sidebar {
    margin-left: 310px;
    padding: 1.5rem 2rem;
}

.card {
    background: rgba(255, 255, 255, 0.85);
    padding: 1.5rem;
    border-radius: 18px;
    margin-bottom: 1.5rem;
    box-shadow: 0 15px 30px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(8px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat {
    text-align: center;
}

.stat strong {
    font-size: 2rem;
    display: block;
    margin-top: 0.5rem;
}

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

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

th, td {
    padding: 0.6rem;
    border-bottom: 1px solid #e5e5e5;
    text-align: left;
}

tr.danger td {
    background: #ffecec;
}

.table-responsive table {
    min-width: 600px;
}

form label {
    display: block;
    margin-top: 1rem;
    font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="datetime-local"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-top: 0.3rem;
    font-size: 1rem;
}

textarea {
    resize: vertical;
}

.alert {
    padding: 0.8rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert.success {
    background: #e7f6ed;
    color: #1c7c3e;
}

.alert.error {
    background: #fdecea;
    color: #c03a2b;
}

.inline-form {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 1rem 0;
}

.filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 1rem;
}

.text-muted {
    color: #6f7785;
    margin: 0;
}

.list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.list li {
    padding: 0.4rem 0;
    border-bottom: 1px solid #eee;
}

.footer {
    text-align: center;
    padding: 2rem 1rem;
    color: #889;
}

.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, #0d1b2a, #1b263b);
}

.login-card {
    background: #fff;
    padding: 2rem;
    border-radius: 10px;
    width: 320px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.login-card h1 {
    margin-top: 0;
    margin-bottom: 1rem;
    text-align: center;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.floating-add {
    position: fixed;
    left: 280px;
    bottom: 1.5rem;
    width: 62px;
    height: 62px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: linear-gradient(135deg, #4c6ef5, #8c4fff);
    color: #fff;
    font-size: 2rem;
    box-shadow: 0 15px 30px rgba(58, 60, 125, 0.3);
    z-index: 50;
    cursor: pointer;
}

.floating-add span {
    position: relative;
    top: -5px;
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 100;
    overflow-y: auto;
    padding: 1.5rem 0;
}

.modal.open {
    display: block;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    margin: 4% auto;
    background: #fff;
    width: min(420px, 90vw);
    max-height: calc(100vh - 3rem);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    animation: pop 0.25s ease;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.modal.large .modal-content {
    width: min(620px, 95vw);
}

.modal-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

.radio-group {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.optional-fields {
    margin-top: 1rem;
}

.two-col {
    display: flex;
    gap: 1rem;
}

.two-col > div {
    flex: 1;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.settings-panel {
    padding: 1rem;
    border-radius: 14px;
    background: rgba(246, 248, 255, 0.9);
    border: 1px solid rgba(198, 208, 238, 0.8);
}

.settings-panel h2 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.settings-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0 1.25rem;
}

.settings-avatar {
    width: 84px;
    height: 84px;
    min-width: 84px;
    min-height: 84px;
    max-width: 84px;
    max-height: 84px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, #4f86ff, #6b5bff);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 700;
    flex-shrink: 0;
}

.settings-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    max-width: 100%;
    max-height: 100%;
}

.settings-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    margin-top: 1rem;
}

.settings-checkbox input[type="checkbox"] {
    width: auto;
    margin-top: 0.15rem;
}

.quick-task-feedback {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #1c7c3e;
}

.quick-task-feedback.error {
    color: #c03a2b;
}

.modal-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

body.modal-open {
    overflow: hidden;
}

@keyframes pop {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.task-board {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    align-items: flex-start;
}

.task-stat-chips {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: #555;
}

.task-stat-chips span {
    background: #eef2ff;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
}

.task-column {
    background: #f2f4f8;
    border-radius: 10px;
    padding: 0.8rem;
    min-width: 250px;
    display: flex;
    flex-direction: column;
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.task-dropzone {
    flex: 1;
    padding-right: 0.2rem;
}

.task-card {
    background: #fff;
    border-radius: 10px;
    padding: 0.8rem;
    margin-bottom: 0.8rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    cursor: grab;
}

.task-card.dragging {
    opacity: 0.5;
}

.task-card header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.task-card-top-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
}

.task-complete-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #cfd8ea;
    border-radius: 50%;
    background: #f7f9ff;
    color: #2d9c5b;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.task-complete-btn:hover {
    background: #eaf8ef;
    border-color: #7bcf98;
    transform: translateY(-1px);
}

.task-card h3 {
    margin: 0;
    font-size: 1rem;
}

.task-card p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    color: #444;
}

.task-card footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #666;
}

.task-card .badge {
    background: #eef2ff;
    color: #2536a7;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
}

.task-card.priority-high {
    border-left: 4px solid #f2695c;
}

.task-card.priority-normal {
    border-left: 4px solid #2d9cdb;
}

.task-card.priority-low {
    border-left: 4px solid #6fcf97;
}

.task-card.overdue {
    background: #fff3f1;
}

.platform-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: #f2f4f8;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.checkbox-label:hover {
    background: #eef2ff;
}

@media (max-width: 700px) {
    .sidebar {
        display: none;
        width: min(82vw, 320px);
        top: 0.5rem;
        left: 0.5rem;
        bottom: 0.5rem;
    }
    body.sidebar-open .sidebar {
        display: flex;
    }
    .sidebar-toggle {
        display: block;
    }
    body.sidebar-open .sidebar-toggle {
        background: rgba(9, 12, 24, 0.85);
        color: #fff;
    }
    .sidebar-overlay {
        display: none;
    }
    body.sidebar-open .sidebar-overlay {
        display: block;
    }
    .container.with-sidebar {
        margin-left: 0;
        padding: 1.5rem 1rem;
    }
    .inline-form,
    .filters {
        flex-direction: column;
        align-items: stretch;
    }
    .floating-add {
        left: 1rem;
        bottom: 1rem;
    }
    .two-col {
        flex-direction: column;
    }
    .modal-content {
        margin: 10% auto;
    }
    .table-responsive table {
        min-width: 500px;
    }
}

/* ── Firmen-Badge ─────────────────────────────────── */
.company-badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    background: color-mix(in srgb, var(--c) 15%, #fff);
    color: color-mix(in srgb, var(--c) 80%, #000);
    border: 1px solid color-mix(in srgb, var(--c) 35%, transparent);
}

/* ── Social-Status-Badges ─────────────────────────── */
.status-badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}
.status-draft    { background: #f0f0f0; color: #555; }
.status-pending  { background: #fff3cd; color: #7d5a00; }
.status-approved { background: #d4edda; color: #155724; }
.status-rejected { background: #fdecea; color: #7b1c1c; }
.status-published{ background: #e0d4ff; color: #3a1f7a; }

/* ── Nav-Badge (Freigabe-Zähler in Sidebar) ───────── */
.nav-badge {
    margin-left: auto;
    background: #f2695c;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.35rem;
}

/* ── Dashboard: Alert-Stat-Karte ──────────────────── */
.card.stat.stat-alert strong {
    color: #e74c3c;
}

/* ── Social-Media: Beitragstext ───────────────────── */
.social-content {
    background: #f8f9ff;
    border: 1px solid #e0e5ff;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    font-size: 0.97rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.social-media-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
    align-items: start;
}

.social-media-gallery-item {
    border: 1px solid #d9def2;
    border-radius: 10px;
    overflow: hidden;
    background: #f8faff;
}

.social-media-gallery-item a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    max-height: 280px;
    padding: 0.5rem;
    background: #eef2ff;
}

.social-media-gallery-image {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 260px;
    object-fit: contain;
    background: #f8faff;
}

.content-meta {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    font-size: 0.82rem;
    color: #6b74a0;
    margin-top: 0.75rem;
}

.content-meta span {
    background: #eef2ff;
    border-radius: 999px;
    padding: 0.2rem 0.65rem;
}

.mono-input {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.92rem;
    white-space: pre-wrap;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.preview-table td small,
.preview-table th small {
    color: #6f7785;
}

.preview-table input,
.preview-table select,
.preview-table textarea {
    width: 100%;
    margin: 0 0 0.45rem;
}

.preview-table textarea {
    min-height: 96px;
}

.preview-table td {
    vertical-align: top;
}

tr.ai-row-needs-review td {
    background: #fffbf0;
    border-top: 2px solid #f5a623;
    border-bottom: 2px solid #f5a623;
}

tr.ai-row-needs-review td:first-child {
    border-left: 4px solid #f5a623;
}

.ai-review-hints {
    margin-top: 0.5rem;
    font-size: 0.82rem;
    color: #7a5c00;
    line-height: 1.5;
}

.hint-box {
    background: #f8f9ff;
    border: 1px solid #dfe5ff;
    border-radius: 12px;
    padding: 1rem 1.1rem;
}

.hint-box p:last-child {
    margin-bottom: 0;
}

/* ── Ansichts-Toggle (Tabelle / Timeline) ─────────── */
.view-toggle {
    display: flex;
    gap: 0;
    border: 1px solid #d0d5e8;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    align-self: flex-start;
}
.view-toggle-btn {
    padding: 0.45rem 0.9rem;
    font-size: 0.88rem;
    font-weight: 500;
    color: #555;
    background: #fff;
    text-decoration: none;
    border-right: 1px solid #d0d5e8;
    transition: background 0.15s;
}
.view-toggle-btn:last-child { border-right: none; }
.view-toggle-btn.active {
    background: linear-gradient(135deg, #3f69ff, #7c3bff);
    color: #fff;
}
.view-toggle-btn:hover:not(.active) { background: #f0f2ff; }

/* ── Timeline ─────────────────────────────────────── */
.timeline { display: flex; flex-direction: column; gap: 1.5rem; }

.timeline-week-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b74a0;
    margin-bottom: 0.75rem;
}
.timeline-week-count {
    background: #e8ecff;
    color: #3f69ff;
    border-radius: 999px;
    padding: 0.1rem 0.5rem;
    font-size: 0.78rem;
}

.timeline-posts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.75rem;
}

.timeline-card {
    background: #fff;
    border: 1px solid #e5e9f5;
    border-radius: 12px;
    padding: 0.85rem 1rem;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    transition: box-shadow 0.15s, transform 0.15s;
}
.timeline-card:hover {
    box-shadow: 0 8px 20px rgba(30, 40, 100, 0.1);
    transform: translateY(-2px);
}
.timeline-card-top {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    align-items: center;
}
.timeline-card-title {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.3;
}
.timeline-card-meta {
    font-size: 0.8rem;
    color: #888;
}

/* ── Bulk-Create Tabelle ──────────────────────────── */
.bulk-table-wrap {
    overflow-x: auto;
    margin-bottom: 0.5rem;
    border: 1px solid #e0e5f0;
    border-radius: 10px;
}
.bulk-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
}
.bulk-table th {
    background: #f4f6fc;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b74a0;
    padding: 0.6rem 0.75rem;
    border-bottom: 2px solid #e0e5f0;
    text-align: left;
}
.bulk-table td {
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid #eef0f8;
    vertical-align: top;
}
.bulk-table tr:last-child td { border-bottom: none; }
.bulk-table input,
.bulk-table select,
.bulk-table textarea {
    width: 100%;
    font-size: 0.88rem;
    padding: 0.35rem 0.5rem;
    border: 1px solid #d5d9ea;
    border-radius: 6px;
    margin: 0;
}
.bulk-table textarea { resize: vertical; min-height: 48px; }
.btn-row-remove {
    background: transparent;
    border: none;
    color: #bbb;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}
.btn-row-remove:hover { color: #e74c3c; background: #fdecea; }
