/* V021.4 – alleinige Rechnungsmaske, Entkopplung von Termin/Auftrag */
#maV214InvoiceRoot{max-width:1780px;margin:14px auto 32px;padding:0 14px;color:#172e45;font-family:system-ui,-apple-system,Segoe UI,Arial,sans-serif}
#maV214InvoiceRoot *{box-sizing:border-box}
#maV214InvoiceRoot .v214-toolbar{display:flex;align-items:center;justify-content:space-between;gap:18px;flex-wrap:wrap;margin-bottom:18px}
#maV214InvoiceRoot .v214-toolbar h2{color:#102c47;font-size:25px;margin:0}
#maV214InvoiceRoot .v214-layout{display:grid;grid-template-columns:minmax(380px,.87fr) minmax(440px,1.13fr);gap:23px;align-items:start}
#maV214InvoiceRoot .v214-panel,#maV214InvoiceRoot .v214-paper{background:#fff!important;color:#1b334c!important;border:1px solid #d9e2ec!important;border-radius:16px;padding:24px;box-shadow:0 9px 30px #0b2c4c18}
#maV214InvoiceRoot .v214-paper{position:sticky;top:10px;padding:14px;background:#fff!important}
#maV214InvoiceRoot .v214-paper iframe{width:100%;min-height:700px;height:min(77vh,1000px);display:block;background:white;border:0;border-radius:7px}
#maV214InvoiceRoot .v214-panel label{display:block;color:#263b55!important;font-weight:650;margin:12px 0 7px;font-size:14px}
#maV214InvoiceRoot .v214-panel input,#maV214InvoiceRoot .v214-panel select,#maV214InvoiceRoot .v214-panel textarea{background:#fff!important;color:#1e364d!important;border:1px solid #c3d1df!important;border-radius:9px;padding:11px 12px;width:100%;font:inherit;min-height:43px}
#maV214InvoiceRoot .v214-panel input:disabled,#maV214InvoiceRoot .v214-panel textarea:disabled{background:#f0f4f8!important;color:#637588!important}
#maV214InvoiceRoot .v214-cols{display:grid;grid-template-columns:1fr 1fr;gap:14px}
#maV214InvoiceRoot .v214-tabs{display:flex;gap:6px;padding:4px;background:#e6edf3;border-radius:10px}
#maV214InvoiceRoot .v214-tabs button{flex:1;background:transparent;color:#19354f!important;border:0;border-radius:8px;font-weight:700;padding:11px}
#maV214InvoiceRoot .v214-tabs button.active{background:#2b5778!important;color:#fff!important}
#maV214InvoiceRoot .v214-panel h3{color:#173753;font-size:17px;margin:22px 0 10px}
#maV214InvoiceRoot .v214-btn{border:1px solid #c1d0df!important;border-radius:9px;background:#edf3f8!important;color:#15334d!important;min-height:43px;padding:9px 13px;font-weight:700;cursor:pointer}
#maV214InvoiceRoot .v214-btn.primary{color:#fff!important;background:#075fa7!important;border-color:#075fa7!important}
#maV214InvoiceRoot .v214-btn.green{color:#fff!important;background:#11865a!important;border-color:#11865a!important}
#maV214InvoiceRoot .v214-btn:disabled{opacity:.6;cursor:not-allowed}
#maV214InvoiceRoot .v214-actions{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin-top:18px}
#maV214InvoiceRoot .v214-editrow{display:grid;grid-template-columns:minmax(0,2fr) 88px 110px 90px 42px;gap:7px;align-items:end}
#maV214InvoiceRoot .v214-editrow label{margin:4px 0}
#maV214InvoiceRoot .v214-editrow input{padding:8px;font-size:13px}
#maV214InvoiceRoot .v214-lines{max-height:215px;overflow-y:auto;overscroll-behavior:contain;border:1px solid #d7e2ec;border-radius:10px;margin:12px 0;background:#fbfdff}
#maV214InvoiceRoot .v214-lines table{width:100%;color:#1c3952;border-collapse:collapse;font-size:13px}
#maV214InvoiceRoot .v214-lines th{position:sticky;top:0;background:#e4ebf2!important;padding:9px 7px;color:#163651!important;text-align:left}
#maV214InvoiceRoot .v214-lines td{padding:7px;border-bottom:1px solid #e3eaf1}
#maV214InvoiceRoot .v214-lines td .v214-btn{min-height:30px;padding:3px 8px;color:#aa2332!important}
#maV214InvoiceRoot .v214-message{padding:10px 12px;border-radius:9px;background:#eaf2f8;color:#1e4c6b;font-size:13px;margin:12px 0}
#maV214InvoiceRoot .v214-state{font-weight:750;font-size:14px;color:#266090}
#maV214InvoiceRoot .v214-final{color:#087248}
#view .ma-v214-order-state{border:1px solid #6d99b3;background:#193950;color:#fff;border-radius:12px;padding:15px;margin:12px 0}
#view .ma-v214-order-state h3{margin:0 0 6px;color:#fff}
#view .ma-v214-order-state button{margin:6px 7px 4px 0}
#view .ma-v214-contact{display:inline-block;margin:4px 0;font-size:13px;font-weight:700;color:#f2d98c}
#view .ma-v214-restore-card{padding:15px;margin:14px 0;border:1px solid #50728e;border-radius:12px;background:#14374e}
#view .ma-v214-restore-card button{margin:5px}
#view #maManualTimeCard,#view #maManualInvoiceCard{display:none!important}
#view .ma-v16-cost-hours,#view #plannerCostPreview,#view #maV210Rate{display:none!important}
#view .ma-v210-invoice-create{display:none!important}
/* Kopfschalter getrennt: keine Ueberlagerung bei engen Fenstern. */
body>header.ma-v212-header #maV16TopAlerts{width:194px!important;min-width:194px!important;display:flex!important;justify-content:flex-end!important;position:relative!important;z-index:4!important;overflow:visible!important}
body>header.ma-v212-header #maNotificationDock{width:100%!important;min-width:194px!important;display:flex!important;justify-content:flex-end!important;gap:4px!important}
body>header.ma-v212-header #maNotificationDock button{flex:0 0 42px!important;width:42px!important;min-width:42px!important;max-width:42px!important}
@media(min-width:1141px){body>header.ma-v212-header{grid-template-columns:156px minmax(0,1fr) 210px!important}}
@media(max-width:1050px){#maV214InvoiceRoot .v214-layout{grid-template-columns:1fr}#maV214InvoiceRoot .v214-paper{position:static}}
@media(max-width:650px){#maV214InvoiceRoot .v214-cols{grid-template-columns:1fr}#maV214InvoiceRoot .v214-editrow{grid-template-columns:1fr 65px 90px 65px 35px;gap:4px}#maV214InvoiceRoot{padding:0 6px}#maV214InvoiceRoot .v214-panel{padding:15px}}
@media print{#maV214InvoiceRoot{display:none!important}}
/* Preislisten-Fenster: Das gesamte rechte Bearbeitungsfeld bleibt sichtbar.
   Nur die vorhandenen Positionen scrollen. Keine verschachtelte Gesamtscrollbar. */
#maHourlyFloating.ma-hourly-panel{
  display:flex!important;flex-direction:column!important;
  left:max(12px,calc((100vw - 1160px)/2))!important;
  top:max(12px,calc((100vh - 790px)/2))!important;
  width:min(1160px,calc(100vw - 24px))!important;
  height:min(790px,calc(100vh - 24px))!important;
  min-width:0!important;min-height:0!important;max-height:calc(100vh - 24px)!important;
  overflow:hidden!important;resize:none!important;
}
#maHourlyFloating .ma-hourly-header{flex:0 0 auto}
#maHourlyFloating .ma-hourly-content{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,0.9fr);grid-template-rows:auto auto minmax(0,1fr);gap:12px 18px;flex:1;min-height:0;overflow:hidden!important;align-content:stretch}
#maHourlyFloating .ma-hourly-content>p{grid-column:1/-1;margin:0}
#maHourlyFloating .ma-hourly-content>#maManageRates{grid-column:1/-1;justify-self:start;margin:0}
#maHourlyFloating .ma-hourly-content>.card{grid-column:1;grid-row:3;margin:0!important;align-self:start;min-width:0;overflow:visible!important}
#maHourlyFloating .ma-hourly-content>#maHourlyRateRows{grid-column:2;grid-row:3;min-height:0;max-height:100%;overflow-y:auto!important;overflow-x:hidden;overscroll-behavior:contain;padding-right:7px}
#maHourlyFloating .ma-hourly-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
#maHourlyFloating .ma-hourly-fixed{grid-template-columns:1fr 1fr}
#maHourlyFloating .ma-hourly-content:not(:has(>.card))>#maHourlyRateRows{grid-column:1/-1}
@media(max-width:760px){#maHourlyFloating .ma-hourly-content{display:flex;flex-direction:column;overflow-y:auto!important}#maHourlyFloating .ma-hourly-content>.card{flex:0 0 auto}#maHourlyFloating .ma-hourly-content>#maHourlyRateRows{max-height:220px;min-height:90px;overflow:auto}}
/* Last rule wins against the legacy dark theme's very specific form overrides. */
html body #view #maV214InvoiceRoot .v214-panel input,
html body #view #maV214InvoiceRoot .v214-panel select,
html body #view #maV214InvoiceRoot .v214-panel textarea{
  background-color:#fff!important;color:#17314d!important;
  border-color:#b9cad9!important;box-shadow:none!important;
  -webkit-text-fill-color:#17314d!important;
}
html body #view #maV214InvoiceRoot .v214-panel input:disabled,
html body #view #maV214InvoiceRoot .v214-panel select:disabled,
html body #view #maV214InvoiceRoot .v214-panel textarea:disabled{
  background-color:#eef3f8!important;color:#53697d!important;
  -webkit-text-fill-color:#53697d!important;
}
html body #view #maV214InvoiceRoot .v214-panel input::placeholder,
html body #view #maV214InvoiceRoot .v214-panel textarea::placeholder{color:#8192a4!important;opacity:1}
