/* ═══════════════════════════════════════════════════════════════════════════
   FWS Überlingen – Schulverwaltung · Waldorf Design System v3.1
   Warm · Organisch · Handwerklich · Mobile-First
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,600;1,400&family=Source+Sans+3:wght@300;400;500;600&display=swap');

/* ── Tokens ──────────────────────────────────────────────────────────────── */
:root {
    /* Waldorf-Palette */
    --clay:       #c96840;   /* Terrakotta – Hauptfarbe */
    --clay-dark:  #a84e28;
    --clay-light: #f0c4a8;
    --clay-50:    #fdf4f0;
    --clay-100:   #f9e4d8;

    --ochre:      #b8872a;   /* Ocker – Akzent */
    --ochre-light:#f7edd8;
    --ochre-50:   #fdf8f0;

    --moss:       #5a8c40;   /* Grün – positiv */
    --moss-light: #dce8d4;
    --moss-50:    #f2f5f0;

    --ink-900:    #1e1810;
    --ink-800:    #2e2418;
    --ink-700:    #40341e;
    --ink-600:    #5a4a2c;
    --ink-500:    #7a6644;
    --ink-400:    #9a8660;
    --ink-300:    #b8a880;
    --ink-200:    #d4c8a8;
    --ink-100:    #ece6d4;
    --ink-50:     #f8f5ee;

    --parchment:  #faf6ee;
    --white:      #ffffff;

    /* Semantisch */
    --font-serif: 'Lora', Georgia, serif;
    --font-sans:  'Source Sans 3', 'Segoe UI', sans-serif;

    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 16px;

    --shadow-sm:  0 1px 4px rgba(30,24,16,.08);
    --shadow-md:  0 4px 16px rgba(30,24,16,.11);
    --shadow-lg:  0 8px 32px rgba(30,24,16,.16);
}

/* ── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: var(--font-sans);
    color: var(--ink-800);
    background: var(--parchment);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; }

/* ── Topbar ──────────────────────────────────────────────────────────────── */
.topbar {
    background: var(--ink-800);
    position: sticky; top: 0; z-index: 200;
    box-shadow: 0 2px 12px rgba(30,24,16,.3);
}
.topbar-row1 {
    display: flex; align-items: center; gap: .75rem;
    padding: .7rem 1.25rem;
    min-height: 52px;
}
.topbar-logo {
    font-family: var(--font-serif);
    font-size: .95rem; font-weight: 600;
    color: var(--ochre-light);
    letter-spacing: .2px;
    white-space: nowrap;
    flex-shrink: 0;
    overflow: hidden; text-overflow: ellipsis;
}
.topbar-actions { display: flex; gap: .4rem; flex-shrink: 0; margin-left: auto; align-items: center; }

.topbar-row2 {
    display: flex; align-items: center; gap: .15rem;
    padding: .25rem 1rem .3rem;
    background: rgba(0,0,0,.22);
    border-top: 1px solid rgba(255,255,255,.07);
    overflow-x: auto;
    scrollbar-width: none;
}
.topbar-row2::-webkit-scrollbar { display: none; }

.mod-sep { color: rgba(255,255,255,.18); font-size: .7rem; padding: 0 .2rem; flex-shrink: 0; }

.mod-link {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .25rem .65rem;
    border-radius: var(--r-sm);
    text-decoration: none;
    font-size: .78rem; font-weight: 500;
    color: rgba(255,255,255,.6);
    white-space: nowrap; flex-shrink: 0;
    transition: background .15s, color .15s;
}
.mod-link:hover  { background: rgba(255,255,255,.1); color: var(--ochre-light); }
.mod-link.active { background: var(--clay); color: var(--white); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .55rem 1.1rem;
    border-radius: var(--r-sm); border: none;
    font-family: var(--font-sans); font-size: .88rem; font-weight: 500;
    cursor: pointer; text-decoration: none;
    background: var(--clay); color: var(--white);
    transition: background .15s, transform .1s;
    -webkit-tap-highlight-color: transparent;
}
.btn:hover  { background: var(--clay-dark); }
.btn:active { transform: scale(.97); }

