/* Hausverwaltung Welsch – Erscheinungsbild
   Tannengrün (Haustür, Fensterläden) + Messing (Klingelschild) auf kalkhellem Grund. */
:root {
  --hv-gruen: #1e4636;
  --hv-gruen-hell: #2d5c48;
  --hv-messing: #b4893a;
  --hv-messing-dunkel: #8a6824;
  --hv-kalk: #f2f4f1;
  --hv-flaeche: #ffffff;
  --hv-schiefer: #1f2a25;
  --hv-linie: #d6ddd8;
  --hv-ziegel: #a3402f;
  --hv-plus: #2e6b4a;

  --primary: var(--hv-gruen);
  --secondary: var(--hv-gruen-hell);
  --accent: var(--hv-messing);
  --primary-fg: #fff;
  --body-fg: var(--hv-schiefer);
  --body-bg: var(--hv-flaeche);
  --body-quiet-color: #5d6b64;
  --body-medium-color: #3c4943;
  --body-loud-color: #0f1a15;
  --header-color: #dfe8e2;
  --header-branding-color: #e9d3a3;
  --header-bg: var(--hv-gruen);
  --header-link-color: #fff;
  --breadcrumbs-fg: #c9d8cf;
  --breadcrumbs-link-fg: #fff;
  --breadcrumbs-bg: var(--hv-gruen-hell);
  --link-fg: #22694d;
  --link-hover-color: #0f3326;
  --link-selected-fg: var(--hv-messing-dunkel);
  --hairline-color: #e4e9e5;
  --border-color: var(--hv-linie);
  --error-fg: var(--hv-ziegel);
  --message-success-bg: #e3f0e7;
  --message-warning-bg: #f7ecd2;
  --message-error-bg: #f6e0dc;
  --darkened-bg: var(--hv-kalk);
  --selected-bg: #e6efe9;
  --selected-row: #eef4ef;
  --button-fg: #fff;
  --button-bg: var(--hv-gruen);
  --button-hover-bg: #143326;
  --default-button-bg: var(--hv-messing-dunkel);
  --default-button-hover-bg: #6f531b;
  --close-button-bg: #6b7a72;
  --close-button-hover-bg: #4f5c55;
  --delete-button-bg: var(--hv-ziegel);
  --delete-button-hover-bg: #832f22;
  --object-tools-fg: #fff;
  --object-tools-bg: var(--hv-gruen-hell);
  --object-tools-hover-bg: var(--hv-gruen);
  --font-family-primary: "Instrument Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --hv-kalk: #18211c; --hv-flaeche: #121915; --hv-schiefer: #e2e9e4; --hv-linie: #2c3a33;
    --hv-ziegel: #e48a7a; --hv-plus: #7fc79c; --hv-messing: #d2ae63;
    --primary: #2b5a46; --secondary: #1e4636; --body-quiet-color: #9aaaa1; --body-medium-color: #c3cfc8; --body-loud-color: #f4f8f5;
    --header-bg: #173a2c; --breadcrumbs-bg: #1e4636; --link-fg: #8fcfae; --link-hover-color: #c3ebd5; --link-selected-fg: #d2ae63;
    --hairline-color: #222e28; --selected-bg: #1d2c24; --selected-row: #1a2721;
    --message-success-bg: #1d3327; --message-warning-bg: #3a3020; --message-error-bg: #3d231e;
    --button-bg: #2b5a46; --button-hover-bg: #367058; --default-button-bg: #9c7a33; --default-button-hover-bg: #b18b3b;
    --object-tools-bg: #2b5a46; --object-tools-hover-bg: #367058;
  }
}
:root[data-theme="dark"] {
  --hv-kalk: #18211c; --hv-flaeche: #121915; --hv-schiefer: #e2e9e4; --hv-linie: #2c3a33;
  --hv-ziegel: #e48a7a; --hv-plus: #7fc79c; --hv-messing: #d2ae63;
  --primary: #2b5a46; --secondary: #1e4636; --body-quiet-color: #9aaaa1; --body-medium-color: #c3cfc8; --body-loud-color: #f4f8f5;
  --header-bg: #173a2c; --breadcrumbs-bg: #1e4636; --link-fg: #8fcfae; --link-hover-color: #c3ebd5; --link-selected-fg: #d2ae63;
  --hairline-color: #222e28; --selected-bg: #1d2c24; --selected-row: #1a2721;
  --message-success-bg: #1d3327; --message-warning-bg: #3a3020; --message-error-bg: #3d231e;
  --button-bg: #2b5a46; --button-hover-bg: #367058; --default-button-bg: #9c7a33; --default-button-hover-bg: #b18b3b;
  --object-tools-bg: #2b5a46; --object-tools-hover-bg: #367058;
}

