/**
 * Tools - Trialog Intranet Design
 * Tool-specific components ported from the intranet.html design prototype:
 * the tool-card landing grid, the two-column calculator layout with result
 * box, and the live document previews. Classes carry the in-tool- / in-calc- /
 * in-doc- prefix so they can coexist with the legacy stylesheets; design
 * tokens (--in-*) live in intranet.css, shared primitives in intranet-ui.css.
 */

/* ========================================
   TOOL CARD GRID (landing)
   ======================================== */

.in-tool-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.in-tool-card {
  border: 1px solid var(--in-line);
  border-radius: var(--in-radius);
  background: #fff;
  box-shadow: var(--in-shadow-sm);
  padding: 22px;
  transition: 0.18s;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-family: inherit;
  color: inherit;
}

.in-tool-card.clickable {
  cursor: pointer;
}

.in-tool-card.clickable:hover {
  box-shadow: var(--in-shadow-lg);
  transform: translateY(-3px);
  border-color: var(--in-blue-400);
}

.in-tool-card.soon {
  opacity: 0.72;
}

.in-tool-card h3 {
  font-size: 16.5px;
  font-weight: 700;
  margin: 0;
}

.in-tool-card p {
  font-size: 13.5px;
  color: var(--in-ink-500);
  flex: 1;
  margin: 0;
}

.in-tool-ic {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.in-tool-ic svg {
  width: 26px;
  height: 26px;
}

.in-tool-go {
  font-size: 13px;
  font-weight: 700;
  color: var(--in-blue-500);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.in-tool-soon-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--in-amber);
  background: var(--in-amber-soft);
  padding: 3px 9px;
  border-radius: 20px;
  align-self: flex-start;
}

/* ========================================
   CALCULATOR LAYOUT + RESULT BOX
   ======================================== */

.in-calc-wrap {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 22px;
  align-items: start;
}

.in-calc-result {
  background: linear-gradient(135deg, var(--in-navy-800), var(--in-navy-600));
  color: #fff;
  border-radius: var(--in-radius);
  padding: 24px;
}

.in-calc-big {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.8px;
  margin-top: 4px;
}

.in-calc-line {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 14px;
}

.in-calc-line:last-child {
  border-bottom: none;
}

.in-calc-line b {
  font-weight: 700;
}

/* ========================================
   DOCUMENT PREVIEW
   ======================================== */

.in-doc-preview {
  background: #fff;
  border: 1px solid var(--in-line);
  border-radius: var(--in-radius);
  padding: 34px;
  font-size: 14px;
  line-height: 1.7;
  box-shadow: var(--in-shadow-sm);
  min-height: 200px;
}

.in-doc-brand {
  font-family: var(--in-serif);
  font-size: 24px;
  letter-spacing: 2px;
  color: var(--in-navy-800);
  font-weight: 600;
}

.in-doc-preview h2 {
  font-size: 18px;
  margin: 18px 0 10px;
}

.in-doc-muted {
  color: var(--in-ink-500);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 1080px) {
  .in-tool-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .in-calc-wrap {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .in-tool-grid {
    grid-template-columns: 1fr;
  }

  .in-calc-big {
    font-size: 28px;
  }
}

/* ========================================
   FEINSCHLIFF
   ======================================== */

/* Tastatur-Fokus auf klickbaren Werkzeug-Karten. */
.in-tool-card.clickable:focus-visible {
  outline: 2px solid var(--in-blue-500);
  outline-offset: 3px;
}

/* Icon antwortet dezent auf den Karten-Hover. */
.in-tool-ic {
  transition: transform 0.18s ease;
}

.in-tool-card.clickable:hover .in-tool-ic {
  transform: scale(1.06);
}

/* Rechenergebnisse und Summenzeilen mit tabellarischen Ziffern. */
.in-calc-big,
.in-calc-line {
  font-variant-numeric: tabular-nums;
}

/* Dokumentvorschau: Zahlen/Daten im Brieftext laufen ebenfalls tabellarisch. */
.in-doc-preview {
  font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
  .in-tool-card.clickable:hover {
    transform: none;
  }

  .in-tool-ic,
  .in-tool-card.clickable:hover .in-tool-ic {
    transform: none;
    transition: none;
  }
}

/* Kategorieueberschrift im Unterreiter "Formulare". Die Formulare stehen
   nach Sparte gegliedert - man sucht dort nach dem Dokument, und das haengt
   an der Sparte. Die Arbeitstools brauchen das nicht: Ein Rechner bleibt
   ein Rechner, egal was er durchrechnet. */
.in-tool-kat {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 30px 0 14px;
}

.in-tool-kat:first-child {
  margin-top: 0;
}

.in-tool-kat h2 {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--in-navy-800);
  margin: 0;
  white-space: nowrap;
}

/* Linie hinter der Ueberschrift bis zum Rand - haelt die Kategorien
   auseinander, ohne eine weitere Kastenkante einzuziehen. */
.in-tool-kat::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--in-line);
}

