/* ============================================================
   OptimizaX Kalender, gemeinsames Bauteil.
   Einmal gebaut, von XRMaps und Masterplan geladen, nicht kopiert.
   Farben, Radien und Abstaende folgen dem OptimizaX-Regelwerk.
   ============================================================ */
.htk{
  --navy:#002B49; --weiss:#FFFFFF; --gold:#F4A900; --dunkelgold:#8F6300;
  --hellblau:#F4F8FC; --grau:#5b7183;
  --r8:8px; --r16:16px; --r999:999px;
  display:grid; grid-template-columns:320px 1fr 0; height:100%;
  min-height:520px; background:var(--hellblau); color:var(--navy);
  font-family:inherit; position:relative; overflow:hidden;
}
.htk *{ box-sizing:border-box; }
.htk.htk-detail-auf{ grid-template-columns:320px 1fr 360px; }

/* ---- Linkes Ergebnispaneel ---- */
.htk-links{ background:var(--weiss); border-right:1px solid #dbe4ee;
  display:flex; flex-direction:column; min-height:0; }
.htk-einst{ padding:16px; border-bottom:1px solid #dbe4ee; }
.htk-monatzeile{ display:flex; align-items:center; gap:8px; margin-bottom:16px; }
.htk-monat{ font-size:18px; font-weight:700; flex:1; }
.htk-navbtn{ width:44px; height:44px; border:none; border-radius:var(--r999);
  background:var(--hellblau); color:var(--navy); font-size:18px; cursor:pointer; }
.htk-navbtn:hover{ background:#e6eef7; }
.htk-heute{ height:44px; padding:0 16px; border:none; border-radius:var(--r999);
  background:var(--navy); color:var(--weiss); font-size:13px; cursor:pointer; }
.htk-ansichten{ display:flex; gap:4px; margin-bottom:16px; }
.htk-ansichten button{ flex:1; height:44px; border:1px solid #dbe4ee;
  background:var(--weiss); color:var(--grau); font-size:13px; border-radius:var(--r8);
  cursor:pointer; }
.htk-ansichten button.aktiv{ background:var(--navy); color:var(--weiss); border-color:var(--navy); }
.htk-filter{ display:flex; flex-wrap:wrap; gap:4px; }
.htk-filter button{ height:32px; padding:0 12px; border:1px solid #dbe4ee;
  background:var(--weiss); color:var(--grau); font-size:13px; border-radius:var(--r999);
  cursor:pointer; }
.htk-filter button.aktiv{ background:var(--gold); color:var(--navy); border-color:var(--gold); font-weight:700; }

.htk-listekopf{ padding:16px 16px 8px; font-size:13px; color:var(--grau);
  text-transform:uppercase; letter-spacing:.04em; }
.htk-liste{ flex:1; overflow-y:auto; padding:0 16px 16px; }
.htk-litem{ display:flex; gap:8px; padding:8px; border-radius:var(--r8);
  cursor:pointer; align-items:flex-start; }
.htk-litem:hover{ background:var(--hellblau); }
.htk-lpunkt{ width:8px; height:8px; border-radius:var(--r999); margin-top:8px; flex:none; }
.htk-ldatum{ font-size:13px; font-weight:700; }
.htk-ltitel{ font-size:15px; }
.htk-lzeit{ font-size:13px; color:var(--grau); }

/* ---- Mittlere Kalenderflaeche ---- */
.htk-mitte{ display:flex; flex-direction:column; min-height:0; padding:16px; }
.htk-woche{ display:grid; grid-template-columns:repeat(7,1fr); gap:4px; margin-bottom:4px; }
.htk-wtag{ font-size:13px; color:var(--grau); text-align:center; padding:4px 0; font-weight:700; }
.htk-gitter{ flex:1; display:grid; grid-template-columns:repeat(7,1fr);
  grid-auto-rows:1fr; gap:4px; min-height:0; }
.htk-tag{ background:var(--weiss); border-radius:var(--r8); padding:8px;
  display:flex; flex-direction:column; gap:4px; overflow:hidden; cursor:pointer;
  border:2px solid transparent; }
.htk-tag:hover{ border-color:#dbe4ee; }
.htk-tag.htk-fremd{ background:#eef3f9; }
.htk-tag.htk-heutetag{ border-color:var(--gold); }
.htk-tagzahl{ font-size:15px; font-weight:700; }
.htk-tag.htk-fremd .htk-tagzahl{ color:var(--grau); }
.htk-chip{ font-size:13px; color:var(--weiss); background:var(--navy);
  border-radius:var(--r8); padding:2px 8px; white-space:nowrap; overflow:hidden;
  text-overflow:ellipsis; line-height:1.4; }

/* ---- Rechtes Detailpaneel ---- */
.htk-rechts{ background:var(--weiss); border-left:1px solid #dbe4ee;
  display:flex; flex-direction:column; min-height:0; }
.htk-rkopf{ display:flex; align-items:center; gap:8px; padding:16px; border-bottom:1px solid #dbe4ee; }
.htk-rtitel{ flex:1; font-size:18px; font-weight:700; }
.htk-zu{ width:44px; height:44px; border:none; background:var(--hellblau);
  border-radius:var(--r999); font-size:18px; cursor:pointer; color:var(--navy); }
.htk-form{ flex:1; overflow-y:auto; padding:16px; display:flex; flex-direction:column; gap:16px; }
.htk-feld{ display:flex; flex-direction:column; gap:4px; }
.htk-feld label{ font-size:13px; color:var(--grau); }
.htk-feld input, .htk-feld textarea, .htk-feld select{ min-height:44px; padding:8px 12px;
  border:1px solid #dbe4ee; border-radius:var(--r8); font-size:15px; font-family:inherit;
  color:var(--navy); background:var(--weiss); }
.htk-feld textarea{ min-height:96px; resize:vertical; }
.htk-zeile2{ display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.htk-check{ flex-direction:row; align-items:center; gap:8px; }
.htk-check input{ min-height:24px; width:24px; }
.htk-farben{ display:flex; gap:8px; }
.htk-farbe{ width:32px; height:32px; border-radius:var(--r999); border:2px solid transparent; cursor:pointer; }
.htk-farbe.aktiv{ border-color:var(--navy); }
.htk-aktion{ display:flex; gap:8px; padding:16px; border-top:1px solid #dbe4ee; }
.htk-speichern{ flex:1; height:44px; border:none; border-radius:var(--r999);
  background:var(--gold); color:var(--navy); font-size:15px; font-weight:700; cursor:pointer; }
.htk-loeschen{ height:44px; padding:0 16px; border:1px solid #dbe4ee;
  background:var(--weiss); color:var(--dunkelgold); border-radius:var(--r999); cursor:pointer; font-size:13px; }

.htk-neu{ margin:0 16px 16px; height:44px; border:1px dashed var(--gold);
  background:var(--weiss); color:var(--dunkelgold); border-radius:var(--r8);
  font-size:15px; font-weight:700; cursor:pointer; }

/* ---- Listenansicht (statt Gitter) ---- */
.htk-mitte.htk-listmodus .htk-woche, .htk-mitte.htk-listmodus .htk-gitter{ display:none; }
.htk-langliste{ display:none; flex:1; overflow-y:auto; flex-direction:column; gap:8px; }
.htk-mitte.htk-listmodus .htk-langliste{ display:flex; }
.htk-lzeile{ background:var(--weiss); border-radius:var(--r8); padding:16px;
  display:flex; gap:16px; align-items:flex-start; cursor:pointer; border-left:8px solid var(--navy); }
.htk-lzeile:hover{ background:#f7fafd; }
.htk-lzeile .d{ font-size:24px; font-weight:700; min-width:64px; }
.htk-lzeile .m{ font-size:13px; color:var(--grau); }
.htk-lzeile .t{ font-size:18px; }
.htk-lzeile .b{ font-size:13px; color:var(--grau); }

/* ---- Telefon ---- */
@media (max-width:820px){
  .htk{ grid-template-columns:1fr; grid-template-rows:auto 1fr; }
  .htk-links{ border-right:none; border-bottom:1px solid #dbe4ee; }
  .htk-liste{ max-height:160px; }
  .htk.htk-detail-auf{ grid-template-columns:1fr; }
  .htk-rechts{ position:absolute; inset:0; z-index:20; }
}
