/* ============================================================
   Redaktionsplan – Apple-inspiriertes Design
   ============================================================ */

:root {
    --bg:            #f5f5f7;
    --surface:       #ffffff;
    --text:          #1d1d1f;
    --text-sec:      #6e6e73;
    --accent:        #0071e3;
    --accent-press:  #0060c0;
    --border:        #d2d2d7;
    --border-soft:   #e8e8ed;

    /* Statusfarben */
    --st-idee:       #8e8e93;
    --st-arbeit:     #0071e3;
    --st-review:     #ff9500;
    --st-geplant:    #5e5ce6;
    --st-veroeff:    #34c759;

    --radius:        14px;
    --radius-sm:     9px;
    --shadow:        0 2px 12px rgba(0, 0, 0, .06), 0 1px 3px rgba(0, 0, 0, .04);
    --shadow-lg:     0 12px 40px rgba(0, 0, 0, .18);
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
            "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
}

/* ---------- Navigation (frosted glass) ---------- */
.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(245, 245, 247, .72);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border-soft);
}
.nav-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
    height: 52px;
    display: flex;
    align-items: center;
    gap: 28px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 17px;
    letter-spacing: -.01em;
    color: var(--text);
    text-decoration: none;
}
.brand-logo { height: 26px; width: auto; display: block; }
.nav-links { display: flex; gap: 4px; margin-left: 8px; }
.nav-link {
    color: var(--text-sec);
    text-decoration: none;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 8px;
    transition: background .15s, color .15s;
}
.nav-link:hover { color: var(--text); background: rgba(0, 0, 0, .04); }
.nav-link.active { color: var(--text); font-weight: 500; }
.nav-logout {
    margin-left: auto;
    color: var(--accent);
    text-decoration: none;
    font-size: 14px;
}
.nav-logout:hover { text-decoration: underline; }

/* ---------- Layout ---------- */
.main {
    max-width: 1120px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}
.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}
.page-title {
    font-size: 34px;
    font-weight: 600;
    letter-spacing: -.02em;
    margin: 0;
}
.page-sub { color: var(--text-sec); margin: 4px 0 0; font-size: 14px; }

.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* ---------- Buttons ---------- */
.btn {
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 980px;
    padding: 9px 18px;
    cursor: pointer;
    transition: background .15s, transform .05s, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-press); }
.btn-ghost { background: rgba(0, 0, 0, .05); color: var(--text); }
.btn-ghost:hover { background: rgba(0, 0, 0, .09); }
.btn-block { width: 100%; }

.icon-btn {
    font-family: inherit;
    font-size: 13px;
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background .15s;
}
.icon-btn:hover { background: rgba(0, 113, 227, .08); }
.icon-btn-danger { color: #ff3b30; }
.icon-btn-danger:hover { background: rgba(255, 59, 48, .08); }

/* ---------- Formularfelder ---------- */
.field {
    font-family: inherit;
    font-size: 15px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    width: 100%;
    transition: border-color .15s, box-shadow .15s;
}
.field:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, .18);
}
.field-sm { font-size: 14px; padding: 7px 10px; }

.fl {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 12px;
    color: var(--text-sec);
    font-weight: 500;
}

/* ---------- Login ---------- */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.login-card {
    background: var(--surface);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    padding: 44px 40px;
    width: 100%;
    max-width: 360px;
    text-align: center;
}
.login-title {
    font-size: 26px;
    font-weight: 600;
    letter-spacing: -.02em;
    margin: 0 0 6px;
}
.login-sub { color: var(--text-sec); margin: 0 0 28px; font-size: 14px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-error { color: #ff3b30; font-size: 13px; margin: -4px 0 0; }

/* ---------- Filter ---------- */
.filters { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.filters .field-sm { width: auto; min-width: 150px; }
.filter-check {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--text-sec);
    cursor: pointer;
    user-select: none;
}
.filter-check input { cursor: pointer; }

/* ---------- Tabelle ---------- */
.table { width: 100%; border-collapse: collapse; }
.table thead th {
    text-align: left;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-sec);
    text-transform: uppercase;
    letter-spacing: .03em;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-soft);
}
.table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-soft);
    vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #fafafb; }
.td-title { font-weight: 500; }
.td-owner { color: var(--text-sec); }
.td-dates { color: var(--text-sec); font-size: 13px; white-space: nowrap; }
.th-actions { width: 1%; }
.td-actions { white-space: nowrap; text-align: right; }
.empty { text-align: center; color: var(--text-sec); padding: 40px 16px; }

/* ---------- Chips & Status ---------- */
.chip {
    display: inline-block;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 980px;
    white-space: nowrap;
}
.chip-channel { background: rgba(0, 0, 0, .05); color: var(--text-sec); }