.btn-sm {
    padding: .32rem .75rem;
    font-size: .8rem; border-radius: var(--r-sm);
    border: none; cursor: pointer;
    font-family: var(--font-sans); font-weight: 500;
    display: inline-flex; align-items: center; gap: .3rem;
    text-decoration: none;
    background: var(--clay); color: var(--white);
    transition: background .15s;
    -webkit-tap-highlight-color: transparent;
}
.btn-sm:hover { background: var(--clay-dark); }

.btn-ghost {
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.2);
    color: rgba(255,255,255,.85);
    padding: .28rem .7rem;
    font-size: .78rem; font-weight: 500;
    border-radius: var(--r-sm); cursor: pointer;
    text-decoration: none; font-family: var(--font-sans);
    transition: background .15s;
    -webkit-tap-highlight-color: transparent;
}
.btn-ghost:hover { background: rgba(255,255,255,.2); }

.btn-outline {
    background: transparent; border: 1.5px solid var(--ink-200);
    color: var(--ink-600);
}
.btn-outline:hover { border-color: var(--clay); color: var(--clay); background: var(--clay-50); }

.btn-green  { background: var(--moss); }
.btn-green:hover  { background: #3d6428; }
.btn-muted  { background: var(--ink-400); }
.btn-muted:hover  { background: var(--ink-500); }
.btn-danger { background: #c0392b; }
.btn-danger:hover { background: #9b2820; }

/* ── Layout ──────────────────────────────────────────────────────────────── */
.page {
    max-width: 1260px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem;
}
.page-sm  { max-width: 860px; }
.page-md  { max-width: 1060px; }

/* ── Page Title ──────────────────────────────────────────────────────────── */
.page-title {
    font-family: var(--font-serif);
    font-size: 1.3rem; font-weight: 600;
    color: var(--ink-800);
    margin-bottom: 1.4rem;
    display: flex; align-items: center; gap: .75rem;
}
.page-title::after {
    content: ''; flex: 1; height: 1px;
    background: linear-gradient(to right, var(--ink-200), transparent);
}

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
    background: var(--white);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--ink-100);
    overflow: hidden;
    margin-bottom: 1.1rem;
}
.card-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: .8rem 1.25rem;
    background: var(--ochre-50);
    border-bottom: 1px solid var(--ochre-light);
    flex-wrap: wrap; gap: .5rem;
}
.card-header h3 {
    font-family: var(--font-serif);
    font-size: .93rem; color: var(--ink-700);
}
.card-body  { padding: 1.1rem 1.25rem; }
.card-footer {
    padding: .65rem 1.25rem;
    border-top: 1px solid var(--ink-100);
    background: var(--ink-50);
    display: flex; gap: .5rem; flex-wrap: wrap;
}

/* ── Stats ───────────────────────────────────────────────────────────────── */
.stats-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: .75rem;
    margin-bottom: 1.25rem;
}
.stat-box {
    background: var(--white);
    border-radius: var(--r-md);
    padding: .9rem 1.1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--ink-100);
    text-align: center;
}
.stat-num {
    font-family: var(--font-serif);
    font-size: 1.8rem; font-weight: 600;
    color: var(--clay);
    line-height: 1.1;
}
.stat-lbl { font-size: .72rem; color: var(--ink-500); margin-top: .2rem; }

