/* style.css - Clean Version */

/* 1. VARIABLEN & GRUNDEINSTELLUNGEN */
:root {
    --bg-color: #f0f2f5;
    --card-bg: #ffffff;
    --text-color: #333333;
    --text-muted: #666666;
    --border-color: #dddddd;
    --primary: #007bff;
    --primary-hover: #0056b3;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
}

body {
    margin: 0;
    padding: 20px;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    /* WICHTIG: Kein display:flex hier, damit die Seite normal von oben nach unten fließt */
}

h1 { margin-bottom: 1.5rem; font-weight: 300; }
h2 { margin-top: 0; font-weight: 400; border-bottom: 1px solid var(--border-color); padding-bottom: 15px;}
h3 { margin-top: 0; font-weight: 600; color: var(--text-color); }
a { text-decoration: none; color: inherit; }

/* 2. NAVIGATION */
.nav { 
    background: var(--card-bg); 
    padding: 15px 25px; 
    border-radius: 12px; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    margin-bottom: 30px;
}
.nav-left, .nav-right { display: flex; align-items: center; gap: 20px; }
.nav a { font-weight: 600; color: #555; transition: 0.2s; }
.nav a:hover { color: #000; }

.btn-logout { color: var(--danger) !important; cursor: pointer; }
.btn-login { background: var(--primary); color: white !important; padding: 8px 15px; border-radius: 6px; }

/* 3. GRID & CARDS */
.finance-container { max-width: 1400px; margin: 0 auto; }
.finance-grid { display: grid; grid-template-columns: 3fr 1fr; gap: 20px; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-bottom: 30px; }

.card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border: 1px solid transparent;
    /* transition: transform 0.2s;  <-- HIER GELÖSCHT (Globale Bewegung aus) */
}

/* Neuer Block: Nur klickbare Karten (Links) dürfen sich bewegen */
a.card {
    transition: transform 0.2s, box-shadow 0.2s;
    display: block; /* Stellt sicher, dass der Link wie eine Box wirkt */
}

a.card:hover { 
    transform: translateY(-3px); 
    box-shadow: 0 6px 15px rgba(0,0,0,0.1); 
}

/* Card Content Styles */
.card-icon { font-size: 2.5rem; color: var(--primary); margin-bottom: 10px; }
.card-title { font-weight: bold; font-size: 1.1em; display: block; margin-bottom: 5px; }
.card-desc { color: var(--text-muted); font-size: 0.9em; }

/* 4. ALERTS & FORMULARE */
.alert { padding: 15px; margin-bottom: 20px; border-radius: 8px; background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }

input, select, textarea {
    display: block; width: 100%; padding: 12px; margin: 8px 0 20px;
    border: 1px solid var(--border-color); border-radius: 6px;
    background: #fff; color: var(--text-color); font-size: 1rem; box-sizing: border-box;
}

button.btn, .btn {
    display: inline-block; padding: 10px 20px; border-radius: 6px;
    background-color: var(--primary); color: white; border: none;
    font-weight: 600; cursor: pointer; font-size: 1rem;
}
button:hover, .btn:hover { background-color: var(--primary-hover); }

/* 5. TABELLEN & MOBILE */
.table-responsive { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 0.95em; }
th, td { text-align: left; padding: 12px 8px; border-bottom: 1px solid #eee; }
th { background-color: #f8f9fa; color: var(--text-muted); font-weight: 600; }

.nav-scroll {
    display: flex; gap: 5px; overflow-x: auto; padding-bottom: 5px; white-space: nowrap;
    scrollbar-width: none;
}
.btn-group { background: white; padding: 5px; border-radius: 8px; display: flex; gap: 5px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }

/* Switch Toggle */
.switch { position: relative; display: inline-block; width: 40px; height: 20px; margin-right:10px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 20px; }
.slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 2px; bottom: 2px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--warning); }
input:checked + .slider:before { transform: translateX(20px); }

@media (max-width: 768px) {
    .finance-grid { grid-template-columns: 1fr; }
    .nav { flex-direction: column; gap: 15px; text-align: center; }
    .nav-left, .nav-right { flex-direction: column; gap: 10px; }
}
.inventory-card {
        background: #fff;
        border: 1px solid #dae0e5;
        border-radius: 8px;
        margin: 15px 0;
        overflow: hidden;
        transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Der Header: Eine Zeile, Flexbox */
.inventory-header {
    padding: 12px 15px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: space-between; /* Text links, Toggle rechts */
    cursor: pointer;
    user-select: none;
}

.inventory-header:hover {
    background: #e9ecef;
}

/* Der Inhalt: Standardmäßig versteckt */
.inventory-body {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out, opacity 0.4s ease-in-out, padding 0.4s ease;
    padding: 0 15px; /* Kein Padding wenn zu */
    background: #fff;
}

/* Aktiv-Status (wird per JS gesetzt) */
.inventory-card.active {
    border-color: #0d6efd;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.08);
}

.inventory-card.active .inventory-header {
    background: #e7f1ff; /* Leichtes Blau im Header wenn aktiv */
    color: #052c65;
}

.inventory-card.active .inventory-body {
    padding: 20px 15px; /* Padding kommt dazu beim Öffnen */
    max-height: 400px; /* Genug Platz zum Ausfahren */
    opacity: 1;
    border-top: 1px solid #dae0e5;
}

/* Kleiner Text im Header */
.header-label {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}
.split-card {
    background: #fff;
    border: 1px solid #dae0e5;
    border-radius: 8px;
    margin-bottom: 20px; /* Abstand nach unten */
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.split-header {
    padding: 12px 15px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}

.split-header:hover {
    background: #e9ecef;
}

.split-body {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out, opacity 0.4s ease-in-out, padding 0.4s ease;
    padding: 0 15px;
    background: #fff;
}

/* Aktiv-Status */
.split-card.active {
    border-color: #17a2b8; /* Ein Cyan/Teal Ton zur Unterscheidung, oder #0d6efd für Blau */
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.15);
}

.split-card.active .split-header {
    background: #e0f7fa; /* Ganz leichtes Cyan */
    color: #006064;
}

.split-card.active .split-body {
    padding: 20px 15px;
    max-height: 1000px; /* Genug Platz für viele Zeilen */
    opacity: 1;
    border-top: 1px solid #dae0e5;
}    
