/* ==========================================================================
   Viamed Buchungsportal – globales Stylesheet
   ========================================================================== */

:root {
  /* Farben */
  --color-bg: #F5F7FA;
  --color-surface: #ffffff;
  --color-hero: #123D2D;
  --color-primary: #1E7A5C;
  --color-primary-dark: #145C43;
  --color-primary-soft: #1E8A6E;
  --color-primary-bg: #E5F3EC;
  --color-primary-bg-strong: #E7F5F0;

  --color-text: #14213D;
  --color-text-muted: #5B6675;
  --color-text-faint: #9AA5B1;
  --color-text-body: #40495A;

  --color-border: #E3E7ED;
  --color-divider: #F0F2F5;
  --color-divider-strong: #F3F4F7;
  --color-divider-soft: #EEF1F5;

  --color-danger: #C4362E;
  --color-danger-bg: #FDECEA;
  --color-warning: #C77700;
  --color-warning-bg: #FFF3DF;
  --color-info: #4C4FA0;
  --color-info-bg: #EEF0FB;
  --color-neutral-bg: #EEF1F5;
  --color-neutral-fg: #4B5566;

  --color-sidebar-bg: #0F2A22;
  --color-sidebar-hover: #173327;
  --color-sidebar-border: #1F3A30;
  --color-sidebar-text: #8FB3A2;
  --color-sidebar-text-dim: #7FA894;
  --color-sidebar-text-dimmer: #9DB0D6;

  /* Typografie */
  --font-heading: 'Plus Jakarta Sans', sans-serif;
  --font-body: 'Source Sans 3', system-ui, sans-serif;

  /* Abstände */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  /* Radien */
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 16px;
  --radius-pill: 20px;

  /* Schatten */
  --shadow-card: 0 1px 2px rgba(20, 33, 61, .05);
  --shadow-card-hover: 0 8px 20px -6px rgba(20, 33, 61, .12);
  --shadow-button: 0 8px 20px -8px rgba(30, 122, 92, .6);
  --shadow-dropdown: 0 16px 32px -10px rgba(20, 33, 61, .2);
  --shadow-modal: 0 24px 48px -12px rgba(20, 33, 61, .3);
}

/* ---------- Reset & Grundlagen ---------- */
* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--color-bg);
  font-family: var(--font-body);
  color: var(--color-text);
}

h1, h2, h3, h4 { font-family: var(--font-heading); margin: 0; }

button, input, select, textarea { font-family: var(--font-body); }

input::placeholder, textarea::placeholder { color: var(--color-text-faint); }

a { color: var(--color-primary); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--color-primary-dark); text-decoration: underline; }

button { cursor: pointer; transition: background-color .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .1s ease; }
button:active { transform: scale(.97); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #D7DEE7; border-radius: var(--radius-sm); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ==========================================================================
   Auth-Layout (Login / 2FA)
   ========================================================================== */

.auth-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 44% 56%;
}

.auth-hero {
  background: var(--color-hero);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--space-8) 56px;
  color: #fff;
}

.auth-hero::before, .auth-hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.auth-hero::before {
  width: 520px; height: 520px; background: var(--color-primary); opacity: .55; top: -180px; left: -160px;
}

.auth-hero::after {
  width: 380px; height: 380px; background: var(--color-primary-soft); opacity: .25; bottom: -140px; right: -120px;
}

.auth-hero > * { position: relative; z-index: 1; }

.auth-hero-brand { display: flex; align-items: center; gap: var(--space-4); }

.auth-hero-logo {
  width: 48px; height: 48px; border-radius: 12px; background: #fff;
  display: flex; align-items: center; justify-content: center;
  color: var(--color-hero); font-size: 22px;
}

.auth-hero-brandname {
  font-family: var(--font-heading); font-weight: 800; font-size: 24px; letter-spacing: .5px;
}

.auth-hero-title {
  max-width: 420px; font-family: var(--font-heading); font-weight: 700;
  font-size: 34px; line-height: 1.25; margin-bottom: var(--space-4);
}

