/* ============================================================
   CRM SundPark — Basis-Stylesheet
   Markenwelt: Petrol · Off-White · Aqua (Interaktion) · Bernstein (sparsam)
   Schriften lokal gehostet (kein Laufzeit-CDN).
   ============================================================ */

@font-face {
    font-family: 'Newsreader';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/newsreader-600.woff2') format('woff2');
}
@font-face {
    font-family: 'Newsreader';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/newsreader-700.woff2') format('woff2');
}
@font-face {
    font-family: 'Hanken Grotesk';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/hanken-grotesk-400.woff2') format('woff2');
}
@font-face {
    font-family: 'Hanken Grotesk';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/hanken-grotesk-500.woff2') format('woff2');
}
@font-face {
    font-family: 'Hanken Grotesk';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/hanken-grotesk-700.woff2') format('woff2');
}

:root {
    --petrol:      #0B1E27;
    --petrol-soft: #14303d;
    --offwhite:    #F4F1EA;
    --offwhite-muted: #A8BBC1;  /* gedämpftes Off-White auf Petrol (wie sundpark.de) */
    --aqua:        #3FC7C2;
    --amber:       #D9A441;
    --ink:         #1c2b33;
    --muted:       #5d6f78;
    --card:        #ffffff;
    --line:        #e3ded2;
    --ok:          #2e9e6b;
    --error:       #c0392b;
    --violett:     #7A45A8;     /* überfällige Fristen — eigene Stufe über Rot */
    --radius:      10px;
    --font-head:   'Newsreader', Georgia, serif;
    --font-body:   'Hanken Grotesk', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--offwhite);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.55;
}

/* --- Kopfleiste ------------------------------------------- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: var(--petrol);
    color: var(--offwhite);
    padding: 0.7rem 1.2rem;
}
.brand {
    display: flex;
    align-items: baseline;   /* Logo steht mit Unterkante auf der Schrift-Baseline (wie sundpark.de) */
    gap: 0.65rem;
    color: var(--offwhite);
    text-decoration: none;
}
/* Brand behält ihre Farben beim Hover (nicht die globale a:hover-Regel erben) */
.brand:hover { color: var(--offwhite); }
/* Sund-/Strait-Marke — drei Balken, mittlerer in Aqua (wie sundpark.de) */
.strait {
    display: inline-flex;
    align-items: stretch;
    gap: 4px;
    height: 1.2rem;
    flex: none;
}
.strait i {
    width: 3px;
    background: var(--offwhite);
    border-radius: 2px;
}
.strait i:nth-child(2) { background: var(--aqua); }
.brandmark {
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 1.3rem;
    letter-spacing: -0.01em;
    line-height: 1;
}
.brandtag {
    font-family: var(--font-body);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--offwhite-muted);
    align-self: center;
}
.brand-crm {
    font-family: var(--font-body);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--aqua);
    border: 1px solid rgba(63, 199, 194, 0.45);
    border-radius: 4px;
    padding: 2px 7px;
    align-self: center;
    margin-left: 0.15rem;
}

/* --- Inhalt ------------------------------------------------ */
.page {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.5rem 1.2rem 3rem;
}
h1, h2, h3 {
    font-family: var(--font-head);
    font-weight: 600;
    color: var(--petrol);
    line-height: 1.2;
    margin: 0.4em 0;
}
h1 { font-size: 2rem; }
.lead { color: var(--muted); margin-top: 0; }

a { color: var(--aqua); }
a:hover { color: var(--petrol); }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.2rem 1.4rem;
    margin: 1rem 0;
    box-shadow: 0 1px 3px rgba(11, 30, 39, 0.06);
}

/* --- Status-Tabelle ---------------------------------------- */
.status-table {
    width: 100%;
    border-collapse: collapse;
}
.status-table th,
.status-table td {
    text-align: left;
    padding: 0.55rem 0.4rem;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}
.status-table tr:last-child th,
.status-table tr:last-child td { border-bottom: none; }
.status-table th {
    width: 40%;
    font-weight: 500;
    color: var(--muted);
}

.badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
}
.badge-ok    { background: var(--ok); }
.badge-error { background: var(--error); }
.badge-warn  { background: var(--amber); }
.badge-violett { background: var(--violett); }
.error-detail {
    margin-top: 0.4rem;
    font-size: 0.85rem;
    color: var(--error);
    word-break: break-word;
}

/* --- Navigation -------------------------------------------- */
.mainnav {
    display: flex;
    align-items: center;
    gap: 1.1rem;
}
.mainnav a:not(.timer-chip) {
    color: var(--offwhite-muted);
    text-decoration: none;
    font-weight: 400;
    font-size: 0.95rem;
    position: relative;
    padding: 4px 0;
    transition: color 220ms ease;
}
.mainnav a:not(.timer-chip)::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 1.5px;
    width: 100%;
    background: var(--aqua);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 300ms ease;
}
.mainnav a:not(.timer-chip):hover { color: var(--offwhite); }
.mainnav a:not(.timer-chip):hover::after { transform: scaleX(1); }
.inline { display: inline; margin: 0; }
.linkbtn {
    background: none;
    border: none;
    padding: 0;
    color: var(--aqua);
    font: inherit;
    font-weight: 500;
    cursor: pointer;
}
.linkbtn:hover { text-decoration: underline; }

/* --- Buttons ------------------------------------------------ */
.btn {
    display: inline-block;
    border: 2px solid transparent;
    border-radius: var(--radius);
    padding: 0.55rem 1.1rem;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: filter 0.15s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: 0.55; cursor: wait; }
.btn-primary { background: var(--aqua); color: var(--petrol); }
.btn-outline {
    background: transparent;
    border-color: var(--petrol);
    color: var(--petrol);
}
.btn-danger { background: var(--error); color: #fff; }
.btn-small { padding: 0.25rem 0.7rem; font-size: 0.85rem; font-weight: 500; }
.btn-block { display: block; width: 100%; }

/* --- Formulare ---------------------------------------------- */
.stack { display: flex; flex-direction: column; gap: 0.9rem; }
.stack label { display: flex; flex-direction: column; gap: 0.3rem; font-weight: 500; }
.row { display: flex; gap: 0.7rem; flex-wrap: wrap; align-items: center; }
.row input[type="text"] { flex: 1; min-width: 200px; }
input[type="text"],
input[type="password"],
input[type="email"] {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.55rem 0.8rem;
    font: inherit;
    background: #fff;
    color: var(--ink);
}
input:focus {
    outline: 2px solid var(--aqua);
    outline-offset: 1px;
    border-color: var(--aqua);
}

/* --- Login -------------------------------------------------- */
.login-wrap {
    display: flex;
    justify-content: center;
    padding-top: 5vh;
}
.login-card { width: 100%; max-width: 380px; }
.divider {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--muted);
    font-size: 0.85rem;
    margin: 1.2rem 0;
}
.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-top: 1px solid var(--line);
}

select {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.45rem 0.6rem;
    font: inherit;
    background: #fff;
    color: var(--ink);
}
select:focus { outline: 2px solid var(--aqua); outline-offset: 1px; }
.check { display: flex; align-items: center; gap: 0.5rem; font-weight: 500; }
.check input { width: 1.1rem; height: 1.1rem; accent-color: var(--aqua); }

textarea {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.55rem 0.8rem;
    font: inherit;
    background: #fff;
    color: var(--ink);
    width: 100%;
    box-sizing: border-box;
}
textarea:focus { outline: 2px solid var(--aqua); outline-offset: 1px; }
input[type="date"],
input[type="number"] {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.5rem 0.7rem;
    font: inherit;
    background: #fff;
}
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.9rem;
}
.grid-2 label { display: flex; flex-direction: column; gap: 0.3rem; font-weight: 500; }
@media (max-width: 600px) { .grid-2 { grid-template-columns: 1fr; } }
.spread { justify-content: space-between; align-items: center; }