/* ── Tables ──────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.smart-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.smart-table th {
    background: var(--ochre-50);
    color: var(--ink-600); font-weight: 600;
    padding: .55rem 1rem; text-align: left;
    border-bottom: 2px solid var(--ochre-light);
    white-space: nowrap;
    font-size: .75rem; text-transform: uppercase; letter-spacing: .5px;
}
.smart-table td {
    padding: .55rem 1rem;
    border-bottom: 1px solid var(--ink-100);
    vertical-align: middle;
}
.smart-table tr:last-child td { border-bottom: none; }
.smart-table tr:hover td { background: var(--ochre-50); }
.smart-table tr.hidden-row { display: none; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex; align-items: center;
    padding: .13rem .55rem;
    border-radius: 20px;
    font-size: .72rem; font-weight: 600; white-space: nowrap;
}
.badge-lk    { background: #fff8e6; color: #7a5200; border: 1px solid #f0d890; }
.badge-verw  { background: #f0eeff; color: #4030a0; border: 1px solid #c8bcf0; }
.badge-sl    { background: var(--clay-100); color: var(--clay-dark); border: 1px solid var(--clay-light); }
.badge-ext   { background: var(--moss-50); color: #2d5a1a; border: 1px solid var(--moss-light); }
.badge-kiga  { background: #e8f5e8; color: #2d6a2d; border: 1px solid #a8d0a8; }
.badge-hort  { background: #fef0e0; color: #7a3800; border: 1px solid #f0c890; }
.badge-sonst { background: var(--ink-100); color: var(--ink-600); border: 1px solid var(--ink-200); }
.badge-ok    { background: var(--moss-50); color: #2d5a1a; border: 1px solid var(--moss-light); }
.badge-warn  { background: #fef8e0; color: #7a5a00; border: 1px solid #f0dc90; }
.badge-err   { background: #fdf0ed; color: #8a1c10; border: 1px solid var(--clay-light); }
.badge-g     { background: var(--moss-50); color: #2d5a1a; border: 1px solid var(--moss-light); }
.badge-miss  { background: var(--clay-50); color: var(--clay-dark); border: 1px solid var(--clay-light); }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: .9rem; }
.form-group label {
    display: block;
    font-size: .78rem; font-weight: 600;
    color: var(--ink-600); margin-bottom: .3rem;
    letter-spacing: .2px;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: .6rem .9rem;
    font-size: .9rem; font-family: var(--font-sans);
    border: 1.5px solid var(--ink-200);
    border-radius: var(--r-sm);
    background: var(--white); color: var(--ink-800);
    transition: border-color .15s, box-shadow .15s;
    -webkit-appearance: none; appearance: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--clay);
    box-shadow: 0 0 0 3px rgba(201,104,64,.13);
}
.form-group input[type=checkbox],
.form-group input[type=radio] {
    -webkit-appearance: auto; appearance: auto;
    width: 16px; height: 16px;
    padding: 0; border: none; background: none;
    box-shadow: none; border-radius: 0;
    cursor: pointer; min-height: unset; flex-shrink: 0;
}
.form-row    { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.form-row.c3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row.c4 { grid-template-columns: 2fr 1fr 1fr 1fr; }

/* ── Grid helper ─────────────────────────────────────────────────────────── */
.g4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; }
@media (max-width: 860px) { .g4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .g4 { grid-template-columns: 1fr; } }

