/* Jahreskalender Web – Oberfläche */
:root {
  --blue: #1f4e79; --blue2: #2e6da4; --bg: #f4f6f9; --card: #fff; --ink: #1c2430; --muted: #6b7684; --line: #dde2e8;
  --sat: #d6e4f5; --sun: #8eb4e3; --hol: #e6b8b7; --fer: #92d899; --danger: #c0392b;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); font-size: 15px; padding-bottom: env(safe-area-inset-bottom); }
.btn { font: inherit; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 8px; padding: 8px 14px; cursor: pointer; min-height: 38px; }
.btn:hover { background: #eef2f7; }
.btn.primary { background: var(--blue2); border-color: var(--blue2); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--blue); }
.btn.danger { color: var(--danger); border-color: #e7b6b0; }
.btn.icon { padding: 4px 12px; font-size: 20px; line-height: 1; }
.btn.sm { padding: 4px 10px; min-height: 30px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: default; }
select, input { font: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); min-height: 38px; }
input[type=color] { padding: 2px; width: 48px; }

/* Kopf und Reiter */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--blue); color: #fff; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; margin-right: auto; }
.brand img { border-radius: 6px; }
.yearNav { display: flex; align-items: center; gap: 6px; }
.yearNav b { font-size: 19px; min-width: 52px; text-align: center; }
.top .btn.icon { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.25); }
.top select { max-width: 190px; }
.top .btn.primary { background: #f0b429; border-color: #f0b429; color: #1c2430; }
.tabs { position: sticky; top: 54px; z-index: 19; display: flex; gap: 2px; background: #fff; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { font: inherit; border: 0; background: none; padding: 11px 14px; cursor: pointer; color: var(--muted); white-space: nowrap; border-bottom: 3px solid transparent; }
.tabs button.on { color: var(--blue); border-bottom-color: var(--blue2); font-weight: 600; }
main { padding: 14px; max-width: 1900px; margin: 0 auto; }
body:not([data-tab=kalender]) main { max-width: 1000px; }

/* Jahreskalender */
.kalTools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.kalTools .info { color: var(--muted); font-size: 13px; margin-right: auto; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.seg button { font: inherit; border: 0; background: none; padding: 7px 14px; cursor: pointer; }
.seg button.on { background: var(--blue2); color: #fff; }
.kalTitle { margin: 4px 0 6px; font-size: 20px; }
.yearWrap { overflow-x: auto; background: #fff; border: 1px solid #000; }
.year { display: grid; grid-template-columns: repeat(12, minmax(118px, 1fr)); min-width: 1420px; font-family: "Arial Narrow", "Roboto Condensed", "Liberation Sans Narrow", Arial, sans-serif; }
.mcol { border-left: 1px solid #000; }
.mcol:first-child { border-left: 0; }
.mhead { text-align: center; font-weight: 700; font-size: 15px; padding: 3px 0; border-bottom: 1px solid #000; }
.day { position: relative; display: flex; height: 36px; border-bottom: 1px solid #c9ced4; cursor: pointer; }
.day:hover { background: #fff8e1; }
.day.empty { background: #f2f2f2; cursor: default; }
.day.today { outline: 2px solid #f0b429; outline-offset: -2px; z-index: 1; }
.day .dn { width: 31px; flex: none; padding: 2px 2px; font-size: 11.5px; line-height: 1.15; border-right: 1px solid #e1e4e8; }
.day .dn b { display: block; white-space: nowrap; }
.day .dn i { font-style: normal; font-size: 9px; color: #333; }
.dn.sat { background: var(--sat); } .dn.sun { background: var(--sun); } .dn.hol { background: var(--hol); }
.day .tx { flex: 1; min-width: 0; overflow: hidden; padding: 1px 3px; font-size: 10px; line-height: 1.12; display: flex; flex-direction: column; justify-content: center; }
.day .tx div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day .tx .more { color: var(--blue2); font-weight: 600; }
.day.fer { box-shadow: inset -8px 0 0 var(--fer); }
.day .moon { right: 11px !important; }
.day .moon { position: absolute; right: 7px; top: 50%; transform: translateY(-50%); font-size: 10px; }
.day .abs { display: flex; gap: 2px; padding: 0 9px 0 0; }
.day .abs i { width: 5px; margin-bottom: -1px; position: relative; z-index: 2; }
.kalFoot { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 12px; align-items: flex-start; }
.ferTab h3 { font-size: 14px; margin: 0 0 6px; }
.ferGrid { display: grid; grid-template-columns: repeat(6, auto); border: 1px solid #000; font-size: 12px; }
.ferGrid div { display: flex; flex-direction: column; text-align: center; border-left: 1px solid #000; }
.ferGrid div:first-child { border-left: 0; }
.ferGrid b { padding: 3px 8px; border-bottom: 1px solid #000; }
.ferGrid span { padding: 3px 8px; background: var(--fer); }
.leg { font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.pl { display: inline-flex; align-items: center; gap: 4px; margin-right: 12px; }
.pl i, .dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }

/* Monatsansicht */
.monthNav { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 6px 0 10px; }
.monthNav h2 { margin: 0; font-size: 20px; min-width: 180px; text-align: center; }
.mlist { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.mrow { display: flex; border-bottom: 1px solid var(--line); min-height: 46px; cursor: pointer; }
.mrow.fer { box-shadow: inset -10px 0 0 var(--fer); }
.mrow.today { background: #fff8e1; }
.mrow .dn { width: 62px; flex: none; padding: 6px 8px; display: flex; flex-direction: column; }
.mrow .dn b { font-size: 18px; } .mrow .dn span { font-size: 13px; } .mrow .dn i { font-style: normal; font-size: 11px; color: #333; }
.mtx { flex: 1; padding: 6px 10px; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.it { font-size: 14px; }
.it.feiertag, .it.gedenktag { color: #8a2b2b; }
.it.geburtstag { color: #1f4e79; }
.it.jahreszeit, .it.mond, .it.ferit { color: var(--muted); font-size: 13px; }
.absit { display: flex; align-items: center; gap: 6px; }
.absit i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

/* Listen, Karten, Formulare */
.listHead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 10px; }
.listHead h2 { margin: 0 auto 0 0; font-size: 19px; }
.listHead input[type=search] { flex: 1; min-width: 160px; }
.tbl { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; font-size: 14px; }
.tbl th { text-align: left; background: #eef2f7; padding: 8px 10px; font-weight: 600; }
.tbl td { padding: 7px 10px; border-top: 1px solid var(--line); vertical-align: top; }
.tbl.click tr[data-i]:hover td, .tbl.click td[data-y]:hover { background: #fff8e1; cursor: pointer; }
.tbl tr.feiertag td:last-child { color: #8a2b2b; }
.nw { white-space: nowrap; } .r { text-align: right; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; }
.card h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 16px; flex-wrap: wrap; }
.card h3 small { color: var(--muted); font-weight: 400; }
.sp { flex: 1; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 8px; }
.kpis div { background: #f4f6f9; border-radius: 8px; padding: 8px; text-align: center; }
.kpis b { display: block; font-size: 22px; } .kpis span { font-size: 12px; color: var(--muted); }
.kpis .neg b { color: var(--danger); }
.small { font-size: 13px; color: var(--muted); } .muted { color: var(--muted); } .info { font-size: 13px; color: var(--muted); }
.subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.subtabs button { font: inherit; border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 6px 14px; cursor: pointer; }
.subtabs button.on { background: var(--blue2); color: #fff; border-color: var(--blue2); }
.fld { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.fld span { font-size: 13px; font-weight: 600; }
.fld small { color: var(--muted); font-size: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.chks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 14px; }
.chks.c3 { grid-template-columns: repeat(3, 1fr); } .chks.c4 { grid-template-columns: repeat(4, 1fr); }
.chk, .colr { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 14px; cursor: pointer; }
.chk input { width: 18px; height: 18px; min-height: 0; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; }
.inl { display: flex; align-items: center; gap: 8px; margin-right: auto; }

dialog { border: 0; border-radius: 14px; padding: 0; width: min(480px, 94vw); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(20,30,45,.45); }
dialog form { padding: 18px 20px 14px; }
dialog h2 { margin: 0 0 14px; font-size: 18px; }
.dlgFoot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.dlgErr { color: var(--danger); font-size: 13px; min-height: 1em; margin: 0; }
.dayInfo { margin: -6px 0 10px; color: var(--muted); font-size: 13px; }
.dayList { list-style: none; padding: 0; margin: 0 0 10px; }
.dayList li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.dayList li.feiertag, .dayList li.gedenktag { color: #8a2b2b; }
.dayList small { color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 120px); background: #1c2430; color: #fff; padding: 10px 16px; border-radius: 10px; max-width: 92vw; transition: transform .25s; z-index: 50; font-size: 14px; }
.toast.show { transform: translate(-50%, 0); } .toast.err { background: var(--danger); }

@media (max-width: 700px) {
  body { font-size: 15px; }
  .brand span { display: none; }
  .top { gap: 6px; padding: 8px 10px; }
  .top select { max-width: 130px; }
  .tabs { top: 54px; }
  .tabs button { padding: 10px 9px; font-size: 14px; }
  main { padding: 10px; }
  .grid2, .grid4 { grid-template-columns: 1fr; }
  .chks, .chks.c3, .chks.c4 { grid-template-columns: 1fr 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
}
@media print {
  .top, .tabs, .kalTools, .listHead input, .listHead button, .subtabs, .toast { display: none !important; }
  body { background: #fff; } main { padding: 0; max-width: none !important; }
  .card { break-inside: avoid; border-color: #999; }
  .yearWrap { overflow: visible; } .year { min-width: 0; }
}