/* --- Notizen ------------------------------------------------ */
.notes { list-style: none; margin: 1rem 0 0; padding: 0; }
.notes li { border-top: 1px solid var(--line); padding: 0.7rem 0; }
.note-head { display: flex; gap: 0.7rem; align-items: baseline; }
.note-body { margin-top: 0.2rem; }
.note-form { margin-bottom: 1rem; }
code {
    background: rgba(11, 30, 39, 0.06);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-size: 0.9em;
    word-break: break-all;
}

/* --- Tabellen ----------------------------------------------- */
.table-scroll { overflow-x: auto; }
.matrix th .small { display: block; font-weight: 400; }
.matrix td { white-space: nowrap; }
.badge-muted { background: var(--muted); }

/* --- Meldungen ---------------------------------------------- */
.alert {
    border-radius: var(--radius);
    padding: 0.7rem 1rem;
    margin: 0.8rem 0;
    font-weight: 500;
}
.alert-error { background: #fdecea; color: var(--error); border: 1px solid #f5c6c0; }
.alert-ok    { background: #e8f6ef; color: var(--ok);    border: 1px solid #bfe5d2; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

/* --- Fristen-Ampel ------------------------------------------ */
.ampel-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.7rem;
    margin: 1rem 0;
}
@media (max-width: 600px) { .ampel-row { grid-template-columns: 1fr 1fr; } }
.ampel-box {
    display: block;
    text-align: center;
    padding: 0.8rem 0.4rem;
    border-radius: var(--radius);
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    line-height: 1.3;
}
.ampel-box strong { display: block; font-size: 1.6rem; font-family: var(--font-head); }
.ampel-violett { background: var(--violett); }
.ampel-rot   { background: var(--error); }
.ampel-gelb  { background: var(--amber); }
.ampel-gruen { background: var(--ok); }
.ampel-box:hover { filter: brightness(1.08); color: #fff; }
.dot {
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 50%;
    display: inline-block;
    vertical-align: middle;
}
.dot-violett { background: var(--violett); }
.dot-rot   { background: var(--error); }
.dot-gelb  { background: var(--amber); }
.dot-gruen { background: var(--ok); }
.dot-aus   { background: var(--line); }
.row-muted td { color: var(--muted); }
.sync-ok { color: var(--ok); font-weight: 700; }
.sync-error { color: var(--error); font-weight: 700; cursor: help; }
.sum-row th { border-top: 2px solid var(--petrol); }
.inline-label { display: flex; align-items: center; gap: 0.4rem; font-weight: 500; }
.timer-chip {
    background: var(--amber);
    color: #fff !important;
    border-radius: 999px;
    padding: 0.1rem 0.7rem;
    font-weight: 700;
    text-decoration: none;
}
.time-form { margin-bottom: 1rem; }
.row-gap-top { margin-top: 0.8rem; }
.chip-big { font-size: 0.95rem; padding: 0.35rem 0.9rem; text-decoration: none; }

/* --- Kanban-Board ------------------------------------------- */
.page-wide { max-width: 1400px; }
.kanban {
    display: flex;
    gap: 0.8rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    scroll-snap-type: x proximity;
    align-items: flex-start;
}
.kcol {
    flex: 0 0 auto;
    width: 272px;
    background: rgba(11, 30, 39, 0.05);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 230px);
}
.kcol-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.8rem;
    font-family: var(--font-head);
    font-weight: 600;
    color: var(--petrol);
    border-bottom: 1px solid var(--line);
}
.kcards {
    padding: 0.6rem;
    overflow-y: auto;
    flex: 1;
    min-height: 70px;
}
.kcard {
    position: relative;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.55rem 1.7rem 0.55rem 0.7rem;
    margin-bottom: 0.55rem;
    box-shadow: 0 1px 2px rgba(11, 30, 39, 0.07);
}
.kcard-title {
    display: block;
    color: var(--ink);
    text-decoration: none;
    font-weight: 500;
    line-height: 1.3;
    word-break: break-word;
}
.kcard-title:hover { color: var(--aqua); }
.kcard-meta {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    margin-top: 0.4rem;
    flex-wrap: wrap;
}
.khandle {
    position: absolute;
    top: 0.3rem;
    right: 0.25rem;
    padding: 0.25rem 0.4rem;
    cursor: grab;
    touch-action: none;     /* erlaubt Drag per Finger ohne Scroll-Konflikt */
    color: var(--muted);
    user-select: none;
    font-size: 0.95rem;
}
.kghost {
    position: fixed;
    z-index: 60;
    pointer-events: none;
    opacity: 0.9;
    transform: rotate(2deg);
    box-shadow: 0 8px 22px rgba(11, 30, 39, 0.3);
}
.kdragging { opacity: 0.35; }
.chip {
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(11, 30, 39, 0.08);
    color: var(--petrol);
    border-radius: 999px;
    padding: 0.08rem 0.5rem;
    white-space: nowrap;
}
.chip-warn { background: var(--amber); color: #fff; }
.prio {
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    display: inline-block;
    flex: 0 0 auto;
}
.prio-niedrig  { background: #9fb3bc; }
.prio-normal   { background: var(--aqua); }
.prio-hoch     { background: var(--amber); }
.prio-dringend { background: var(--error); }
@media (max-width: 600px) {
    .kcol { width: 82vw; }
    .kcol-head { position: sticky; top: 0; }
}

/* --- Plus-Knopf & Dialog ------------------------------------ */
.fab {
    position: fixed;
    right: 1.1rem;
    bottom: 1.2rem;
    width: 3.4rem;
    height: 3.4rem;
    border-radius: 50%;
    background: var(--aqua);
    color: var(--petrol);
    font-size: 2rem;
    line-height: 1;
    border: none;
    box-shadow: 0 4px 16px rgba(11, 30, 39, 0.35);
    cursor: pointer;
    z-index: 40;
}
.fab:hover { filter: brightness(1.08); }
dialog {
    border: none;
    border-radius: var(--radius);
    padding: 1.2rem 1.4rem;
    width: min(420px, 92vw);
    box-shadow: 0 10px 40px rgba(11, 30, 39, 0.4);
}
dialog::backdrop { background: rgba(11, 30, 39, 0.55); }
dialog h2 { margin-top: 0; }

/* --- Checkliste --------------------------------------------- */
.checklist { list-style: none; margin: 0 0 1rem; padding: 0; }
.checklist li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--line);
}
.checklist li:last-child { border-bottom: none; }
.checklist .done { text-decoration: line-through; color: var(--muted); }
.checkbtn {
    background: none;
    border: none;
    font-size: 1.15rem;
    cursor: pointer;
    padding: 0 0.2rem;
    color: var(--petrol);
}
.linkbtn.small { font-size: 1rem; color: var(--muted); }
.nowrap { white-space: nowrap; }

