/* ============================================================
   Redaktionssystem – Basis-Stylesheet
   Farben nach Infoblatt Pförring, lokale Fonts
   Mobile-first, kein externes Framework
   ============================================================ */

/* ── Reset & Basis ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    /* Markenfarben (aus pfoerring.de) */
    --color-green:       #a0ce4e;
    --color-green-dk:    #91c928;
    --color-green-xdk:   #54770f;
    --color-blue:        #427aaa;
    --color-blue-dk:     #1172c1;

    /* Semantische Farben */
    --color-primary:     var(--color-blue);
    --color-primary-dk:  var(--color-blue-dk);
    --color-accent:      var(--color-green);
    --color-accent-dk:   var(--color-green-dk);
    --color-success:     var(--color-green-dk);
    --color-error:       #9d1111;
    --color-warning:     #c0830b;

    /* Neutrale Töne */
    --color-bg:          #f6f6f6;
    --color-surface:     #ffffff;
    --color-border:      #e0dede;
    --color-border-dk:   #c0bfbf;
    --color-text:        #333333;
    --color-text-muted:  #747474;

    /* Layout */
    --radius:     6px;
    --radius-lg:  10px;
    --shadow-sm:  0 1px 3px rgb(0 0 0 / .08);
    --shadow-md:  0 4px 16px rgb(0 0 0 / .10);
    --shadow-card: 0 2px 8px rgb(0 0 0 / .08);

    /* Typografie */
    --font-body:    'Roboto', system-ui, -apple-system, sans-serif;
    --font-heading: 'Roboto Slab', Georgia, serif;
    --font-mono:    'Courier New', monospace;
}

html { font-size: var(--font-size-base, 16px); scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.65;
    min-height: 100vh;
}

/* Überschriften → Roboto Slab */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    line-height: 1.25;
    color: var(--color-text);
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

