/* objektplaner-klaus.css — Objektplaner im Klaus-Stil (Daniel 19.10.2026).
   Liegt NACH dem eigenen <style> des Objektplaners und überschreibt nur das Bildschirm-Aussehen:
   dunkles Glas, Violett statt Grün als Hauptfarbe, Orbitron für Überschriften, größere Bedienelemente am Handy.
   Druckansichten (Tageszettel, Deckblatt A4) bleiben absichtlich hell – siehe @media print im Objektplaner. */

@media screen {
  :root {
    --ink: #eef0f7;            /* Text */
    --ink-soft: #9aa1b6;
    --paper: #07080d;          /* Seitenhintergrund */
    --card: rgba(22,24,36,.72);
    --line: rgba(255,255,255,.09);
    --moss: #8b5cf6;           /* Hauptfarbe (vorher Grün) */
    --moss-soft: rgba(139,92,246,.16);
    --clay: #f87171;           /* überfällig */
    --clay-soft: rgba(248,113,113,.14);
    --amber: #fbbf24;          /* heute fällig */
    --amber-soft: rgba(251,191,36,.13);
    --slate: #67e8f9;          /* Info / Saison */
    --slate-soft: rgba(34,211,238,.12);
    --stone: #7d8399;
    --radius: 16px;
    --shadow: 0 8px 30px rgba(0,0,0,.28);
    --k-glass-hi: rgba(255,255,255,.05);
    --k-line2: rgba(255,255,255,.14);
    --k-grad: linear-gradient(135deg, #7c3aed, #4f46e5);
    --k-titel: Orbitron, "Segoe UI", sans-serif;
    color-scheme: dark;
  }
  html { background: #0a0b12; }
  body {
    background: radial-gradient(900px 600px at 8% -10%, rgba(124,58,237,.20), transparent 60%),
                radial-gradient(800px 600px at 105% 10%, rgba(79,70,229,.16), transparent 60%),
                radial-gradient(700px 500px at 50% 120%, rgba(236,72,153,.08), transparent 60%), var(--paper);
    background-attachment: fixed;
    color: var(--ink); font-size: 14.5px;
  }
  a { color: #c4b5fd; }
  ::selection { background: rgba(168,85,247,.35); }
  h1, .topbar h1 { font-family: var(--k-titel); font-weight: 600; letter-spacing: .04em; }
  .topbar h1 { font-size: 22px; }
  .detail-head h1 { font-size: 26px; line-height: 1.25; }   /* Orbitron ist breit – kleiner als die alte Schrift */

  /* ---------- Kopfleiste + Seitenleiste ---------- */
  .headerbar { background: rgba(7,8,13,.86); border-bottom: 1px solid var(--line); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); height: 60px; }
  .hb-back { color: var(--ink-soft); border: 1px solid var(--k-line2); background: var(--k-glass-hi); border-radius: 10px; padding: 6px 10px; font-size: 13px; }
  .hb-back:hover { color: #fff; background: rgba(255,255,255,.1); }
  .hb-mark { background: var(--k-grad); border-radius: 11px; box-shadow: 0 0 18px rgba(124,58,237,.45); }
  .hb-company { font-family: var(--k-titel); font-size: 15px; letter-spacing: .22em; text-transform: uppercase;
    background: linear-gradient(90deg, #a78bfa, #f1ecff 50%, #a78bfa); -webkit-background-clip: text; background-clip: text; color: transparent; }
  .hb-date, .hb-role-lbl { color: var(--stone); }
  .hb-role { background: var(--k-glass-hi); border: 1px solid var(--k-line2); color: var(--ink); border-radius: 10px; }
  .side { background: rgba(10,11,18,.72); border-right: 1px solid var(--line); top: 60px; height: calc(100vh - 60px); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
  .nav button { color: var(--ink-soft); border-radius: 11px; padding: 10px 12px; font-size: 14.5px; }
  .nav button:hover { background: var(--k-glass-hi); color: #fff; }
  .nav button.on { background: var(--k-grad); color: #fff; box-shadow: 0 4px 18px rgba(124,58,237,.35); }
  .side-foot { color: var(--stone); }
  .brand .mark { background: var(--k-grad); }

  /* ---------- Knöpfe ---------- */
  .btn { background: var(--k-glass-hi); border: 1px solid var(--k-line2); color: var(--ink); border-radius: 11px; padding: 9px 15px; font-size: 14px; font-weight: 600; min-height: 38px; }
  .btn:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.22); }
  .btn.primary { background: var(--k-grad); border-color: transparent; color: #fff; box-shadow: 0 4px 16px rgba(124,58,237,.3); }
  .btn.primary:hover { filter: brightness(1.1); background: var(--k-grad); }
  .btn:disabled, .btn.primary:disabled { background: rgba(255,255,255,.04); border-color: var(--line); color: var(--stone); box-shadow: none; }
  .btn:disabled:hover, .btn.primary:disabled:hover { background: rgba(255,255,255,.04); filter: none; }
  .btn.sm { padding: 6px 11px; font-size: 13px; min-height: 32px; border-radius: 9px; }
  .btn.ghost { background: transparent; border-color: transparent; }
  .btn.danger { color: #fca5a5; }
  .btn.danger:hover { background: var(--clay-soft); border-color: rgba(248,113,113,.4); }
  .x:hover { background: var(--k-glass-hi); }
  .back { color: #c4b5fd; }

  /* ---------- Karten, Zeilen, Tabellen ---------- */
  .card, .stat, .pt-daycard, .ein-sumcard, .rc-resultcard, .db-sec, .db-esec, .pt-wrap {
    background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
    /* bewusst kein Milchglas-Unschärfe-Effekt: bei vielen Karten ruckelt das Scrollen auf älteren iPhones */
  }
  .card, .stat { border-radius: var(--radius); }
  .row { border-bottom-color: var(--line); flex-wrap: wrap; row-gap: 8px; }
  .row > .grow { min-width: 170px; }
  .row > .btn, .row > .pill, .row > .tag { flex-shrink: 0; white-space: nowrap; }
  .row:hover { background: rgba(255,255,255,.035); }
  .stat .n { font-family: var(--k-titel); font-weight: 600; }
  .stat.moss .n { color: #c4b5fd; }
  table th { color: var(--stone); }
  table td, table th { border-color: var(--line); }
  .muted, .hint { color: var(--stone); }
  .section-title { color: var(--stone); }

  /* ---------- Etiketten ---------- */
  .pill.moss { color: #ddd6fe; }
  .pill.clay { color: #fecaca; }
  .pill.amber { color: #fde68a; }
  .pill.slate { color: #a5f3fc; }
  .pill.stone, .tag { background: rgba(255,255,255,.07); color: var(--ink-soft); }
  .chip { background: var(--k-glass-hi); border-color: var(--k-line2); color: var(--ink-soft); }
  .chip:hover { color: #ddd6fe; border-color: rgba(139,92,246,.6); background: var(--moss-soft); }
  .banner, .specific-note, .cap-warn-soft { background: var(--amber-soft); border-color: rgba(251,191,36,.35); color: #fde68a; }

  /* ---------- Eingabefelder (Handy: 16px, sonst zoomt iOS) ---------- */
  input[type=date], input[type=text], input:not([type]), input[type=number], input[type=search], input[type=time], select, textarea, .obj-search, .pt-controls select {
    background: rgba(255,255,255,.05); border: 1px solid var(--k-line2); color: var(--ink); border-radius: 11px; min-height: 42px; font-size: 16px;
  }
  input:focus, select:focus, textarea:focus, .obj-search:focus { outline: 2px solid rgba(139,92,246,.45); border-color: #8b5cf6; background: rgba(255,255,255,.07); }
  input::placeholder, textarea::placeholder { color: var(--stone); }
  select option { background: #151726; color: var(--ink); }
  .field label { color: var(--stone); }
  .check, .cl-rot { border-color: var(--k-line2); }
  .check.on { border-color: #8b5cf6; background: var(--moss-soft); }

  /* ---------- Fenster ---------- */
  .overlay { background: rgba(5,6,12,.66); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
  .modal { background: rgba(20,22,34,.97); border: 1px solid var(--k-line2); border-radius: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.55); }
  .modal-h, .modal-f { border-color: var(--line); }

  /* ---------- Feste helle Flächen aus dem Objektplaner abdunkeln ---------- */
  .pool, .svc-block, .db-subedit, .rc-cmprow, .cl-view, .pt-hcell, .pt-daycard-h, .wk-empty, .obj-search { background: rgba(255,255,255,.03); }
  .pt-corner, .pt-teamcell { background: #11131d; border-color: var(--line); }
  .pt-cell { border-color: var(--line); }
  .pt-cell:hover { background: rgba(255,255,255,.04); }
  .pt-cell.pt-today { background: rgba(139,92,246,.08); }
  .pt-hday.pt-today { background: var(--k-grad); }
  .pt-hmonth, .pt-hday .pt-daynum { color: var(--ink); }
  .pt-chip { background: rgba(139,92,246,.16); border-color: rgba(139,92,246,.38); border-radius: 8px; }
  .pt-chip-title { color: #ede9fe; }
  .pt-chip-obj { color: #b8b0e6; }
  .pt-chip-once { background: rgba(34,211,238,.12); border-color: rgba(34,211,238,.35); }
  .pt-chip-once .pt-chip-title { color: #cffafe; }
  .pt-chip-once .pt-chip-obj { color: #8fd8e6; }
  .pt-chip-ord { border-color: rgba(139,92,246,.38); }
  .pt-chip-ord button { color: #c4b5fd; }
  /* Plantafel: Einsätze und „+“ kompakt (Daniel 19.10.) */
  .pt-grid .pt-cell { padding: 10px 10px 4px; gap: 2px; }   /* Einsatz schmaler als der Tag (Daniel 19.10.) */
  .pt-grid .pt-chip { padding: 2px 6px; font-size: 11px; line-height: 1.2; border-radius: 6px; }
  .pt-grid .pt-chip-obj { font-size: 9.5px; }
  .pt-grid .pt-addbtn { border-width: 1px; font-size: 11px; line-height: 1; padding: 2px 0; border-radius: 5px; }
  .pt-addbtn { border-color: var(--k-line2); color: var(--stone); }
  .pt-addbtn:hover { border-color: #8b5cf6; color: #ddd6fe; background: var(--moss-soft); }
  .pt-viewtoggle, .rc-modetoggle { border-color: var(--k-line2); border-radius: 11px; }
  .pt-viewtoggle button, .rc-modetoggle button { background: transparent; color: var(--ink-soft); }
  .pt-viewtoggle button.on, .rc-modetoggle button.on { background: var(--k-grad); color: #fff; }
  .pt-tooltip { background: rgba(20,22,34,.97); border: 1px solid var(--k-line2); }
  .ord-btn { background: var(--k-glass-hi); border-color: var(--k-line2); color: var(--ink-soft); }
  .ord-btn:hover:not(:disabled) { background: var(--moss-soft); border-color: #8b5cf6; color: #ddd6fe; }
  .dash-dur { color: #ddd6fe; background: var(--moss-soft); border-color: rgba(139,92,246,.35); }
  .dash-dur-edit { color: #a5f3fc; border-color: rgba(34,211,238,.3); }
  .dash-dur-edit input { background: rgba(255,255,255,.06); color: var(--ink); border-color: rgba(34,211,238,.3); }
  .cap-box, .hist-sum { background: rgba(34,211,238,.06); border-color: rgba(34,211,238,.25); }
  .cap-grid > div, .cap-grid .cap-hl, .cap-visitrow, .hist-sum-total { border-color: rgba(34,211,238,.2); }
  .missing-list { background: transparent; border-color: rgba(248,113,113,.35); }
  .db-sec-h { background: rgba(255,255,255,.04); color: var(--ink); }
  .db-tbl td, .db-tbl th, .wk-row, .rc-catrow, .rc-svcrow, .rc-bwarow, .rc-tbl td, .rc-tbl th, .db-sec-h { border-color: var(--line); }
  .db-daily { color: #a5f3fc; border-color: rgba(34,211,238,.3); }
  .wk-cell { border-color: var(--line); }
  .wk-empty, .wk-empty .wk-h { color: var(--stone); }
  .wk-ok { color: #ddd6fe; border-color: rgba(139,92,246,.35); }
  .wk-full { color: #fde68a; border-color: rgba(251,191,36,.35); }
  .wk-over { color: #fecaca; border-color: rgba(248,113,113,.4); }
  .prio-red { background: rgba(248,113,113,.14); color: #fecaca; border-color: rgba(248,113,113,.4); }
  .prio-yellow { background: rgba(251,191,36,.13); color: #fde68a; border-color: rgba(251,191,36,.35); }
  .prio-green { background: rgba(52,211,153,.13); color: #a7f3d0; border-color: rgba(52,211,153,.35); }
  .rc-tabs { border-color: var(--line); }
  .rc-tabs button.on { color: #c4b5fd; border-bottom-color: #8b5cf6; }
  .rc-step { background: var(--k-glass-hi); border-color: var(--k-line2); color: var(--ink-soft); }
  .rc-step.on { background: var(--k-grad); border-color: transparent; color: #fff; }
  .rc-activebar, .rc-computedbar, .ht-yeartotal, .ht-diff.ok { color: #ddd6fe; }
  .ein-sumval, .rc-resultval, .ht-rev, .ht-e, .ht-yeartotal b, .rc-active { color: #c4b5fd; font-family: var(--k-titel); font-weight: 600; }
  .ein-row .ein-amount { color: #a5f3fc; }
  .contract-no { color: #a5f3fc; }
  .ht-diff.bad { color: #fecaca; }

  /* Tabellen ohne eigene Klasse (z. B. Saisonarbeiten): Luft, Linien, auf dem Handy seitlich scrollbar */
  table:not([class]) { width: 100%; border-collapse: collapse; }
  table:not([class]) th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--stone); font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  table:not([class]) td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
  table:not([class]) tr:last-child td { border-bottom: 0; }
  table:not([class]) tr:hover td { background: rgba(255,255,255,.03); }
  .card:has(> table) { overflow-x: auto; }

  /* Saisonarbeiten-Liste: am PC als Tabelle, am Handy als kleine Karten (Objekt + Knopf oben, Zähler + Stand darunter) */
  /* Saison-Karte: Kopfzeile klappt die Objektliste ein/aus (Daniel 21.10.) */
  .sa-kopf { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; cursor: pointer; border-radius: var(--radius); user-select: none; }
  .sa-kopf:hover { background: rgba(255,255,255,.03); }
  .sa-kopf:focus-visible { outline: 2px solid #8b5cf6; outline-offset: -2px; }
  .sa-pfeil { flex: 0 0 auto; width: 22px; height: 22px; margin-top: 1px; display: inline-grid; place-items: center; border-radius: 7px;
              background: rgba(139,92,246,.16); color: #c4b5fd; font-size: 12px; }
  .sa-karte .sa-kopf + .sa-tab { border-top: 1px solid var(--line); }
  .sa-tab { width: 100%; border-collapse: collapse; }
  .sa-tab th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--stone); font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .sa-tab td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
  .sa-tab tr:last-child td { border-bottom: 0; }
  .sa-tab tbody tr:hover td { background: rgba(255,255,255,.03); }
  @media (max-width: 640px) {
    .sa-tab thead { display: none; }
    .sa-tab tbody tr { display: grid; grid-template-columns: 1fr auto; gap: 8px 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); align-items: center; }
    .sa-tab td { display: block; padding: 0; border: 0; }
    .sa-tab td:nth-child(1) { grid-column: 1; grid-row: 1; }
    .sa-tab td:nth-child(4) { grid-column: 2; grid-row: 1; text-align: right; }
    .sa-tab td:nth-child(2) { grid-column: 1; grid-row: 2; }
    .sa-tab td:nth-child(3) { grid-column: 2; grid-row: 2; text-align: right; font-size: 13.5px; }
  }

  /* Rückfrage („Wirklich löschen?“) und kurze Meldung unten – wie in der Klaus-App (Daniel 19.10.) */
  #frage { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 16px;
    background: rgba(5,6,12,.55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
  #frage .fbox { width: min(360px, 100%); padding: 18px 18px 14px; border-radius: 14px; background: rgba(24,20,40,.97);
    border: 1px solid rgba(168,85,247,.4); box-shadow: 0 18px 50px rgba(0,0,0,.55); }
  #frage .ftext { font-size: 15px; line-height: 1.45; color: var(--ink); white-space: pre-line; }
  #frage .fknoepfe { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
  #frage button { min-height: 42px; padding: 8px 18px; border-radius: 10px; font-size: 14.5px; font-weight: 600; cursor: pointer; color: var(--ink);
    border: 1px solid var(--k-line2); background: rgba(255,255,255,.06); font-family: inherit; }
  #frage button:hover { background: rgba(255,255,255,.11); }
  #frage .fja { border-color: transparent; background: var(--k-grad); color: #fff; }
  #frage .fja.gefahr { background: rgba(248,113,113,.18); border-color: rgba(248,113,113,.55); color: #fecaca; }
  #frage .fja.gefahr:hover { background: rgba(248,113,113,.3); }
  #frage button:focus-visible { outline: 2px solid #8b5cf6; outline-offset: 2px; }
  #meldung { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 24px); z-index: 10001; max-width: min(440px, calc(100vw - 32px));
    padding: 11px 15px; border-radius: 11px; font-size: 14px; line-height: 1.4; white-space: pre-line;
    color: #ede9fe; background: rgba(28,22,48,.97); border: 1px solid rgba(167,139,250,.45); box-shadow: 0 10px 30px rgba(0,0,0,.5);
    transform: translate(-50%, 10px); opacity: 0; transition: opacity .18s, transform .18s; pointer-events: none; }
  #meldung.zeigen { opacity: 1; transform: translate(-50%, 0); }
  #meldung.ok { color: #dcfce7; background: rgba(16,36,28,.97); border-color: rgba(74,222,128,.5); }
  #meldung.fehler { color: #fee2e2; background: rgba(40,18,26,.97); border-color: rgba(248,113,113,.5); }

  /* Hinweistexte direkt in einer Karte bekommen den gleichen Rand wie die Zeilen */
  .card-b > .hint { padding-left: 18px; padding-right: 18px; }
  /* Verrechnungssatz: Zeilen (Kategorien, Bereiche, Zuschläge) fangen auf Höhe der Überschrift an (Daniel 19.10.) */
  .card-b:not([style*="padding"]) > .rc-catrow, .card-b:not([style*="padding"]) > .rc-svcrow, .card-b:not([style*="padding"]) > .rc-bwarow { padding-left: 18px; padding-right: 18px; }

  /* Feste Farben direkt im Programmcode (style="…") */
  [style*="background:#fff"], [style*="background: #fff"], [style*="background:#ffffff"] { background: var(--card) !important; }
  [style*="background:#f7f7f3"], [style*="background:#fbfaf6"], [style*="background:#faf9f5"], [style*="background:#f0eee6"] { background: rgba(255,255,255,.04) !important; }
  [style*="background:#e7eef5"], [style*="background:#cfe0ee"] { background: var(--slate-soft) !important; }
  [style*="color:#999"], [style*="color:#888"] { color: var(--stone) !important; }
  [style*="border-color:var(--clay)"] { border-color: rgba(248,113,113,.5) !important; }

  /* ---------- Handy und Tablet ---------- */
  @media (max-width: 860px) {
    body { font-size: 15px; }
    .headerbar { height: auto; min-height: 60px; padding: calc(env(safe-area-inset-top) + 8px) 14px 8px; }
    .hb-left { min-width: 0; flex: 1; }
    .hb-left > div:last-child { min-width: 0; }
    .hb-company { font-size: 12.5px; letter-spacing: .12em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .hb-mark { width: 30px; height: 30px; flex-shrink: 0; }
    .side { position: sticky; top: 0; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px 10px;
            overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
    .nav { flex-wrap: nowrap; gap: 4px; }
    .nav button { white-space: nowrap; padding: 9px 12px; min-height: 42px; }
    .main { padding: 16px 14px calc(env(safe-area-inset-bottom) + 50px); }
    .topbar h1 { font-size: 19px; }
    /* Objekt-Kopf: Name über volle Breite, Knöpfe darunter nebeneinander */
    .detail-head { flex-direction: column; align-items: stretch; gap: 12px; }
    .detail-head h1 { font-size: 21px; line-height: 1.25; overflow-wrap: anywhere; }
    .detail-head > div:last-child > .btn { flex: 1 1 auto; }
    /* Deckblatt: am Handy eine Spalte statt zwei gequetschter */
    .db-grid { grid-template-columns: minmax(0, 1fr); }
    .db-sec { min-width: 0; }
    .db-kv { flex-wrap: wrap; }
    .db-k { min-width: 110px; }
    .db-v { min-width: 0; overflow-wrap: anywhere; }
    /* Deckblatt bearbeiten: Zeilen umbrechen (Name oben, Datumsfelder darunter) */
    .db-erow { flex-wrap: wrap; }
    .db-erow > input[type=text], .db-erow > select { flex: 1 1 100%; }
    .db-erow .db-datel { flex: 1 1 120px; min-width: 0; }
    .db-erow .db-datel input { width: 100%; min-width: 0; }
    .card-b > .hint { padding-left: 14px; padding-right: 14px; }
    .card-b:not([style*="padding"]) > .rc-catrow, .card-b:not([style*="padding"]) > .rc-svcrow, .card-b:not([style*="padding"]) > .rc-bwarow { padding-left: 14px; padding-right: 14px; }
    /* Karten-Kopf (z. B. Team im Dashboard): Titel oben, Stunden + Druckknopf darunter umbrechen */
    .card-h { flex-wrap: wrap; padding: 13px 14px; }
    .card-h > h2 { min-width: 0; }
    .card-h > div { flex-wrap: wrap; min-width: 0; }
    .card-h .pill { white-space: normal; }
    .pt-viewtoggle { max-width: 100%; }
    .pt-viewtoggle button { padding: 8px 10px; }
    .btn { min-height: 42px; }
    .btn.sm { min-height: 36px; }
    .row { padding: 12px 14px; }
    .modal { border-radius: 18px; }
    .overlay { padding: 16px 10px; }
    table { font-size: 14px; }
  }
}
