/* Design refresh (copy only) – overrides loaded after styles.css / pwa css */

/* 1. Header: settings/user menu */
.topbar .user-menu { max-width: none; position: relative; }
.settings-menu { position: relative; }
.settings-menu-trigger {
  display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none;
  padding: 6px 10px; border: 1px solid rgba(255,255,255,.3); color: #f4f4f4;
  font-size: 14px; white-space: nowrap;
}
.settings-menu-trigger::-webkit-details-marker { display: none; }
.settings-menu-trigger:hover, .settings-menu[open] .settings-menu-trigger { background: rgba(255,255,255,.1); }
.settings-menu-trigger:focus-visible { outline: 2px solid var(--ssi-yellow); outline-offset: 2px; }
.settings-menu-avatar { width: 20px; height: 20px; border-radius: 50%; background: var(--ssi-yellow); flex: none;
  -webkit-mask: none; position: relative; }
.settings-menu-avatar::after { content: ""; position: absolute; inset: 5px 6px 9px; border-radius: 50%; background: #111; box-shadow: 0 7px 0 1px #111; }
.topbar .user-menu-label { font-size: 14px; color: #f4f4f4; overflow: visible; text-overflow: clip; max-width: none; }
.settings-menu-caret { width: 0; height: 0; border: 5px solid transparent; border-top-color: currentColor; margin-top: 5px; }
.settings-menu-panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 280px;
  display: flex !important; flex-direction: column; align-items: stretch; gap: 12px; flex-wrap: nowrap !important;
  background: #1a1a1a; color: #f4f4f4; border: 1px solid #333; border-top: 3px solid var(--ssi-yellow);
  padding: 12px 14px; box-shadow: 0 8px 24px rgba(0,0,0,.35); width: auto !important;
}
.settings-menu-section { display: flex; flex-direction: column; gap: 4px; }
.settings-menu-heading { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #bdbdbd; }
.settings-menu-panel .theme-switch { align-self: flex-start; }
.settings-menu-panel .theme-switch button { font-size: 12px; padding: 6px 10px; min-height: 28px; }
.settings-menu-actions { display: flex; gap: 8px; border-top: 1px solid #333; padding-top: 10px; }
.settings-menu-actions .btn { flex: 1; background: transparent; color: #f0f0f0; border-color: rgba(255,255,255,.35); }
.settings-menu-actions .btn:hover:not(:disabled) { background: rgba(255,255,255,.1); }
@media (max-width: 760px) {
  .settings-menu-panel { position: static; margin-top: 6px; min-width: 0; }
  .topbar .user-menu-label { white-space: normal; }
}

/* 2. INTERN status bar: SSI brand colours instead of olive */
.internal-db-bar { background: #1a1a1a; color: #f4f4f4; border-bottom: 3px solid #FEEE19; padding: 2px 24px 4px; }
.internal-db-summary { color: #FEEE19; font-size: 12px; }
.internal-db-summary > span:first-child { background: #FEEE19; color: #111; padding: 1px 8px; }
.internal-db-summary-metrics { color: #f4f4f4; font-size: 14px; }
.internal-db-kicker { font-size: 12px; color: #cfcfcf; opacity: 1; }
.internal-db-metric small { font-size: 12px; }
.internal-db-detail { font-size: 14px; color: #dcdcdc; opacity: 1; }

/* 3. Visual bugs */
/* nav: only .active is yellow; focus/hover clearly different (no double "active" look) */
.top-nav .nav-link:not(.active):focus,
.top-nav .nav-link:not(.active):focus-visible { background: transparent; color: #fff; outline: 1px dashed rgba(255,255,255,.7); outline-offset: 2px; }
.top-nav .nav-link:not(.active):hover { background: rgba(255,255,255,.08); color: #fff; }
/* Angebot: empty grey intro bar when compact layout hides its texts */
html[data-chrome="compact"] .offer-setup-intro { display: none; }
/* Oracle clause: break URL only at sensible points */
.oracle-clause-quote a { word-break: normal; overflow-wrap: anywhere; white-space: normal; }
/* Checkboxes inline with their label text */
label:has(> input[type="checkbox"]),
label:has(> input[type="radio"]) { flex-direction: row; align-items: center; gap: 8px; }
label:has(> input[type="checkbox"]) > input,
label:has(> input[type="radio"]) > input { margin: 0; width: 16px; height: 16px; flex: 0 0 auto; }
label.check-row:has(> input[type="checkbox"]) { flex-wrap: wrap; align-items: flex-start; }
label.check-row:has(> input[type="checkbox"]) > input { margin-top: 2px; }

/* 4. Background watermark: removed (logo stays in header/footer) */
body::before, body::after,
html[data-theme="dark"] body::before, html[data-theme="dark"] body::after { display: none !important; content: none !important; }
body { background-image: none; }

/* 5. Type scale 12/14/16/20/24px, Arial (SSI), label contrast */
:root, html[data-theme="dark"] { --ssi-yellow: #FEEE19; --font: Arial, "Helvetica Neue", Helvetica, sans-serif; }
:root { --ssi-muted: #444444; --ssi-label: #2b2b2b; }
html[data-theme="dark"] { --ssi-muted: #b8b8b8; --ssi-label: #e2e2e2; }
body { font-family: var(--font); font-size: 14px; }
label { font-size: 14px; color: var(--ssi-label); }
.field-hint { font-size: 12px; color: var(--ssi-muted); }
.page-context h1 { font-size: 24px; }
.page-context p { font-size: 14px; }
main h2:not(.offer-sheet h2):not(.hero-banner h2) { font-size: 20px; }
main h3:not(.offer-sheet h3) { font-size: 16px; }

/* 6. Main workflow stepper vs. sub-steps; no stepper on admin pages */
.workflow-stepper { background: var(--ssi-panel); border-bottom: 1px solid var(--ssi-line); padding: 10px 0; }
.workflow-stepper .workflow-step { border: 0; background: transparent; border-radius: 0; font-size: 16px; font-weight: 700; padding: 6px 12px; color: var(--ssi-muted); }
.workflow-stepper .workflow-step-num { width: 28px; height: 28px; border-radius: 50%; font-size: 14px; border: 2px solid currentColor; background: transparent; }
.workflow-stepper .workflow-step.is-active { color: var(--ssi-ink); box-shadow: inset 0 -3px 0 var(--ssi-yellow); }
.workflow-stepper .workflow-step.is-active .workflow-step-num { background: #111; color: #FEEE19; border-color: #111; }
.workflow-stepper .workflow-step.is-done .workflow-step-num { background: var(--ssi-yellow); color: #111; border-color: #111; }
.workflow-stepper .workflow-step-sep { width: 48px; height: 2px; }
/* sub-steps: light underline tabs, clearly secondary */
.step-wizard-nav, .license-wizard-nav { gap: 0 !important; border-bottom: 1px solid var(--ssi-line); }
.step-wizard-tab, .license-wizard-tab { border: 0; border-bottom: 3px solid transparent; background: transparent; font-size: 14px; font-weight: 600; color: var(--ssi-muted); padding: 8px 12px; margin-bottom: -1px; }
.step-wizard-tab:hover, .license-wizard-tab:hover { background: transparent; color: var(--ssi-ink); border-bottom-color: var(--ssi-line); }
.step-wizard-tab.is-active, .license-wizard-tab.is-active { background: transparent; color: var(--ssi-ink); border-bottom-color: var(--ssi-yellow); }
/* admin views: hide stepper, show the flow links in the top nav instead */
body.is-tool-view .workflow-stepper { display: none !important; }
html[data-chrome="compact"] body.is-tool-view .top-nav .nav-link-flow { display: inline-flex; opacity: .85; }

/* 7. One primary action per screen */
/* "Weiter" is the only yellow button in wizard footers; save is secondary */
.btn.editor-save:not(.primary) { background: var(--ssi-btn-bg); color: var(--ssi-ink); border-color: var(--ssi-border-strong); }
/* Offer: once a preview exists, "Revision speichern" is primary, "Vorschau erzeugen" secondary; Weiter stays primary */
.btn:disabled { opacity: .5; cursor: help; }
.export-disabled-hint { margin: 4px 0 0; }
.offer-actions:not(:has(#btnWordOfferDoc:disabled)) + .export-disabled-hint { display: none; }
/* Stammdaten: single save button, sticky at the bottom of the form */
.stammdaten-actions { position: sticky; bottom: 0; z-index: 5; background: var(--ssi-panel); border-top: 3px solid var(--ssi-yellow); padding: 12px 16px; margin-top: 16px; }

/* 8. Consistent inputs: one background, lighter placeholders, units inside fields */
:root { --ssi-input: #ffffff; }
html[data-theme="dark"] { --ssi-input: #242424; }
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea {
  background: var(--ssi-input) !important; color: var(--ssi-ink); font-size: 14px; border: 1px solid #bdbdbd;
}
input:not([type="checkbox"]):not([type="radio"]):focus, select:focus, textarea:focus { border-color: #111; outline: 2px solid var(--ssi-yellow); outline-offset: 0; }
input[readonly], textarea[readonly] { background: var(--ssi-surface-soft) !important; color: var(--ssi-muted); }
::placeholder { color: #9e9e9e !important; font-weight: 400 !important; font-style: italic; opacity: 1; }
html[data-theme="dark"] ::placeholder { color: #7a7a7a !important; }
.input-unit { position: relative; display: block; }
.input-unit > input { width: 100%; padding-right: 48px !important; text-align: right; }
.input-unit::after { content: attr(data-unit); position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-size: 12px; font-weight: 700; color: var(--ssi-muted); pointer-events: none; }

/* 9. Login: no disabled pseudo-link; availability note is shown as plain text instead */
#btnForgotPassword:disabled { display: none; }
#recoveryAvailability { font-size: 14px; color: var(--ssi-muted); text-align: center; }

/* 10. Consistent page layouts */
/* Archiv header like Benutzer/Stammdaten (no yellow block) */
.archive-head { background: transparent; border: 0; border-bottom: 4px solid var(--ssi-yellow); padding: 0 0 12px; margin-bottom: 16px; color: var(--ssi-ink); }
.archive-head h2 { color: var(--ssi-ink); font-size: 24px; }
.archive-head p { color: var(--ssi-muted); font-size: 14px; max-width: 48rem; }
.archive-head p strong { color: var(--ssi-ink); }
.archive-toolbar[hidden] { display: none !important; }
.users-head, .stammdaten-head { border-bottom: 4px solid var(--ssi-yellow); padding-bottom: 12px; margin-bottom: 16px; }
.users-head p, .stammdaten-head p { font-size: 14px; }
/* Stammdaten: all cards share one width */
.stammdaten-form { max-width: none; }
#view-stammdaten .contacts-admin, .stammdaten-form .block { width: 100%; max-width: none; box-sizing: border-box; }
.stammdaten-form .block .offer-adjust-grid, .stammdaten-form .block .form-grid { max-width: none; }
/* Empty / loading / error states */
.empty-state { border: 1px dashed var(--ssi-line); background: var(--ssi-panel); padding: 24px; text-align: center; color: var(--ssi-muted); font-size: 14px; }
.empty-state.is-loading::before, td.muted[data-i18n$="loading"]::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 8px; vertical-align: -1px;
  border: 2px solid var(--ssi-line); border-top-color: #111; border-radius: 50%; animation: ds-spin .8s linear infinite; }
.empty-state.is-error { border-color: var(--ssi-red); color: var(--ssi-red); }
.users-table td.muted[colspan] { text-align: center; padding: 24px; color: var(--ssi-muted); font-size: 14px; background: var(--ssi-surface-muted); }
@keyframes ds-spin { to { transform: rotate(360deg); } }
/* Offer view: Vorschau/Revision is the primary task there – pager Weiter stays secondary */
#btnOfferWizardNext.primary { background: var(--ssi-btn-bg); color: var(--ssi-ink); border-color: var(--ssi-border-strong); }
.input-unit > input { margin: 0 !important; }
