/*
 * Tresor (Weboberflaeche von Vaultwarden) im Aufbau aller Werkzeuge: Seitenleiste in Tanne mit Raster und Wortmarke,
 * Hauptfarbe Tanne statt Blau, Schrift PT Sans. Aufbau, Menue und Inhalt bleiben von Bitwarden; geaendert werden nur
 * dessen Farbvariablen und wenige Elemente. Der Init-Container im Pod von Vaultwarden bindet die Datei ein
 * (deploy/base/vaultwarden.yaml).
 */
@font-face { font-family: 'PT Sans'; src: url('fonts/pt-sans-regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'PT Sans'; src: url('fonts/pt-sans-bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }

/* Hell und dunkel: Bitwarden setzt die Variablen auf :root und .theme_dark, hier mit Vorrang */
html:root,
html.theme_light,
html.theme_dark {
  --font-sans: var(--gruene-schrift);
  /* Markenfarbe: Gruen von Tanne bis Klee statt Blau */
  --color-brand-050: #eef6f0;
  --color-brand-100: #d7ebdd;
  --color-brand-200: #b3d9bf;
  --color-brand-300: #80c096;
  --color-brand-400: #4ea56f;
  --color-brand-500: #1f8a4c;
  --color-brand-600: #008939;
  --color-brand-700: #005538;
  --color-brand-800: #004a31;
  --color-brand-900: #003d28;
  --color-brand-950: #002a1c;
  --color-brand-950-rgb: 0, 42, 28;
  /* Seitenleiste */
  --color-nav-bg-primary: #005538;
  --color-nav-bg-primary-hover: rgba(255, 255, 255, 0.1);
  --color-nav-bg-primary-strong: #29705a;
  --color-nav-bg-primary-hover-strong: #337a62;
  --color-nav-border-primary: rgba(255, 255, 255, 0.15);
  --color-nav-fg-primary: #ffffff;
  --color-background-alt3: 0 85 56;
  --color-background-alt4: 0 61 40;
}

/* Hell: warme Grautoene und Flaechen wie Social Media statt der blaeulichen von Bitwarden. Bitwarden nutzt beides,
   die Grauskala (Hex) und aeltere Variablen als RGB-Tripel. */
html:root,
html.theme_light {
  --color-gray-050: #f7f6f2;
  --color-gray-100: #ecebe5;
  --color-gray-200: #e4e0d6;
  --color-gray-300: #cfc9bb;
  --color-gray-400: #a3a69c;
  --color-gray-400-rgb: 163, 166, 156;
  --color-gray-500: #7b867f;
  --color-gray-600: #56645b;
  --color-gray-700: #3b4840;
  --color-gray-800: #26332b;
  --color-gray-900: #15261d;
  --color-gray-950: #0b1610;
  --color-gray-950-rgb: 11, 22, 16;
  --color-background: 255 255 255;
  --color-background-alt: 247 246 242;
  --color-background-alt2: 0 85 56;
  --color-primary-100: 238 246 240;
  --color-primary-300: 123 134 127;
  --color-primary-600: 0 85 56;
  --color-primary-700: 0 61 40;
  --color-secondary-100: 236 235 229;
  --color-secondary-300: 207 201 187;
  --color-secondary-500: 123 134 127;
  --color-secondary-600: 86 100 91;
  --color-secondary-700: 59 72 64;
  --color-info-100: 238 246 240;
  --color-info-600: 0 137 57;
  --color-info-700: 0 85 56;
  --color-text-main: 21 38 29;
  --color-text-muted: 86 100 91;
  /* Illustrationen (leerer Tresor, Hinweise) in Gruen statt Blau */
  --color-illustration-bg-primary: 215 235 221;
  --color-illustration-bg-secondary: 179 217 191;
  --color-illustration-bg-tertiary: 255 255 255;
  --color-illustration-outline: 0 61 40;
  --color-illustration-logo: 0 85 56;
  --color-illustration-tertiary: 255 241 122;
}

/* Avatar wie in den anderen Werkzeugen: Sonne mit Schrift in Tanne. Bitwarden setzt die Farbe je Konto als
   Variable im style-Attribut; !important hat davor Vorrang. */
bit-avatar { --avatar-bg: var(--gruene-sonne) !important; --avatar-bg-hover: #f2e25f !important; }
bit-avatar svg text { fill: var(--gruene-tanne) !important; font-weight: 700; }

/* Der Inhaltsbereich bekommt beim Seitenwechsel den Fokus (Sprungziel); ohne blauen Rahmen des Browsers */
main#main-content:focus { outline: none; }
/* Warmer Grund wie in Social Media und Mein Konto, darauf weisse Tafeln */
html.theme_light body,
html.theme_light main#main-content { background: var(--gruene-grund); }
html { color-scheme: light; }

/* Kopf der Seitenleiste: unser Raster und die Wortmarke statt des Vaultwarden-Logos */
bit-nav-logo > div { display: flex; align-items: center; gap: 4px; padding: 12px 12px 18px 12px !important; background: var(--gruene-tanne) !important; }
bit-nav-logo > div > a { display: none !important; }
#bit-side-nav { background: var(--gruene-tanne); }

/* Das Produkt-Raster von Bitwarden (unten in der Leiste, oben rechts im Kopf) ersetzt unser Raster */
navigation-product-switcher,
product-switcher { display: none !important; }

/* Eingeklappt (nur Symbole, Bitwarden nimmt dann die Breite aus dem style-Attribut) bleibt vom Kopf das Raster */
#bit-side-nav:not([style*='width']) bit-nav-logo > div { justify-content: center; padding-inline: 4px !important; }
#bit-side-nav:not([style*='width']) .gruene-logo { display: none; }

/* Seiten vor der Anmeldung: Kopfzeile in Tanne mit Raster und Wortmarke statt des Vaultwarden-Logos, ohne die
   Hintergrundbilder von Bitwarden */
bit-landing-header header { background: var(--gruene-tanne) !important; align-items: center; min-height: 58px; padding: 0 8px !important; }
bit-landing-header header > a { display: none !important; }
bit-landing-layout div:has(> bit-svg #left-bg-illustration-clip),
bit-landing-layout div:has(> bit-svg #right-bg-illustration-clip),
bit-landing-hero bit-icon,
bit-landing-hero bit-svg { display: none !important; }
bit-landing-hero h1 { color: var(--gruene-tanne); font-weight: 700; }

/* --- Tresor-Seite: aufgeraeumt wie die anderen Werkzeuge ------------------------------------------------------- */

/* Titel wie in Social Media und Mein Konto */
bit-header h1, bit-header h1 * { color: var(--gruene-tanne) !important; font-weight: 700 !important; }

/* Die Checkliste "Erste Schritte" (Werbung fuer Import und Browser-Erweiterung) nimmt oben den Platz weg */
app-vault-onboarding { display: none !important; }

/* Filter und Liste: zwei Spalten, beide als weisse Tafel mit runden Ecken */
app-vault > div:has(> div > app-vault-filter) {
  display: grid !important; grid-template-columns: clamp(220px, 22vw, 264px) minmax(0, 1fr); gap: 24px; align-items: start; margin: 0 !important;
}
app-vault > div:has(> div > app-vault-filter) > div { max-width: none !important; flex-basis: auto !important; padding: 0 !important; }
app-vault-filter > div {
  background: #fff; border: 1px solid var(--gruene-rand) !important; border-radius: 12px !important; overflow: hidden;
}
app-vault-filter > div > div > div:first-child {
  background: #fff !important; border-bottom: 1px solid var(--gruene-rand) !important; border-radius: 0 !important;
  padding: 14px 16px !important; color: var(--gruene-text-3); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
}
app-vault-filter > div > div > div.tw-p-5 { padding: 16px !important; }
app-vault-filter .filter-heading, app-vault-filter .filter-heading button { color: var(--gruene-tanne); font-weight: 700; }
/* Die Tafel sitzt direkt um die Tabelle: Bitwardens Liste meldet ihre Hoehe ohne Kopfzeile, ein Rahmen aussen
   herum schnitte die letzte Zeile ab */
app-vault-items .cdk-virtual-scroll-content-wrapper {
  background: #fff; border: 1px solid var(--gruene-rand); border-radius: 12px; overflow: hidden; width: 100%; box-sizing: border-box;
}
app-vault-items thead th { background: #faf9f6; color: var(--gruene-text-2); font-size: 13px; font-weight: 700; border-color: var(--gruene-rand) !important; }
app-vault-items tbody tr:hover { background: var(--gruene-hauch); }
app-vault-items td, app-vault-items th { border-color: var(--gruene-rand) !important; }

/* Schmal: Filter ueber der Liste */
@media (max-width: 899.98px) {
  app-vault > div:has(> div > app-vault-filter) { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}

/* Hauptknoepfe mit den runden Ecken der anderen Werkzeuge */
button[bitbutton], a[bitbutton] { border-radius: 8px !important; }

/* Schmale Bildschirme: Bitwarden zeigt die Leiste nicht; oben steht unsere Kopfzeile mit Raster und Wortmarke */
.gruene-tresor-kopf { display: none; }
@media (max-width: 767.98px) {
  .gruene-tresor-kopf {
    display: flex; align-items: center; gap: 4px; position: fixed; top: 0; left: 0; right: 0; z-index: 40;
    height: 58px; padding: 0 8px; background: var(--gruene-tanne); color: #fff;
  }
  main#main-content { padding-top: calc(58px + 24px) !important; }
}
