/* ViaLo-CRM – Shared UI Stylesheet
 * CI-Anpassung an seniorenassistenz-henning.de
 * Version: v12 (Plastizität)
 *
 * Wichtig:
 * - Klassen mit Modulpräfix (siehe docs/ui-design/_standard/klassen-konvention.md).
 * - Generische Hilfsklassen (.vl-...) sind plattformübergreifend nutzbar.
 * - Wenn dieses Stylesheet verändert wird: alle Templates testen, die es einbinden.
 */

:root {
  /* CI seniorenassistenz-henning.de */
  --bg: #faf6ee;
  --card: #ffffff;
  --card-grad-start: #ffffff;
  --card-grad-end: #fbf6ec;
  --text: #2a2a2a;
  --text-muted: #6b6258;

  --beige: #e4daca;
  --beige-soft: #f1eadd;
  --beige-strong: #c9b89a;

  --line: #e7decd;
  --line-soft: #f0e7d4;

  --brand: #48688e;
  --brand-hover: #3a5476;
  --brand-light: #7fa1ce;
  --brand-soft: #eef2f8;

  --ok: #2f6e3a;
  --ok-soft: #e3efd9;
  --warn: #8a5a1a;
  --warn-soft: #f3e6cf;
  --err: #8b1a1a;
  --err-soft: #f5d9d9;

  /* Plastizität – v12 */
  --shadow: 0 1px 2px rgba(60, 50, 30, .06),
            0 10px 28px rgba(72, 104, 142, .14);
  --shadow-strong: 0 2px 4px rgba(60, 50, 30, .08),
                   0 18px 40px rgba(72, 104, 142, .18);
  --shadow-inset-top: inset 0 1px 0 rgba(255, 255, 255, .9);

  --radius: 14px;
  --radius-sm: 8px;
  --radius-pill: 999px;

  --font-body: "Open Sans", system-ui, -apple-system, sans-serif;
  --font-head: "Lato", "Open Sans", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 16px;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-head); }

/* === Topbar === */
.vl-topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--brand);
}
.vl-topbar-right {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 400;
  font-family: var(--font-body);
  display: flex;
  gap: 14px;
  align-items: center;
}
.vl-topbar-right a { color: var(--brand); font-weight: 600; }

/* Hamburger-Button — desktop versteckt */
.vl-nav-toggle {
  display: none;
  flex-direction: column; justify-content: space-between;
  width: 26px; height: 18px;
  background: none; border: none; cursor: pointer; padding: 0;
  flex-shrink: 0;
}
.vl-nav-toggle span {
  display: block; width: 100%; height: 2px;
  background: var(--brand); border-radius: 2px;
  transition: transform .22s ease, opacity .18s ease;
  transform-origin: center;
}
.vl-nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.vl-nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.vl-nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

@media (max-width: 720px) {
  .vl-topbar { padding: 10px 14px; gap: 10px; }
  .vl-topbar-right { font-size: 12px; gap: 10px; }
  .vl-topbar-user-info { display: none; }
  .vl-topbar-search { flex: 1 1 auto; }
  .vl-nav-toggle { display: flex; }

  /* Nav-Drawer — standardmäßig eingeklappt */
  .vl-modnav {
    overflow: hidden;
    max-height: 0;
    padding: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    border-bottom: none;
    transition: max-height .28s ease;
  }
  .vl-modnav.open {
    max-height: 480px;
    border-bottom: 1px solid var(--line);
    padding: 6px 0 10px;
  }
  .vl-modnav a {
    padding: 11px 20px;
    font-size: 14px;
    border-bottom: 1px solid var(--line-soft);
    border-right: none;
  }
  .vl-modnav a:last-child { border-bottom: none; }
  .vl-modnav .vl-nav-sep { display: none; }
}

/* === Hauptbereich (linksbündig, responsiv) === */
.vl-main {
  max-width: 960px;
  width: 100%;
  margin: 28px 0;
  padding: 0 24px 0 32px;
}
@media (min-width: 1400px) {
  .vl-main { max-width: 1100px; }
}
@media (max-width: 720px) {
  .vl-main { padding: 0 16px; }
}

