/* ===========================================================================
   Navion Ansagen-Generator – Design nach Navion Brand Guidelines
   Markenfarbe Grün #15c183, Dunkel #212121, helle Grüntöne.
   Gestaltung: ruhig, aufgeräumt, großzügiger Weißraum, klare Hierarchie.
   =========================================================================== */

:root {
    --green: #15c183;
    --green-dark: #11a06d;
    --green-light: #41edae;
    --dark: #212121;
    --bg: #f4f8f5;
    --tint: #e9f0ec;
    --card: #ffffff;
    --text: #212121;
    --muted: #6c7a72;
    --border: #e2e9e4;
    --ring: rgba(21, 193, 131, 0.20);
    --ok: #15a06b;
    --error: #c0392b;
    --radius: 14px;
    --shadow: 0 1px 3px rgba(33, 33, 33, 0.05), 0 10px 30px rgba(33, 33, 33, 0.05);

    /* Spacing-Skala (4er-Raster) */
    --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
    --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--green-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

/* --- Layout ------------------------------------------------------------- */

.container {
    max-width: 760px;
    margin: 0 auto;
    padding: var(--s6) var(--s5) var(--s8);
}
.container--admin { max-width: 920px; }

.centered {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--s5);
    background:
        radial-gradient(900px 500px at 100% -10%, rgba(21, 193, 131, 0.10), transparent 60%),
        radial-gradient(700px 500px at -10% 110%, rgba(65, 237, 174, 0.10), transparent 60%),
        var(--bg);
}

.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: var(--s6);
    width: 100%;
}
.card--narrow { max-width: 400px; }

/* --- Topbar ------------------------------------------------------------- */

.topbar {
    background: var(--dark);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--s4) var(--s6);
    flex-wrap: wrap;
    gap: var(--s3);
}
.topbar__brand { font-weight: 700; font-size: 1.1rem; letter-spacing: .2px; }
.topbar__brand span, .brand span { color: var(--green); font-weight: 600; }
.topbar__nav { display: flex; align-items: center; gap: var(--s5); }
.topbar__nav a { color: #fff; font-weight: 500; }
.topbar__nav a:hover { color: var(--green-light); text-decoration: none; }
.topbar__user { color: #b9c2bc; font-size: .85rem; }

.brand { color: var(--dark); font-size: 1.5rem; margin: 0 0 var(--s1); font-weight: 700; }

/* --- Typo --------------------------------------------------------------- */

h1 { color: var(--dark); font-size: 1.6rem; margin: 0 0 var(--s6); font-weight: 700; letter-spacing: -.01em; }
h1::after {
    content: "";
    display: block;
    width: 48px;
    height: 4px;
    margin-top: var(--s3);
    border-radius: 2px;
    background: var(--green);
}
h2 { color: var(--dark); font-size: 1.1rem; margin: 0 0 var(--s4); font-weight: 600; }
h3 { color: var(--dark); font-size: .95rem; margin: 0 0 var(--s3); font-weight: 600; }
.muted { color: var(--muted); margin-top: 0; }

/* --- Workflow / Formfelder ---------------------------------------------- */

.workflow { list-style: none; margin: 0; padding: 0; }
.step { margin-bottom: var(--s5); }
.step > label {
    display: block;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: var(--s2);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: 9px;
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
    color: var(--text);
    transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { resize: vertical; }

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 4px var(--ring);
}

input[type="range"] { width: 100%; accent-color: var(--green); padding: 0; border: none; }

.counter { font-size: .8rem; color: var(--muted); margin-top: var(--s1); text-align: right; }

/* --- Platzhalter-Felder ------------------------------------------------- */

.placeholders {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--s4);
    padding: var(--s4);
    background: var(--tint);
    border-radius: 10px;
}
.placeholders__field label {
    display: block;
    font-size: .85rem;
    color: var(--muted);
    margin-bottom: var(--s1);
    font-weight: 500;
}
.placeholders__field input.invalid {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.15);
}

/* --- Buttons ------------------------------------------------------------ */

.btn {
    display: inline-block;
    border: none;
    border-radius: 9px;
    padding: 12px 22px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    transition: background .15s ease, opacity .15s ease, transform .05s ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--green); color: #fff; }
