/* ============================================================
   Wyländer Ranglisten-System – Stylesheet
   ============================================================ */

:root {
    --primary:    #1a3a5c;
    --primary-lt: #2563a8;
    --accent:     #e8a020;
    --success:    #2e7d32;
    --danger:     #c62828;
    --bg:         #f4f6f8;
    --white:      #ffffff;
    --border:     #d0d7e0;
    --text:       #1a1a2e;
    --text-muted: #6b7a8d;
    --shadow:     0 2px 8px rgba(0,0,0,0.10);
    --radius:     8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
}

/* ---- Header ---- */
.header {
    background: var(--primary);
    color: var(--white);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header h1 { font-size: 1.1rem; font-weight: 600; letter-spacing: 0.02em; }
.header .sub { font-size: 0.8rem; opacity: 0.7; }
.header .nav { display: flex; gap: 4px; }
.header .nav a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 0.88rem;
    transition: background 0.15s;
}
.header .nav a:hover, .header .nav a.aktiv {
    background: rgba(255,255,255,0.15);
    color: var(--white);
}

/* ---- Layout ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 24px 16px; }
.page-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ---- Cards ---- */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 24px;
    margin-bottom: 20px;
}
.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ---- Tabellen ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
thead th {
    background: var(--primary);
    color: var(--white);
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}
thead th.num { text-align: right; }
tbody tr { border-bottom: 1px solid var(--border); }
tbody tr:hover { background: #f0f4f8; }
tbody td { padding: 9px 12px; }
tbody td.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody td.rang { text-align: center; font-weight: 700; }

/* Rang-Badges */
.rang-1 { color: #b8860b; font-size: 1.1em; }
.rang-2 { color: #6b6b6b; }
.rang-3 { color: #8b4513; }

/* Note-Farben */
.note-top    { color: var(--success); font-weight: 700; }
.note-mittel { color: var(--primary-lt); }
.note-gering { color: var(--text-muted); }

/* ---- Formulare ---- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.form-group input,
.form-group select,
.form-group textarea {
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border-color 0.15s;
    background: var(--white);
    color: var(--text);
}
.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-lt);
    box-shadow: 0 0 0 3px rgba(37,99,168,0.12);
}
.form-group input.eingabe-gross {
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    padding: 14px;
    border: 2px solid var(--primary-lt);
}
.form-group .note-preview {
    font-size: 1rem;
    font-weight: 700;
    color: var(--success);
    min-height: 1.5em;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}
.btn-primary   { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-lt); }
.btn-accent    { background: var(--accent); color: var(--white); }
.btn-accent:hover { background: #c8880e; }
.btn-success   { background: var(--success); color: var(--white); }
.btn-success:hover { background: #1b5e20; }
.btn-danger    { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #8b0000; }
.btn-outline   { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: var(--white); }
.btn-sm { padding: 5px 12px; font-size: 0.83rem; }
.btn-lg { padding: 13px 28px; font-size: 1rem; }

/* ---- Kategorie-Tabs ---- */
.kat-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.kat-tab {
    padding: 7px 18px;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    background: var(--white);
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.15s;
}
.kat-tab:hover, .kat-tab.aktiv {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* ---- Status-Badges ---- */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}
.badge-green  { background: #e8f5e9; color: var(--success); }
.badge-orange { background: #fff3e0; color: #e65100; }
.badge-grey   { background: #eceff1; color: #546e7a; }

/* ---- Eingabe-Seite spezifisch ---- */
.eingabe-header {
    background: var(--primary);
    color: var(--white);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.eingabe-header .info { font-size: 0.9rem; opacity: 0.85; }
.eingabe-header .startnr { font-size: 1.8rem; font-weight: 800; }

.disz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
    margin: 16px 0;
}
.disz-card {
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
}
.disz-card.erfasst { border-color: var(--success); background: #f1f8f1; }
.disz-card .disz-name { font-size: 0.82rem; font-weight: 700; color: var(--text-muted); margin-bottom: 6px; }
.disz-card input {
    width: 100%;
    padding: 8px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    border: 1.5px solid var(--border);
    border-radius: 5px;
}
.disz-card .note-anzeige {
    text-align: center;
    font-size: 0.85rem;
    margin-top: 5px;
    font-weight: 600;
    color: var(--success);
    min-height: 1.2em;
}

/* ---- Ranglisten-Seite ---- */
.rangliste-kopf {
    text-align: center;
    padding: 16px;
    background: var(--primary);
    color: var(--white);
    border-radius: var(--radius);
    margin-bottom: 20px;
}
.rangliste-kopf h2 { font-size: 1.5rem; }
.rangliste-kopf p { opacity: 0.8; font-size: 0.9rem; }
.refresh-info {
    text-align: right;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}
#countdown { font-weight: 700; color: var(--primary-lt); }

/* ---- Fortschritts-Balken ---- */
.progress-wrap { background: var(--border); border-radius: 4px; height: 6px; margin-top: 4px; }
.progress-bar { background: var(--accent); height: 100%; border-radius: 4px; transition: width 0.3s; }

/* ---- Alerts ---- */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}
.alert-success { background: #e8f5e9; color: var(--success); border-left: 4px solid var(--success); }
.alert-error   { background: #ffebee; color: var(--danger); border-left: 4px solid var(--danger); }
.alert-info    { background: #e3f2fd; color: #1565c0; border-left: 4px solid #1565c0; }
.alert-warning { background: #fff8e1; color: #e65100; border-left: 4px solid #e65100; }

/* ---- Statistik-Boxen ---- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-box {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
    box-shadow: var(--shadow);
}
.stat-box .zahl { font-size: 2rem; font-weight: 800; color: var(--primary); }
.stat-box .bez  { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; margin-top: 4px; }

/* ---- Druck ---- */
@media print {
    .header, .no-print, .kat-tabs, .btn { display: none !important; }
    body { background: white; font-size: 11pt; }
    .card { box-shadow: none; padding: 0; margin: 0; }
    table { font-size: 10pt; }
    thead th { background: #333 !important; -webkit-print-color-adjust: exact; }
    .rangliste-kopf { background: #333 !important; -webkit-print-color-adjust: exact; }
}

/* ---- Responsive ---- */
@media (max-width: 700px) {
    .header { padding: 0 12px; }
    .header .nav { display: none; }
    .container { padding: 12px 8px; }
    .form-grid { grid-template-columns: 1fr 1fr; }
    .disz-grid { grid-template-columns: 1fr 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}
