/* ==========================================================================
   🎨 GLOBAL CONSTANTS & THEME VARIABLES (Schädelfest / Band-Logistik Look)
   ========================================================================== */
:root {
    /* Farbpalette */
    --color-bg: #f8fafc;          /* Sanftes, augenschonendes Hellgrau */
    --color-surface: #ffffff;     /* Reines Weiß für Karten und Tabellen */
    --color-text: #1e293b;        /* Deep Slate - knackig lesbares Dunkelgrau */
    --color-muted: #64748b;       /* Dezentes Grau für Beschreibungen */
    
    /* Akzentfarben */
    --color-primary: #198754;     /* Schädelfest-Grün für Erfolge & Hauptbuttons */
    --color-primary-hover: #146c43;
    --color-secondary: #0d6efd;   /* Logistik-Blau für Infos & Updates */
    --color-danger: #dc3545;      /* Warn-Rot für Löschen & Fehler */
    --color-dark: #1e252b;        /* Anthrazit für die Header-Navigation */
    
    /* Layout-Konstanten */
    --max-width: 1200px;
    --radius: 6px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --transition: all 0.2s ease-in-out;
}

/* ==========================================================================
   RESET & BASE STYLES (Sorgt für identischen Look auf jedem Browser)
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
    padding: 0;
}

h1, h2, h3 {
    color: #0f172a;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

p {
    color: var(--color-muted);
    margin-bottom: 1rem;
}

/* ==========================================================================
   🧱 THE STRUCTURAL GRID (Das unzerstörbare Gehäuse)
   ========================================================================== */
.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Zwingt den Footer, immer unten zu kleben! */
}

.main-content {
    flex: 1;
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1.5rem;
}

/* ==========================================================================
   📱 RESPONSIVE NAVIGATION BAR (Handy + PC flexibel)
   ========================================================================== */
.main-nav {
    background-color: var(--color-dark);
    padding: 0.75rem 1.5rem;
    box-shadow: var(--shadow);
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    flex-direction: column; /* Mobile First: Untereinander */
    gap: 0.75rem;
    align-items: center;
}

.nav-brand {
    color: #fff;
    font-weight: bold;
    font-size: 1.2rem;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap; /* Verhindert das Herausrutschen auf kleinen Handys */
    justify-content: center;
}

.nav-links a {
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    transition: var(--transition);
}

.nav-links a:hover, .nav-links a.active {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

/* 🖥️ Medien-Weiche für PC-Monitore (Ab 768 Pixel Breite) */
@media (min-width: 768px) {
    .nav-container {
        flex-direction: row; /* Nebeneinander auf dem PC */
        justify-content: space-between;
    }
    .nav-links {
        gap: 1rem;
    }
}

/* ==========================================================================
   🎛️ BUTTON SYSTEM & FORM ELEMENTS
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
}

.btn-primary { background-color: var(--color-primary); color: #fff; }
.btn-primary:hover { background-color: var(--color-primary-hover); }

.btn-secondary { background-color: var(--color-secondary); color: #fff; }
.btn-secondary:hover { opacity: 0.9; }

.btn-danger { background-color: var(--color-danger); color: #fff; }
.btn-danger:hover { opacity: 0.9; }

/* ==========================================================================
   📊 PROFESSINELLES TABELLEN-SYSTEM (Kein Quetschen, mit Scroll-Tresor)
   ========================================================================== */
.table-responsive {
    width: 100%;
    overflow-x: auto; /* Erzeugt auf Handys einen sauberen horizontalen Wisch-Tresor */
    -webkit-overflow-scrolling: touch;
    background-color: var(--color-surface);
    border-radius: var(--radius);
    border: 1px solid #e2e8f0;
    box-shadow: var(--shadow);
    margin-top: 1.5rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.925rem;
}

.data-table th {
    background-color: #f1f5f9;
    color: #334155;
    font-weight: 700;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid #cbd5e1;
    white-space: nowrap;
}

.data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

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

.data-table tr:hover td {
    background-color: #f8fafc; /* Dezentes Highlight beim Drüberfahren */
}

/* ==========================================================================
   🗂️ DASHBOARD DASH-GRID (Die Kacheln)
   ========================================================================== */
.dash-grid {
    display: grid;
    grid-template-columns: 1fr; /* Mobile First: 1 Kachel pro Zeile */
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.dash-card {
    background-color: var(--color-surface);
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.dash-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* 🖥️ Medien-Weichen für Kacheln auf größeren Bildschirmen */
@media (min-width: 576px) { .dash-grid { grid-template-columns: repeat(2, 1fr); } } /* 2 Kacheln */
@media (min-width: 992px) { .dash-grid { grid-template-columns: repeat(3, 1fr); } } /* 3 Kacheln */

/* ==========================================================================
   📯 FOOTER
   ========================================================================== */
.site-footer {
    background-color: #ffffff;
    border-top: 1px solid #e2e8f0;
    padding: 1.5rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--color-muted);
}