/* --- Fußzeile ---------------------------------------------- */
.footer {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1.2rem 1.5rem;
    color: var(--muted);
    font-size: 0.85rem;
}
/* Marken-Signatur im Footer */
.footer-tag {
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.8;
    margin: 0;
}
.footer-tag svg { display: inline-block; }
.footer-tag .heart { color: #E0606F; vertical-align: -3px; }
.footer-tag .cloud { color: var(--aqua); vertical-align: -4px; }
.footer-tag .b { color: var(--ink); font-weight: 600; }
.footer-tag em { font-style: italic; }
.footer-tag a { color: inherit; text-decoration: none; transition: color 200ms ease; }
.footer-tag a:hover .b,
.footer-tag a:hover em { color: var(--aqua); }

/* --- Mobil ------------------------------------------------- */
@media (max-width: 700px) {
    .topbar { flex-wrap: nowrap; gap: 0.6rem; }
    .mainnav {
        overflow-x: auto;
        flex-wrap: nowrap;
        gap: 0.8rem;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .mainnav::-webkit-scrollbar { display: none; }
    .mainnav a, .mainnav .linkbtn { white-space: nowrap; }
    .brand { flex: none; }
}
@media (max-width: 600px) {
    h1 { font-size: 1.6rem; }
    .page { padding: 1rem 0.9rem 2.5rem; }
    .status-table th { width: 46%; }
}
/* sehr schmal: „Media"-Zusatz weicht, Logo + SundPark + CRM bleiben */
@media (max-width: 460px) {
    .brandtag { display: none; }
    .brandmark { font-size: 1.15rem; }
}
