/* copagoSyncWorkerWebGUI – Farbwelt: warmes Papiergrau, Tinte, sparsame Statusfarben */
:root {
    --papier: #F3F1EC;
    --flaeche: #FBFAF7;
    --weiss: #FFFFFF;
    --tinte: #1B1E22;
    --tinte-2: #33383F;
    --text: #2B2F35;
    --text-2: #4A4F57;
    --leise: #6A6F77;
    --sehr-leise: #9AA0A8;
    --linie: #E2DED6;
    --linie-2: #CFCAC0;
    --linie-3: #EEEAE4;
    --hover: #E6E2DA;
    --ok: #22613C;
    --ok-bg: #E8F2EC;
    --blau: #1F5FAD;
    --blau-bg: #E4EDF9;
    --rot: #A3261A;
    --rot-bg: #FBE9E7;
    --gelb: #8A5A07;
    --gelb-bg: #FBF1DE;
    --sans: "Segoe UI", "IBM Plex Sans", system-ui, -apple-system, sans-serif;
    --mono: "Cascadia Mono", "IBM Plex Mono", Consolas, ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--sans); font-size: 13px; background: var(--papier); color: var(--tinte); }
button, input, textarea, select { font: inherit; color: inherit; }
.mono { font-family: var(--mono); }
.klein { font-size: 12px; }
.nowrap { white-space: nowrap; }
.rechtsbuendig { text-align: right; }
.rechts { margin-left: auto; }
.text-leise { color: var(--leise); }
.text-fehler { color: var(--rot); }
.vorformatiert { white-space: pre-line; font-size: 13.5px; line-height: 1.5; margin: 0; }
hr { border: 0; border-top: 1px solid var(--linie-3); margin: 8px 0; }
:focus-visible { outline: 2px solid var(--blau); outline-offset: 2px; }

.ico { width: 16px; height: 16px; flex-shrink: 0; }
.ico-s { width: 14px; height: 14px; }

