/* =========================================================
   Stundensatzrechner - services.hwk-berlin.de/stundensatz/
   Übernommen aus assistenten.zdh.de/stundensatzrechner.php (3.0) und in den Portalrahmen
   eingepasst: Farben aus css/style.css, Buttons aus style.css, eigener Kopf entfällt.
   Schrift kommt aus dem Portalkopf, Lucide und Chart.js liegen unter stundensatz/assets/.
   Developed by Toni Sciacca - mail@tonisciacca.com
   ========================================================= */

:root {
    --primary:        var(--hwk-green-dark);
    --primary-hover:  #357a14;
    --primary-light:  rgba(64, 147, 24, 0.10);
    --bg-light:       var(--bg-body);
    --text-primary:   var(--hwk-black);
    --text-secondary: var(--hwk-grey-dark);
    --text-muted:     var(--hwk-grey);
    --border-color:   var(--hwk-blue-light-25);
    --danger:         var(--hwk-red-dark);
    --shadow-sm:      var(--shadow-default);
}

/* style.css setzt Abstände an Überschriften und Absätzen - hier gelten die eigenen */
.ss h1, .ss h2, .ss h3, .ss h4, .ss h5, .ss p { margin: 0; padding: 0; }
.ss { display: block; width: 100%; color: var(--text-primary); }

/* ---------------- Kopfband ---------------- */
.ss-hero {
    background: linear-gradient(135deg, var(--hwk-blue-dark) 0%, var(--hwk-green-dark) 100%);
    color: #fff;
    padding: 24px 40px 26px;
}
.ss-hero-inner { max-width: 1320px; margin: 0 auto; }
.ss-hero-kicker {
    display: inline-flex; align-items: center; gap: 7px;
    background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.35);
    border-radius: 999px; padding: 5px 13px; font-size: 13px; font-weight: 600; margin-bottom: 12px;
}
.ss-hero-kicker svg { width: 15px; height: 15px; }
.ss-hero h1 { color: #fff; font-size: 28px; line-height: 1.2; margin-bottom: 10px; }
.ss-hero p { color: rgba(255,255,255,.94); font-size: 15px; max-width: 80ch; line-height: 1.5; }
.ss-hero-fakten { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 14px; font-size: 13.5px; font-weight: 500; }
.ss-hero-fakten span { display: inline-flex; align-items: center; gap: 7px; }
.ss-hero-fakten svg { width: 16px; height: 16px; }

/* Symbolgröße in Buttons aus style.css */
.ss .btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.main-container { max-width: 1400px; margin: 0 auto; padding: 24px 40px; }

.card { background: white; border: 1px solid var(--border-color); margin-bottom: 24px; }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; }
.card-header i { color: var(--primary); width: 20px; height: 20px; }
.card-body { padding: 24px; }

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 20px; }
.form-row:last-child { margin-bottom: 0; }
.form-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.form-input { width: 100%; padding: 10px 14px; font-size: 14px; border: 1px solid var(--border-color); background: white; font-family: inherit; }
.form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }

