/* =========================
   Grundlayout & Reset
   ========================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    color: #111827;
}

/* App-Rahmen */
.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-main {
    flex: 1;
}

.app-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* =========================
   Header / Navigation
   ========================= */
.app-header {
    background: #111827;
    color: #f9fafb;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.app-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Branding */
.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.brand-logo {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 30%, #38bdf8, #6366f1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: #e5e7eb;
}

.brand-subtitle {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* Links in der Navigation */
.nav-links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.nav-links a {
    color: #e5e7eb;
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-links a:hover {
    background: rgba(249, 250, 251, 0.12);
    color: #ffffff;
}

.nav-user {
    font-size: 0.8rem;
    color: #9ca3af;
}

/* =========================
   Buttons
   ========================= */
.btn {
    display: inline-block;
    border-radius: 999px;
    border: none;
    padding: 0.5rem 1.1rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1, #3b82f6);
    color: #f9fafb;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(59, 130, 246, 0.45);
}

.btn-outline {
    background: transparent;
    border: 1px solid #d1d5db;
    color: #111827;
}

.btn-outline:hover {
    background: #f3f4f6;
}

/* =========================
   Karten / Kacheln
   ========================= */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.card {
    background: rgba(255,255,255,0.95);
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 10px 25px rgba(15,23,42,0.08);
    border: 1px solid rgba(209, 213, 219, 0.8);
}

.card h2 {
    margin-top: 0;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.card p {
    margin: 0.25rem 0 0.75rem 0;
    font-size: 0.9rem;
    color: #4b5563;
}

/* =========================
   Startseite / Hero-Bereich
   ========================= */
.hero {
    margin-top: 2rem;
    margin-bottom: 1.5rem;
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.8fr);
    gap: 2rem;
    align-items: center;
}

.hero-main h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.hero-main p {
    margin: 0.25rem 0 0.75rem;
    color: #4b5563;
    max-width: 36rem;
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.badge {
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    color: #4b5563;
}

.hero-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Rechte Seite im Hero */
.hero-side {
    background: radial-gradient(circle at 10% 0, #38bdf8, #6366f1);
    border-radius: 20px;
    padding: 1rem;
    color: #f9fafb;
    box-shadow: 0 12px 30px rgba(79, 70, 229,0.35);
}

.hero-side h2 {
    font-size: 1.1rem;
    margin-top: 0;
}

.hero-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 0.75rem;
    margin-top: 1rem;
    font-size: 0.85rem;
}

.hero-metric {
    background: rgba(15, 23, 42, 0.18);
    border-radius: 12px;
    padding: 0.5rem 0.6rem;
}

/* =========================
   Auth / Formulare (Login etc.)
   ========================= */
.auth-card {
    max-width: 380px;
    margin: 3rem auto;
    background: rgba(255,255,255,0.95);
    border-radius: 18px;
    padding: 1.5rem 1.75rem;
    box-shadow: 0 12px 28px rgba(15,23,42,0.12);
    border: 1px solid #e5e7eb;
}

.auth-card h1 {
    margin-top: 0;
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.auth-card label {
    display: block;
    font-size: 0.85rem;
    color: #374151;
    margin-bottom: 0.3rem;
}

.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="text"],
.auth-card input[type="date"],
.auth-card input[type="number"] {
    width: 100%;
    padding: 0.45rem 0.6rem;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.auth-card input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 1px rgba(99,102,241,0.4);
}

/* Hilfsklassen */
.text-muted {
    color: #6b7280;
    font-size: 0.8rem;
}

/* =========================
   Tabellen & Listen
   ========================= */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.9rem;
    background: rgba(255,255,255,0.95);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(15,23,42,0.08);
    border: 1px solid rgba(209, 213, 219, 0.8);
}

.table thead {
    background: #f3f4f6;
}

.table th,
.table td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover {
    background: #f9fafb;
}

/* =========================
   Status-Badges
   ========================= */
.status-pill {
    display: inline-block;
    padding: 0.1rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-draft {
    background: #e5e7eb;
    color: #374151;
}

.status-sent {
    background: rgba(59, 130, 246, 0.1);
    color: #1d4ed8;
}

.status-paid {
    background: rgba(16, 185, 129, 0.1);
    color: #047857;
}

.status-overdue {
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
}

.status-cancelled {
    background: rgba(107, 114, 128, 0.1);
    color: #4b5563;
}

/* Mahnstufe */
.level-pill {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    border: 1px solid rgba(209, 213, 219, 0.9);
    background: #f9fafb;
    color: #374151;
}

/* Abschnitts-Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    margin-top: 1.5rem;
}

.section-header h1,
.section-header h2 {
    margin: 0;
}

.section-header .text-muted {
    max-width: 420px;
}

/* =========================
   Footer
   ========================= */
.app-footer {
    border-top: 1px solid #e5e7eb;
    background: rgba(249, 250, 251, 0.9);
    font-size: 0.8rem;
    color: #6b7280;
}

.app-footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* =========================
   Responsive
   ========================= */
@media (max-width: 800px) {
    .hero {
        grid-template-columns: minmax(0, 1fr);
    }

    .app-header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .nav-links {
        flex-wrap: wrap;
    }
}

/* =========================
   Formulare (allgemein)
   ========================= */
.form-card {
    background: rgba(255,255,255,0.96);
    border-radius: 18px;
    padding: 1.5rem 1.75rem;
    box-shadow: 0 12px 28px rgba(15,23,42,0.10);
    border: 1px solid #e5e7eb;
    margin-top: 1.5rem;
}

.form-card h1,
.form-card h2 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.form-description {
    margin-top: 0;
    margin-bottom: 1.25rem;
}

/* Grid für mehrspaltige Formulare */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem 1.5rem;
}

/* einzelne Felder */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.form-group label,
.form-label {
    font-size: 0.85rem;
    color: #374151;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.45rem 0.6rem;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 0.9rem;
    background: #ffffff;
}

.form-textarea {
    min-height: 70px;
    resize: vertical;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 1px rgba(99,102,241,0.35);
}

/* Aktionen unten im Formular */
.form-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}