.status {
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: filter .15s, transform .05s;
}
.status:hover { filter: brightness(.95); }
.status:active { transform: scale(.96); }

/* ---------- Inline-Formulare (neu / bearbeiten) ---------- */
.row-editing td, .new-form-wrap { background: #fafafb; }
.inline-form { padding: 18px 16px; }
.new-form-wrap { border-top: 1px solid var(--border-soft); }
.inline-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}
.inline-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- Kalender-Zugänge ---------- */
.feed-box {
    margin-top: 20px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px 24px;
}
.feed-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.feed-text { display: flex; flex-direction: column; gap: 3px; max-width: 460px; }
.feed-title { font-weight: 600; font-size: 15px; }
.feed-sub { color: var(--text-sec); font-size: 13px; line-height: 1.45; }
.feed-add { display: flex; gap: 8px; align-items: center; }
.feed-add .field-sm { width: 180px; }
.feed-url {
    flex: 1;
    min-width: 0;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 12px;
    color: var(--text-sec);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
}
.feed-url:focus { outline: none; border-color: var(--accent); }

.token-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.token-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #fafafb;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
}
.token-label { font-weight: 500; font-size: 14px; min-width: 120px; flex-shrink: 0; }
.token-actions { display: flex; gap: 4px; flex-shrink: 0; }
.token-empty { color: var(--text-sec); font-size: 14px; margin: 0; padding: 8px 0; }

/* ---------- Einstellungen: Status & Kanäle ---------- */
.settings-grid { display: flex; flex-direction: column; gap: 20px; }
.settings-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.settings-item {
    background: #fafafb;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
}
.settings-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.settings-row .field-sm { flex: 1; }
.settings-add { display: flex; gap: 8px; align-items: center; }
.settings-add .field-sm { width: 220px; }
.color-input {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: none;
    cursor: pointer;
    flex-shrink: 0;
}
.reorder-btns { display: flex; flex-direction: column; gap: 0; flex-shrink: 0; }
.reorder-btns .icon-btn { padding: 0 6px; line-height: 1.3; }
.reorder-btns .icon-btn:disabled { opacity: .3; cursor: default; }
.reorder-btns .icon-btn:disabled:hover { background: none; }

/* ============================================================
   Gantt
   ============================================================ */
.gantt-scroll { overflow-x: auto; padding: 4px; }
.gantt {
    display: grid;
    grid-template-columns: 180px repeat(var(--weeks), minmax(64px, 1fr));
    grid-auto-rows: 48px;
    min-width: max-content;
}

.gantt-corner {
    grid-column: 1;
    grid-row: 1;
    position: sticky;
    left: 0;
    z-index: 3;
    background: var(--surface);
    display: flex;
    align-items: center;
    padding: 0 16px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-sec);
    text-transform: uppercase;
    letter-spacing: .03em;
    border-bottom: 1px solid var(--border-soft);
}
.gantt-head {
    grid-row: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1px;
    border-bottom: 1px solid var(--border-soft);
    border-left: 1px solid var(--border-soft);
}
.gantt-kw { font-size: 12px; font-weight: 600; }
.gantt-date { font-size: 10px; color: var(--text-sec); }

.gantt-label {
    grid-column: 1;
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 16px;
    border-bottom: 1px solid var(--border-soft);
    overflow: hidden;
}
.gantt-label-title {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gantt-label-owner { font-size: 11px; color: var(--text-sec); }

.gantt-cell {
    border-bottom: 1px solid var(--border-soft);
    border-left: 1px solid var(--border-soft);
}

.gantt-bar {
    align-self: center;
    height: 30px;
    margin: 0 3px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0 10px;
    font-family: inherit;
    color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
    transition: transform .08s, box-shadow .15s, filter .15s;
    z-index: 1;
    overflow: hidden;
}
.gantt-bar:hover { filter: brightness(1.05); box-shadow: 0 3px 8px rgba(0, 0, 0, .22); }
.gantt-bar:active { transform: scale(.98); }
.gantt-bar-label {
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- Modal (Gantt-Datumseditor) ---------- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, .28);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fade .18s ease;
}
.modal {
    background: var(--surface);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    padding: 28px;
    width: 100%;
    max-width: 380px;
    animation: pop .2s ease;
}
.modal-title { font-size: 19px; font-weight: 600; margin: 0 0 2px; letter-spacing: -.01em; }
.modal-sub { color: var(--text-sec); font-size: 13px; margin: 0 0 20px; }
.modal-fields { display: flex; gap: 14px; margin-bottom: 22px; }
.modal-fields .fl { flex: 1; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop {
    from { opacity: 0; transform: scale(.96) translateY(6px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
    .page-title { font-size: 27px; }
    .inline-grid { grid-template-columns: 1fr 1fr; }
    .table thead { display: none; }
    .td-dates { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}