/* === Breadcrumb === */
.vl-breadcrumb {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.vl-breadcrumb a { color: var(--text-muted); }
.vl-breadcrumb a:hover { color: var(--brand); }

/* === Karten === */
.vl-card {
  background: linear-gradient(180deg, var(--card-grad-start) 0%, var(--card-grad-end) 100%);
  border-radius: var(--radius);
  box-shadow: var(--shadow), var(--shadow-inset-top);
  border: 1px solid var(--line-soft);
  overflow: hidden;
  margin-bottom: 16px;
}
.vl-card--padded { padding: 22px 24px; }
.vl-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line-soft);
  gap: 12px;
  flex-wrap: wrap;
}
.vl-card-title {
  margin: 0;
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: .01em;
}
.vl-card-body { padding: 20px 22px; }

/* === Page-Header (Titel + Aktionen oben) === */
.vl-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  padding: 22px 24px;
}
.vl-page-title {
  margin: 0 0 4px 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.01em;
}
.vl-page-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

/* === Pille / Status === */
.vl-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  font-family: var(--font-body);
  text-transform: uppercase;
}
.vl-pill--active   { background: var(--ok-soft);   color: var(--ok); }
.vl-pill--inactive { background: var(--warn-soft); color: var(--warn); }

/* === Aktionen / Buttons === */
.vl-action {
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: border-color .12s, background .12s, color .12s, transform .1s;
  min-height: 44px;
}
.vl-action:hover {
  background: var(--beige-soft);
  border-color: var(--beige-strong);
  color: var(--text);
  text-decoration: none;
}
.vl-action:active { transform: translateY(1px); }
.vl-action:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.vl-action--brand {
  background: linear-gradient(180deg, #5a7aa3 0%, var(--brand) 100%);
  color: #fff;
  border-color: var(--brand-hover);
  box-shadow: 0 1px 2px rgba(0,0,0,.12), inset 0 1px 0 rgba(255,255,255,.18);
}
.vl-action--brand:hover {
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-hover) 100%);
  border-color: var(--brand-hover);
  color: #fff;
}
.vl-action--primary {
  background: linear-gradient(180deg, #93b1d8 0%, var(--brand-light) 100%);
  color: #fff;
  border-color: #6c8fc1;
  box-shadow: 0 1px 2px rgba(0,0,0,.10), inset 0 1px 0 rgba(255,255,255,.22);
}
.vl-action--primary:hover {
  background: linear-gradient(180deg, var(--brand-light) 0%, #6c8fc1 100%);
  border-color: #6c8fc1;
  color: #fff;
}

.vl-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* === Modul-Toggle-Leiste (für Kundendetail) === */
.vl-tabs {
  background: linear-gradient(180deg, var(--card-grad-start) 0%, var(--card-grad-end) 100%);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow), var(--shadow-inset-top);
  border: 1px solid var(--line-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 16px;
}
.vl-tabs-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 0 8px 0 4px;
  font-family: var(--font-head);
}
.vl-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
  text-decoration: none;
}
.vl-tab:hover { border-color: var(--brand-light); background: var(--brand-soft); text-decoration: none; }
.vl-tab:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.vl-tab--active {
  background: linear-gradient(180deg, #5a7aa3 0%, var(--brand) 100%);
  border-color: var(--brand-hover);
  color: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.10), inset 0 1px 0 rgba(255,255,255,.18);
}
.vl-tab--active:hover {
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-hover) 100%);
  border-color: var(--brand-hover);
  color: #fff;
}
.vl-tab--soon {
  opacity: .55;
  pointer-events: none;
  border-style: dashed;
  background: var(--beige-soft);
}
.vl-tab-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--beige);
  color: var(--text-muted);
  margin-left: 4px;
  letter-spacing: .03em;
}

/* === Datenraster (Stammdaten u. ä.) === */
.vl-data {
  display: grid;
  grid-template-columns: 130px 1fr 130px 1fr;
  row-gap: 8px;
  column-gap: 14px;
  font-size: 13.5px;
  margin: 0;
  align-items: baseline;
}
@media (max-width: 720px) {
  .vl-data { grid-template-columns: 120px 1fr; }
}
.vl-data-label { color: var(--text-muted); font-size: 12.5px; }
.vl-data-value { font-weight: 600; margin: 0; color: var(--text); }
.vl-data-value--muted { font-weight: 500; color: var(--text-muted); }
.vl-data-value--mono  { font-variant-numeric: tabular-nums; }