.btn--primary:hover { background: var(--green-dark); text-decoration: none; }
.btn--primary:disabled { opacity: .55; cursor: default; }
.btn--ghost { background: transparent; border: 1px solid rgba(255,255,255,.45); color: #fff; }
.btn--ghost:hover { background: rgba(255,255,255,.12); text-decoration: none; }
.btn--outline { background: #fff; color: var(--green-dark); border: 1px solid var(--border); }
.btn--outline:hover { background: var(--tint); text-decoration: none; }
.btn--block { width: 100%; margin-top: var(--s2); }
.btn--small { padding: 8px 14px; font-size: .85rem; }

/* Dezente Text-Aktionen (Tabellenzeilen) – kein Flächen-Rauschen */
.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s2) var(--s4);
    justify-content: flex-end;
}
.row-actions .inline-form { display: inline; margin: 0; }
.action {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-size: .85rem;
    font-weight: 500;
    color: var(--green-dark);
    cursor: pointer;
    white-space: nowrap;
}
.action:hover { text-decoration: underline; }
.action--muted { color: var(--muted); }
.action--danger { color: var(--error); }

/* --- Badges ------------------------------------------------------------- */

.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .3px;
    line-height: 1.7;
    white-space: nowrap;
}
.badge--active   { background: #e6f7ef; color: var(--ok); }
.badge--inactive { background: var(--tint); color: var(--muted); }
.badge--default  { background: rgba(21, 193, 131, 0.12); color: var(--green-dark); }

/* --- Wartebalken -------------------------------------------------------- */

.progress {
    margin-top: var(--s3);
    height: 6px;
    width: 100%;
    background: var(--tint);
    border-radius: 999px;
    overflow: hidden;
}
.progress__bar {
    height: 100%;
    width: 40%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--green), var(--green-light));
    animation: progress-slide 1.1s ease-in-out infinite;
}
@keyframes progress-slide {
    0%   { margin-left: -40%; }
    100% { margin-left: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .progress__bar { animation-duration: 2.4s; }
}

/* --- Status / Alerts ---------------------------------------------------- */

.status { margin-left: var(--s3); font-size: .9rem; font-weight: 500; }
.status--busy { color: var(--muted); }
.status--ok { color: var(--ok); }
.status--error { color: var(--error); }

.alert {
    padding: var(--s3) var(--s4);
    border-radius: 10px;
    margin-bottom: var(--s4);
    font-size: .92rem;
}
.alert--error { background: #fdecea; color: var(--error); }
.alert--ok { background: #e6f7ef; color: var(--ok); }

/* --- Ergebnis ----------------------------------------------------------- */

.result {
    margin-top: var(--s6);
    padding: var(--s5);
    background: var(--card);
    border-left: 4px solid var(--green);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.result audio { width: 100%; margin-bottom: var(--s4); display: block; }

/* --- Admin -------------------------------------------------------------- */

.admin-section {
    background: var(--card);
    border-radius: var(--radius);
    padding: var(--s6);
    margin-bottom: var(--s5);
    box-shadow: var(--shadow);
}
.section-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: var(--s6) 0 var(--s5);
}

.table-wrap { width: 100%; overflow-x: auto; }
table.tpl { width: 100%; border-collapse: collapse; min-width: 460px; }
table.tpl th, table.tpl td {
    text-align: left;
    padding: var(--s3) var(--s2);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    line-height: 1.4;
}
table.tpl tr:last-child td { border-bottom: none; }
table.tpl th {
    color: var(--muted);
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    font-weight: 600;
}
table.tpl th:last-child,
table.tpl td:last-child { text-align: right; width: 1%; white-space: nowrap; }

.cell-name { font-weight: 500; }
.cell-name small { color: var(--muted); font-weight: 400; }
.cell-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .8rem;
    color: var(--muted);
    overflow-wrap: anywhere;
    word-break: break-word;
}
.cell-text { color: var(--muted); font-size: .88rem; max-width: 320px; overflow-wrap: anywhere; }

/* --- Formulare ---------------------------------------------------------- */

.form-grid { display: grid; gap: var(--s4); }
.form-grid > div { min-width: 0; }
.form-grid label {
    font-weight: 600;
    color: var(--dark);
    display: block;
    margin-bottom: var(--s1);
}
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.checkbox {
    font-weight: 400 !important;
    display: flex;
    gap: var(--s2);
    align-items: center;
    color: var(--text);
}
.checkbox input { width: auto; }
.form-actions { display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap; }

.inline-form { display: inline; }
.bg-remove { margin-top: var(--s3); }
code { background: var(--tint); padding: 1px 6px; border-radius: 5px; font-size: .9em; }

@media (max-width: 600px) {
    .form-row-2 { grid-template-columns: 1fr; }
    .cell-text { max-width: 160px; }
    .topbar { flex-direction: column; align-items: flex-start; }
    .container { padding: var(--s5) var(--s4) var(--s7); }
    .admin-section { padding: var(--s5); }
}
