@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
    --rot: #9B1B2A;
    --rot-dunkel: #7a1421;
    --rot-hell: #c4233b;
    --rot-bg: #fdf2f3;
    --grau: #8A8A8A;
    --grau-hell: #e8e8e8;
    --grau-dunkel: #444;
    --weiss: #FFFFFF;
    --text: #1a1a1a;
    --text-soft: #555;
    --border: #d0d0d0;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --radius: 8px;
    --radius-lg: 14px;
    --gruen: #1a7a3c;
    --gruen-bg: #e8f5ed;
    --orange: #c45a00;
    --orange-bg: #fdf0e3;
    --blau: #1a4f8a;
    --blau-bg: #e8f0f8;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'IBM Plex Sans', sans-serif;
    background: #f5f5f5;
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

/* ─── TOPBAR ─────────────────────────────────────────── */
.topbar {
    background: var(--rot);
    color: var(--weiss);
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(155,27,42,0.35);
}

.topbar-logo {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-logo span.accent {
    background: rgba(255,255,255,0.18);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    font-weight: 500;
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.topbar-nav a, .topbar-nav button {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    border: none;
    background: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.topbar-nav a:hover, .topbar-nav button:hover,
.topbar-nav a.aktiv {
    background: rgba(255,255,255,0.18);
    color: var(--weiss);
}

/* ─── LAYOUT ─────────────────────────────────────────── */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 24px;
}

.container-sm {
    max-width: 560px;
    margin: 0 auto;
    padding: 40px 24px;
}

/* ─── CARDS ──────────────────────────────────────────── */
.card {
    background: var(--weiss);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 28px;
    margin-bottom: 20px;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--grau-dunkel);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.75rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title::before {
    content: '';
    display: block;
    width: 3px;
    height: 14px;
    background: var(--rot);
    border-radius: 2px;
}

/* ─── BUTTONS ────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius);
    border: none;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    line-height: 1;
}

.btn-primary {
    background: var(--rot);
    color: var(--weiss);
}
.btn-primary:hover { background: var(--rot-dunkel); }

.btn-gruen {
    background: var(--gruen);
    color: var(--weiss);
    font-size: 1.1rem;
    padding: 16px 32px;
}
.btn-gruen:hover { background: #155f30; }

.btn-rot {
    background: var(--rot);
    color: var(--weiss);
    font-size: 1.1rem;
    padding: 16px 32px;
}
.btn-rot:hover { background: var(--rot-dunkel); }

.btn-secondary {
    background: var(--grau-hell);
    color: var(--grau-dunkel);
}
.btn-secondary:hover { background: #d8d8d8; }

.btn-danger {
    background: #fce8ea;
    color: var(--rot);
}
.btn-danger:hover { background: #f8d0d3; }

.btn-sm {
    padding: 5px 12px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
    border-radius: 10px;
}

/* ─── FORMS ──────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--grau-dunkel);
    margin-bottom: 5px;
}

.form-control {
    width: 100%;
    padding: 9px 13px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.925rem;
    color: var(--text);
    background: var(--weiss);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
    outline: none;
    border-color: var(--rot);
    box-shadow: 0 0 0 3px rgba(155,27,42,0.1);
}

/* ─── TABELLEN ───────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

thead th {
    background: #f8f8f8;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--grau);
    padding: 10px 14px;
    text-align: left;
    border-bottom: 2px solid var(--grau-hell);
}

tbody td {
    padding: 11px 14px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

tbody tr:hover { background: #fafafa; }
tbody tr:last-child td { border-bottom: none; }

/* ─── BADGES ─────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-aktiv { background: var(--gruen-bg); color: var(--gruen); }
.badge-inaktiv { background: var(--grau-hell); color: var(--grau); }
.badge-krank { background: var(--orange-bg); color: var(--orange); }
.badge-kindkrank { background: var(--blau-bg); color: var(--blau); }
.badge-arbeit { background: var(--gruen-bg); color: var(--gruen); }
.badge-offen { background: #fff3cd; color: #856404; }

/* ─── ALERTS ─────────────────────────────────────────── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.9rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert-fehler { background: #fce8ea; color: var(--rot-dunkel); border-left: 3px solid var(--rot); }
.alert-erfolg { background: var(--gruen-bg); color: var(--gruen); border-left: 3px solid var(--gruen); }
.alert-info { background: var(--blau-bg); color: var(--blau); border-left: 3px solid var(--blau); }

/* ─── GRID ───────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

/* ─── STAT CARDS ─────────────────────────────────────── */
.stat-card {
    background: var(--weiss);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    border-top: 3px solid var(--rot);
}

.stat-card .stat-val {
    font-size: 2rem;
    font-weight: 700;
    font-family: 'IBM Plex Mono', monospace;
    color: var(--rot);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--grau);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ─── STEMPEL-BEREICH ────────────────────────────────── */
.stempel-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 32px;
}

.stempel-btn {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    transition: transform 0.15s, box-shadow 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.18);
}