/* === Sektionsüberschrift in einer Karte === */
.vl-section-title {
  margin: 0 0 12px 0;
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--brand);
}

/* === Trenner innerhalb einer Karte === */
.vl-divider {
  border: none;
  border-top: 1px dashed var(--line-soft);
  margin: 16px 0 14px 0;
}

/* === Datentabelle === */
.vl-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}
.vl-table thead th {
  text-align: left;
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--beige-soft);
}
.vl-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
.vl-table tbody tr:last-child td { border-bottom: none; }
.vl-table tbody tr:hover td { background: rgba(72,104,142,.04); }
.vl-table .vl-table-num { text-align: right; font-variant-numeric: tabular-nums; }
.vl-table .vl-table-actions { text-align: right; white-space: nowrap; }
.vl-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 720px) {
  .vl-table thead th { padding: 8px 10px; font-size: 11px; }
  .vl-table tbody td { padding: 10px 10px; font-size: 13px; }
}

/* === Formular === */
.vl-form { display: flex; flex-direction: column; gap: 14px; }
.vl-form-row { display: flex; flex-direction: column; gap: 4px; }
.vl-form-row--inline { flex-direction: row; align-items: center; gap: 10px; flex-wrap: wrap; }
.vl-form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: .02em;
}
.vl-form-input,
.vl-form-select,
.vl-form-textarea {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font-body);
  background: var(--card);
  color: var(--text);
  width: 100%;
  max-width: 480px;
  transition: border-color .12s, box-shadow .12s;
}
.vl-form-input:focus,
.vl-form-select:focus,
.vl-form-textarea:focus {
  outline: none;
  border-color: var(--brand-light);
  box-shadow: 0 0 0 3px rgba(127, 161, 206, .25);
}
.vl-form-help {
  font-size: 12px;
  color: var(--text-muted);
}
.vl-form-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
  flex-wrap: wrap;
}

/* === Flash-Messages === */
.vl-flash {
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 14px;
  border: 1px solid transparent;
}
.vl-flash--success { background: var(--ok-soft);    color: var(--ok);    border-color: #c8e0b3; }
.vl-flash--error   { background: var(--err-soft);   color: var(--err);   border-color: #e6c0c0; }
.vl-flash--warning { background: var(--warn-soft);  color: var(--warn);  border-color: #e6c992; }
.vl-flash--info    { background: var(--brand-soft); color: var(--brand); border-color: #cfdbed; }

/* === Inline-Hinweis === */
.vl-empty {
  padding: 28px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* Org-Switcher Button (Barrierefreiheit: focus-visible, kein inline JS) */
.vl-org-switch-btn {
  display: block; width: 100%; text-align: left;
  padding: 6px 10px; font-size: 12.5px; color: var(--text);
  background: transparent; border: 0; border-radius: 4px;
  cursor: pointer; font-family: inherit;
  transition: background .1s;
}
.vl-org-switch-btn:hover { background: var(--beige-soft); }
.vl-org-switch-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }

/* === Tooltip (CSS-only, ARIA-beschriftet) ===
   Nutzung: <span class="vl-tip" aria-label="Hilfetext">?</span> */
.vl-tip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand);
  font-size: 10px; font-weight: 700; font-style: normal;
  cursor: help; position: relative; vertical-align: middle;
  margin-left: 4px; flex-shrink: 0;
  border: 1px solid var(--brand-light);
}
.vl-tip::after {
  content: attr(aria-label);
  position: absolute; bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%);
  background: #1a1a2e; color: #fff;
  font-size: 12px; font-weight: 400; line-height: 1.4;
  white-space: normal; max-width: 260px; width: max-content;
  padding: 6px 10px; border-radius: 5px;
  pointer-events: none; opacity: 0;
  transition: opacity .15s; z-index: 9999;
}
.vl-tip:hover::after, .vl-tip:focus::after {
  opacity: 1;
}

/* A11y P2: Skip-Link — visually hidden, visible on keyboard focus.
   Targets <main id="main-content"> in base templates. */
.vl-skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000;
  padding: 8px 12px;
  background: var(--brand, #2c5fa3);
  color: #fff;
  text-decoration: none;
  border-radius: 0 0 6px 0;
  font-weight: 600;
}
.vl-skip-link:focus,
.vl-skip-link:focus-visible {
  left: 0;
  outline: 3px solid #fff;
  outline-offset: 2px;
}