.auth-hero-copy { max-width: 420px; font-size: 17px; line-height: 1.6; color: #CDE9DC; }

.auth-hero-footer { font-size: 14px; color: #9FD3BC; }

.auth-panel {
  display: flex; align-items: center; justify-content: center; padding: var(--space-8) 40px;
}

.auth-form { width: 100%; max-width: 420px; }

.auth-title { font-family: var(--font-heading); font-weight: 700; font-size: 28px; margin-bottom: var(--space-2); }
.auth-subtitle { font-size: 15px; color: var(--color-text-muted); margin-bottom: 36px; }

.auth-footnote {
  margin-top: var(--space-6); padding-top: var(--space-5);
  border-top: 1px solid var(--color-divider-soft); font-size: 13px;
  color: var(--color-text-faint); text-align: center;
}

.twofa-icon-wrap {
  width: 56px; height: 56px; border-radius: var(--radius-lg); background: var(--color-primary-bg);
  display: flex; align-items: center; justify-content: center; margin-bottom: var(--space-6);
  color: var(--color-primary); font-size: 24px;
}

.twofa-fields { display: flex; gap: var(--space-3); margin-bottom: var(--space-6); }

.twofa-field {
  width: 100%; aspect-ratio: 1; text-align: center; font-size: 22px; font-weight: 700;
  color: var(--color-text); border: 1.5px solid var(--color-border); border-radius: var(--radius-md); outline: none;
}

.twofa-footer {
  margin-top: var(--space-6); display: flex; flex-direction: column; align-items: center;
  gap: var(--space-3); text-align: center; font-size: 14px;
}

.twofa-resend-form { display: flex; align-items: center; gap: 6px; }

.link-button {
  background: none; border: none; padding: 0; margin: 0; font: inherit;
  color: var(--color-primary); text-decoration: underline; cursor: pointer;
}

@media (max-width: 900px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
}

/* ==========================================================================
   App-Layout (Sidebar + Inhalt)
   ========================================================================== */

.app-layout { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--color-sidebar-bg); padding: 18px 14px; display: flex; flex-direction: column;
  gap: 2px; height: 100vh; overflow-y: auto; position: sticky; top: 0;
}

.sidebar-brand { display: flex; align-items: center; gap: var(--space-3); padding: 6px 12px 18px; }

.sidebar-brand-logo {
  width: 40px; height: 40px; border-radius: var(--radius-md); background: var(--color-primary);
  display: flex; align-items: center; justify-content: center; flex: none; color: #fff; font-size: 18px;
}

.sidebar-brand-name { font-family: var(--font-heading); font-weight: 800; font-size: 18px; color: #fff; letter-spacing: .5px; }

.nav-item {
  display: flex; align-items: center; gap: var(--space-3); padding: 9px 14px; border-radius: var(--radius-md);
  background: transparent; border: none; color: var(--color-sidebar-text); font-size: 14.5px; font-weight: 600;
  text-align: left; margin-bottom: 1px; width: 100%; transition: background-color .15s ease, color .15s ease;
}

.nav-item:hover { background: var(--color-sidebar-hover); color: #fff; text-decoration: none; }
.nav-item i { width: 20px; text-align: center; }
.nav-item.active { background: var(--color-primary); color: #fff; }
.nav-item.active:hover { background: var(--color-primary-dark); color: #fff; }

.sidebar-spacer { flex: 1; }

.sidebar-user {
  display: flex; align-items: center; gap: var(--space-2); padding: 10px 12px;
  border-top: 1px solid var(--color-sidebar-border); margin-top: 6px;
}

.sidebar-user-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--color-primary);
  display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff;
  font-size: 13px; flex: none;
}

.sidebar-user-name { font-size: 13.5px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 12px; color: var(--color-sidebar-text-dim); }

.sidebar-demo {
  padding: 9px 12px; border-radius: var(--radius-md); background: var(--color-sidebar-hover); margin-bottom: 6px;
}

.sidebar-demo-label {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--color-sidebar-text-dim); margin-bottom: 6px;
}

.sidebar-demo-switch { display: flex; background: var(--color-sidebar-bg); border-radius: var(--radius-sm); padding: 3px; gap: 3px; }

.sidebar-demo-option {
  flex: 1; padding: var(--space-2); border-radius: 6px; border: none; font-size: 12.5px; font-weight: 700;
  background: transparent; color: var(--color-sidebar-text-dimmer); transition: background-color .15s ease, color .15s ease;
}

.sidebar-demo-option:hover:not(.active) { background: var(--color-sidebar-hover); color: #fff; }
.sidebar-demo-option.active { background: var(--color-primary); color: #fff; }
.sidebar-demo-option.active:hover { background: var(--color-primary-dark); color: #fff; }

.sidebar-logout {
  display: flex; align-items: center; gap: var(--space-3); padding: 10px 14px; border-radius: var(--radius-md);
  background: transparent; border: none; color: var(--color-sidebar-text); font-size: 14.5px; font-weight: 600;
  text-align: left; width: 100%; transition: background-color .15s ease, color .15s ease;
}

.sidebar-logout:hover { background: var(--color-sidebar-hover); color: #fff; }

@media (max-width: 860px) {
  .app-layout { grid-template-columns: 1fr; }
  .sidebar {
    height: auto; position: static; flex-direction: row; align-items: center;
    overflow-x: auto; padding: 10px 12px; gap: var(--space-2);
  }
  .sidebar-brand { padding: 4px 8px; }
  .sidebar-brand-name { display: none; }
  .nav-item { width: auto; white-space: nowrap; margin-bottom: 0; }
  .nav-item span { display: none; }
  .sidebar-spacer, .sidebar-user, .sidebar-demo { display: none; }
  .sidebar-logout { width: auto; white-space: nowrap; }
  .sidebar-logout span { display: none; }
}

.content { display: flex; flex-direction: column; min-height: 100vh; overflow: hidden; }
.content-main { flex: 1; padding: var(--space-5) 28px; overflow: auto; }

.page-title { font-family: var(--font-heading); font-weight: 700; font-size: 20px; color: var(--color-text); margin-bottom: var(--space-3); }

.breadcrumb { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); font-size: 13.5px; font-weight: 600; }
.breadcrumb a { color: var(--color-text-muted); }
.breadcrumb .sep { font-size: 10px; color: #C7CDD6; }
.breadcrumb .current { color: var(--color-text); }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  padding: 13px 16px; border-radius: var(--radius-md); border: none; font-size: 15px; font-weight: 700;
  cursor: pointer; text-decoration: none;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .1s ease;
}
.btn:active { transform: scale(.97); }

.btn-primary { background: var(--color-primary); color: #fff; box-shadow: var(--shadow-button); }
.btn-primary:hover { background: var(--color-primary-dark); box-shadow: var(--shadow-card-hover); transform: translateY(-1px); }
.btn-secondary { background: var(--color-bg); border: 1.5px solid var(--color-border); color: var(--color-text); }
.btn-secondary:hover { background: #fff; border-color: var(--color-primary); color: var(--color-primary); }
.btn-danger-soft { background: var(--color-danger-bg); border: none; color: var(--color-danger); }
.btn-danger-soft:hover { background: var(--color-danger); color: #fff; }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-danger:hover { background: #A32C25; box-shadow: 0 8px 20px -8px rgba(196, 54, 46, .6); transform: translateY(-1px); }
.btn-primary-soft { background: var(--color-primary-bg); border: none; color: var(--color-primary); }
.btn-primary-soft:hover { background: var(--color-primary); color: #fff; }
.btn-sm { padding: 9px 16px; font-size: 13.5px; border-radius: var(--radius-sm); }
.btn-icon { padding: 7px 10px; font-size: 13px; border-radius: var(--radius-sm); border: none; }
.btn-block { width: 100%; }
.btn-pill {
  padding: 10px 18px; border-radius: var(--radius-sm); border: 1.5px solid var(--color-border);
  background: #fff; color: var(--color-text-body); font-size: 14px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; transition: border-color .15s ease, background-color .15s ease, color .15s ease, transform .1s ease;
}
.btn-pill:hover { border-color: var(--color-primary); color: var(--color-primary); }
.btn-pill.selected,
.btn-pill:has(input:checked) { border-color: var(--color-primary); background: var(--color-primary); color: #fff; }
.btn-pill.selected:hover,
.btn-pill:has(input:checked):hover { background: var(--color-primary-dark); color: #fff; }
.btn-tab {
  padding: 9px 16px; border-radius: var(--radius-sm); border: 1.5px solid var(--color-border);
  background: #fff; color: var(--color-text-body); font-size: 13.5px; font-weight: 600;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease, transform .1s ease;
}
.btn-tab:hover { border-color: var(--color-primary); color: var(--color-primary); }
.btn-tab.selected { border-color: var(--color-primary); background: var(--color-primary); color: #fff; }
.btn-tab.selected:hover { background: var(--color-primary-dark); color: #fff; }

/* ==========================================================================
   Karten, KPIs
   ========================================================================== */

.card { background: var(--color-surface); border-radius: var(--radius-lg); border: 1px solid var(--color-divider-soft); }
.card-pad { padding: var(--space-4); }
.card-pad-lg { padding: var(--space-6) var(--space-8); }

.kpi-grid { display: grid; gap: var(--space-3); margin-bottom: var(--space-3); }
.kpi-grid-4 { grid-template-columns: repeat(4, 1fr); }
.kpi-grid-3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 720px) {
  .kpi-grid-4, .kpi-grid-3 { grid-template-columns: repeat(2, 1fr); }
}

.kpi-card {
  background: var(--color-surface); border-radius: var(--radius-lg); padding: 14px 16px;
  box-shadow: var(--shadow-card); border: 1px solid var(--color-divider-soft);
  transition: transform .15s ease, box-shadow .15s ease;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card-hover); }
.kpi-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-2); }
.kpi-label { font-size: 13px; font-weight: 600; color: var(--color-text-muted); }
.kpi-icon-wrap { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; }
.kpi-icon-wrap.kpi-icon-primary { background: var(--color-primary-bg); color: var(--color-primary); }
.kpi-icon-wrap.kpi-icon-warning { background: var(--color-warning-bg); color: var(--color-warning); }
.kpi-icon-wrap.kpi-icon-success { background: var(--color-primary-bg-strong); color: var(--color-primary-soft); }
.kpi-icon-wrap.kpi-icon-neutral { background: var(--color-neutral-bg); color: var(--color-neutral-fg); }
.kpi-icon-wrap.kpi-icon-danger { background: var(--color-danger-bg); color: var(--color-danger); }
.kpi-icon-wrap i { font-size: 15px; }
.kpi-value { font-family: var(--font-heading); font-weight: 800; font-size: 25px; color: var(--color-text); }

/* ==========================================================================
   Formulare
   ========================================================================== */

.form-label { display: block; font-size: 14px; font-weight: 600; color: var(--color-text); margin-bottom: var(--space-2); }

.form-input, .form-select {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--color-border); border-radius: 9px;
  font-size: 14.5px; color: var(--color-text); outline: none; background: #fff;
}

.form-input:focus, .form-select:focus { border-color: var(--color-primary); }
.form-input.has-error, .form-select.has-error { border-color: var(--color-danger); }

.form-error { font-size: 12px; color: var(--color-danger); margin-top: 6px; font-weight: 600; }

.form-row { display: grid; gap: var(--space-4); margin-bottom: var(--space-5); }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }

@media (max-width: 640px) {
  .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
}

.field-group { margin-bottom: var(--space-2); }

.password-field { position: relative; margin-bottom: var(--space-3); }
.password-toggle {
  position: absolute; right: 6px; top: 6px; bottom: 6px; width: 38px; background: transparent;
  border: none; color: var(--color-text-muted); font-size: 16px;
}

.pill-row { display: flex; gap: var(--space-3); flex-wrap: wrap; }

.transport-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); }
@media (max-width: 640px) { .transport-grid { grid-template-columns: repeat(2, 1fr); } }

.transport-option {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-3);
  padding: var(--space-6) var(--space-3); border-radius: var(--radius-md); border: 2px solid var(--color-border);
  background: #fff; color: var(--color-text-body); font-size: 14px; font-weight: 700; cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease, transform .1s ease;
}
.transport-option:hover { border-color: var(--color-primary); background: var(--color-primary-bg); color: var(--color-primary); }
.transport-option i { font-size: 24px; }
.transport-option.selected,
.transport-option:has(input:checked) { border-color: var(--color-primary); background: var(--color-primary-bg); color: var(--color-primary); }

.form-section { border-top: 1px solid var(--color-divider); padding-top: var(--space-6); }
.form-section:first-child { border-top: none; padding-top: 0; }
.form-section-title {
  font-family: var(--font-heading); font-weight: 700; font-size: 16px; color: var(--color-text); margin-bottom: 14px;
}
.form-section-title i { color: var(--color-primary); margin-right: 10px; }

.summary-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px 32px; background: var(--color-bg);
  border-radius: 12px; padding: var(--space-5);
}
@media (max-width: 640px) { .summary-grid { grid-template-columns: 1fr; } }
.summary-label { font-size: 12px; font-weight: 600; color: var(--color-text-faint); text-transform: uppercase; letter-spacing: .04em; }
.summary-value { font-size: 14.5px; color: var(--color-text); font-weight: 600; margin-top: 2px; }

/* ==========================================================================
   Badges / Status
   ========================================================================== */

.badge { display: inline-block; padding: 5px 12px; border-radius: var(--radius-pill); font-size: 12.5px; font-weight: 700; }
.badge-warning { background: var(--color-warning-bg); color: var(--color-warning); }
.badge-info { background: var(--color-info-bg); color: var(--color-info); }
.badge-success { background: var(--color-primary-bg-strong); color: var(--color-primary-soft); }
.badge-neutral { background: var(--color-neutral-bg); color: var(--color-neutral-fg); }
.badge-danger { background: var(--color-danger-bg); color: var(--color-danger); }
.badge-active { background: var(--color-primary-bg); color: var(--color-primary); }

/* ==========================================================================
   Tabellen
   ========================================================================== */

.table-card { background: var(--color-surface); border-radius: var(--radius-lg); border: 1px solid var(--color-divider-soft); overflow: hidden; }

.table-toolbar {
  display: flex; align-items: center; gap: var(--space-4); padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--color-divider); flex-wrap: wrap;
}

.table-search { position: relative; flex: 1; max-width: 320px; min-width: 180px; }
.table-search i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--color-text-faint); font-size: 13px; }
.table-search input { width: 100%; padding: 10px 14px 10px 36px; border: 1.5px solid var(--color-border); border-radius: 9px; font-size: 14px; outline: none; }