.stempel-btn:hover {
    transform: scale(1.04);
    box-shadow: 0 10px 32px rgba(0,0,0,0.24);
}

.stempel-btn:active { transform: scale(0.97); }

.stempel-btn.start {
    background: linear-gradient(145deg, #22a454, #1a7a3c);
    color: white;
}

.stempel-btn.stop {
    background: linear-gradient(145deg, var(--rot-hell), var(--rot-dunkel));
    color: white;
}

.stempel-btn .icon { font-size: 2.5rem; }

/* ─── MONATSSTUNDEN-ÜBERSICHT ────────────────────────── */
.monat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.monat-row:last-child { border-bottom: none; }

.monat-row .est-name { font-weight: 500; }
.monat-row .stunden {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1rem;
    color: var(--rot);
    font-weight: 600;
}

/* ─── PAGE HEADER ────────────────────────────────────── */
.page-header {
    margin-bottom: 28px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

.page-header .page-sub {
    font-size: 0.9rem;
    color: var(--grau);
    margin-top: 2px;
}

/* ─── LOGIN ──────────────────────────────────────────── */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a0508 0%, #3d0c12 50%, #9B1B2A 100%);
    padding: 24px;
}

.login-card {
    background: var(--weiss);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--rot);
    letter-spacing: -0.02em;
}

.login-logo .sub {
    font-size: 0.85rem;
    color: var(--grau);
    margin-top: 4px;
}

/* ─── SIDEBAR LAYOUT ─────────────────────────────────── */
.admin-layout {
    display: flex;
    min-height: calc(100vh - 56px);
}

.sidebar {
    width: 220px;
    flex-shrink: 0;
    background: var(--weiss);
    border-right: 1px solid var(--grau-hell);
    padding: 20px 0;
    position: sticky;
    top: 56px;
    height: calc(100vh - 56px);
    overflow-y: auto;
}

.sidebar-section {
    padding: 6px 0;
    margin-bottom: 8px;
}

.sidebar-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--grau);
    padding: 0 18px;
    margin-bottom: 4px;
}

.sidebar a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 18px;
    font-size: 0.9rem;
    color: var(--grau-dunkel);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.12s;
}

.sidebar a:hover {
    background: var(--rot-bg);
    color: var(--rot);
}

.sidebar a.aktiv {
    background: var(--rot-bg);
    color: var(--rot);
    border-left-color: var(--rot);
    font-weight: 600;
}

.sidebar a .ico { font-size: 1.05rem; }

.main-content {
    flex: 1;
    padding: 32px;
    overflow-x: hidden;
}

/* ─── PRINT ──────────────────────────────────────────── */
@media print {
    .topbar, .sidebar, .btn, .no-print { display: none !important; }
    body { background: white; }
    .card { box-shadow: none; border: 1px solid #ddd; }
}

/* ─── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 768px) {
    .admin-layout { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: static; border-right: none; border-bottom: 1px solid var(--grau-hell); display: flex; flex-wrap: wrap; padding: 8px; }
    .sidebar a { padding: 8px 12px; border-left: none; border-bottom: 2px solid transparent; }
    .sidebar a.aktiv { border-left: none; border-bottom-color: var(--rot); }
    .sidebar-section { margin-bottom: 0; }
    .sidebar-label { display: none; }
    .main-content { padding: 20px 16px; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .container { padding: 20px 16px; }
    .stempel-btn { width: 150px; height: 150px; }
}

/* ─── UTILITY ────────────────────────────────────────── */
.text-rot { color: var(--rot); }
.text-gruen { color: var(--gruen); }
.text-grau { color: var(--grau); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-mono { font-family: 'IBM Plex Mono', monospace; }
.fw-600 { font-weight: 600; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.w-100 { width: 100%; }
