:root {
  /* CI S-A-S Schankanlagenservice-Süd — Marken-Navy/Gold/Kupfer/gedämpftes Rot-Orange */
  --bg: #f2f1ec;
  --panel: #ffffff;
  --ink: #01152b;
  --muted: #6b7686;
  --line: #e6dfd0;
  --brand: #ebb42c;       /* Marken-Gold */
  --brand-dk: #c89620;
  --accent: #b47049;      /* Kupfer, Sekundärakzent (Avatare u.ä.) */
  --ring: rgba(235,180,44,.28);
  --ok-bg: #e6f4ea; --ok-ink: #1e7d3a;
  --err-bg: #f5e3dc; --err-ink: #b24d34;
  --warn-bg: #fff6e0; --warn-ink: #8a6d12;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(1,21,43,.06), 0 4px 16px rgba(1,21,43,.07);
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--brand-dk); text-decoration: none; }
a:hover { text-decoration: underline; }

header.topbar {
  background: linear-gradient(95deg, #01152b 0%, #0e2034 100%);
  color: #fff; padding: 13px 26px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: 0 2px 12px rgba(1,21,43,.18);
  position: sticky; top: 0; z-index: 100;
}
/* Sticky Kopfzeile würde Sprungziele (Direkthilfe-Anker, #hash-Links) sonst verdecken. */
[id] { scroll-margin-top: 80px; }
header.topbar .brand { font-weight: 800; letter-spacing: .5px; font-size: 19px; color: #fff; }
header.topbar .brand b { color: var(--brand); }
header.topbar .sub { color: #9db0c4; font-size: 13px;
  border-left: 1px solid rgba(255,255,255,.25); padding-left: 16px; }
header.topbar nav { margin-left: auto; display: flex; gap: 4px; align-items: center; }
header.topbar nav > a { color: #e8ecf1; font-size: 14px; font-weight: 500; padding: 6px 12px; border-radius: 6px; }
header.topbar nav > a:hover { color: var(--brand); text-decoration: none; background: rgba(255,255,255,.07); }

.nav-user { color: #9db0c4; font-size: 13px; padding: 6px 8px; opacity: .75; }
.nav-logout { margin-left: 2px; color: #d49485 !important; border: 1px solid rgba(255,100,80,.35); }

/* Eigener Tooltip statt Browser-Standard (title-Attribut lässt sich nicht umfärben) */
.icon-tip { position: relative; }
.icon-tip::after {
  content: attr(data-tip);
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(-4px);
  background: #0e2034; color: #fff; font-size: 12px; font-weight: 500; white-space: nowrap;
  padding: 6px 10px; border-radius: 6px; box-shadow: 0 4px 14px rgba(0,0,0,.25);
  opacity: 0; pointer-events: none; transition: opacity .12s, transform .12s; z-index: 300;
}
.icon-tip:hover::after, .icon-tip:focus-visible::after { opacity: 1; transform: translateX(-50%) translateY(0); }
.nav-logout:hover { background: rgba(255,100,80,.12) !important; color: #d49485 !important; }

/* Dropdown */
.dropdown { position: relative; }
.dropbtn {
  color: #e8ecf1; font-size: 14px; font-weight: 500;
  padding: 6px 12px; border-radius: 6px; cursor: pointer;
  display: flex; align-items: center; gap: 5px; white-space: nowrap;
  user-select: none;
}
.dropbtn::after { content: '▾'; font-size: 10px; opacity: .7; transition: transform .15s; }
.dropdown.open .dropbtn { color: var(--brand); background: rgba(255,255,255,.07); }
.dropdown.open .dropbtn::after { transform: rotate(-180deg); }
.dropdown-menu {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 200;
  background: #0e2034; border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.35);
  min-width: 190px; padding: 6px 0; white-space: nowrap;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a {
  display: block; padding: 8px 16px;
  color: #e8ecf1; font-size: 14px; font-weight: 400;
}
.dropdown-menu a:hover { color: var(--brand); background: rgba(255,255,255,.07); text-decoration: none; }
.dropdown-menu .sep { border-top: 1px solid rgba(255,255,255,.1); margin: 5px 0; }

main { max-width: 1080px; margin: 28px auto; padding: 0 20px; }
h1 { font-size: 24px; margin: 0 0 4px; }
.lead { color: var(--muted); margin: 0 0 24px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); gap: 16px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow);
}
.card .num { font-size: 30px; font-weight: 800; color: var(--brand-dk); line-height: 1; }
.card .lbl { color: var(--muted); font-size: 13px; margin-top: 6px; text-transform: uppercase; letter-spacing: .4px; }

.card.filter { cursor: pointer; text-align: left; font: inherit; width: 100%; transition: box-shadow .15s, border-color .15s; }
.card.filter:hover { border-color: var(--brand-dk); }
.card.filter.active { border-color: var(--brand-dk); border-width: 2px; box-shadow: 0 0 0 2px rgba(0,0,0,.04) inset; }

.card.blink { animation: card-blink 1.4s ease-in-out infinite; }
@keyframes card-blink {
  0%, 100% { box-shadow: var(--shadow); background: var(--panel); }
  50%      { box-shadow: 0 0 0 2px var(--err-ink); background: var(--err-bg); }
}

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge.ok { background: var(--ok-bg); color: var(--ok-ink); }
.badge.warn { background: var(--warn-bg); color: var(--warn-ink); }
.badge.err { background: var(--err-bg); color: var(--err-ink); }

table { width: 100%; border-collapse: collapse; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
th { background: #fbf0d9; color: var(--ink); font-weight: 700; }
th a.sortlink { color: inherit; white-space: nowrap; cursor: pointer; }
th a.sortlink:hover { text-decoration: underline; }
tr:last-child td { border-bottom: 0; }
/* Tour ohne hinterlegtes Lokal -> rot markieren */
tr.tour-leer td { background: var(--err-bg); }
tr.tour-leer td, tr.tour-leer input { color: var(--err-ink); }
tbody tr.clickable:hover { background: #fbf0d9; }

.btn { display: inline-block; background: var(--brand); color: #01152b; border: 0; border-radius: 10px;
  padding: 10px 18px; font-weight: 700; font-size: 15px; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--brand-dk); color: #fff; text-decoration: none; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }

.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; font-weight: 500; }
.flash.ok { background: var(--ok-bg); color: var(--ok-ink); }
.flash.err { background: var(--err-bg); color: var(--err-ink); }
.flash.warn { background: var(--warn-bg); color: var(--warn-ink); }

/* Formulare */
form.stack { display: grid; gap: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px 18px; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 3px; font-weight: 600; }
input[type=text], input[type=number], input[type=email], input[type=tel], input[type=url],
input[type=time], input[type=date], input[type=password],
select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ring); border-color: var(--brand); }
textarea { min-height: 60px; resize: vertical; }
.chk { display: flex; align-items: center; gap: 8px; }
.chk input { width: auto; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 20px; }
.panel h2 { margin: 0 0 14px; font-size: 17px; }
.panel details summary { cursor: pointer; margin-bottom: 14px; }
.panel details[open] summary { margin-bottom: 14px; }
.panel details summary h2 { display: inline; margin: 0; }
.notiz-gruppe { margin-bottom: 22px; }
.notiz-gruppe:last-child { margin-bottom: 0; }
.notiz-gruppe summary { cursor: pointer; margin-bottom: 10px; }
.notiz-gruppe h3 { display: inline-flex; align-items: center; gap: 10px; margin: 0; font-size: 15px; }
.notiz-gruppe table { margin-top: 10px; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar input[type=text], .toolbar select { width: auto; min-width: 200px; }
.btn-sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn-icon { padding: 5px 8px; line-height: 1; }
.back-btn { margin-bottom: 16px; }
.btn-active { background: var(--brand); color: #01152b; }
.btn.danger { background: #f5e3dc; color: #b24d34; }
.btn.danger:hover { background: #b24d34; color: #fff; }
.muted { color: var(--muted); font-size: 13px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
code.tok { background: #fbf0d9; padding: 2px 7px; border-radius: 6px; font-size: 13px; }

/* Direkthilfe-Modus: "?" anklicken, dann auf eine Spaltenüberschrift zeigen */
body.hilfe-modus, body.hilfe-modus * { cursor: help !important; }
body.hilfe-modus [data-hilfe]:hover { background: var(--brand); color: #01152b; border-radius: 6px; }
.stack details p { transition: background-color 1.2s ease; border-radius: 6px; }
.hilfe-highlight { background-color: rgba(235, 180, 44, .35) !important; }
mark.hilfe-treffer { background: var(--brand); color: #01152b; border-radius: 3px; padding: 0 1px; }

/* === Tourenplan (optische Ansicht) === */
.tourgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 16px; }
.tourcard { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px; box-shadow: var(--shadow); text-decoration: none; color: var(--ink); transition: transform .08s, box-shadow .12s; }
.tourcard:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 8px 26px rgba(1,21,43,.13); }
.tourcard .tname { font-size: 17px; font-weight: 800; margin-bottom: 10px; line-height: 1.25; }
.tourcard .trow { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.tourcard .av { width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; flex: 0 0 auto; }
.tourcard .bn { font-size: 13.5px; color: var(--muted); }
.tourcard .bn b { color: var(--ink); display: block; font-size: 14.5px; }
.tourcard .stats { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 20px;
  font-size: 12.5px; font-weight: 600; background: #fbf0d9; color: var(--ink); }
.pill.ok { background: var(--ok-bg); color: var(--ok-ink); }
.pill.open { background: var(--warn-bg); color: var(--warn-ink); }
.wd { display: inline-block; background: var(--ink); color: #fff; border-radius: 8px; padding: 2px 9px;
  font-size: 12px; font-weight: 700; margin-left: 6px; vertical-align: middle; }

/* Timeline der Stationen */
.tl { list-style: none; margin: 0; padding: 0; position: relative; }
.tl:before { content: ""; position: absolute; left: 19px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.tl li { position: relative; padding: 0 0 14px 54px; }
.tl .num { position: absolute; left: 0; top: 0; width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px; z-index: 1; box-shadow: 0 0 0 4px var(--bg); }
.tl .num.done { background: var(--ok-ink); color: #fff; }
.stbox { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px;
  box-shadow: var(--shadow); }
.stbox .sh { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.stbox .nm { font-size: 16.5px; font-weight: 700; }
.stbox .zeit { color: var(--brand-dk); font-weight: 700; font-size: 14px; }
.stbox .adr { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.stbox .chips { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 10px; }
.stbox .chips .anlage-zeile { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chip2 { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 8px; background: #fbf0d9; color: var(--ink); }
.chip2.bier { background: #f6e2b8; } .chip2.afg { background: #d9ecf6; } .chip2.postmix { background: #e6dcf6; }
.chip2.wasser { background: #d9f0ee; }
.stbox .extra { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; color: var(--muted); }
.stbox .extra a { color: var(--brand-dk); }
.stbox .key { color: #8a6d12; font-weight: 600; }

/* Kalender — Monatsraster */
.kalender-toolbar { display: flex; align-items: center; gap: 12px; margin: 12px 0; }
.kalender-legende { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.kalender-legende-eintrag { display: flex; align-items: center; gap: 6px; }
.kalender-legende-punkt { width: 11px; height: 11px; border-radius: 50%; display: inline-block; box-shadow: inset 0 0 0 1px rgba(1,21,43,.15); }
.kalender-monat {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
}
.kalender-kopf {
  background: var(--panel); padding: 8px 6px; text-align: center;
  font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px;
}
.kalender-tag {
  background: var(--panel); min-height: 108px; padding: 6px; display: flex; flex-direction: column;
  gap: 3px; overflow-y: auto;
}
.kalender-tag.ausserhalb { background: var(--bg); }
.kalender-tag.ausserhalb .kalender-tag-nummer { color: var(--muted); }
.kalender-tag.heute { box-shadow: inset 0 0 0 2px var(--brand-dk); }
.kalender-tag-kopf { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 2px; }
.kalender-tag-wochentag { display: none; font-size: 11px; color: var(--muted); font-weight: 700; }
.kalender-tag-nummer { font-size: 13px; font-weight: 700; }
.kalender-tag.heute .kalender-tag-nummer {
  background: var(--brand-dk); color: #fff; border-radius: 50%;
  width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; font-size: 12px;
}
.kalender-termin {
  display: block; background: #fbf0d9; color: var(--ink); border-radius: 6px; padding: 2px 6px;
  font-size: 12px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kalender-termin:hover { text-decoration: none; background: var(--brand); }
.kalender-termin.ganztag { background: #d9ecf6; }
.kalender-termin-zeit { font-weight: 700; color: var(--brand-dk); margin-right: 3px; }

@media (max-width: 720px) {
  .kalender-monat { grid-template-columns: 1fr; }
  .kalender-kopf { display: none; }
  .kalender-tag { min-height: 0; flex-direction: row; align-items: flex-start; flex-wrap: wrap; }
  .kalender-tag.ausserhalb { display: none; }
  .kalender-tag-kopf { flex-direction: column; align-items: flex-start; margin: 0 8px 0 0; min-width: 44px; }
  .kalender-tag-wochentag { display: block; }
  .kalender-tag > .kalender-termin { flex: 1 1 auto; }
}

footer.foot { max-width: 1080px; margin: 40px auto 24px; padding: 0 20px; color: var(--muted); font-size: 12.5px; }

/* Link zur Nachbaranwendung Material. Abgesetzt, damit man sieht: hier verlaesst man SAS. */
.nav-extern { border: 1px solid rgba(120,190,255,.35); color: #8fc7f5 !important; }
.nav-extern:hover { background: rgba(120,190,255,.12) !important; }