.table-scroll { overflow-x: auto; }

table.data-table { width: 100%; border-collapse: collapse; }
table.data-table thead tr { background: #FAFBFC; }
table.data-table th {
  text-align: left; padding: var(--space-3) var(--space-4); font-size: 12.5px; font-weight: 700;
  color: var(--color-text-faint); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
}
table.data-table th.sortable { cursor: pointer; user-select: none; }
table.data-table td { padding: 14px var(--space-4); font-size: 14px; color: var(--color-text); }
table.data-table tbody tr { border-top: 1px solid var(--color-divider); transition: background-color .15s ease; }
table.data-table tbody tr:hover { background: #FAFBFC; }
.row-actions { display: flex; gap: var(--space-2); }

/* Aktionen-Spalte bleibt beim horizontalen Scrollen auf kleinen Screens sichtbar */
table.data-table th:last-child, table.data-table td:last-child {
  position: sticky; right: 0; box-shadow: -8px 0 8px -8px rgba(20, 33, 61, .08);
}
table.data-table th:last-child { background: #FAFBFC; }
table.data-table td:last-child { background: var(--color-surface); }
table.data-table tbody tr:hover td:last-child { background: #FAFBFC; }

@media (max-width: 960px) { .col-hide-md { display: none; } }
@media (max-width: 720px) { .col-hide-sm { display: none; } }

.table-pagination { display: flex; align-items: center; justify-content: space-between; padding: var(--space-4) var(--space-6); border-top: 1px solid var(--color-divider); }
.page-btn { width: 34px; height: 34px; border-radius: var(--radius-sm); border: 1.5px solid var(--color-border); background: #fff; color: var(--color-text-muted); transition: border-color .15s ease, background-color .15s ease, color .15s ease; }
.page-btn:hover:not(.active) { border-color: var(--color-primary); color: var(--color-primary); }
.page-btn.active { border-color: var(--color-primary); background: var(--color-primary); color: #fff; font-weight: 700; }

/* ==========================================================================
   Dropdown / Filter-Select
   ========================================================================== */

.filter-select {
  width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 10px 14px;
  border: 1.5px solid var(--color-border); border-radius: 9px; font-size: 14px; background: #fff;
  color: var(--color-text);
}

/* ==========================================================================
   Custom Select (durchsuchbar)
   ========================================================================== */

.custom-select { position: relative; display: block; width: 100%; }
.custom-select-native { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; margin: 0; padding: 0; border: 0; }

.custom-select-trigger {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  padding: 12px 14px; border: 1.5px solid var(--color-border); border-radius: 9px; font-size: 14.5px;
  background: #fff; color: var(--color-text); text-align: left; font-family: var(--font-body);
  transition: border-color .15s ease;
}
.custom-select--filter .custom-select-trigger { padding: 10px 14px; font-size: 14px; }
.custom-select-trigger .custom-select-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.custom-select-trigger .custom-select-value:empty::before { content: "\00a0"; }
.custom-select-trigger i { color: var(--color-text-faint); font-size: 12px; transition: transform .15s ease; flex: none; }

.custom-select.is-open .custom-select-trigger { border-color: var(--color-primary); }
.custom-select.is-open .custom-select-trigger i { transform: rotate(180deg); }
.custom-select.has-error .custom-select-trigger { border-color: var(--color-danger); }
.custom-select-native:disabled + .custom-select-trigger,
.custom-select-trigger:disabled { opacity: .6; cursor: not-allowed; }

.custom-select-panel {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
  background: #fff; border: 1px solid var(--color-divider-soft); border-radius: var(--radius-md);
  box-shadow: var(--shadow-dropdown); overflow: hidden; animation: fadeSlideIn .12s ease;
}

.custom-select-search { position: relative; padding: var(--space-2); border-bottom: 1px solid var(--color-divider); }
.custom-select-search i { position: absolute; left: 21px; top: 50%; transform: translateY(-50%); color: var(--color-text-faint); font-size: 12.5px; }
.custom-select-search input {
  width: 100%; padding: 9px 12px 9px 32px; border: 1.5px solid var(--color-border); border-radius: 8px;
  font-size: 13.5px; outline: none; font-family: var(--font-body); color: var(--color-text);
}
.custom-select-search input:focus { border-color: var(--color-primary); }

.custom-select-list { max-height: 240px; overflow-y: auto; padding: 6px; }

.custom-select-option {
  display: block; width: 100%; text-align: left; padding: 9px 12px; border: none; background: transparent;
  border-radius: 7px; font-size: 14px; color: var(--color-text); font-family: var(--font-body);
}
.custom-select-option:hover { background: var(--color-bg); }
.custom-select-option.is-selected { background: var(--color-primary-bg); color: var(--color-primary); font-weight: 700; }
.custom-select-option.is-disabled { color: var(--color-text-faint); cursor: not-allowed; }
.custom-select-option[hidden] { display: none; }

.custom-select-empty { padding: 16px 12px; text-align: center; font-size: 13px; color: var(--color-text-faint); }

/* ==========================================================================
   Dashboard-Extras
   ========================================================================== */

.dashboard-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: var(--space-3); }
@media (max-width: 960px) { .dashboard-grid { grid-template-columns: 1fr; } }

.booking-list-item { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) 0; border-bottom: 1px solid var(--color-divider-strong); }
.booking-list-icon {
  width: 34px; height: 34px; border-radius: 9px; background: var(--color-bg); display: flex; align-items: center;
  justify-content: center; flex: none; color: var(--color-text-muted); font-size: 13px;
}
.booking-list-main { flex: 1; min-width: 0; }
.booking-list-name { font-size: 14px; font-weight: 700; color: var(--color-text); }
.booking-list-meta { font-size: 12.5px; color: var(--color-text-muted); }

.cta-card {
  background: var(--color-primary); border: none; border-radius: 12px; padding: 13px 16px; text-align: left;
  color: #fff; box-shadow: 0 10px 24px -12px rgba(30, 122, 92, .7); display: block; width: 100%;
  transition: background-color .15s ease, box-shadow .15s ease, transform .1s ease;
}
.cta-card:hover {
  background: var(--color-primary-dark); color: #fff; box-shadow: 0 14px 28px -12px rgba(30, 122, 92, .8);
  transform: translateY(-1px); text-decoration: none;
}
.cta-card i { font-size: 14px; margin-bottom: 6px; display: block; }
.cta-card-title { font-family: var(--font-heading); font-weight: 700; font-size: 14.5px; margin-bottom: 2px; }
.cta-card-sub { font-size: 12px; color: #CDE9DC; }
.cta-card:hover .cta-card-sub { color: #CDE9DC; }

.notice-item { display: flex; gap: 9px; padding: 7px 0; border-bottom: 1px solid var(--color-divider-strong); }
.notice-item i { color: var(--color-primary); margin-top: 2px; font-size: 13px; }
.notice-text { font-size: 12.5px; color: var(--color-text-body); line-height: 1.45; }

.quick-filter {
  display: flex; align-items: center; gap: var(--space-2); padding: 7px 13px; border-radius: var(--radius-pill);
  background: var(--color-bg); border: 1px solid var(--color-border); font-size: 13.5px; font-weight: 600; color: var(--color-text-body);
}
.quick-filter span { background: #fff; border-radius: 10px; padding: 1px 8px; font-size: 12px; color: var(--color-primary); }

.calendar-row { display: flex; align-items: center; gap: var(--space-3); }
.calendar-day { width: 52px; font-size: 13px; font-weight: 600; color: var(--color-text-muted); }
.calendar-track { flex: 1; height: 8px; border-radius: 5px; background: var(--color-divider); position: relative; overflow: hidden; }
.calendar-bar { position: absolute; inset: 0; background: var(--color-primary); border-radius: 5px; }
.calendar-count { width: 24px; text-align: right; font-size: 13px; font-weight: 700; color: var(--color-text); }

/* ==========================================================================
   Kanban / Dispositionsboard
   ========================================================================== */

.kanban-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-5); align-items: start; }
@media (max-width: 1100px) { .kanban-board { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .kanban-board { grid-template-columns: 1fr; } }

.kanban-column { background: #EDEFF3; border-radius: var(--radius-lg); padding: 14px; min-height: 200px; }
.kanban-column-head { display: flex; align-items: center; justify-content: space-between; padding: 6px var(--space-2) 14px; }
.kanban-dot { width: 9px; height: 9px; border-radius: 50%; }
.kanban-column-name { font-weight: 700; font-size: 14px; color: var(--color-text); }
.kanban-count { font-size: 12.5px; font-weight: 700; color: var(--color-text-muted); background: #fff; border-radius: var(--radius-sm); padding: 2px 9px; }
.kanban-cards { display: flex; flex-direction: column; gap: var(--space-3); }

.kanban-card {
  background: #fff; border-radius: 12px; padding: var(--space-4); box-shadow: 0 1px 2px rgba(20, 33, 61, .06);
  transition: transform .15s ease, box-shadow .15s ease;
}
.kanban-card:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -8px rgba(20, 33, 61, .15); }
.kanban-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-2); }
.kanban-card-id { font-size: 12.5px; font-weight: 700; color: var(--color-text-faint); }
.kanban-card-actions { display: flex; align-items: center; gap: var(--space-2); }
.kanban-card-actions button { background: none; border: none; font-size: 13px; }
.kanban-card-patient { font-size: 14.5px; font-weight: 700; color: var(--color-text); margin-bottom: 6px; }
.kanban-card-route { font-size: 12.5px; color: var(--color-text-muted); margin-bottom: var(--space-3); line-height: 1.5; }
.kanban-card-foot { display: flex; align-items: center; justify-content: space-between; padding-top: var(--space-3); border-top: 1px solid var(--color-divider-strong); }
.kanban-card-time { font-size: 12px; font-weight: 600; color: var(--color-text-muted); }
.kanban-card-driver { font-size: 12px; font-weight: 700; color: var(--color-primary); }

/* ==========================================================================
   Modal
   ========================================================================== */

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(20, 33, 61, .45); display: flex; align-items: center;
  justify-content: center; z-index: 100; animation: overlayIn .15s ease;
}

.modal {
  background: #fff; border-radius: var(--radius-xl); padding: var(--space-8); width: 420px; max-width: calc(100vw - 32px);
  box-shadow: var(--shadow-modal); animation: modalIn .18s ease;
}

.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-5); }
.modal-title { font-family: var(--font-heading); font-weight: 700; font-size: 18px; color: var(--color-text); }
.modal-close { background: none; border: none; color: var(--color-text-faint); font-size: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: var(--space-3); }
.modal[hidden], .modal-backdrop[hidden] { display: none; }

@keyframes fadeSlideIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes modalIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }

/* ==========================================================================
   Erfolgs-Screen (Buchung abgeschlossen)
   ========================================================================== */

.success-card { text-align: center; padding: 56px var(--space-8); }
.success-icon {
  width: 64px; height: 64px; border-radius: 50%; background: var(--color-primary-bg-strong); display: flex;
  align-items: center; justify-content: center; margin: 0 auto var(--space-5); color: var(--color-primary-soft); font-size: 26px;
}
.success-title { font-family: var(--font-heading); font-weight: 700; font-size: 22px; color: var(--color-text); margin-bottom: var(--space-2); }
.success-copy { font-size: 14.5px; color: var(--color-text-muted); margin-bottom: 28px; }

/* ==========================================================================
   Utility
   ========================================================================== */

.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mb-3 { margin-bottom: var(--space-3); }
.mb-5 { margin-bottom: var(--space-5); }
.text-muted { color: var(--color-text-muted); }

/* ==========================================================================
   Toasts
   ========================================================================== */

.toast-stack {
  position: fixed; top: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column;
  gap: 10px; max-width: min(360px, calc(100vw - 32px));
}

.toast {
  display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px; border-radius: var(--radius-md);
  background: #fff; box-shadow: var(--shadow-modal); border: 1px solid var(--color-divider-soft);
  font-size: 14px; font-weight: 600; color: var(--color-text); animation: toastIn .2s ease;
}

.toast.is-leaving { animation: toastOut .18s ease forwards; }

.toast i:first-child { font-size: 15px; margin-top: 1px; flex: none; }
.toast span { flex: 1; line-height: 1.4; }
.toast-close { background: none; border: none; color: var(--color-text-faint); font-size: 13px; flex: none; padding: 2px; }
.toast-close:hover { color: var(--color-text); }

.toast-success { border-left: 3px solid var(--color-primary); }
.toast-success i:first-child { color: var(--color-primary); }
.toast-error { border-left: 3px solid var(--color-danger); }
.toast-error i:first-child { color: var(--color-danger); }
.toast-warning { border-left: 3px solid var(--color-warning); }
.toast-warning i:first-child { color: var(--color-warning); }
.toast-info { border-left: 3px solid var(--color-info); }
.toast-info i:first-child { color: var(--color-info); }

@keyframes toastIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(24px); } }

@media (max-width: 480px) {
  .toast-stack { left: 16px; right: 16px; top: 12px; max-width: none; }
}

/* ==========================================================================
   Tastatur-Fokus
   ========================================================================== */

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2.5px solid var(--color-primary-soft); outline-offset: 2px; border-radius: 4px;
}

.nav-item:focus-visible, .sidebar-logout:focus-visible, .sidebar-demo-option:focus-visible {
  outline: 2.5px solid #fff; outline-offset: -2px;
}

.custom-select-trigger:focus-visible, .custom-select-option:focus-visible {
  outline: 2.5px solid var(--color-primary-soft); outline-offset: 2px;
}

.btn:focus-visible, .btn-pill:focus-visible, .btn-tab:focus-visible, .transport-option:focus-visible,
.page-btn:focus-visible, .btn-icon:focus-visible {
  outline: 2.5px solid var(--color-primary-soft); outline-offset: 2px;
}
