/* --- Basis & Layout --- */
body { 
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; 
    background-color: #f4f7f9; 
    color: #333; 
    margin: 0; 
    padding: 20px; 
}

.container { 
    max-width: 1200px; 
    margin: 0 auto; 
}

/* Header-Bereich */
.header-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #3498db;
    margin-bottom: 25px;
    padding-bottom: 10px;
}

h2 { margin: 0; color: #2c3e50; }

.date-info-header {
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* --- Navigation & Buttons --- */
.nav-link {
    text-decoration: none;
    background: #3498db;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 0.9rem;
    transition: background 0.2s;
    margin-left: 5px;
    display: inline-block;
}

.nav-link:hover { background: #2980b9; }

/* --- Dashboard-Karten (index.php) --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.nav-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    text-decoration: none;
    color: #2c3e50;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    border-top: 5px solid #3498db;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.nav-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.icon-large { font-size: 2.5rem; margin-bottom: 10px; display: block; }

.nav-card h3 { margin: 10px 0 5px 0; font-size: 1.25rem; }
.nav-card p { margin: 0; font-size: 0.9rem; color: #7f8c8d; line-height: 1.4; }

/* Farbakzente für Karten */
.card-summe  { border-top-color: #16a085; } /* Türkis */
.card-tag    { border-top-color: #3498db; } /* Blau */
.card-monat  { border-top-color: #9b59b6; } /* Lila */
.card-jahr   { border-top-color: #27ae60; } /* Grün */
.card-script { border-top-color: #e67e22; } /* Orange */

/* --- Info-Boxen (Preise auf index.php) --- */
.info-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.info-card {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    align-items: flex-start;
    gap: 15px;
    border-left: 5px solid #3498db;
}

.info-card.waerme { border-left-color: #e67e22; }

.info-card .icon { font-size: 2rem; line-height: 1; }
.info-card .label { color: #7f8c8d; font-size: 0.75rem; text-transform: uppercase; display: block; }
.info-card .price-main { font-size: 1.3rem; font-weight: bold; color: #2c3e50; display: block; }
.info-card .price-sub { font-size: 0.9rem; color: #34495e; margin-top: 4px; display: block; }
.info-card small { font-size: 0.75rem; font-weight: normal; color: #95a5a6; }

.info-card .date-info {
    font-size: 0.7rem;
    color: #bdc3c7;
    margin-top: 10px;
    border-top: 1px solid #f9f9f9;
    padding-top: 5px;
}

/* --- Tabellen-Design --- */
.table-container { 
    background: #fff; 
    border-radius: 10px; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.1); 
    overflow: hidden; 
}

table { width: 100%; border-collapse: collapse; }
th { 
    background-color: #34495e; 
    color: #ecf0f1; 
    padding: 15px; 
    font-size: 0.85rem; 
    text-transform: uppercase; 
    text-align: left; 
}
td { padding: 12px 15px; border-bottom: 1px solid #eee; vertical-align: middle; }
tr:hover { background-color: #f9fbff; }

/* Status-Farben in Tabellen */
.kosten { color: #e74c3c; font-weight: 600; }
.ertrag { color: #27ae60; font-weight: 600; }
.einheit { font-size: 0.8rem; color: #7f8c8d; margin-left: 2px; }
.monat-cell { font-weight: bold; color: #2980b9; line-height: 1.2; }
.info-text { font-size: 0.75rem; color: #95a5a6; display: block; margin-top: 2px; }

/* Spezifisch für Tagesansicht (Datum/Zeit Kombi) */
.date-cell strong { display: block; }
.date-cell span { color: #7f8c8d; font-size: 0.85rem; }

/* --- Skript-Steuerung (script_trigger.php) --- */
.console {
    background-color: #2d3436;
    color: #fab1a0;
    padding: 20px;
    border-radius: 8px;
    font-family: 'Courier New', Courier, monospace;
    white-space: pre-wrap;
    margin-top: 20px;
    border: 1px solid #636e72;
}

.btn-run {
    background-color: #e67e22;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}
.btn-run:hover { background-color: #d35400; }

/* --- Jahresstatistik Footer (Cards) --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin-top: 25px;
}
.stat-card {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-top: 4px solid #3498db;
}
.stat-card h3 { margin: 0; font-size: 0.75rem; color: #7f8c8d; text-transform: uppercase; }
.stat-card .value { font-size: 1.3rem; font-weight: bold; margin: 5px 0; }
.stat-card.total { border-top-color: #27ae60; }

/* --- Footer --- */
.footer-note {
    margin-top: 40px;
    text-align: center;
    color: #bdc3c7;
    font-size: 0.8rem;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

/* --- Druck-Optimierung --- */
@media print {
    body { background-color: #fff; padding: 0; margin: 0; }
    .nav-link, .header-box div, .info-bar, .dashboard-grid, .footer-note, .btn-run { 
        display: none !important; 
    }
    .container { max-width: 100%; width: 100%; margin: 0; }
    .table-container { box-shadow: none; border: 1px solid #ccc; border-radius: 0; }
    th { background-color: #eee !important; color: #000 !important; border-bottom: 1px solid #000; }
    td { border-bottom: 1px solid #ccc; }
    .kosten, .ertrag { color: #000 !important; }
}

/* --- Responsive Anpassungen --- */
@media (max-width: 768px) {
    body { padding: 10px; }
    .header-box { flex-direction: column; align-items: flex-start; gap: 10px; }
    th, td { padding: 10px 8px; font-size: 0.8rem; }
}