html, body { background: var(--hv-kalk); }
body { font-size: 15px; font-feature-settings: "tnum" 1; }
#container, #content { background: var(--hv-kalk); }

/* Kopf: das Klingelschild */
#header { padding: 12px 24px; align-items: center; }
#site-name { margin: 0; }
#site-name a.hv-schild {
  display: inline-flex; flex-direction: column; gap: 1px; padding: 6px 14px 7px; border-radius: 4px;
  border: 1px solid var(--hv-messing); color: var(--header-branding-color); text-decoration: none;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(0,0,0,.08));
  box-shadow: inset 0 0 0 3px rgba(0,0,0,.12);
}
.hv-schild .hv-name { font-size: 1.15rem; font-weight: 600; letter-spacing: .01em; line-height: 1.2; }
.hv-schild .hv-zusatz { font-size: .72rem; color: #c9d8cf; font-weight: 400; }
#user-tools { font-size: .85rem; text-transform: none; letter-spacing: 0; }
#user-tools a { color: #fff; border-bottom: none; text-decoration: underline; text-decoration-color: rgba(255,255,255,.35); text-underline-offset: 3px; }
.hv-nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: 24px; }
.hv-nav a { color: #dfe8e2; text-decoration: none; padding: 6px 10px; border-radius: 6px; font-size: .9rem; }
.hv-nav a:hover, .hv-nav a:focus-visible { background: rgba(255,255,255,.1); color: #fff; }
div.breadcrumbs { padding: 8px 24px; font-size: .85rem; }

/* Überschriften und Kästen ohne Großbuchstaben-Geschrei */
#content h1 { font-weight: 600; font-size: 1.6rem; color: var(--body-loud-color); letter-spacing: -.01em; }
.module h2, .module caption, .inline-group h2 {
  background: transparent; color: var(--primary); text-transform: none; letter-spacing: 0; font-size: 1rem; font-weight: 600;
  padding: 10px 12px 8px; border-bottom: 2px solid var(--hv-messing);
}
:root[data-theme="dark"] .module h2, :root[data-theme="dark"] .module caption, :root[data-theme="dark"] .inline-group h2 { color: var(--hv-messing); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .module h2, :root:not([data-theme="light"]) .module caption,
  :root:not([data-theme="light"]) .inline-group h2 { color: var(--hv-messing); }
}
.module, .inline-group, #changelist .results, fieldset.module { background: var(--hv-flaeche); border-radius: 8px; }
.module { border: 1px solid var(--hv-linie); }
thead th, tfoot td, .inline-group thead th { text-transform: none; letter-spacing: 0; font-size: .82rem; font-weight: 600; color: var(--body-medium-color); }
#changelist table thead th { background: var(--hv-kalk); }
td, th { font-variant-numeric: tabular-nums; }

/* Eingaben und Knöpfe */
input[type=text], input[type=number], input[type=email], input[type=password], input[type=search], input[type=url], input:not([type]),
select, textarea, .vTextField {
  border-radius: 6px; border: 1px solid var(--hv-linie); padding: 6px 8px; background: var(--hv-flaeche); color: var(--body-fg);
}
input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, button:focus-visible {
  outline: 2px solid var(--hv-messing); outline-offset: 1px;
}
.button, input[type=submit], input[type=button], .submit-row input, a.button { border-radius: 6px; font-weight: 600; }
.submit-row { background: var(--hv-flaeche); border: 1px solid var(--hv-linie); border-radius: 8px; }
.object-tools a { border-radius: 14px; text-transform: none; letter-spacing: 0; font-size: .8rem; }

/* Startseite */
.hv-start { max-width: 1100px; }
.hv-gruss { margin: 4px 0 18px; }
.hv-gruss h1 { margin: 0; }
.hv-gruss p { margin: 2px 0 0; color: var(--body-quiet-color); }
.hv-raster { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; align-items: start; margin-bottom: 28px; }
.hv-raster > .hv-breit { grid-column: 1 / -1; }
.hv-tafel { background: var(--hv-flaeche); border: 1px solid var(--hv-linie); border-radius: 8px; }
.hv-tafel h2 { margin: 0; padding: 12px 16px 10px; font-size: 1rem; font-weight: 600; color: var(--primary); border-bottom: 2px solid var(--hv-messing); }
:root[data-theme="dark"] .hv-tafel h2 { color: var(--hv-messing); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hv-tafel h2 { color: var(--hv-messing); } }
.hv-tafel ul { list-style: none; margin: 0; padding: 0; }
.hv-tafel li { display: flex; gap: 12px; align-items: baseline; padding: 10px 16px; border-top: 1px solid var(--hairline-color); list-style: none; }
.hv-tafel li:first-child { border-top: 0; }
.hv-tafel .grow { flex: 1; min-width: 0; }
.hv-tafel .leise { color: var(--body-quiet-color); font-size: .85rem; }
.hv-tafel .betrag { white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.hv-tafel .minus { color: var(--hv-ziegel); }
.hv-tafel .ok { color: var(--hv-plus); }
.hv-tafel .leer { padding: 14px 16px; color: var(--body-quiet-color); }
.hv-zahl { display: inline-block; min-width: 2.2em; padding: 1px 8px; border-radius: 12px; text-align: center; font-weight: 600;
           background: var(--selected-bg); color: var(--primary); }
.hv-zahl.null { background: transparent; color: var(--body-quiet-color); }
.hv-start a { text-decoration: none; }
.hv-start a:hover .grow { text-decoration: underline; }
#content-related { display: none; }
#content-main .app-list, .dashboard #content { width: auto; }

@media (max-width: 767px) {
  #header { padding: 10px 14px; flex-wrap: wrap; gap: 6px; }
  .hv-nav { margin-left: -10px; width: calc(100% + 10px); flex-wrap: nowrap; overflow-x: auto; }
  .hv-nav a { white-space: nowrap; }
  .hv-schild .hv-zusatz { display: none; }
  div.breadcrumbs { padding: 8px 14px; }
  .hv-raster { grid-template-columns: 1fr; }
  .hv-tafel li { padding: 10px 12px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
#branding { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
input[type=date] { min-width: 10.5em; font-family: inherit; }

/* Objektwahl auf der Startseite und Anzeige im Kopf */
.hv-objektwahl { margin-bottom:18px; }
.hv-objekte { display:flex; flex-wrap:wrap; gap:8px; padding:12px 16px 14px; }
.hv-objekte a { display:flex; flex-direction:column; padding:8px 14px; border:1px solid var(--hv-linie); border-radius:8px; text-decoration:none;
                color:var(--body-fg); min-width:150px; }
.hv-objekte a span { font-size:.78rem; color:var(--body-quiet-color); }
.hv-objekte a.aktiv { border-color:var(--hv-messing); box-shadow:inset 0 0 0 1px var(--hv-messing); background:var(--selected-row); font-weight:600; }
.hv-aktiv { display:inline-flex; align-items:center; gap:6px; padding:5px 10px; border-radius:16px; border:1px solid rgba(255,255,255,.35);
            color:#fff !important; text-decoration:none; font-size:.85rem; white-space:nowrap; }
.hv-aktiv:hover { background:rgba(255,255,255,.1); }
