/* =================================================================================================
   Datei: /public_service/assets/service.css
   ================================================================================================= */

:root{
  --gap: 16px;
  --radius: 12px;
  --border: 1px solid rgba(0,0,0,.12);
  --shadow: 0 6px 18px rgba(0,0,0,.06);
  --pad: 16px;
  --maxw: 1200px;
  --font: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;

  --bg-page: #f6f7f9;
  --bg-app:  #ffffff;
  --bg-main: #f6f7f9;
}

*{ box-sizing:border-box; }
html{ scrollbar-gutter: stable; }

body{
  margin:0;
  font-family: var(--font);
  background: var(--bg-page);
  color:#111;
  font-size: 14px;
  line-height: 1.45;
}

a{ color:inherit; text-decoration:none; }

.input{ font-size: 16px; }
.btn{ font-size: 14px; }
.card__title{ font-size: 15px; }

/* 10) HEADER / BAR / TOPNAV */
.bar{ width:100%; background: var(--bg-app); }
.bar__inner{ max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }

.topnav{ border-bottom: var(--border); }
.topnav__inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: 10px 0;
}
.topnav__left{
  display:flex;
  gap:14px;
  flex-wrap: wrap;
  padding-left: 10px;
}
.topnav__right{
  display:flex;
  align-items:center;
  gap:10px;
  white-space:nowrap;
  padding-right: 10px;
}

/* 20) APP / PAGE / FOOTER */
.app{
  max-width: var(--maxw);
  margin: 12px auto;
  background: var(--bg-app);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: visible;
}
.page-block{ padding: var(--pad); background: transparent; }

.app-footer{
  border-top: var(--border);
  background:#fff;
  padding: 8px var(--pad);
  font-size:11px;
  opacity:.7;
}
.app-footer__inner{
  max-width:1100px;
  margin:0 auto;
  padding:14px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.app-footer__links{ display:flex; gap:10px; }

/* 30) GRID & CARDS */
.grid{
  display:grid;
  gap: var(--gap);
}

.grid--start{ grid-template-columns: repeat(3, 1fr); }

/* 2-Spalten Bereich unten (Kontakt links, Infos rechts) */
.grid--two{ grid-template-columns: 2fr 1fr; }

@media (max-width: 980px){
  .grid--start{ grid-template-columns: repeat(2, 1fr); }
  .grid--two{ grid-template-columns: 1fr; }
}

@media (max-width: 620px){
  .grid--start{ grid-template-columns: 1fr; }
  .topnav__inner{ align-items:flex-start; }
}

.card{
  background:#fff;
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.card__title{
  padding:10px 12px;
  font-weight:700;
  border-bottom: var(--border);
  background: rgba(0,0,0,.02);
}
.card__body{ padding:12px; min-height:90px; }

/* 40) FORMS / INPUTS / BUTTONS */
.input{
  width:100%;
  padding:10px 12px;
  border: var(--border);
  border-radius: 10px;
  background:#fff;
  font: inherit;
  font-size: 14px;
}

.input:focus{
  outline: none;
  border-color: rgba(0,123,255,.35);
  box-shadow: 0 0 0 3px rgba(0,123,255,.12);
}

.input:disabled{
  background: rgba(0,0,0,.03);
  opacity: .85;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,.16);
  background: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.btn:hover{ background: rgba(0,0,0,.04); }
.btn:disabled{ opacity: .55; cursor: not-allowed; }
.btn--ghost{ background: transparent; }

/* 50) STATUS */
.status__dot{
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #e74c3c;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,.10);
  margin-top:3px;
}
.status__dot[data-state="online"]{ background:#2ecc71; }
.status__dot[data-state="busy"]  { background:#f1c40f; }
.status__dot[data-state="away"]  { background:#e74c3c; }
.status__dot[data-state="off"]   { background:#080302; }

.status{
  display:flex;
  align-items:flex-start;
  gap:14px;
  padding-top:6px;
  padding-bottom:6px;
  margin-bottom:14px;
}
.status > div{ display:flex; flex-direction:column; }
.status__title{ display:block; font-weight:600; line-height:1.25; }
#svcStateText{ display:block; margin-top:6px; line-height:1.35; }

/* 51) STATUS-CHIPS */
.chip{
  border-radius:999px;
  padding:6px 10px;
  border:1px solid rgba(0,0,0,.18);
  background:#fff;
  font-size:12px;
  line-height:1;
}
.chip.is-active{
  box-shadow: 0 0 0 2px rgba(0,0,0,.18) inset;
  font-weight:600;
}
.row_chips{ display:flex; gap:10px; justify-content:center; flex-wrap:wrap; pointer-events: none;
  cursor: default; }

/* 60) UTILS */
.msg{ white-space: pre-line; }
.msg.msg--fixed{ height: 60px; }

.msg--error{
  border: 1px solid rgba(176,0,32,.25);
  background: rgba(176,0,32,.06);
  padding: 10px 12px;
  border-radius: 10px;
}
.msg--info{
  border: 1px solid rgba(0,123,255,.18);
  background: rgba(0,123,255,.06);
  padding: 10px 12px;
  border-radius: 10px;
}

.space{ padding-top: 10px; }
.muted{ opacity: .75; }

.note{
  font-size: 12px;
  opacity: .8;
}

/* 70) SERVICE-CODE BAR (vormals TV BAR)
   FIX: immer untereinander im Card-Grid (keine "Ausbeulung" nach unten rechts)
*/
.tvbar{
  display:flex;
  flex-direction:column;   /* << wichtig: untereinander */
  align-items:stretch;
  gap:10px;
  margin-top: 6px;
}
.tvbar__left{
  flex: 0 0 auto;
  min-width: 0;            /* << verhindert overflow in grid */
}
.tvbar__input{
  width: 100%;             /* << volle Breite der Card */
  height: 42px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: .5px;
  padding-top: 3px;
  padding-bottom: 3px;
  text-align: center;
}
.tvbar__right{
  display:flex;
  gap:10px;
  flex: 0 0 auto;
  white-space: normal;     /* << darf umbrechen */
}
.tvbar__right .btn{
  flex: 1 1 0;             /* << Buttons gleich breit */
  min-width: 0;
}

/* 80) FORMGRID (Kontaktformular) */
.formgrid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.field{ display:flex; flex-direction:column; }

.label{ font-size: 11px; opacity: .7; margin-bottom: 6px; }

.input--select{
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(0,0,0,.55) 50%),
    linear-gradient(135deg, rgba(0,0,0,.55) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

.input--ta{ resize: vertical; min-height: 110px; }

.row{ display:flex; gap:10px; }
.row--end{ justify-content: flex-end; }

.row--end .btn{ width: 100%; }

/* Feld-Fehlertexte */
.field__err{
  min-height: 16px;
  margin-top: 6px;
  font-size: 12px;
  color: rgba(176,0,32,.92);
}

/* Key/Value Tabelle rechts */
.kv{ display:flex; flex-direction:column; gap:10px; }
.kv__row{
  display:grid;
  grid-template-columns: 90px 1fr;
  gap:10px;
  align-items:start;
}
.kv__k{
  font-size: 12px;
  opacity: .75;
}
.kv__v{
  font-size: 13px;
}