.info-box { background: var(--primary-light); border-left: 4px solid var(--primary); padding: 12px 16px; margin-bottom: 16px; }
.info-box h4 { font-size: 13px; font-weight: 600; color: var(--primary); margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.info-box h4 i { width: 16px; height: 16px; }
.info-box p { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.warning-box { background: rgba(255,141,37,0.1); border-left: 4px solid var(--hwk-orange); padding: 12px 16px; margin-bottom: 16px; }
.warning-box h4 { font-size: 13px; font-weight: 600; color: var(--hwk-orange); margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.warning-box h4 i { width: 16px; height: 16px; }
.warning-box p { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }

/* Gesellen-Liste */
.gesellen-head, .geselle-row { display: grid; grid-template-columns: 1.4fr 1.4fr 1.4fr 44px; gap: 14px; align-items: center; }
.gesellen-head { margin-bottom: 8px; }
.gesellen-head span { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; color: var(--text-muted); }
.geselle-row { margin-bottom: 12px; }
.btn-icon { width: 44px; height: 42px; display: flex; align-items: center; justify-content: center; background: white; border: 1px solid var(--border-color); cursor: pointer; color: var(--danger); }
.btn-icon:hover { background: #fbeef2; }
.btn-icon i { width: 18px; height: 18px; }
.btn-add { margin-top: 6px; padding: 9px 16px; background: var(--primary-light); color: var(--primary); border: 1px dashed var(--primary); font-weight: 600; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; font-family: inherit; }
.btn-add i { width: 16px; height: 16px; }

.sozial-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; margin-bottom: 20px; }
.sozial-card { background: var(--bg-light); border: 1px solid var(--border-color); padding: 14px; }
.sozial-card h5 { font-size: 12px; color: var(--primary); margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; gap: 8px; }
.sozial-card h5 i { width: 16px; height: 16px; }
.sozial-item { display: flex; justify-content: space-between; padding: 5px 0; font-size: 12px; border-bottom: 1px solid #eee; }
.sozial-item:last-child { border-bottom: none; padding-top: 8px; margin-top: 4px; border-top: 1px solid var(--border-color); font-weight: 600; }
.sozial-item .label { color: var(--text-secondary); }
.sozial-item .value { font-family: 'Consolas', monospace; font-weight: 500; }

/* Speichern/Laden-Leiste */
.save-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; background: white; border: 1px solid var(--border-color); padding: 14px 20px; margin-bottom: 24px; }
.save-bar .grow { flex: 1 1 200px; }
.save-bar select, .save-bar input { padding: 9px 12px; font-size: 14px; border: 1px solid var(--border-color); font-family: inherit; width: 100%; }
.save-status { font-size: 12px; color: var(--text-muted); }

.ergebnis-section { background: linear-gradient(135deg, #f8faf8 0%, #eef5ee 100%); border: 2px solid var(--primary); padding: 32px; margin-top: 32px; }
.ergebnis-header { text-align: center; margin-bottom: 20px; padding-bottom: 20px; border-bottom: 2px solid var(--primary-light); }
.ergebnis-header h2 { font-size: 22px; color: var(--primary); display: flex; align-items: center; justify-content: center; gap: 12px; }
.ergebnis-header h2 i { width: 28px; height: 28px; }
.ergebnis-header p { font-size: 14px; color: var(--text-muted); margin-top: 8px; }

/* Ansicht-Umschalter */
.view-toggle { display: flex; justify-content: center; gap: 0; margin-bottom: 24px; }
.view-toggle button { padding: 10px 22px; background: white; border: 1px solid var(--primary); color: var(--primary); font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; }
.view-toggle button:first-child { border-right: none; }
.view-toggle button.active { background: var(--primary); color: white; }

.result-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 28px; }
.result-card { background: white; border: 1px solid var(--border-color); padding: 24px; text-align: center; }
.result-card.highlight { border: 2px solid var(--primary); background: linear-gradient(135deg, #f0fff0 0%, #e8f5e9 100%); }
.result-card h5 { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }
.result-card .value { font-size: 38px; font-weight: 700; color: var(--text-primary); }
.result-card.highlight .value { color: var(--primary); }
.result-card .unit { font-size: 16px; font-weight: 500; color: var(--text-muted); }
.result-card .detail { font-size: 11px; color: var(--text-muted); margin-top: 6px; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.kpi-card { background: white; border: 1px solid var(--border-color); padding: 16px; text-align: center; }
.kpi-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; }
.kpi-value { font-size: 20px; font-weight: 700; color: var(--primary); margin-top: 6px; }

.chart-table-row { display: grid; grid-template-columns: 320px 1fr; gap: 24px; }
.chart-container { background: white; border: 1px solid var(--border-color); padding: 16px; }
.chart-container h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); text-align: center; margin-bottom: 12px; }

.table-container { background: white; border: 1px solid var(--border-color); overflow: hidden; }
.table-header { padding: 12px 16px; background: var(--bg-light); border-bottom: 1px solid var(--border-color); }
.table-header h4 { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.table-header h4 i { width: 16px; height: 16px; color: var(--primary); }
.calc-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.calc-table th { padding: 8px 12px; text-align: left; font-size: 10px; font-weight: 600; text-transform: uppercase; background: #fafafa; color: var(--text-muted); }
.calc-table th:not(:first-child) { text-align: right; }
.calc-table td { padding: 8px 12px; border-bottom: 1px solid #f0f0f0; }
.calc-table td:not(:first-child) { text-align: right; font-family: 'Consolas', monospace; font-weight: 500; }
.calc-table .section-header { background: var(--bg-light); }
.calc-table .section-header td { font-weight: 600; font-size: 10px; text-transform: uppercase; color: var(--text-secondary); padding: 6px 12px; }
.calc-table .subtotal-row { background: var(--primary-light); }
.calc-table .subtotal-row td { font-weight: 600; }
.calc-table .total-row { background: var(--primary); color: white; }
.calc-table .total-row td { font-weight: 700; padding: 10px 12px; }

/* Je-Lohnstufe-Tabelle */
.stufen-table { width: 100%; border-collapse: collapse; font-size: 13px; background: white; }
.stufen-table th { padding: 12px; text-align: right; font-size: 11px; font-weight: 600; text-transform: uppercase; background: var(--bg-light); color: var(--text-muted); border-bottom: 1px solid var(--border-color); }
.stufen-table th:first-child { text-align: left; }
.stufen-table td { padding: 12px; border-bottom: 1px solid #f0f0f0; text-align: right; font-family: 'Consolas', monospace; }
.stufen-table td:first-child { text-align: left; font-family: inherit; font-weight: 600; }
.stufen-table tr.misch td { background: var(--primary-light); font-weight: 700; border-top: 2px solid var(--primary); }
.stufen-table td.vk { color: var(--primary); font-weight: 700; }

.actions-bar { display: flex; justify-content: center; gap: 12px; margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border-color); flex-wrap: wrap; }

@media (max-width: 1200px) { .main-container { padding: 24px; } .chart-table-row { grid-template-columns: 280px 1fr; } }
@media (max-width: 900px) {
    .result-cards { grid-template-columns: 1fr; } .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .chart-table-row { grid-template-columns: 1fr; }
    .gesellen-head, .geselle-row { grid-template-columns: 1fr 1fr; }
    .gesellen-head span:nth-child(3), .gesellen-head span:nth-child(4) { display:none; }
}
@media (max-width: 600px) { .main-container { padding: 16px; } .form-row { grid-template-columns: 1fr; } .sozial-grid { grid-template-columns: 1fr; } .ss-hero { padding: 20px 16px 22px; } .ss-hero h1 { font-size: 24px; } }
@media print { .tt-header, .tt-footer, .ss-hero, .actions-bar, .save-bar, .view-toggle, .btn-add, .btn-icon { display: none !important; } .main-container { max-width: 100%; padding: 0; } .card, .ergebnis-section { break-inside: avoid; } }