@keyframes ecg { from { transform: translateX(0); } to { transform: translateX(-120px); } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes einblenden { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.blink { animation: blink 1.2s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .blink, .ecg, .dlg, .toast { animation: none !important; } }

/* ---------- Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 6px; border: 1px solid transparent;
       font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; background: none; transition: background-color .12s; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-ghost { color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: var(--hover); }
.btn-ghost.aktiv, .btn-ghost.aktiv:hover { background: var(--tinte); color: #fff; }
.btn-primary { background: var(--tinte); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--tinte-2); }
.btn-outline { border-color: var(--linie-2); background: var(--weiss); }
.btn-outline:hover:not(:disabled) { background: #F7F5F1; }
.btn-danger { border-color: #E7B4AE; color: var(--rot); background: var(--weiss); }
.btn-danger:hover:not(:disabled) { background: #FBEDEB; }
.btn.links { margin-right: auto; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; padding: 6px; border: 0; border-radius: 6px; background: none; cursor: pointer; }
.icon-btn:hover { background: var(--hover); }
.icon-btn.rahmen { border: 1px solid var(--linie-2); background: var(--weiss); padding: 0 8px; }
.link { border: 0; background: none; padding: 0; text-decoration: underline; cursor: pointer; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: #7BD69C; }

/* ---------- Startseite */
.startseite { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.startkarte { max-width: 460px; width: 100%; background: var(--weiss); border: 1px solid var(--linie); border-radius: 8px; padding: 24px; text-align: center; margin: 40px auto; }
.startkarte h1 { font-size: 16px; margin: 0 0 6px; }
.startkarte .btn { margin-top: 12px; }
.login { text-align: left; }
.login h1 { font-size: 18px; margin: 4px 0 16px; }
.login-marke { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.marke-name.dunkel { color: var(--tinte); }
.marke-zusatz.dunkel { color: var(--leise); }
.login-form { margin-top: 8px; }
.login-btn { width: 100%; justify-content: center; height: 36px; margin-top: 4px; }
.login-meldung { font-size: 12.5px; padding: 8px 10px; border-radius: 6px; margin: 0 0 12px; }
.login-meldung.fehler { background: var(--rot-bg); color: var(--rot); }
.login-meldung.ok { background: var(--ok-bg); color: var(--ok); }
.diagnose { text-align: left; font-size: 11.5px; background: var(--papier); border: 1px solid var(--linie); border-radius: 6px; padding: 8px 10px; margin-top: 12px; line-height: 1.6; word-break: break-word; }
.start-icon { width: 40px; height: 40px; margin: 0 auto 12px; border-radius: 50%; background: var(--rot-bg); color: var(--rot); display: flex; align-items: center; justify-content: center; }
.start-icon .ico { width: 20px; height: 20px; }

/* ---------- Layout */
.seite { min-height: 100vh; display: flex; flex-direction: column; }
.kopf { background: var(--tinte); color: #fff; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding: 10px 16px; }
.marke { display: flex; align-items: baseline; gap: 8px; }
.marke-name { font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.marke-zusatz { color: rgba(255,255,255,.5); font-weight: 500; }
.marke-version { font-size: 11px; color: rgba(255,255,255,.4); }
.instanz { display: flex; align-items: center; gap: 8px; font-size: 12px; min-width: 0; }
.instanz-label { color: rgba(255,255,255,.5); }
.instanz-wert { background: rgba(255,255,255,.1); border-radius: 4px; padding: 3px 8px; color: rgba(255,255,255,.9); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kopf-rechts { display: flex; align-items: center; gap: 20px; margin-left: auto; flex-wrap: wrap; }
.status-block { display: flex; align-items: center; gap: 16px; }
.instanz-select { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.2); border-radius: 4px; padding: 3px 6px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.instanz-select option { color: var(--tinte); background: #fff; }
.benutzer { display: flex; align-items: center; gap: 8px; padding-left: 16px; border-left: 1px solid rgba(255,255,255,.15); }
.benutzer-name { font-size: 12px; color: rgba(255,255,255,.75); }
.btn-kopf { height: 28px; color: rgba(255,255,255,.85); border-color: rgba(255,255,255,.25); font-size: 12px; }
.btn-kopf:hover { background: rgba(255,255,255,.1); }
.seite > .startkarte { margin: 48px auto; }
.status-text { font-weight: 600; font-size: 13px; }
.status-sub { font-size: 11px; color: rgba(255,255,255,.55); }
.ecg-box { position: relative; width: 120px; height: 40px; overflow: hidden; }
.ecg { animation: ecg 1.6s linear infinite; }
.ecg-fade { position: absolute; inset: 0 0 0 auto; width: 32px; background: linear-gradient(to left, var(--tinte), transparent); }

.werkzeuge { background: var(--flaeche); border-bottom: 1px solid var(--linie); padding: 6px 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.trenner { width: 1px; height: 20px; background: #DAD6CE; margin: 0 4px; }
.suche { position: relative; margin-left: auto; min-width: 200px; }
.suche input { width: 256px; max-width: 100%; height: 32px; padding: 0 8px 0 30px; border: 1px solid var(--linie-2); border-radius: 6px; background: var(--weiss); }
.suche-ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--sehr-leise); }

.kennzahlen { display: flex; flex-wrap: wrap; gap: 4px 24px; padding: 12px 16px 0; font-size: 12px; color: var(--text-2); }
.inhalt { flex: 1; padding: 8px 16px 16px; }
.fuss { border-top: 1px solid var(--linie); background: var(--flaeche); padding: 6px 16px; display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 11.5px; color: var(--text-2); }
.abgeschnitten { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

/* ---------- Tabelle */
.tabelle-rahmen { border: 1px solid var(--linie); border-radius: 8px; background: var(--flaeche); overflow-x: auto; }
table.jobs { width: 100%; min-width: 1080px; border-collapse: collapse; }
table.jobs thead th { position: sticky; top: 0; background: var(--flaeche); text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--linie);
                      font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; color: var(--leise); white-space: nowrap; }
table.jobs thead th button { border: 0; background: none; padding: 0; cursor: pointer; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; }
table.jobs thead th button:hover { color: var(--tinte); }
table.jobs td { padding: 8px 12px; }
tr.gruppe td { padding: 16px 12px 6px; }
.gruppe-titel { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.gruppe-anzahl { font-size: 11px; color: var(--sehr-leise); margin-left: 8px; }
.ton-ok { color: var(--ok); }
.ton-leise { color: var(--leise); }
.gruppe-leer { color: var(--sehr-leise); font-size: 12px; }
tr.job { background: var(--weiss); border-bottom: 1px solid var(--linie-3); cursor: default; user-select: none; }
tr.job:hover { background: #F7F5F1; }
tr.job.gewaehlt { background: var(--tinte); color: #fff; }
tr.job.gewaehlt td.server { color: rgba(255,255,255,.7); }
tr.job.entfernt { opacity: .6; }
td.name { font-weight: 500; white-space: nowrap; }
td.server { font-size: 11.5px; color: var(--leise); }
td.leer, .leer { padding: 32px; text-align: center; color: var(--leise); }

.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 4px; padding: 2px 6px; font-size: 11.5px; font-weight: 600; }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-ready { background: var(--ok-bg); color: var(--ok); }
.pill-running { background: var(--blau-bg); color: var(--blau); }
.pill-failed { background: var(--rot-bg); color: var(--rot); }
.pill-provisioning { background: var(--gelb-bg); color: var(--gelb); }
.pill-removing { background: var(--linie-3); color: var(--leise); text-decoration: line-through; }
.pill-unbekannt { background: var(--linie-3); color: var(--leise); }

.tabelle-scroll { overflow-x: auto; }
table.queue { width: 100%; border-collapse: collapse; font-size: 12px; }
table.queue th { text-align: left; font-size: 11px; color: var(--leise); padding: 8px 16px 8px 0; border-bottom: 1px solid var(--linie); white-space: nowrap; }
table.queue td { padding: 6px 16px 6px 0; border-bottom: 1px solid var(--linie-3); white-space: nowrap; }

/* ---------- Dialoge */
.overlay { position: fixed; inset: 0; display: flex; background: rgba(27,30,34,.4); outline: none; }
.dlg { background: var(--flaeche); display: flex; flex-direction: column; box-shadow: 0 20px 50px rgba(0,0,0,.25); animation: einblenden .18s ease-out; }
.dlg-normal, .dlg-wide { margin: auto; width: calc(100% - 32px); max-height: 90vh; border-radius: 8px; }
.dlg-normal { max-width: 560px; }
.dlg-wide { max-width: 1040px; }
.dlg-side { margin-left: auto; height: 100%; width: 100%; max-width: 680px; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; height: 56px; padding: 0 20px; border-bottom: 1px solid var(--linie); flex-shrink: 0; }
.dlg-head h2 { font-size: 15px; font-weight: 600; margin: 0; }
.dlg-body { overflow-y: auto; padding: 16px 20px; flex: 1; }
.dlg-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--linie); flex-shrink: 0; }

/* ---------- Formulare */
.sektion { border: 1px solid var(--linie); border-radius: 8px; background: var(--weiss); padding: 8px 16px 10px; margin: 0 0 16px; min-width: 0; }
.sektion:disabled { opacity: .6; }
.sektion legend { padding: 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; color: var(--leise); }
fieldset.innen { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.innen:disabled { opacity: .5; }
.feld { margin-bottom: 12px; }
.feld label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.eingabe { width: 100%; border: 1px solid var(--linie-2); border-radius: 6px; background: var(--weiss); padding: 6px 10px; font-size: 13px; resize: vertical; }
.eingabe[readonly], .eingabe:disabled { background: #EFECE6; color: #6A6F77; }
.eingabe.fehlerhaft { border-color: #C9473A; background: #FDF5F4; }
.feld-fehler { display: flex; align-items: center; gap: 4px; color: var(--rot); font-size: 12px; margin: 4px 0 0; }
.feld-hinweis { color: #7A7F87; font-size: 11.5px; margin: 4px 0 0; }
.check { display: flex; align-items: flex-start; gap: 8px; padding: 4px 0; font-size: 13px; cursor: pointer; }
.check input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--tinte); }
.check.aus { opacity: .55; cursor: default; }
.check small { color: #7A7F87; margin-left: 6px; font-size: 11px; }
.zeile { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px; }
.zeile.eng { gap: 4px; flex-wrap: nowrap; margin: 0; }
.grid-nr { display: grid; grid-template-columns: 160px 1fr; gap: 0 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.grid-opt { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.abstand-oben { margin-top: 8px; }
.test-ok { display: inline-flex; align-items: center; gap: 4px; color: #2F7D4F; font-size: 12px; }
.test-err { color: var(--rot); font-size: 12px; }
.test-info { color: var(--leise); font-size: 12px; }

@media (max-width: 760px) {
    .grid-nr, .grid-2, .grid-opt { grid-template-columns: 1fr; }
    .kopf-rechts { margin-left: 0; }
    .benutzer { border-left: 0; padding-left: 0; }
    .suche { margin-left: 0; flex: 1; }
    .suche input { width: 100%; }
}

/* ---------- Meldungen */
.toaster { position: fixed; right: 16px; bottom: 48px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: 400px; }
.toast { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 6px; border: 1px solid; font-size: 12.5px; box-shadow: 0 8px 24px rgba(0,0,0,.12); animation: einblenden .18s ease-out; }
.toast-ok { background: var(--weiss); border-color: #CFE3D6; }
.toast-ok .toast-ico { color: #2F7D4F; }
.toast-info { background: var(--weiss); border-color: #EBD9B4; }
.toast-info .toast-ico { color: var(--gelb); }
.toast-error { background: #FDF5F4; border-color: #E7B4AE; color: #7A1C12; }
.toast-text { flex: 1; }
.toast-x { border: 0; background: none; padding: 0; cursor: pointer; opacity: .6; }
.toast-x:hover { opacity: 1; }

/* ---------- Blazor-Fehlerleiste */
#blazor-error-ui { background: #FBE9E7; color: #7A1C12; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2); display: none; left: 0; padding: .6rem 1.25rem .7rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }
#blazor-error-ui .reload { margin-left: 8px; color: inherit; font-weight: 600; }
