/* =====================================================================
   Flottenwacht Portal – Gestaltung 2026 und Schnellzugriff
   26.11.2026

   Zwei Teile in einer Datei:
     A) Die Oberfläche für Suche, Neu anlegen und Schnellhandlung
        (gehört zu schnellzugriff.js).
     B) Feinschliff am vorhandenen Portal-Design.

   Das Portal ist gestalterisch gut aufgestellt – es hat bereits ein
   sauberes Token-System (--pt, --co, --ok/wn/bad/inf mit weichen
   Varianten, drei Radien, zwei Schatten). Hier wird nichts umgeworfen,
   sondern nachgezogen, wo es dicht, schwer oder unruhig wirkt.

   Alle Token stammen aus app.css und werden nur benutzt, nicht
   umdefiniert – damit bleibt das Portal in einem Stück, auch wenn
   diese Datei entfernt wird.
   ===================================================================== */

/* =====================================================================
   A) SCHNELLZUGRIFF
   ===================================================================== */

/* ---- Die beiden Knöpfe in der dunklen Seitenleiste ---- */
.fw-schnellbox{display:grid;gap:.4rem;padding:0 .5rem .9rem}
.fw-suche-start,.fw-neu-start{
  display:flex;align-items:center;gap:.6rem;width:100%;
  padding:.62rem .7rem;border-radius:var(--rs);
  font:inherit;font-size:.88rem;font-weight:600;cursor:pointer;
  text-align:left;transition:background .15s ease,border-color .15s ease;
}
.fw-suche-start{
  background:rgba(255,255,255,.08);border:1px solid var(--dln);color:rgba(255,255,255,.82);
}
.fw-suche-start:hover{background:rgba(255,255,255,.14);color:#fff}
.fw-suche-start svg,.fw-neu-start svg{width:16px;height:16px;flex:0 0 16px}
.fw-suche-start span{flex:1}
.fw-suche-start kbd{
  font:inherit;font-size:.68rem;font-weight:600;letter-spacing:.02em;
  padding:.16rem .36rem;border-radius:5px;
  background:rgba(255,255,255,.12);color:rgba(255,255,255,.72);
}
.fw-neu-start{background:var(--co);border:1px solid var(--co);color:#fff}
.fw-neu-start:hover{background:#b0340f;border-color:#b0340f}
.fw-suche-start:focus-visible,.fw-neu-start:focus-visible{
  outline:2px solid #fff;outline-offset:2px;
}

/* ---- Die Suche selbst ---- */
#fw-suche{
  position:fixed;inset:0;z-index:300;display:none;
  padding:10vh 1.1rem 1.1rem;
  background:rgba(8,24,27,.46);backdrop-filter:blur(6px);
}
#fw-suche.on{display:block}
/* EIN Fenster, nicht drei Kästen: ein Rahmen, ein Radius, ein Schatten. */
.fw-suche-panel{
  width:min(100%,660px);margin:0 auto;overflow:hidden;
  background:var(--white);border:1px solid var(--ln);border-radius:var(--rl);
  box-shadow:0 2px 8px rgba(10,27,30,.10),0 34px 70px -28px rgba(10,27,30,.5);
}
.fw-suche-feld{display:flex;align-items:center;gap:.7rem;padding:.9rem 1rem}
.fw-suche-feld svg{width:19px;height:19px;flex:0 0 19px;color:var(--ink3)}
.fw-suche-feld input{
  flex:1;min-width:0;border:0!important;background:none!important;
  padding:.2rem 0!important;font:inherit;font-size:1.02rem;color:var(--ink);
  outline:none!important;box-shadow:none!important;
}
/* Kein Fokusrahmen im Suchfeld: das ganze Fenster IST der Fokus, ein
   Kasten um den Kasten verwirrt nur. */
.fw-suche-feld input:focus,.fw-suche-feld input:focus-visible{
  outline:none!important;box-shadow:none!important;border:0!important;
}
.fw-suche-feld input::-webkit-search-cancel-button{filter:grayscale(1);opacity:.45}
.fw-suche-feld input::placeholder{color:var(--ink3)}
.fw-suche-feld kbd{
  font:inherit;font-size:.7rem;font-weight:600;color:var(--ink3);
  padding:.18rem .4rem;border:1px solid var(--ln);border-radius:5px;background:var(--paper);
}
.fw-suche-liste{
  max-height:min(52vh,460px);overflow:auto;padding:.35rem;
  border-top:1px solid var(--ln);
}
.fw-suche-zeile{
  display:flex;align-items:center;gap:.75rem;width:100%;
  padding:.6rem .65rem;border:0;border-radius:var(--rs);
  background:none;font:inherit;text-align:left;cursor:pointer;
}
.fw-suche-zeile.aus{background:var(--ptl)}
.fw-suche-zeile:hover{background:var(--paper2)}
.fw-suche-icon{
  display:grid;place-items:center;width:30px;height:30px;flex:0 0 30px;
  border-radius:8px;background:var(--ptl);color:var(--pt);
}
.fw-suche-icon svg{width:16px;height:16px}
.fw-suche-text{display:grid;gap:.08rem;min-width:0}
.fw-suche-text b{font-size:.93rem;font-weight:650;color:var(--ink);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.fw-suche-text small{font-size:.78rem;color:var(--ink3);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.fw-suche-leer{margin:0;padding:1.6rem 1rem;text-align:center;color:var(--ink3);
  font-size:.9rem;line-height:1.6}
.fw-suche-fuss{
  display:flex;gap:1.1rem;padding:.55rem 1rem;
  border-top:1px solid var(--ln);
  background:var(--paper);color:var(--ink3);font-size:.76rem;
}
.fw-suche-fuss kbd{
  font:inherit;font-size:.72rem;padding:.08rem .3rem;margin-right:.25rem;
  border:1px solid var(--ln);border-radius:4px;background:var(--white);
}
@media(max-width:620px){
  #fw-suche{padding:0}
  .fw-suche-panel{width:100%;border-radius:0;border-left:0;border-right:0;min-height:100vh}
  .fw-suche-liste{max-height:calc(100vh - 128px)}
  .fw-suche-fuss{display:none}
}

/* ---- Neu anlegen ---- */
.fw-neu-raster{display:grid;grid-template-columns:1fr 1fr;gap:.6rem}
.fw-neu-karte{
  display:grid;gap:.18rem;padding:.9rem 1rem;text-align:left;cursor:pointer;
  border:1px solid var(--ln);border-radius:var(--r);background:var(--white);
  font:inherit;transition:border-color .15s ease,box-shadow .15s ease,transform .12s ease;
}
.fw-neu-karte b{font-size:.96rem;font-weight:650;color:var(--ink)}
.fw-neu-karte small{font-size:.79rem;color:var(--ink3);line-height:1.45}
.fw-neu-karte:hover{border-color:var(--pt);box-shadow:var(--sh);transform:translateY(-1px)}
.fw-neu-karte:focus-visible{outline:2px solid var(--pt);outline-offset:2px}
@media(max-width:560px){.fw-neu-raster{grid-template-columns:1fr}}

/* ---- Schnellhandlung in der Fristenliste ---- */
.fw-schnell{margin-right:.4rem}

/* =====================================================================
   B) FEINSCHLIFF
   ===================================================================== */

/* Kartenköpfe: eine Haarlinie trägt besser als eine graue Fläche */
.ch{background:transparent!important;border-bottom:1px solid var(--ln)!important}
.ch h3{font-size:.98rem;font-weight:650;letter-spacing:-.012em}
.cnt{color:var(--ink3);font-variant-numeric:tabular-nums}

/* Tiefe zurücknehmen – der Dialog lag unter einem sehr schweren Schatten */
.sheet{box-shadow:0 2px 8px rgba(10,27,30,.08),0 32px 64px -24px rgba(10,27,30,.45)!important}
.card,.k{box-shadow:0 1px 2px rgba(20,27,30,.04),0 4px 14px -8px rgba(20,27,30,.14)!important}

/* Kennzahlen: mitwachsend statt starr vier Spalten – vier schmale
   Kacheln auf einem 13-Zoll-Bildschirm waren zu eng. */
.kpi{grid-template-columns:repeat(auto-fit,minmax(176px,1fr))!important}

/* Statuschips: Fließschrift liest sich besser als Maschinenschrift,
   Ziffern bleiben tabellarisch. */
.tag{font-family:var(--ff)!important;font-variant-numeric:tabular-nums;font-weight:600!important}

/* Tabellen: Zeilen führen das Auge, und der Kopf bleibt beim Rollen
   stehen. Das ist bei Fristenlisten der eigentliche Gewinn. */
tbody tr{transition:background .12s ease}
tbody tr:hover{background:var(--paper2)}
thead th{position:sticky;top:0;z-index:1;background:var(--white)}
td,th{padding-top:.62rem!important;padding-bottom:.62rem!important}

/* Seitlich rollende Tabellen zeigen jetzt, dass rechts noch etwas kommt */
.tw{
  background:
    linear-gradient(90deg,var(--white) 30%,rgba(255,255,255,0)) left/36px 100% no-repeat,
    linear-gradient(270deg,var(--white) 30%,rgba(255,255,255,0)) right/36px 100% no-repeat,
    radial-gradient(farthest-side at 0 50%,rgba(20,27,30,.13),transparent) left/12px 100% no-repeat,
    radial-gradient(farthest-side at 100% 50%,rgba(20,27,30,.13),transparent) right/12px 100% no-repeat;
  background-attachment:local,local,scroll,scroll;
}

/* Tastaturbedienung sichtbar machen – überall gleich */
a:focus-visible,button:focus-visible,summary:focus-visible,
input:focus-visible,select:focus-visible,textarea:focus-visible,
[tabindex]:focus-visible{outline:2px solid var(--pt)!important;outline-offset:2px!important}
#side a:focus-visible,#side button:focus-visible{outline-color:#fff!important}

/* Schaltflächen: eine Stärke, eine Höhe */
.b{font-weight:600!important;min-height:38px}
.b.bxs{min-height:30px}
.bp:hover{background:#b0340f}
.bs:hover{border-color:var(--pt);color:var(--pt)}

/* Formularfelder im Dialog */
.sb input,.sb select,.sb textarea{transition:border-color .14s ease,box-shadow .14s ease}
.sb input:focus,.sb select:focus,.sb textarea:focus{
  border-color:var(--pt)!important;box-shadow:0 0 0 3px rgba(15,76,85,.12)!important;outline:none!important;
}

/* Leere Zustände: weniger Fläche, mehr Hinweis */
.empty{padding:1.9rem 1.2rem!important;line-height:1.6}

/* Auf dem Handy zählt jede Zeile */
@media(max-width:620px){
  .fw-schnellbox{padding:0 .35rem .7rem}
  .card{margin-bottom:.8rem}
  .cb{padding:1rem}
  td,th{padding-left:.8rem!important;padding-right:.8rem!important}
  .b{min-height:40px}
  .head{margin-bottom:1rem}
}

@media(prefers-reduced-motion:reduce){
  .fw-neu-karte:hover{transform:none}
  tbody tr,.b,.fw-neu-karte{transition:none}
}