/* ── Inline Panel ────────────────────────────────────────────────────────── */
.inline-panel {
    display: none;
    padding: 1.25rem;
    background: var(--ochre-50);
    border-top: 2px solid var(--ochre-light);
    animation: slideDown .18s ease-out;
}
.inline-panel.open { display: block; }
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-5px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Messages ────────────────────────────────────────────────────────────── */
.msg { padding: .75rem 1rem; border-radius: var(--r-md); font-size: .875rem; margin-bottom: .9rem; display: flex; align-items: flex-start; gap: .5rem; }
.msg.ok   { background: var(--moss-50); color: #1e4010; border: 1px solid var(--moss-light); }
.msg.err  { background: var(--clay-50); color: #6b1c10; border: 1px solid var(--clay-light); }
.msg.info { background: var(--ochre-50); color: var(--ink-700); border: 1px solid var(--ochre-light); }
.message.success { background: var(--moss-50); color: #1e4010; border: 1px solid var(--moss-light); padding: .75rem 1rem; border-radius: var(--r-md); font-size: .875rem; margin-bottom: .9rem; }
.message.error   { background: var(--clay-50); color: #6b1c10; border: 1px solid var(--clay-light); padding: .75rem 1rem; border-radius: var(--r-md); font-size: .875rem; margin-bottom: .9rem; }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-bg {
    display: none; position: fixed; inset: 0;
    background: rgba(30,24,16,.55);
    z-index: 500;
    align-items: center; justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(3px);
}
.modal-bg.open { display: flex; }
.modal-box {
    background: var(--white);
    border-radius: var(--r-lg);
    padding: 1.6rem;
    max-width: 540px; width: 100%;
    box-shadow: var(--shadow-lg);
    max-height: 90vh; overflow-y: auto;
    animation: modalIn .2s ease-out;
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(12px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-title, .modal-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 1.1rem; padding-bottom: .8rem;
    border-bottom: 1px solid var(--ink-100);
}
.modal-title h2, .modal-head h2 {
    font-family: var(--font-serif);
    font-size: 1.05rem; color: var(--ink-800); margin: 0;
}
.modal-close {
    background: var(--ink-100); border: none;
    width: 28px; height: 28px; border-radius: 50%;
    cursor: pointer; color: var(--ink-600);
    font-size: .85rem; transition: background .15s;
    display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--ink-200); }

/* ── Info Card ───────────────────────────────────────────────────────────── */
.info-card {
    background: var(--ochre-50);
    border: 1px solid var(--ochre-light);
    border-left: 4px solid var(--clay);
    border-radius: var(--r-md);
    padding: 1.1rem 1.25rem; margin-bottom: 1rem;
}
.info-card h3 { font-family: var(--font-serif); color: var(--clay-dark); margin-bottom: .5rem; font-size: .95rem; }
.info-card code { background: var(--clay-100); padding: .15rem .45rem; border-radius: 4px; font-size: .85rem; word-break: break-all; }

/* ── Progress ────────────────────────────────────────────────────────────── */
.prog-track { height: 7px; background: var(--ink-100); border-radius: 4px; overflow: hidden; }
.prog-fill  { height: 100%; border-radius: 4px; transition: width .4s ease; }

/* ── Action Buttons ──────────────────────────────────────────────────────── */
.act {
    display: inline-flex; align-items: center;
    background: none; border: none; cursor: pointer;
    padding: .22rem .42rem; border-radius: var(--r-sm);
    font-size: .82rem; color: var(--ink-500);
    text-decoration: none; transition: background .15s;
    min-height: 32px;
}
.act:hover     { background: var(--ink-100); }
.act-del       { color: #c0392b; }
.act-del:hover { background: var(--clay-50); }
.act-edit      { color: var(--clay); }
.act-edit:hover { background: var(--clay-50); }

/* ── Typ-Pills ───────────────────────────────────────────────────────────── */
.typ-pills { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: .9rem; }
.typ-pill {
    padding: .2rem .75rem; border-radius: 20px;
    background: var(--ink-100); color: var(--ink-600);
    font-size: .76rem; font-weight: 600;
    cursor: pointer; transition: all .15s;
    border: 1.5px solid transparent; user-select: none;
    -webkit-tap-highlight-color: transparent;
    min-height: 30px; display: inline-flex; align-items: center;
}
.typ-pill:hover  { border-color: var(--clay-light); color: var(--clay); }
.typ-pill.active { background: var(--clay); color: var(--white); border-color: var(--clay); }

/* ── Search in Topbar ────────────────────────────────────────────────────── */
.search-box {
    display: flex; align-items: center; gap: .35rem;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.18);
    border-radius: var(--r-sm);
    padding: .28rem .7rem;
}
.search-box input {
    border: none; background: transparent; outline: none;
    font-size: .82rem; color: var(--white); width: 140px;
    font-family: var(--font-sans);
}
.search-box input::placeholder { color: rgba(255,255,255,.45); }

/* ── Bulk Bar ────────────────────────────────────────────────────────────── */
.bulk-bar {
    display: flex; align-items: center; gap: .65rem;
    padding: .6rem 1.25rem;
    background: var(--ochre-50);
    border-top: 1px solid var(--ochre-light);
    flex-wrap: wrap;
}

/* ── Divider ─────────────────────────────────────────────────────────────── */
.divider {
    display: flex; align-items: center; gap: .65rem;
    font-size: .7rem; font-weight: 700;
    letter-spacing: 1.4px; text-transform: uppercase;
    color: var(--ink-400); margin: 1.4rem 0 .8rem;
}
.divider::before,
.divider::after { content: ''; flex: 1; height: 1px; background: var(--ink-200); }

/* ── Footer ──────────────────────────────────────────────────────────────── */
footer {
    text-align: center; padding: 1.5rem;
    color: var(--ink-400); font-size: .75rem;
    border-top: 1px solid var(--ink-100); margin-top: 2rem;
}

/* ── Responsive Base ─────────────────────────────────────────────────────── */
@media (max-width: 860px) {
    .form-row.c4 { grid-template-columns: 1fr 1fr; }
    .form-row.c3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
    .form-row, .form-row.c3, .form-row.c4 { grid-template-columns: 1fr; }
    .page       { padding: 1rem .85rem; }
    .card-body  { padding: .85rem 1rem; }
    .card-header { padding: .7rem 1rem; }
    .stats-strip { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
    .stat-num   { font-size: 1.5rem; }
    .smart-table { font-size: .8rem; }
    .smart-table th, .smart-table td { padding: .5rem .75rem; }
    .topbar-row1 { padding: .6rem .85rem; min-height: 48px; }
    .topbar-logo { font-size: .85rem; }
    .topbar-row2 { padding: .22rem .6rem .26rem; gap: .1rem; }
    .mod-link    { font-size: .73rem; padding: .2rem .5rem; }
    .modal-box  { padding: 1.1rem; }
    .page-title { font-size: 1.1rem; }
    .btn-block-mobile { width: 100%; justify-content: center; }
}

/* ── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--ink-50); }
::-webkit-scrollbar-thumb { background: var(--ink-300); border-radius: 3px; }

/* ── Print ───────────────────────────────────────────────────────────────── */
@media print {
    .topbar, .btn, .btn-sm, .act, .search-box,
    .bulk-bar, .typ-pills, .inline-panel, footer { display: none !important; }
    .page   { padding: 0; max-width: 100%; }
    .card   { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
    body    { background: white; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Legacy-Aliases
   ═══════════════════════════════════════════════════════════════════════════ */
.topbar-right { display: flex; gap: .5rem; align-items: center; flex-shrink: 0; margin-left: auto; }

.container    { max-width: 1260px; margin: 0 auto; padding: 1.5rem 1.25rem; }
.content-section { max-width: 1260px; margin: 0 auto; padding: 1.5rem 1.25rem; }

.overview-section {
    background: var(--white); border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm); border: 1px solid var(--ink-100);
    padding: 1.25rem; margin-bottom: 1.1rem;
}
.overview-section h3 {
    font-family: var(--font-serif); font-size: 1rem; color: var(--ink-700);
    margin-bottom: 1rem; padding-bottom: .5rem; border-bottom: 1px solid var(--ink-100);
}

.data-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.data-table th {
    background: var(--ochre-50); color: var(--ink-600); font-weight: 600;
    padding: .55rem 1rem; text-align: left; border-bottom: 2px solid var(--ochre-light);
    white-space: nowrap; font-size: .75rem; text-transform: uppercase; letter-spacing: .5px;
}
.data-table td { padding: .55rem 1rem; border-bottom: 1px solid var(--ink-100); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--ochre-50); }
.data-table .total-row td { border-top: 2px solid var(--ochre-light); font-weight: 700; background: var(--ochre-50); }

.btn-small, .btn.btn-small {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .28rem .65rem; border-radius: var(--r-sm); border: none;
    font-family: var(--font-sans); font-size: .78rem; font-weight: 500;
    cursor: pointer; text-decoration: none;
    background: var(--clay); color: var(--white);
    transition: background .15s; white-space: nowrap;
}
.btn-small:hover { background: var(--clay-dark); }
.btn-small.btn-danger, .btn.btn-danger { background: #c0392b; }
.btn-small.btn-danger:hover, .btn.btn-danger:hover { background: #9b2820; }
.btn-small.btn-secondary { background: var(--ink-400); }
.btn-small.btn-secondary:hover { background: var(--ink-500); }

.input-group { display: flex; gap: .5rem; align-items: flex-end; flex-wrap: wrap; }

.kpi { background: var(--white); border: 1px solid var(--ink-100); border-radius: var(--r-md); padding: 1rem 1.1rem; box-shadow: var(--shadow-sm); text-align: center; }
.kpi .num { font-family: var(--font-serif); font-size: 1.8rem; font-weight: 700; color: var(--clay); line-height: 1.1; }
.kpi .lbl { font-size: .72rem; color: var(--ink-500); margin-top: .2rem; }
.kpi .sub { font-size: .75rem; color: var(--ink-400); }

.stat-card { background: var(--white); border-radius: var(--r-md); padding: .9rem 1.1rem; box-shadow: var(--shadow-sm); border: 1px solid var(--ink-100); }

.section-card { background: var(--white); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); border: 1px solid var(--ink-100); margin-bottom: 1.1rem; overflow: hidden; }
.sc-header { display: flex; align-items: center; justify-content: space-between; padding: .8rem 1.25rem; background: var(--ochre-50); border-bottom: 1px solid var(--ochre-light); flex-wrap: wrap; gap: .5rem; }
.section-h { font-family: var(--font-serif); font-size: .93rem; color: var(--ink-700); }
.section-title { font-size: .72rem; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--clay); margin-bottom: 1rem; display: flex; align-items: center; gap: .5rem; }
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--ink-200); }

.export-card { background: var(--white); border: 1px solid var(--ink-100); border-radius: var(--r-md); padding: 1rem 1.25rem; box-shadow: var(--shadow-sm); }
.toggle-label { display: flex; align-items: center; gap: .5rem; cursor: pointer; font-size: .88rem; color: var(--ink-700); }
.ctrl-group { display: flex; flex-direction: column; gap: .35rem; margin-bottom: .9rem; }
.ctrl-group-title { font-size: .72rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-400); margin-bottom: .3rem; }

.step { background: var(--ochre-50); border: 1px solid var(--ochre-light); border-left: 4px solid var(--clay); border-radius: var(--r-md); padding: 1rem 1.25rem; margin-bottom: 1rem; }
.step h3 { color: var(--clay-dark); font-family: var(--font-serif); margin-bottom: .5rem; font-size: .95rem; }
.step ul { padding-left: 1.25rem; }
.step li { font-size: .88rem; color: var(--ink-700); margin-bottom: .25rem; }

.info-box { background: var(--ochre-50); border: 1px solid var(--ochre-light); border-left: 4px solid var(--ochre); border-radius: var(--r-md); padding: .75rem 1rem; font-size: .88rem; color: var(--ink-700); margin-bottom: 1rem; }
.badge-kat { background: var(--ochre-50); color: var(--ochre); border: 1px solid var(--ochre-light); }

/* Topbar unified dark */
.topbar { background: var(--ink-800) !important; border-bottom: none !important; box-shadow: 0 2px 12px rgba(30,24,16,.3) !important; }
.topbar h1, .topbar-row1 h1 { margin: 0 !important; font-size: 1rem !important; font-family: var(--font-serif) !important; font-weight: 600 !important; color: var(--ochre-light) !important; white-space: nowrap; }
.topbar-row2 { background: rgba(0,0,0,.22) !important; border-top: 1px solid rgba(255,255,255,.07) !important; }
.mod-link { color: rgba(255,255,255,.6) !important; }
.mod-link:hover { background: rgba(255,255,255,.1) !important; color: var(--ochre-light) !important; }
.mod-link.active { background: var(--clay) !important; color: var(--white) !important; }
.mod-sep { color: rgba(255,255,255,.18) !important; font-size: .7rem; padding: 0 .1rem; flex-shrink: 0; }

.topbar-logo { display: inline-flex; align-items: center; gap: .4rem; font-family: var(--font-serif); font-size: .88rem; font-weight: 600; color: var(--ochre-light); text-decoration: none !important; flex-shrink: 0; white-space: nowrap; }
.topbar-logo:hover { color: var(--white); }
.topbar-logo-text { display: inline; }
.topbar-pagetitle { font-family: var(--font-sans); font-size: 1rem; font-weight: 600; color: var(--white); opacity: .9; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-left: .5rem; max-width: 240px; }

.col-toggle button.active { background: var(--clay) !important; border-color: var(--clay) !important; color: var(--white) !important; }
.stat-num { color: var(--clay) !important; }
.stat-box { background: var(--white) !important; border-radius: var(--r-md) !important; box-shadow: var(--shadow-sm) !important; }

.btn-nav { display: inline-flex; align-items: center; gap: .35rem; padding: .28rem .75rem; border-radius: var(--r-sm); font-size: .8rem; font-weight: 500; font-family: var(--font-sans); text-decoration: none; cursor: pointer; border: none; background: rgba(255,255,255,.12); color: rgba(255,255,255,.85); transition: background .15s; white-space: nowrap; }
.btn-nav:hover { background: rgba(255,255,255,.2); }
.btn-nav-primary { background: var(--clay); color: var(--white); }
.btn-nav-primary:hover { background: var(--clay-dark); }

@media (max-width: 640px) { .topbar-logo-text { display: none; } .topbar-pagetitle { font-size: .88rem; } }

/* FWS Schulverwaltung – Style Additions v3.1
   Diese Datei ans Ende von css/style.css anfügen
   oder separat als <link rel='stylesheet' href='css/style_additions.css'> einbinden
   ────────────────────────────────────────────────────────────── */

/* ═══════════════════════════════════════════════════════════════════════════
   FWS Überlingen – Layout-Optimierung v3.1
   Größere Schrift · Konsistente Suche · Mobile-First
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Schriftgrößen Desktop: alles etwas größer ───────────────────────────── */
html { font-size: 18px; }

body { font-size: 1rem; line-height: 1.65; }

/* Tabellen lesbarer */
.smart-table      { font-size: .97rem; }
.smart-table th   { font-size: .79rem; padding: .65rem 1.05rem; }
.smart-table td   { padding: .65rem 1.05rem; }
.data-table       { font-size: .97rem; }
.data-table th    { font-size: .76rem; }
.data-table td    { padding: .6rem 1rem; }

/* Cards */
.card-header h3   { font-size: 1.05rem; }
.card-body        { padding: 1.25rem 1.4rem; }

/* Stat-Zahlen */
.stat-num, .stat-box .num { font-size: 2.1rem; }
.stat-lbl, .stat-box .lbl, .stat-box .sub { font-size: .78rem; }

/* Buttons */
.btn     { font-size: .96rem; padding: .6rem 1.2rem; }
.btn-sm  { font-size: .83rem; }
.btn-small { font-size: .82rem; padding: .3rem .7rem; }

/* Formulare */
.form-group label    { font-size: .86rem; }
.form-group input,
.form-group select,
.form-group textarea { font-size: .97rem; padding: .65rem .95rem; }

/* Filter-Bar Labels */
.filter-bar label    { font-size: .86rem; }
.filter-bar input,
.filter-bar select   { font-size: .88rem; padding: .44rem .75rem; }

/* Badges */
.badge { font-size: .74rem; padding: .15rem .6rem; }

/* ── Topbar: Suchfeld konsistent überall ─────────────────────────────────── */
.topbar-search {
    display: flex;
    align-items: center;
    gap: .35rem;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: var(--r-sm);
    padding: .3rem .75rem;
    flex: 1;
    max-width: 280px;
    min-width: 160px;
    transition: background .15s, border-color .15s;
}
.topbar-search:focus-within {
    background: rgba(255,255,255,.18);
    border-color: rgba(255,255,255,.4);
}
.topbar-search-icon { font-size: .85rem; opacity: .55; flex-shrink: 0; }
.topbar-search input {
    border: none; background: transparent; outline: none;
    font-size: .86rem; color: var(--white); width: 100%;
    font-family: var(--font-sans);
}
.topbar-search input::placeholder { color: rgba(255,255,255,.45); }

/* ── Mobile: Topbar kompakter ────────────────────────────────────────────── */
@media (max-width: 640px) {
    html { font-size: 16px; }

    .topbar-row1 { padding: .55rem .85rem; gap: .5rem; min-height: 50px; }
    .topbar-logo-text { display: none; }
    .topbar-pagetitle { font-size: .9rem; }

    /* Suchfeld auf Mobile: volle Breite in eigener Zeile */
    .topbar-search {
        max-width: 100%;
        min-width: 0;
    }

    /* Row2 scrollbar */
    .topbar-row2 { gap: .05rem; }
    .mod-link    { font-size: .76rem; padding: .22rem .52rem; }

    /* Tabellen auf Mobile: horizontal scrollbar */
    .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* Smart-table auf Mobile: kleinere Schrift */
    .smart-table    { font-size: .82rem; }
    .smart-table th { font-size: .7rem; padding: .5rem .7rem; }
    .smart-table td { padding: .5rem .7rem; }

    /* Stats 2-spaltig */
    .stats-strip { grid-template-columns: repeat(2, 1fr); }
    .stat-num    { font-size: 1.6rem; }

    /* Cards */
    .card-body    { padding: .85rem 1rem; }
    .card-header  { padding: .7rem 1rem; }
    .card-header h3 { font-size: .92rem; }

    /* Buttons */
    .btn { font-size: .88rem; }

    /* Page */
    .page { padding: .85rem .75rem; }

    /* Modals */
    .modal-box { padding: 1.1rem; border-radius: var(--r-md); }

    /* Filter-Bar vertikal */
    .filter-bar { flex-direction: column; align-items: stretch; gap: .5rem; }
    .filter-bar label { width: 100%; }
    .filter-bar input,
    .filter-bar select { width: 100%; }
}

/* ── Tablet (640–860px) ──────────────────────────────────────────────────── */
@media (min-width: 641px) and (max-width: 860px) {
    html { font-size: 16px;     .topbar-pagetitle { max-width: 160px; font-size: .88rem; }
}
    .stats-strip { grid-template-columns: repeat(3, 1fr); }
    .smart-table { font-size: .88rem; }
    .topbar-search { max-width: 180px; min-width: 120px; }
}

/* ── Footer: ingtools konsistent überall ─────────────────────────────────── */
.site-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    flex-wrap: wrap;
    text-align: center;
    padding: 1.25rem 1.5rem;
    margin-top: 2rem;
    border-top: 1px solid var(--ink-100);
    font-size: .78rem;
    color: var(--ink-400);
    background: var(--parchment);
}
.site-footer-brand   { font-weight: 600; color: var(--ink-500); }
.site-footer-sep     { color: var(--ink-200); }
.site-footer-ingtools { color: var(--ink-400); }
.site-footer-ingtools strong { color: var(--ink-600); }
.site-footer a { color: var(--clay); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* Override: alte <footer> ohne .site-footer Klasse auch stylen */
footer:not(.site-footer) {
    text-align: center;
    padding: 1.25rem 1.5rem;
    color: var(--ink-400);
    font-size: .78rem;
    border-top: 1px solid var(--ink-100);
    margin-top: 2rem;
    background: var(--parchment);
}

/* ── Modal: größer auf Desktop ───────────────────────────────────────────── */
@media (min-width: 641px) {
    .modal-box { padding: 1.85rem 2rem; }
    .modal-head h2 { font-size: 1.1rem; }
}

/* ── Topbar-Row1: Suchfeld zwischen Logo und Actions ─────────────────────── */
.topbar-row1 {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .7rem 1.25rem;
    min-height: 52px;
}
/* Logo nimmt nicht mehr flex:1, damit Suche zentriert bleibt */
.topbar-logo { flex: 0 0 auto; }

/* ── Typ-Filter auf Mobile: wrap statt scroll ────────────────────────────── */
@media (max-width: 640px) {
    .typ-pills { gap: .3rem; }
    .typ-pill  { font-size: .74rem; padding: .2rem .6rem; min-height: 28px; }
}

/* ── Kein overflow-hidden auf smart-table-Container auf Mobile ───────────── */
.card { overflow: visible; }
.card .table-wrap { overflow-x: auto; }

/* ── Topbar Overflow Fix ──────────────────────────────────────────────────── */
.topbar-row1 > * { min-width: 0; }
.topbar-row1 { flex-wrap: nowrap; overflow: hidden; }
.topbar-logo { flex: 0 0 auto !important; }
.topbar-actions { flex: 0 0 auto !important; margin-left: auto; gap: .35rem; }
.topbar-search { flex: 1 1 auto; max-width: 240px; min-width: 100px; }
@media (max-width: 860px) {
    .topbar-search { max-width: 160px; min-width: 90px; }
}
@media (max-width: 640px) {
    .topbar-search { max-width: 130px; min-width: 80px; }
    .topbar-search input { font-size: .78rem; }
    .btn-ghost { padding: .22rem .45rem; font-size: .72rem; }
}
