/* ---------- Grundlayout ---------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --bg-body: #f5f7fb;
    --bg-card: #ffffff;
    --bg-header: #ffffffcc;
    --border-subtle: #e5e7eb;
    --accent: #2563eb;
    --accent-light: #eff6ff;
    --accent-hover: #1d4ed8;
    --text-main: #1f2937;
    --text-soft: #4b5563;
    --text-strong: #111827;
    --success: #16a34a;
    --danger: #dc2626;
    --radius-lg: 12px;
    --radius-full: 999px;
    --shadow-soft: 0 4px 16px rgba(0,0,0,0.06);
    --shadow-medium: 0 8px 22px rgba(0,0,0,0.08);
    --transition-fast: 0.18s ease-out;
    --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg-body);
    font-family: var(--font-body);
    color: var(--text-main);
}

/* ---------- Container ---------- */

body > header,
body > main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px;
}

main {
    padding-top: 40px;
    padding-bottom: 32px;
}
/* ---------- Header Logo ---------- */

.header-left {
    display: flex;
    align-items: center;
    gap: 12px; /* Abstand zwischen Logo und Titel */
}

.header-logo {
    width: 100px;         /* maximale Breite */
    height: auto;         /* proportional */
    display: block;
}

/* Für kleinere Bildschirme darf das Logo kleiner werden */
@media (max-width: 480px) {
    .header-logo {
        width: 70px;
    }
}
	/* ---------- Dashboard ---------- */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.dashboard-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
}

.dashboard-card h3 {
    margin: 0 0 8px;
    font-size: 16px;
    color: #374151;
}

.dashboard-card p {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
}

.dashboard-card small {
    color: #6b7280;
}

.dashboard-card.danger {
    background: #fff1f2;
    border-color: #fecdd3;
}

	
/* ---------- Header / Navigation ---------- */

header {
    position: sticky;
    top: 20px; /* Header rutscht etwas nach unten */
    z-index: 50;
    background: var(--bg-header);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 20px 22px; /* mehr innerer Abstand */
    margin-bottom: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

header h1 {
    margin: 0;
    font-size: 20px;
    color: var(--text-strong);
    letter-spacing: 0.04em;
}

nav {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

nav a {
    display: inline-block;
    padding: 7px 14px;
    font-size: 14px;
    color: var(--text-soft);
    background: #f0f2f8;
    border-radius: var(--radius-full);
    border: 1px solid transparent;
    text-decoration: none;
    transition: var(--transition-fast);
}

nav a:hover {
    background: var(--accent-light);
    color: var(--accent);
    border-color: var(--accent);
}

/* ---------- Card ---------- */

.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    margin: 18px 0;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-soft);
}

.card h2 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 18px;
    color: var(--text-strong);
}

.card p {
    margin: 6px 0;
    color: var(--text-soft);
}

/* ---------- Buttons ---------- */

button,
input[type="submit"],
input[type="button"],
a.btn {
    display: inline-block;
    padding: 8px 16px;
    font-size: 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--accent);
    background: #3ea536;
    color: white;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition-fast);
}

button:hover,
input[type="submit"]:hover,
a.btn:hover {
    background: #3ea536;
    border-color: var(--accent-hover);
}

a {
    color: var(--accent);
}

/* ---------- Formulare ---------- */

label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-main);
    font-size: 14px;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="password"],
select {
    width: 100%;
    max-width: 340px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    font-size: 14px;
    background: white;
    color: var(--text-main);
    outline: none;
    transition: var(--transition-fast);
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="password"]:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

input[type="file"] {
    font-size: 14px;
    color: var(--text-soft);
}

/* ---------- Tabellen ---------- */

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

th {
    background: #f0f2f8;
    padding: 10px;
    font-size: 13px;
    text-align: left;
    color: var(--text-strong);
    border-bottom: 1px solid var(--border-subtle);
}

td {
    padding: 10px;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 14px;
}

tr:hover td {
    background: #f9fafb;
}

/* ---------- Betragsfarben ---------- */

.pos {
    color: var(--success);
    font-weight: 600;
}

.info {
    color: #166534;               /* dunkles Grün */
    background: #dcfce7;          /* hellgrüner Hintergrund */
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 6px 10px;
    margin: 8px 0;
}
.neg {
    color: #dc2626;
    font-weight: 600;
}

/* ---------- Aktionen (Icons) ---------- */

.actions {
    text-align: center;
    white-space: nowrap;
}

.actions a {
    display: inline-block;
    margin: 0 6px;
    font-size: 16px;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.actions a:hover {
    transform: scale(1.2);
    opacity: 0.8;
}

/* ---------- Listen ---------- */

ul {
    padding-left: 20px;
    margin: 8px 0;
}

/* ---------- Responsive Small Screens ---------- */

@media (max-width: 720px) {
    header {
        padding: 10px 14px;
    }

    table td,
    table th {
        font-size: 12px;
        padding: 8px;
    }
}
/* ---------- Grid für Formulare ---------- */

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px 24px;
    margin-top: 12px;
}

.form-grid p {
    margin: 0;
}

/* Optional: Feldgruppen nebeneinander */
.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}
/* --- Aktionen (Icons) --- */
.actions {
    text-align: center;
    white-space: nowrap;
}
.actions a {
    display: inline-block;
    margin: 0 6px;
    font-size: 18px;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease;
}
.actions a:hover {
    transform: scale(1.15);
    opacity: 0.85;
}

/* --- Überfällige Rechnungen markieren --- */
.overdue td {
    background: #fee2e2 !important;
    color: #991b1b;
    font-weight: 600;
}
	/* Rechnungen: Zahlung-Form in Aktionen */
.pay-form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.pay-form select {
    max-width: 180px;
}

.pay-form button {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 16px;
}
	/* PDF Icon Link */
.iconlink {
    font-size: 18px;
    text-decoration: none;
}

/* Überfällige Rechnungen */
.overdue td {
    background: #fee2e2 !important;
    color: #991b1b;
    font-weight: 600;
}

/* Aktionen + Pay Form */
.actions { text-align: center; white-space: nowrap; }

.pay-form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.pay-form select { max-width: 180px; }
.pay-form button { padding: 6px 10px; border-radius: 999px; font-size: 16px; }

