/**
 * guide.css — Modul-CSS des Guide-Moduls (v0.1.0)
 *
 * Additiv nach §7: Spaltenbreiten der drei Listen-Grids, Bereich-/Status-/
 * Typ-Pillen-Farben pro [data-*], Tag-Chips und das Code-Eingabefeld.
 * Alle Farben über Tokens.
 */

/* ================================================================== */
/* „Wechseln"-Link in der Filter-Zeile (zurück aufs Guide-Dashboard).  */
/* Die aktive Firma steht im App-Header-Breadcrumb (Guide / <Firma>).  */
/* ================================================================== */

.guide-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--mid);
  text-decoration: none;
  font-size: var(--font-sm, 13px);
  font-weight: var(--weight-medium, 500);
}
.guide-switch:hover { background: var(--bg-hover); border-color: var(--accent); color: var(--accent); }
.guide-switch i { flex: 0 0 auto; }

/* ================================================================== */
/* Marke — Geschäftsfeld-Kacheln (SafeGuard-Mirror)                   */
/* ================================================================== */

/* GF-Übersicht als Liste */
.guide-gf-grid {
  display: grid;
  /* Breiten aus der CSS-Variable (col-resize-Baustein); Fallback = Defaults. */
  grid-template-columns: var(--guide-gf-cols, minmax(220px, 1fr) 130px 90px 90px 90px 90px 44px);
}
.guide-cell-num { justify-content: center; }
.guide-cell-num .idf-list-cell-text { text-align: center; width: 100%; }
.guide-gf-ampel-pill[data-ampel="gruen"] { background: var(--tint-green);   color: var(--green-text); }
.guide-gf-ampel-pill[data-ampel="gelb"]  { background: var(--tint-orange);  color: var(--orange); }
.guide-gf-ampel-pill[data-ampel="rot"]   { background: var(--tint-red);     color: var(--red); }
.guide-gf-ampel-pill[data-ampel="leer"]  { background: var(--tint-neutral); color: var(--neutral-mid); }
/* Oeffnen-Pille: Shared-Klasse .idf-list-open-btn aus idf-list-grid.css
   (L-D13/#199) - die lokale .guide-open-btn-Kopie ist entfallen. */

/* Marke-Punkte-Liste */
.guide-marke-grid {
  display: grid;
  /* Breiten aus der CSS-Variable (col-resize-Baustein); Fallback = Defaults. */
  grid-template-columns: var(--guide-marke-cols, minmax(240px, 1fr) 150px 150px 44px);
}
.guide-saeule-pill { background: var(--tint-indigo); color: var(--indigo); }
.guide-marke-status-pill[data-status="offen"]     { background: var(--tint-red);    color: var(--red); }
.guide-marke-status-pill[data-status="in_arbeit"] { background: var(--tint-orange); color: var(--orange); }
.guide-marke-status-pill[data-status="definiert"] { background: var(--tint-green);  color: var(--green-text); }

