@import url("table-layout.css?v=20260918-yoursites-row-actions-v1");

/* Consolidated UI layer: shared spacing, controls, tables and accessibility. */
:root {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --radius-control: 11px;
  --radius-panel: 18px;
  --control-height: 42px;
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--blue) 24%, transparent);
  --table-font-size: 12px;
  --table-header-size: 10px;
}

* { box-sizing: border-box; }

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.button,
a.button,
button.button {
  min-height: var(--control-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0 var(--space-4);
  border-radius: var(--radius-control);
  text-decoration: none !important;
  font-weight: 800;
  line-height: 1.2;
}

.button-small,
a.button-small,
button.button-small { min-height: 34px; padding-inline: 12px; }

.panel { border-radius: var(--radius-panel); }
.panel-head { gap: var(--space-4); padding: var(--space-5) var(--space-6); }
.panel-head-actions { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.panel-head-actions .button { white-space: nowrap; }

.searchbar { gap: var(--space-2); }
.searchbar :where(input, select, button, .button) { min-height: var(--control-height); }

:where(input, select, textarea) {
  border-radius: var(--radius-control);
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

:where(input, select, textarea):focus {
  border-color: color-mix(in srgb, var(--blue) 65%, #fff);
  box-shadow: var(--focus-ring);
}

/* Compact system settings use the same controls as the main forms. */
.audit-settings-actions input[type="number"] {
  width: 190px;
  min-width: 190px;
  min-height: var(--control-height);
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: #fff;
  color: var(--ink);
  font: 700 13px/1.2 inherit;
  font-variant-numeric: tabular-nums;
}

.audit-settings-actions input[type="number"]:hover {
  border-color: color-mix(in srgb, var(--blue) 42%, var(--line));
}

.table-wrap { scrollbar-gutter: stable; }
.table-panel table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.table-panel :where(th, td) {
  padding: 10px 7px;
  font-size: var(--table-font-size);
  line-height: 1.35;
  vertical-align: middle;
}
.table-panel :where(th, td):first-child { padding-left: 18px !important; }
.table-panel :where(th, td):last-child { padding-right: 18px; }
.table-panel th {
  font-size: var(--table-header-size);
  letter-spacing: .055em;
  line-height: 1.2;
  text-transform: uppercase;
}
.table-panel thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f7f9fa;
  box-shadow: 0 1px 0 var(--line);
}
.table-panel tbody tr { transition: background-color .14s ease; }
.table-panel tbody tr:hover { background: color-mix(in srgb, var(--blue) 4%, #fff); }
.table-panel td > :where(strong, small) { min-width: 0; }
.table-panel td small { line-height: 1.3; }
.table-panel td > small.organization-inline {
  display: inline-flex;
  align-items: center;
  column-gap: 7px;
}
.table-panel td > small.organization-inline > i { margin: 0; }

.status,
.pill,
.table-summary span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 5px 9px;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 11px;
  line-height: 1;
}

.record-edit-link,
.customer-name-link,
.table-sort { text-underline-offset: 3px; text-decoration-thickness: 1px; }
.record-edit-link:hover,
.customer-name-link:hover,
.table-sort:hover { text-decoration: underline; }

.organization-switcher,
.sidebar nav a { width: 100%; }
.sidebar nav a { min-height: 34px; }

.customer-timeline { margin-top: var(--space-5); }
.timeline-list { list-style: none; margin: 0; padding: 0 var(--space-6) var(--space-5); }
.timeline-list li {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: start;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}
.timeline-list i { width: 9px; height: 9px; margin-top: 5px; border-radius: 50%; background: var(--blue); }
.timeline-list strong,
.timeline-list small { display: block; }
.timeline-list small { margin-top: 3px; color: var(--muted); }
.timeline-list time { white-space: nowrap; color: var(--muted); font-size: 11px; }

.tariff-impact {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
  margin: var(--space-4) 0;
}
.tariff-impact > div { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafb; }
.tariff-impact span,
.tariff-impact strong { display: block; }
.tariff-impact span { color: var(--muted); font-size: 11px; }
.tariff-impact strong { margin-top: 4px; font-size: 16px; }

.saved-filter-action { display: none; }
.saved-filter-action.is-visible { display: inline-flex; }

.session-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.session-list li { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.session-list strong, .session-list small { display: block; }
.session-list small { margin-top: 2px; color: var(--muted); }
.authentication-settings-layout { display: grid; grid-template-columns: minmax(320px,.8fr) minmax(460px,1.2fr); align-items: start; gap: 18px; }
.authentication-lifetime-form,.authentication-session-panel { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #f8fafb; }
.authentication-settings-layout .authentication-lifetime-form { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 12px; }
.authentication-lifetime-form label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 750; }
.authentication-lifetime-form input { width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; outline: 0; background: #fff; color: var(--ink); font: 700 13px/1.2 inherit; }
.authentication-lifetime-form input:focus { border-color: var(--sky); box-shadow: 0 0 0 3px rgba(44,149,218,.18); }
.authentication-lifetime-form small { color: var(--muted); font-size: 11px; font-weight: 600; line-height: 1.45; }
.authentication-lifetime-form .button { min-height: 42px; white-space: nowrap; }
.authentication-session-panel>.eyebrow { margin-bottom: 10px; }
.authentication-session-panel .session-list { --session-row-height: 58px; max-height: calc((var(--session-row-height) * 3) + 16px); overflow-y: auto; padding-right: 4px; scrollbar-gutter: stable; }
.authentication-session-panel .session-list li { min-height: var(--session-row-height); align-items: center; background: #fff; }
.authentication-session-panel .session-list li div { min-width: 0; }
.authentication-session-panel .session-list li small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.authentication-settings-layout .authentication-revoke-form { display: block; margin-top: 12px; }
.authentication-settings + .settings-account-grid { margin-top: 18px; }
.cron-settings-grid .settings-switch { display:flex; align-items:flex-start; gap:12px; padding:14px 16px; border:1px solid var(--line); border-radius:12px; background:#f8fafb; }
.cron-settings-grid .settings-switch input { width:18px; height:18px; margin-top:2px; flex:0 0 auto; }
.cron-settings-grid .settings-switch span { display:grid; gap:4px; }
.cron-settings-grid .settings-switch small { display:block; color:var(--muted); }
.automation-status-panel { margin-top:18px; margin-bottom:18px; }
.automation-status-panel .table-wrap { max-height:260px; }
@media(max-width:1050px) { .authentication-settings-layout { grid-template-columns: 1fr; } }
@media(max-width:620px) { .authentication-settings-layout .authentication-lifetime-form { grid-template-columns: 1fr; } .authentication-lifetime-form .button,.authentication-revoke-form .button { width: 100%; } }
.error-category { color: #a93427; }

/* Operational workspaces */
.table-profile-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-top: 1px solid var(--line);
  background: #fbfcfd;
}
.table-profile-bar > span { margin-right: 4px; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.table-profile-bar button { min-height: 30px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--navy); font: inherit; font-size: 11px; font-weight: 800; cursor: pointer; }
.table-profile-bar button.is-active { border-color: var(--blue); background: var(--blue); color: #fff; }
.record-panel-trigger { display: block; width: 100%; padding: 0; border: 0; background: transparent; color: var(--navy); font: inherit; font-weight: 800; text-align: left; cursor: pointer; }
.record-panel-trigger:hover { color: var(--blue); }

.webservice-table[data-active-profile="compact"] [data-profile-column="technical"],
.webservice-table[data-active-profile="technical"] [data-profile-column="calculation"],
.webservice-table[data-active-profile="calculation"] [data-profile-column="technical"] { display: none; }
.webservice-table[data-active-profile="technical"] [data-profile-column="technical"] { display: table-cell !important; }
.profile-column-hidden { display: none !important; }
.table-panel[data-active-profile]:not([data-active-profile="all"]) table {
  width: 100%;
  min-width: 100%;
  table-layout: fixed;
}
.customer-directory-table[data-active-profile="compact"] :where(th,td),
.customer-directory-table[data-active-profile="technical"] :where(th,td),
.customer-directory-table[data-active-profile="calculation"] :where(th,td) { width: auto !important; }

.dialog-close { width: 36px; height: 36px; border: 0; border-radius: 50%; background: #edf2f5; font-size: 24px; cursor: pointer; }

.detail-side-panel { position: fixed; z-index: 70; inset: 0 0 0 auto; width: min(760px, 92vw); background: #f2f6f8; box-shadow: -20px 0 60px rgba(14,55,85,.2); }
.detail-side-panel[hidden],.detail-panel-backdrop[hidden] { display: none; }
.detail-side-panel > header { display: flex; align-items: center; justify-content: space-between; height: 58px; padding: 0 18px; border-bottom: 1px solid var(--line); background: #fff; }
.detail-side-panel > header button { width: 36px; height: 36px; border: 0; border-radius: 50%; background: #edf2f5; font-size: 22px; cursor: pointer; }
.detail-side-panel [data-detail-panel-content] { height: calc(100% - 58px); }
.detail-panel-frame { width: 100%; height: 100%; border: 0; background: #f2f6f8; }
.detail-panel-backdrop { position: fixed; z-index: 69; inset: 0; background: rgba(15,31,43,.35); }
body.detail-panel-open { overflow: hidden; }

.quality-summary-grid,.technical-result-grid,.revenue-comparison-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.dashboard-kpi-filter { display: flex; justify-content: flex-end; margin: 0 0 12px; }
.dashboard-kpi-filter label { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 11px; font-weight: 800; }
.dashboard-kpi-filter select { width: 190px; min-height: var(--control-height); padding: 0 38px 0 13px; border: 1px solid var(--line); background-color: #fff; color: var(--ink); font: 700 13px/1.2 inherit; }
.revenue-projection { margin-bottom: 18px; }
.revenue-projection .revenue-projection-toolbar { align-items: end; }
.revenue-projection .revenue-projection-toolbar label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 800; }
.revenue-projection .revenue-projection-toolbar input[type="date"] { width: 172px; min-height: 42px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 11px; outline: 0; background: #fff; color: var(--ink); font: 700 13px/1.2 inherit; color-scheme: light; transition: border-color .15s ease,box-shadow .15s ease; }
.revenue-projection .revenue-projection-toolbar input[type="date"]:hover { border-color: #aebdca; }
.revenue-projection .revenue-projection-toolbar input[type="date"]:focus { border-color: var(--sky); box-shadow: 0 0 0 3px rgba(44,149,218,.18); }
.revenue-projection .revenue-projection-toolbar input[type="date"]::-webkit-calendar-picker-indicator { width: 18px; height: 18px; margin: 0; padding: 2px; cursor: pointer; opacity: .65; }
.revenue-projection .revenue-projection-toolbar .button { min-height: 42px; }
.quality-overview-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
.quality-kpi { padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.quality-kpi.is-ok { border-color: #9bd8c2; background: #f0faf6; }
.quality-kpi.is-alert { border-color: #efb2aa; background: #fff5f3; }
.quality-kpi span,.quality-kpi small { display: block; color: var(--muted); }
.quality-kpi strong { display: block; margin: 5px 0 2px; font-size: 25px; }
.quality-cockpit { margin-bottom: 18px; }
.quality-issue-list { max-height: 620px; overflow: auto; }
.quality-summary-grid article,.revenue-comparison-grid article { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.quality-summary-grid strong,.revenue-comparison-grid strong { display: block; margin-top: 5px; font-size: 24px; }
.quality-task-table { table-layout: fixed; }
.quality-task-table th:nth-child(1),.quality-task-table td:nth-child(1) { width: 25%; }
.quality-task-table th:nth-child(2),.quality-task-table td:nth-child(2) { width: 17%; }
.quality-task-table th:nth-child(3),.quality-task-table td:nth-child(3) { width: 31%; }
.quality-task-table th:nth-child(4),.quality-task-table td:nth-child(4) { width: 27%; }
.quality-task-table tbody tr.severity-1 td:first-child { box-shadow: inset 3px 0 #d84b3e; }
.quality-task-table tbody tr:not(.severity-1) td:first-child { box-shadow: inset 3px 0 #dfa02d; }
.quality-task-table td > strong,.quality-task-detail { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quality-task-table .status { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.quality-task-detail { color: var(--ink); }
.quality-issue-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; white-space: nowrap; }
.quality-issue-actions form { display: flex; gap: 6px; margin: 0; }
.quality-issue-actions input[type="date"] { width: 124px; min-height: 32px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-size: 11px; }
.quality-issue-actions .button-small { min-height: 32px; padding-inline: 9px; font-size: 11px; }
.quality-issue-actions .quality-primary-action,
.organization-pulswerk .panel .quality-issue-actions .quality-primary-action {
  min-width: 64px;
  color: #fff !important;
  opacity: 1;
}
.quality-issue-actions .quality-primary-action > span { display: inline; color: inherit; }
.technical-check-layout { display: grid; grid-template-columns: 280px minmax(0,1fr); gap: 18px; padding: 20px; }
.technical-selector { display: grid; grid-template-columns: 210px minmax(0,1fr); gap: 12px; padding: 18px 20px; border-top: 1px solid var(--line); }
.technical-selector > label { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.technical-selector > div { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; max-height: 260px; overflow: auto; }
.technical-selector > div label { display: grid; grid-template-columns: auto minmax(0,1fr); column-gap: 7px; align-items: start; padding: 8px; border: 1px solid var(--line); border-radius: 9px; }
.technical-selector > div label small { grid-column: 2; color: var(--muted); }
.long-operation-state { display: flex; align-items: center; gap: 12px; margin: 0 20px 16px; padding: 12px; border-radius: 11px; background: #edf7fe; }
.long-operation-state[hidden] { display: none !important; }
.long-operation-state .spinner { width: 20px; height: 20px; border: 2px solid #9dc9e7; border-right-color: var(--blue); border-radius: 50%; animation: ds-spin .7s linear infinite; }
.long-operation-state strong,.long-operation-state small { display: block; }
.long-operation-state small { margin-top: 2px; color: var(--muted); }
.technical-results { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; padding: 0 20px 20px; }
.technical-results > article { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.technical-results > article > div:first-child { flex: 1 1 220px; }
.technical-results > article > div:first-child small { display: block; color: var(--muted); }
.technical-results > article > small { flex-basis: 100%; color: var(--muted); overflow-wrap: anywhere; }
.technical-results > article > dl { flex-basis: 100%; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; margin: 4px 0 0; }
.technical-results dt { color: var(--muted); font-size: 10px; font-weight: 800; }
.technical-results dd { margin: 3px 0 0; overflow-wrap: anywhere; }
.technical-check-layout select[multiple] { width: 100%; min-height: 260px; }
.technical-progress { margin-top: 10px; padding: 10px; border-radius: 10px; background: #e8f3fb; color: var(--navy); }
.technical-result-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.technical-result-grid article { padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.technical-result-grid article > small { display: block; margin: 3px 0 10px; color: var(--muted); }
.technical-result-grid dl { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; margin: 0; }
.technical-result-grid dl div { min-width: 0; padding: 7px; border-radius: 8px; background: #f4f7f9; }
.technical-result-grid dt { color: var(--muted); font-size: 10px; font-weight: 800; }
.technical-result-grid dd { overflow-wrap: anywhere; margin: 3px 0 0; font-size: 11px; }
.email-template-grid { display: grid; grid-template-columns: minmax(300px,.8fr) minmax(0,1.2fr); gap: 18px; padding: 20px; }
.email-template-layout { display: grid; grid-template-columns: minmax(280px,.8fr) minmax(0,1.2fr); gap: 18px; padding: 0 20px 20px; }
.email-template-form { display: grid; gap: 10px; }
.email-template-form-heading h3,.email-template-form-heading p { margin: 0; }
.email-template-form-heading p:last-child { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.email-template-accordion { padding: 0; overflow: hidden; }
.email-template-summary { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 22px 26px; cursor: pointer; list-style: none; user-select: none; }
.email-template-summary::-webkit-details-marker { display: none; }
.email-template-summary:focus-visible { outline: 3px solid rgba(44,149,218,.18); outline-offset: -3px; }
.email-template-summary h2 { margin: 2px 0 0; }
.email-template-summary .body-copy { margin: 8px 0 0; }
.email-template-summary-action { display: inline-flex; align-items: center; gap: 12px; flex: 0 0 auto; color: var(--blue); }
.email-template-summary-action>strong { font-size: 12px; }
.email-template-summary-action i { width: 11px; height: 11px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .2s ease; }
.email-template-accordion[open] .email-template-summary-action i { transform: rotate(225deg); }
.email-template-accordion[open] .email-template-summary-action>strong { font-size: 0; }
.email-template-accordion[open] .email-template-summary-action>strong::after { content: "Vorlagen schließen"; font-size: 12px; }
.email-template-accordion-content { padding-top: 20px; border-top: 1px solid var(--line); }
@media(max-width:720px) { .email-template-summary { align-items: flex-start; padding: 18px; } .email-template-summary .body-copy,.email-template-summary-action>strong { display: none; } .email-template-summary-action { gap: 8px; } }
.email-campaign-table .empty-state a.button-primary { color: #fff; }
.provider-cost-accordion { margin-top: 15px; padding: 0; overflow: hidden; }
.provider-cost-summary { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 22px 26px; cursor: pointer; list-style: none; user-select: none; }
.provider-cost-summary::-webkit-details-marker { display: none; }
.provider-cost-summary:focus-visible { outline: 3px solid rgba(44,149,218,.18); outline-offset: -3px; }
.provider-cost-summary h2 { margin: 2px 0 0; }
.provider-cost-summary .body-copy { margin: 8px 0 0; }
.provider-cost-summary-action { display: inline-flex; align-items: center; gap: 12px; flex: 0 0 auto; color: var(--blue); font-size: 12px; font-weight: 800; }
.provider-cost-summary-action i { width: 11px; height: 11px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .2s ease; }
.provider-cost-accordion[open] .provider-cost-summary-action i { transform: rotate(225deg); }
.provider-cost-accordion[open] .provider-cost-summary-action span { font-size: 0; }
.provider-cost-accordion[open] .provider-cost-summary-action span::after { content: "Formular schließen"; font-size: 12px; }
.provider-cost-accordion .provider-cost-form { margin: 0; border-top: 1px solid var(--line); }
.provider-cost-accordion-content { grid-template-columns: minmax(0,1fr); padding: 24px 26px; }
@media(max-width:720px) { .provider-cost-summary { align-items: flex-start; padding: 18px; } .provider-cost-summary .body-copy { display: none; } .provider-cost-summary-action span { display: none; } .provider-cost-accordion-content { padding: 18px; } }
.email-template-list { display: grid; gap: 8px; }
.email-template-list article { padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.email-template-list small { display: block; margin-top: 3px; color: var(--muted); }
.email-schedule-panel { display: grid; grid-template-columns: minmax(0,1fr) minmax(320px,.8fr); gap: 20px; align-items: center; padding: 20px; }
.email-schedule-panel form { display: grid; gap: 9px; }
.email-event-log { margin-top: 18px; }
.revenue-projection-toolbar { display: flex; align-items: end; gap: 10px; }

.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.is-loading::after { content: ''; position: absolute; width: 17px; height: 17px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; color: var(--blue); animation: ds-spin .7s linear infinite; }
@keyframes ds-spin { to { transform: rotate(360deg); } }
.empty-state { display: grid; justify-items: center; gap: 7px; padding: 36px 18px; text-align: center; }
.empty-state h3,.empty-state p { margin: 0; }
.empty-state p { color: var(--muted); }

[id] { scroll-margin-block: 96px; }
.is-anchor-highlighted { animation: dg-anchor-highlight 3.1s ease-out; }
.is-anchor-highlighted > td { animation: dg-anchor-cell-highlight 3.1s ease-out; }
@keyframes dg-anchor-highlight {
  0%,28% { box-shadow: 0 0 0 4px rgba(44,149,218,.58), 0 14px 32px rgba(14,55,85,.18); }
  55% { box-shadow: 0 0 0 2px rgba(44,149,218,.22), 0 8px 20px rgba(14,55,85,.08); }
  100% { box-shadow: 0 0 0 0 rgba(44,149,218,0), 0 0 0 rgba(14,55,85,0); }
}
@keyframes dg-anchor-cell-highlight {
  0%,28% { background-color: #eaf6ff; }
  100% { background-color: transparent; }
}

body.embedded-panel { background: #f2f6f8; }
body.embedded-panel main { width: 100%; min-height: 100vh; padding: 20px; }
body.embedded-panel .topbar { margin-top: 0; }
body.embedded-panel .sidebar { display: none !important; }
body.embedded-panel .shell { display: block !important; }

@media print {
  .sidebar,.topbar .button,.searchbar,.revenue-projection-toolbar { display: none !important; }
  .shell,main { display: block !important; width: 100% !important; margin: 0 !important; padding: 0 !important; }
  .panel { box-shadow: none !important; }
}

@media (max-width: 900px) {
  .panel-head { padding: 18px; }
  .table-profile-bar { margin: 0; padding-inline: 14px; overflow-x: auto; flex-wrap: nowrap; }
  .table-panel .table-wrap { overflow: visible; }
  .table-panel table,.table-panel thead,.table-panel tbody,.table-panel tr,.table-panel td { display: block; width: 100%; }
  .table-panel table { min-width: 0; table-layout: fixed; }
  .table-panel thead { display: none; }
  .table-panel tbody { display: grid; gap: 10px; padding: 12px; }
  .table-panel tbody tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
  .table-panel tbody td { display: grid; grid-template-columns: minmax(90px,.42fr) minmax(0,.58fr); align-items: start; gap: 8px; min-height: 42px; padding: 9px 12px !important; border-bottom: 1px solid #edf1f3; }
  .table-panel tbody td::before { content: attr(data-label); color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
  .table-panel tbody td:first-child { grid-column: 1/-1; font-size: 14px; }
  .table-panel tbody td:first-child::before { display: none; }
  .table-panel tfoot { display: none; }
  .quality-summary-grid,.quality-overview-grid,.revenue-comparison-grid,.technical-result-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .technical-check-layout,.technical-selector,.email-template-grid,.email-template-layout,.email-schedule-panel { grid-template-columns: 1fr; }
  .technical-selector > div,.technical-results { grid-template-columns: 1fr; }
  .detail-side-panel { width: 100vw; }
  .tariff-impact { grid-template-columns: 1fr; }
  .timeline-list { padding-inline: 18px; }
}

@media (max-width: 560px) {
  .table-panel tbody tr { grid-template-columns: 1fr; }
  .table-panel tbody td { grid-template-columns: minmax(105px,.42fr) minmax(0,.58fr); }
  .quality-summary-grid,.quality-overview-grid,.revenue-comparison-grid,.technical-result-grid { grid-template-columns: 1fr; }
  .dashboard-kpi-filter,.dashboard-kpi-filter label { width: 100%; }
  .dashboard-kpi-filter label { align-items: stretch; flex-direction: column; }
  .dashboard-kpi-filter select { width: 100%; }
  .quality-issue-actions { justify-content: flex-start; flex-wrap: wrap; white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Application status bar and persistent color scheme. */
:root {
  --surface: #fff;
  --surface-raised: #fff;
  --surface-subtle: #f7f9fa;
  --surface-muted: #eef3f6;
}
html[data-theme="light"] { color-scheme: light; }

.app-workspace { min-width: 0; }
.app-statusbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 58px;
  padding: 8px clamp(24px,4vw,58px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-raised) 94%, transparent);
  box-shadow: 0 5px 18px rgba(14,55,85,.04);
  backdrop-filter: blur(14px);
}
.app-statusbar-title { display: inline-flex; align-items: center; gap: 9px; min-width: 0; white-space: nowrap; }
.app-statusbar-title strong { overflow: hidden; color: var(--ink); font-size: 13px; text-overflow: ellipsis; }
.app-status-indicator { width: 9px; height: 9px; border-radius: 50%; background: var(--organization-color,var(--blue)); box-shadow: 0 0 0 4px color-mix(in srgb,var(--blue) 12%,transparent); }
.app-statusbar-controls { display: flex; align-items: center; justify-content: flex-end; gap: 14px; min-width: 0; }
.statusbar-organization { display: flex; align-items: center; gap: 8px; margin: 0; }
.statusbar-control { display: flex; align-items: center; gap: 7px; margin: 0; color: var(--muted); font-size: 11px; white-space: nowrap; }
.statusbar-control > span,.statusbar-organization-locked > span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .035em; text-transform: uppercase; }
.statusbar-control select {
  width: auto;
  min-width: 112px;
  min-height: 36px;
  padding: 7px 32px 7px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-raised);
  color: var(--ink);
  font: 750 12px/1.2 inherit;
  cursor: pointer;
}
.statusbar-organization .statusbar-control select { min-width: 150px; border-left: 3px solid var(--organization-color,var(--blue)); }
.statusbar-organization.is-switching { opacity: .6; pointer-events: none; }
.statusbar-organization-locked { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.statusbar-organization-locked strong { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-subtle); color: var(--ink); font-size: 12px; }
.statusbar-organization-locked i { width: 8px; height: 8px; border-radius: 50%; background: var(--organization-color,var(--blue)); }

@media (max-width: 760px) {
  .sidebar nav { overflow-x: auto; overflow-y: hidden; }
  .sidebar .nav-group { width: max-content; min-width: max-content; }
  .sidebar nav a { width: auto; min-width: max-content; flex: 0 0 auto; }
  .app-statusbar { position: sticky; align-items: stretch; flex-direction: column; gap: 8px; padding: 10px 16px; }
  .app-statusbar-title { display: none; }
  .app-statusbar-controls { justify-content: stretch; width: 100%; gap: 8px; }
  .statusbar-organization { flex: 1 1 auto; min-width: 0; }
  .statusbar-control { flex: 1 1 auto; align-items: stretch; flex-direction: column; gap: 3px; min-width: 0; }
  .statusbar-control select,.statusbar-organization .statusbar-control select { width: 100%; min-width: 0; }
  .statusbar-theme-control { flex: 0 0 112px; }
  .statusbar-organization-locked { flex: 1 1 auto; align-items: stretch; flex-direction: column; gap: 3px; }
  .statusbar-organization-locked strong { min-height: 36px; }
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e8f0f6;
  --blue: #68b7ee;
  --sky: #6ec5ff;
  --navy: #75bce8;
  --muted: #9dafbf;
  --line: #304454;
  --paper: #0b141d;
  --white: #13212c;
  --mint: #173c46;
  --green: #69d0ac;
  --sand: #40382f;
  --lilac: #293749;
  --alert: #ff9388;
  --warning: #f1bc69;
  --surface: #111f2a;
  --surface-raised: #152531;
  --surface-subtle: #192a36;
  --surface-muted: #223542;
  --shadow: 0 14px 38px rgba(0,0,0,.28);
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--sky) 32%, transparent);
}
html[data-theme="dark"] body { background: var(--paper); color: var(--ink); }
html[data-theme="dark"] .app-statusbar { background: rgba(17,31,42,.94); box-shadow: 0 7px 22px rgba(0,0,0,.2); }
html[data-theme="dark"] :where(.panel,.kpi-card,.gate-card,.login-card,.yoursites-kpis article,.detail-side-panel,.dialog-card,.inventory-tabs a,.section-tabs,.plugin-subscription-create) {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}
html[data-theme="dark"] :where(input,select,textarea,.button-ghost,.filter,.maintenance-filter,.icon-button,.dialog-close,.summary-edit,.edit-icon,.yoursites-admin-link,.table-profile-bar button,.column-picker summary,.column-picker fieldset,.extra-field-select,.extra-field-input) {
  border-color: var(--line);
  background-color: var(--surface-raised);
  color: var(--ink);
}
html[data-theme="dark"] input::placeholder,html[data-theme="dark"] textarea::placeholder { color: #7890a2; }
html[data-theme="dark"] :where(th,.table-panel thead th) { background: var(--surface-subtle); color: var(--muted); }
html[data-theme="dark"] .table-panel thead th,html[data-theme="dark"] table th { background: var(--surface-subtle); color: var(--muted); }
html[data-theme="dark"] .table-panel tbody tr:hover { background: color-mix(in srgb,var(--blue) 9%,var(--surface)); }
html[data-theme="dark"] .table-panel tbody tr { border-color: var(--line); }
html[data-theme="dark"] :where(.form-actions,.access-scope,.access-password-action,.access-current-password,.authentication-lifetime-form,.authentication-session-panel,.settings-check-list label,.provider-cost-list>div,.customer-profile-summary div,.organization-summary-grid>article,.health-card,.health-empty,.technical-check-status,.technical-selector,.technical-result-grid article,.quality-kpi,.quality-summary-grid article,.revenue-comparison-grid article,.plugin-subscription-card,.scheduled-change-list>article,.scheduled-change-create,.new-website-fields,.address-list,.review-new-customer,.email-template-list article,.email-schedule-panel,.yoursites-site-progress-row,.yoursites-job-counts span) {
  border-color: var(--line);
  background: var(--surface-subtle);
  color: var(--ink);
}
html[data-theme="dark"] :where(.session-list li,.authentication-session-panel .session-list li) { border-color: var(--line); background: var(--surface-raised); }
html[data-theme="dark"] :where(.notice,.quality-health-warning) { border-color: #704a46; background: #2b2022; }
html[data-theme="dark"] .notice-success { border-color: #285b4b; background: #142a26; }
html[data-theme="dark"] :where(.status.ok,.table-summary span,.extra-field-value.is-yes,.extra-field-date.is-current) { background: #173c32; color: #88dfbe; }
html[data-theme="dark"] :where(.status.warn,.table-summary .warning-text,.extra-field-value.is-open,.maintenance-filter.is-warn:not([aria-pressed="true"])) { background: #44341d; color: #ffd18a; }
html[data-theme="dark"] :where(.status.alert,.form-error,.maintenance-filter.is-alert:not([aria-pressed="true"])) { background: #492725; color: #ffaaa2; }
html[data-theme="dark"] .status.ok,html[data-theme="dark"] .table-summary span { background: #173c32; color: #88dfbe; }
html[data-theme="dark"] .status.warn,html[data-theme="dark"] .table-summary .warning-text,html[data-theme="dark"] .maintenance-filter.is-warn:not([aria-pressed="true"]) { background: #44341d; color: #ffd18a; }
html[data-theme="dark"] .status.alert,html[data-theme="dark"] .maintenance-filter.is-alert:not([aria-pressed="true"]) { background: #492725; color: #ffaaa2; }
html[data-theme="dark"] .status.info,html[data-theme="dark"] .status.free { background: #1d3a4d; color: #94ccef; }
html[data-theme="dark"] :where(.pill,.alert-count,.source-logo,.resource-icon.navy,.extra-field-value.is-no,.extra-field-value.is-inactive) { background: var(--surface-muted); color: #c1d5e3; }
html[data-theme="dark"] :where(.yoursites-progress>div,.yoursites-site-progress-bar,.meter,.split) { background: #2a3d4b; }
html[data-theme="dark"] :where(.yoursites-current-targets,.plugin-allocation-line) { background: #172c3a; }
html[data-theme="dark"] .yoursites-site-progress-row.failed { background: #2b2022; }
html[data-theme="dark"] :where(.button-danger) { background: transparent; color: var(--alert); border-color: #704a46; }
html[data-theme="dark"] :where(.button-danger:hover) { background: #332326; }
html[data-theme="dark"] .quality-grid > a.quality-state.is-ok { border-color: #285b4b; background: #142f29; }
html[data-theme="dark"] .quality-grid > a.quality-state.is-ok strong { color: #7ce0b9; }
html[data-theme="dark"] .quality-grid > a.quality-state.is-alert { border-color: #704a46; background: #322326; }
html[data-theme="dark"] .quality-grid > a.quality-state.is-alert strong { color: #ffaaa2; }
html[data-theme="dark"] .quality-grid > a.quality-state.is-free { border-color: #365d77; background: #172d3c; }
html[data-theme="dark"] .quality-grid > a.quality-state.is-free strong { color: #91ccef; }
html[data-theme="dark"] .yoursites-sync-panel .source-list li { border-color: var(--line); background: var(--surface-subtle); }
html[data-theme="dark"] .source-trigger:hover,html[data-theme="dark"] .source-trigger:focus-visible { background: var(--surface-muted); box-shadow: 0 0 0 4px var(--surface-muted); }
html[data-theme="dark"] .yoursites-kpi-health.is-ok { border-color: #285b4b; background: #142f29; }
html[data-theme="dark"] .yoursites-kpi-health.is-ok strong { color: #7ce0b9; }
html[data-theme="dark"] .yoursites-kpi-health.is-alert { border-color: #704a46; background: #322326; }
html[data-theme="dark"] .yoursites-kpi-health.is-alert strong { color: #ffaaa2; }
html[data-theme="dark"] .yoursites-check-health.is-ok { border-color: #285b4b; background: #142f29; }
html[data-theme="dark"] .yoursites-check-health.is-warn { border-color: #72572c; background: #382f20; }
html[data-theme="dark"] .yoursites-check-health.is-alert { border-color: #704a46; background: #322326; }
html[data-theme="dark"] .yoursites-check-health.is-ok .yoursites-check-health-label { color: #7ce0b9; }
html[data-theme="dark"] .yoursites-check-health.is-warn .yoursites-check-health-label { color: #ffd18a; }
html[data-theme="dark"] .yoursites-check-health.is-alert .yoursites-check-health-label { color: #ffaaa2; }
html[data-theme="dark"] .donut::after { background: var(--surface); }
html[data-theme="dark"] .detail-side-panel > header { border-color: var(--line); background: var(--surface-raised); }
html[data-theme="dark"] .detail-panel-backdrop { background: rgba(2,7,12,.72); }
html[data-theme="dark"] body.embedded-panel { background: var(--paper); }
html[data-theme="dark"] .customer-profile-summary { background: var(--line); }
html[data-theme="dark"] :where(.column-picker fieldset,.detail-side-panel,.dialog-card) { box-shadow: 0 22px 52px rgba(0,0,0,.45); }
html[data-theme="dark"] .nav-item:hover,html[data-theme="dark"] .nav-item.is-active { background: #edf4f8; color: #12243a; }
html[data-theme="dark"] .kpi-highlight,html[data-theme="dark"] .filter.is-active,html[data-theme="dark"] .inventory-tabs a.is-active { background: #24445b; color: #fff; border-color: #365d77; }
html[data-theme="dark"] body.organization-pulswerk { --blue: #69d46b; --sky: #69d46b; --navy: #69d46b; --green: #79df7b; --mint: #173c29; }
html[data-theme="dark"] body.organization-all { --blue: #9fb1bf; --sky: #b2c3cf; --navy: #b2c3cf; --green: #8fc7ae; --mint: #283640; }

@media print {
  .app-statusbar { display: none !important; }
}