/* ── Screenreader-only ─────────────────────────────────────── */
.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── Container ─────────────────────────────────────────────── */
.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .55rem 1.4rem;
    border: 2px solid transparent;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: .9rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
    white-space: nowrap;
}
.btn--primary {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #fff;
    text-shadow: 0 1px 1px rgb(0 0 0 / .15);
}
.btn--primary:hover {
    background: var(--color-accent-dk);
    border-color: var(--color-accent-dk);
    text-decoration: none;
    box-shadow: 0 3px 10px rgb(145 201 40 / .35);
}
.btn--ghost {
    background: transparent;
    border-color: var(--color-border-dk);
    color: var(--color-text-muted);
    text-transform: uppercase;
}
.btn--ghost:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    text-decoration: none;
}
.btn--secondary {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}
.btn--secondary:hover {
    background: color-mix(in srgb, var(--color-primary) 85%, #000);
    border-color: color-mix(in srgb, var(--color-primary) 85%, #000);
    text-decoration: none;
}
.btn--sm   { padding: .3rem .85rem; font-size: .78rem; }
.btn--lg   { padding: .75rem 2rem; font-size: 1rem; }
.btn--full { width: 100%; justify-content: center; }

/* ── Alerts ────────────────────────────────────────────────── */
.alert {
    padding: .8rem 1.1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: .9rem;
    border-left: 4px solid;
}
.alert--success {
    background: #f0fbea;
    color: #2d5a0e;
    border-color: var(--color-green-dk);
}
.alert--error {
    background: #fff0f0;
    color: #6b1212;
    border-color: var(--color-error);
}
.alert--warn {
    background: #fffbeb;
    color: #78350f;
    border-color: #f59e0b;
}

/* ── Formulare ─────────────────────────────────────────────── */
.form-group   { margin-bottom: 1.25rem; }
.form-label   { display: block; font-size: .88rem; font-weight: 700; margin-bottom: .35rem; color: var(--color-text); }
.form-input,
textarea,
select {
    width: 100%;
    padding: .6rem .85rem;
    border: 1px solid var(--color-border-dk);
    border-radius: var(--radius);
    font-size: .95rem;
    font-family: var(--font-body);
    background: #fff;
    color: var(--color-text);
    transition: border-color .15s, box-shadow .15s;
}
.form-input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgb(66 122 170 / .18);
}

/* ── Tabellen ──────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table th, .data-table td {
    text-align: left;
    padding: .7rem .9rem;
    border-bottom: 1px solid var(--color-border);
}
.data-table th {
    font-weight: 700;
    font-size: .78rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    background: #fafafa;
}
.data-table tbody tr:hover { background: #f9f9f9; }

/* ── Status-Badges ─────────────────────────────────────────── */
.status-badge {
    display: inline-block;
    padding: .22rem .7rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.status-badge--eingegangen    { background: #ddf0ff; color: #084a7a; }
.status-badge--in_pruefung    { background: #fef9c3; color: #7a5400; }
.status-badge--angenommen     { background: #e6f9d0; color: #2d5a0e; }
.status-badge--abgelehnt      { background: #ffe4e4; color: #6b1212; }
.status-badge--an_satz,
.status-badge--im_satz        { background: #ede9fe; color: #4a1d96; }
.status-badge--zur_freigabe   { background: #fff4e0; color: #7a3d00; }
.status-badge--freigegeben    { background: #d1fae5; color: #064e3b; }
.status-badge--veroeffentlicht{ background: #f0fdf4; color: #15803d; }
.status-badge--ueberarbeitung { background: #fef3c7; color: #92400e; }

/* ── Öffentliches Layout ───────────────────────────────────── */
.site-header {
    background: var(--color-surface);
    border-bottom: 2px solid var(--color-border);
    padding: .85rem 0;
    box-shadow: var(--shadow-sm);
}
.site-main   { padding: 2rem 0; }
.site-footer {
    margin-top: 3rem;
    padding: 1.5rem 0;
    border-top: 2px solid var(--color-border);
    font-size: .82rem;
    color: var(--color-text-muted);
    text-align: center;
}

/* Auth-Box */
.auth-box {
    max-width: 440px;
    margin: 3rem auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2.25rem;
    box-shadow: var(--shadow-md);
}
.auth-box__title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--color-primary);
}

/* ── Dashboard-Layout ──────────────────────────────────────── */
.dashboard-wrapper { display: flex; min-height: 100vh; }

.sidebar {
    width: 230px;
    flex-shrink: 0;
    background: #212934;
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    padding: 1.25rem 0;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
}
.sidebar__logo   { padding: 0 1.25rem 1.5rem; }
.sidebar__nav    { list-style: none; flex: 1; }
.sidebar__nav a  {
    display: block;
    padding: .65rem 1.25rem;
    color: #94a3b8;
    font-size: .9rem;
    border-left: 3px solid transparent;
    transition: color .15s, background .15s;
    font-family: var(--font-body);
}
.sidebar__nav a:hover,
.sidebar__nav a.active {
    color: #fff;
    background: rgb(255 255 255 / .05);
    border-left-color: var(--color-accent);
    text-decoration: none;
}
.sidebar__user   { padding: 1rem 1.25rem; border-top: 1px solid #334155; font-size: .85rem; }
.sidebar__user-name { display: block; font-weight: 700; color: #e2e8f0; font-family: var(--font-heading); }
.sidebar__user-role { display: block; color: #64748b; font-size: .75rem; margin-bottom: .5rem; }
.sidebar__logout    { color: #94a3b8; font-size: .8rem; }
.sidebar__logout:hover { color: #ef4444; }

.dashboard-main    { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.dashboard-header  {
    background: var(--color-surface);
    border-bottom: 2px solid var(--color-border);
    padding: 1rem 1.75rem;
    box-shadow: var(--shadow-sm);
}
.dashboard-header__title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-primary);
    font-family: var(--font-heading);
}
.dashboard-content { padding: 1.75rem; overflow-y: auto; }

/* Stats-Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-top: 3px solid var(--color-accent);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    box-shadow: var(--shadow-card);
}
.stat-card__value {
    display: block;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--color-accent-dk);
    font-family: var(--font-heading);
}
.stat-card__label { display: block; font-size: .78rem; color: var(--color-text-muted); margin-top: .3rem; text-transform: uppercase; letter-spacing: .03em; }

.recent-submissions h2 { font-size: 1.1rem; margin-bottom: 1rem; color: var(--color-primary); }
.empty-state { color: var(--color-text-muted); font-style: italic; }

/* ── Öffentliche Kontaktseite ───────────────────────────────── */
.kontakt-row {
    display: grid;
    grid-template-columns: 9rem 1fr;
    gap: .5rem 1rem;
    padding: .6rem 0;
    border-bottom: 1px solid var(--color-border);
    align-items: start;
}
.kontakt-row:last-child { border-bottom: none; }
.kontakt-row__label {
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--color-text-muted);
    padding-top: .1rem;
}
.kontakt-row__value { color: var(--color-text); }
.kontakt-row__value a { color: var(--color-primary); }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
    .dashboard-wrapper { flex-direction: column; }
    .sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; padding: .5rem; }
    .sidebar__nav { display: flex; flex: 1; }
    .sidebar__nav a { padding: .5rem .75rem; border-left: none; border-bottom: 3px solid transparent; }
    .sidebar__user { width: 100%; border-top: none; border-left: 1px solid #334155; }
    .data-table { font-size: .8rem; }
    .data-table th, .data-table td { padding: .5rem; }
}