/* Bar-Extra im Punkte-Modus: „← Marke" + GF-Name */
.guide-marke-bar-extra { display: inline-flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.guide-gf-name { font-weight: var(--weight-medium, 500); color: var(--ink); }

/* Dateien-Übersicht */
.guide-dateien-grid {
  display: grid;
  /* Breiten aus der CSS-Variable (col-resize-Baustein); Fallback = Defaults. */
  grid-template-columns: var(--guide-dateien-cols, minmax(260px, 1fr) 200px minmax(160px, 1fr) 44px 44px);
}
.guide-cell-datei { display: flex; align-items: center; gap: 8px; min-width: 0; }
.guide-datei-icon { color: var(--mid); flex: 0 0 auto; }
.guide-datei-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ================================================================== */
/* Dashboard (Firmen-Karten)                                          */
/*                                                                    */
/* .guide-card bleibt bewusst Nicht-Konsument von blocks/hub-card     */
/* (H3/#199, Scout-Empfehlung L4): horizontales Row-Layout,           */
/* Icon-Bubble, <button>-Semantik und is-global-Dashed sind fachlich  */
/* eigen und token-sauber - eine is-row-Variante im Shared-Block      */
/* wuerde mehr Overrides erzeugen als sie spart (siehe                */
/* _shared/blocks/hub-card/README.md).                                */
/* ================================================================== */

.guide-dash-hint {
  margin: 0;
  padding: 12px var(--space-8, 32px) 0;
  color: var(--mid);
  font-size: var(--font-sm, 13px);
}
.guide-dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-3, 12px);
  padding: var(--space-4, 16px) var(--space-8, 32px) var(--space-10, 40px);
}
.guide-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md, 6px);
  background: var(--white);
  box-shadow: var(--shadow-card);
  text-align: left;
  font: inherit;
  cursor: pointer;
  color: inherit;
}
.guide-card:hover { background: var(--bg-hover); border-color: var(--accent); }
.guide-card.is-global { border-style: dashed; }
.guide-card-icon {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm, 4px);
  background: var(--tint-accent);
  color: var(--accent);
  font-size: 18px;
}
.guide-card.is-global .guide-card-icon { background: var(--tint-indigo); color: var(--indigo); }
.guide-card-body { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.guide-card-name { font-weight: var(--weight-medium, 500); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guide-card-sub { color: var(--mid); font-size: var(--font-sm, 13px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guide-card-go { flex: 0 0 auto; color: var(--mid); }
.guide-card:hover .guide-card-go { color: var(--accent); }
/* Empty-/Error-State: Shared-Block .idf-empty-state.is-hint aus
   blocks/empty-state (H1/#198) - die lokale .guide-dash-empty-Kopie
   ist entfallen ($useEmptyState auf index.php). */

@media (max-width: 1100px) {
  .guide-dash-hint { padding-left: var(--space-4, 16px); padding-right: var(--space-4, 16px); }
  .guide-dash-grid { padding-left: var(--space-4, 16px); padding-right: var(--space-4, 16px); }
}

/* ================================================================== */
/* Listen-Grids                                                       */
/* ================================================================== */

/* Breiten aus der CSS-Variable (col-resize-Baustein); Fallback = Defaults. */
.guide-konv-grid {
  display: grid;
  grid-template-columns: var(--guide-konv-cols, minmax(240px, 1fr) 180px 140px 44px);
}
.guide-prinz-grid {
  display: grid;
  grid-template-columns: var(--guide-prinz-cols, minmax(240px, 1fr) 180px 140px 44px);
}
.guide-ideen-grid {
  display: grid;
  grid-template-columns: var(--guide-ideen-cols, minmax(240px, 1fr) 150px 48px 44px);
}
.guide-backlog-grid {
  display: grid;
  grid-template-columns: var(--guide-backlog-cols, minmax(240px, 1fr) 130px 140px 48px 44px);
}

/* Bereich-Pille — neutral getönt, hebt „Global" hervor. */
.guide-bereich-pill { background: var(--tint-neutral); color: var(--neutral-mid); }
.guide-bereich-pill[data-bereich="global"] { background: var(--tint-accent); color: var(--accent); }
.guide-bereich-pill[data-bereich="guide"]  { background: var(--tint-indigo); color: var(--indigo); }

/* Status-Pille Konventionen/Prinzipien. */
.guide-status-pill[data-status="aktiv"]    { background: var(--tint-green);   color: var(--green-text); }
.guide-status-pill[data-status="entwurf"]  { background: var(--tint-yellow);  color: var(--yellow-text); }
.guide-status-pill[data-status="veraltet"] { background: var(--tint-neutral); color: var(--neutral-mid); }

/* Status-Pille Ideen. */
.guide-idee-status-pill[data-status="neu"]         { background: var(--tint-accent);  color: var(--accent); }
.guide-idee-status-pill[data-status="in_pruefung"] { background: var(--tint-yellow);  color: var(--yellow-text); }
.guide-idee-status-pill[data-status="uebernommen"] { background: var(--tint-green);   color: var(--green-text); }
.guide-idee-status-pill[data-status="verworfen"]   { background: var(--tint-neutral); color: var(--neutral-mid); }

/* Status-Pille Backlog. */
.guide-backlog-status-pill[data-status="offen"]     { background: var(--tint-orange);  color: var(--orange); }
.guide-backlog-status-pill[data-status="in_arbeit"] { background: var(--tint-accent);  color: var(--accent); }
.guide-backlog-status-pill[data-status="erledigt"]  { background: var(--tint-green);   color: var(--green-text); }

/* Prioritäts-Pille Backlog. */
.guide-prio-pill[data-prio="niedrig"] { background: var(--tint-neutral); color: var(--neutral-mid); }
.guide-prio-pill[data-prio="mittel"]  { background: var(--tint-accent);  color: var(--accent); }
.guide-prio-pill[data-prio="hoch"]    { background: var(--tint-red);     color: var(--red); }

.guide-cell-url { justify-content: center; }

/* ================================================================== */
/* Tags                                                               */
/* ================================================================== */

.guide-tags { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.guide-tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 10px;
  background: var(--tint-neutral);
  color: var(--mid);
  font-size: var(--font-xs, 0.6875rem);
  line-height: 1.5;
}
.guide-tag.is-more { background: transparent; color: var(--mid); }

/* ================================================================== */
/* Code-Eingabefeld im Modal (Monospace)                              */
/* ================================================================== */

.guide-code-input {
  font-family: var(--font-mono, ui-monospace, "SFMono-Regular", "Cascadia Code", Menlo, Consolas, monospace);
  font-size: var(--font-sm, 13px);
  line-height: 1.5;
  white-space: pre;
  overflow-x: auto;
  tab-size: 2;
}

/* ================================================================== */
/* Responsive                                                         */
/* ================================================================== */

@media (max-width: 1100px) {
  /* Bereich-Spalte auf schmalen Screens ausblenden (Konv./Prinz.). */
  .guide-konv-grid  { grid-template-columns: minmax(200px, 1fr) 130px 44px; }
  .guide-prinz-grid { grid-template-columns: minmax(200px, 1fr) 130px 44px; }
  .guide-konv-grid  > .guide-cell-bereich,
  #guide-konv-thead  .guide-konv-grid  > div:nth-child(2),
  .guide-prinz-grid > .guide-cell-bereich,
  #guide-prinz-thead .guide-prinz-grid > div:nth-child(2) { display: none; }
  /* col-resize NUR auf konv/prinz inaktiv (nur diese schalten das Grid um):
     Griffe weg + Scroll-Modus neutralisieren. Auf die konv/prinz-IDs gescopet,
     damit die anderen guide-Listen (gleiche guide.css) unberuehrt bleiben. */
  #guide-konv-thead .idf-colresize-layer,
  #guide-prinz-thead .idf-colresize-layer { display: none; }
  .idf-colresize-scroll #guide-konv-thead,  .idf-colresize-scroll #guide-konv-rows,
  .idf-colresize-scroll #guide-prinz-thead, .idf-colresize-scroll #guide-prinz-rows { width: auto; min-width: 0; }
}
