/* === Minijob SaaS — Design basierend auf bestehender App === */
:root {
    --primary: #2563EB;
    --primary-dark: #1E40AF;
    --accent: #3B82F6;
    --bg: #EAF5FF;
    --bg-card: #ffffff;
    --text: #0B1E40;
    --text-light: #64748B;
    --border: #CBD5E1;
    --success: #16A34A;
    --warning: #F59E0B;
    --danger: #DC2626;
    --nav-bg: #0B1E40;
    --radius: 8px;
}

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

body {
    font-family: Roboto, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    line-height: 1.5;
}

/* === Navigation === */
.nav-bar {
    background: var(--nav-bg);
    color: #EAF5FF;
    position: sticky;
    top: 0;
    z-index: 1000;
}
.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    height: 56px;
}
.nav-brand {
    color: var(--accent);
    text-decoration: none;
    font-size: 18px;
    font-weight: 700;
    margin-right: auto;
}
.nav-links {
    display: flex;
    gap: 4px;
}
.nav-link {
    color: #CBD5E1;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: var(--radius);
    font-size: 14px;
    transition: background 0.2s, color 0.2s;
}
.nav-link:hover { background: rgba(255,255,255,0.1); color: #fff; }
.nav-link-logout { color: #F87171; }
.nav-toggle { display: none; background: none; border: none; color: #fff; font-size: 24px; cursor: pointer; }

@media (max-width: 768px) {
    .nav-toggle { display: block; }
    .nav-links {
        display: none;
        position: absolute; top: 56px; left: 0; right: 0;
        background: var(--nav-bg);
        flex-direction: column;
        padding: 8px 16px;
    }
    .nav-links.nav-open { display: flex; }
}

/* === Main Content === */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px;
}

/* === Cards === */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    padding: 24px;
    margin-bottom: 16px;
}
.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}

/* === KPI Grid === */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.kpi-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    padding: 20px;
    text-align: center;
}
.kpi-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}
.kpi-label {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 4px;
}

/* === Tables === */
.table-wrap { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
th {
    text-align: left;
    padding: 10px 12px;
    background: #F1F5F9;
    color: var(--text);
    font-weight: 600;
    border-bottom: 2px solid var(--border);
}
td {
    padding: 10px 12px;
    border-bottom: 1px solid #E2E8F0;
}
tr:hover td { background: #F8FAFC; }

/* === Forms === */
.form-group {
    margin-bottom: 16px;
}
.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text);
}
.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 16px;
    font-family: inherit;
    color: var(--text);
    background: #fff;
    transition: border-color 0.2s;
}
.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
select.form-input { appearance: auto; }

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: background 0.2s, opacity 0.2s;
    text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* === Badges === */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}
.badge-admin { background: #DBEAFE; color: #1E40AF; }
.badge-worker { background: #E0E7FF; color: #3730A3; }
.badge-active { background: #DCFCE7; color: #166534; }
.badge-inactive { background: #FEE2E2; color: #991B1B; }
.badge-warning { background: #FEF3C7; color: #92400E; }

/* === Alerts === */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 14px;
}
.alert-info { background: #DBEAFE; color: #1E40AF; }
.alert-success { background: #DCFCE7; color: #166534; }
.alert-error { background: #FEE2E2; color: #991B1B; }
.alert-warning { background: #FEF3C7; color: #92400E; }

/* === Auth Pages === */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0B1E40 0%, #1E3A5F 50%, #2563EB 100%);
}
.auth-card {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.auth-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}
.auth-subtitle {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 24px;
}

/* === Modal === */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    margin: 16px;
}
.modal-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
}
.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 16px;
}

/* === Progress Ring (Monatsfortschritt) === */
.progress-kpi-shell {
    position: relative;
    width: 100%;
    max-width: 300px;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
}
.progress-kpi-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
    pointer-events: none;
    transform: rotate(-90deg);
}
.progress-kpi-circle-bg,
.progress-kpi-circle-progress {
    fill: none;
    transform-origin: 50% 50%;
}
.progress-kpi-circle-bg {
    stroke: #CBD5E1;
    stroke-width: 30;
}
.progress-kpi-circle-progress {
    stroke: #57b0ff;
    stroke-width: 30;
    stroke-linecap: round;
    transition: stroke-dasharray 0.4s ease, stroke 0.4s ease;
}
.progress-kpi-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 64px;
}
.progress-kpi-label {
    font-size: 0.92rem;
    font-weight: 800;
    opacity: 0.7;
    margin-bottom: 6px;
}
.progress-kpi-hours {
    font-size: clamp(1.8rem, 6vw, 2.8rem);
    font-weight: 900;
    line-height: 1;
    color: var(--text);
}
.progress-kpi-eur {
    margin-top: 6px;
    font-size: clamp(1rem, 3.6vw, 1.25rem);
    font-weight: 800;
    color: var(--primary);
}
.progress-kpi-max {
    margin-top: 12px;
    font-size: 0.9rem;
    color: var(--text-light);
}

/* === Utilities === */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-light); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.hidden { display: none !important; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }

/* === Month Picker === */
.month-picker {
    display: flex;
    align-items: center;
    gap: 12px;
}
.month-picker-label {
    font-size: 16px;
    font-weight: 600;
    min-width: 140px;
    text-align: center;
}
.month-picker .btn { padding: 6px 12px; }

/* === Calendar Grid === */
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.cal-header {
    padding: 8px 4px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
}
.cal-day {
    min-height: 80px;
    padding: 4px;
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}
.cal-day:hover { background: #F8FAFC; }
.cal-day-num {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 2px;
}
.cal-day-today .cal-day-num {
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cal-day-other { opacity: 0.3; }
.cal-entry {
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 11px;
    margin-bottom: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cal-entry-work { background: #3B82F6; color: #fff; }
.cal-entry-vacation { background: #16A34A; color: #fff; }
.cal-entry-sick { background: #DC2626; color: #fff; }
.cal-entry-holiday { background: #F97316; color: #fff; font-style: italic; }
.cal-day-holiday {
    background: rgba(245,158,11,0.08);
    border: 2px solid #F59E0B !important;
}
.cal-day-today {
    background: rgba(22,163,74,0.08);
    border: 2px solid #16A34A !important;
}
.cal-day-today .cal-day-num {
    background: none !important;
    color: #16A34A;
    border-radius: 0;
    width: auto;
    height: auto;
    display: block;
    font-weight: 800;
}
.cal-day-selected {
    border: 2px solid #F59E0B !important;
}

@media (max-width: 768px) {
    .cal-day { min-height: 50px; }
    .cal-entry {
        font-size: 0;
        height: 5px;
        padding: 0;
        border-radius: 2px;
        margin-bottom: 2px;
    }
    .kpi-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