/* Noch leere Kategorie. Sie wird bewusst ANGEZEIGT statt weggelassen: So ist
   zu sehen, dass es die Sparte gibt und nur noch nichts darin liegt. */
.in-tool-leer {
  grid-column: 1 / -1;
  padding: 22px;
  border: 1px dashed var(--in-line);
  border-radius: 14px;
  text-align: center;
  font-size: 13.5px;
  color: var(--in-ink-500);
  background: var(--in-bg);
}

/* ---------------------------------------------------------------------------
   Suchleiste ueber Arbeitstools und Formulare.

   Bewusst ANDERS eingefaerbt als die Suche in der Kopfleiste: Die dort sucht
   das ganze Intranet, diese nur diesen Bildschirm. Zwei gleich aussehende
   Suchfelder uebereinander waeren eine Einladung, in das falsche zu tippen.
   Deshalb hier Gold statt Blau - dieselbe Farbe, die im Tools-Bereich ohnehin
   die Akzente setzt.
   --------------------------------------------------------------------------- */

.in-tool-suche {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 18px;
  padding: 0 14px;
  height: 46px;
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(201, 162, 75, 0.09), rgba(201, 162, 75, 0.04));
  border: 1px solid rgba(201, 162, 75, 0.4);
  transition: 0.16s;
}

.in-tool-suche:focus-within {
  background: #fff;
  border-color: #c9a24b;
  box-shadow: 0 0 0 3px rgba(201, 162, 75, 0.22), 0 4px 14px rgba(122, 86, 5, 0.1);
}

.in-tool-suche > svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  color: #a8801f;
}

.in-tool-suche input {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  outline: none;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--in-ink-900);
}

.in-tool-suche input::placeholder {
  color: var(--in-ink-500);
}

/* Die eingebaute Kreuz-Schaltflaeche von type="search" faellt je nach
   Browser anders aus - deshalb eine eigene. */
.in-tool-suche input::-webkit-search-cancel-button {
  display: none;
}

.in-tool-suche-x {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: rgba(122, 86, 5, 0.12);
  color: #7a5605;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: 0.14s;
}

.in-tool-suche-x:hover {
  background: rgba(122, 86, 5, 0.22);
}

.in-tool-suche-info {
  margin: -8px 0 18px;
  font-size: 12.5px;
  font-weight: 600;
  color: #96701f;
}

.in-tool-suche-info.is-leer {
  color: var(--in-ink-500);
  font-weight: 500;
}

/* ---------------------------------------------------------------------------
   Formulare (Tools > Formulare) - schmale Zeilen statt Kacheln.

   Ein Werkzeug will erklaert werden, ein Formular nur gefunden. Bei 28
   Dateien erzeugen Kacheln eine Bildlaufstrecke, auf der nichts mehr
   ueberblickt wird - deshalb hier eine Liste in zwei bis drei Spalten mit
   einheitlichem Symbol in einer Strichstaerke.
   --------------------------------------------------------------------------- */

.in-form-liste {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 8px;
  margin-bottom: 4px;
}

.in-form-zeile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--in-line-soft);
  background: var(--in-card);
  text-decoration: none;
  color: inherit;
  transition: 0.14s;
}

.in-form-zeile:hover {
  border-color: var(--in-blue-400);
  background: var(--in-blue-50);
}

.in-form-zeile:focus-visible {
  outline: 2px solid var(--in-blue-400);
  outline-offset: 2px;
}

/* Ein Symbol fuer alle, nur der Farbton trennt die Dateiart. Drei
   verschiedene Zeichnungen nebeneinander wirkten unruhig - die Art steht
   ohnehin im Text daneben. */
.in-form-ic {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.in-form-ic svg {
  width: 17px;
  height: 17px;
}

.in-form-ic--pdf {
  background: #fdeaea;
  color: #c0392b;
}

.in-form-ic--xlsx {
  background: var(--in-green-soft);
  color: var(--in-green-text);
}

.in-form-ic--docx {
  background: var(--in-blue-100);
  color: var(--in-blue-500);
}

.in-form-txt {
  flex: 1;
  min-width: 0;
}

.in-form-name {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--in-ink-900);
  line-height: 1.3;
  /* Lange Dateinamen brechen auf zwei Zeilen und werden dann abgeschnitten -
     so bleiben alle Zeilen gleich hoch. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.in-form-meta {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--in-ink-500);
}

.in-form-dl {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  color: var(--in-ink-500);
  transition: 0.14s;
}

.in-form-dl svg {
  width: 16px;
  height: 16px;
}

.in-form-zeile:hover .in-form-dl {
  background: var(--in-blue-500);
  color: #fff;
}

/* Anzahl der Formulare neben der Kategorie - beziffert, was einen erwartet. */
.in-tool-kat-zahl {
  flex-shrink: 0;
  min-width: 22px;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--in-line-soft);
  color: var(--in-ink-500);
  font-size: 11.5px;
  font-weight: 800;
  text-align: center;
}
