/*!
 * FILE: public/assets/ui/css/10-ui-header-actions.css
 *
 * PURPOSE / ZWECK:
 * - Stabile Desktop-Shell für Sidebar, Topbar, Inhalt und Footer.
 * - Hält Suche, Voice-AI und alle Topbar-Aktionen ohne Seitenüberlauf erreichbar.
 * - Stellt den globalen Suchdialog für Tablet und Handy bereit.
 *
 * SCOPE / DOM-VERTRÄGE:
 * - .ev-sidebar, .ev-shell, .ev-topbar.evh-topbar
 * - .evh-left, .evh-search, .evh-actions
 * - .evh-search-open, .evh-search-dialog und ihre __*-Elemente
 * - .ev-footer
 *
 * THEME / RESPONSIVE:
 * - Verwendet ausschließlich globale EverUI-Variablen und color-mix().
 * - Tablet-/Handy-Umbruch und interne Aktionsnavigation folgen in
 *   20-ui-mobile-shell.css und 50-ui-responsive-scroll.css.
 *
 * WARTUNG / ABGRENZUNG:
 * - Topbar-Kinder bleiben ungeschrumpft; kompakte Suche wird als Icon angeboten.
 * - Keine Fachseiten-, Scheduling-, Datenbank- oder JavaScript-Logik.
 */

.ev-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1500;
  width: var(--ev-sidebar-w);
  height: 100dvh;
  overflow: hidden;
  border-right: 1px solid var(--ev-border);
  background:
    radial-gradient(circle at 0 0, var(--ev-primary-soft), transparent 18rem),
    linear-gradient(180deg, var(--ev-surface), var(--ev-surface-2));
  color: var(--ev-text-2);
  box-shadow: 7px 0 28px rgba(15, 23, 42, .05);
  transition: width .18s ease, transform .18s ease;
}

.ev-sidebar-brand {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: center;
  gap: 9px;
  min-height: var(--ev-topbar-h);
  padding: 0 13px;
  border-bottom: 1px solid var(--ev-border-soft);
}

.ev-brand {
  display: grid;
  grid-template-columns: 39px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 44px;
  color: var(--ev-text);
  text-decoration: none;
}

.ev-brand-mark {
  display: inline-flex;
  width: 39px;
  height: 39px;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--ev-primary), var(--ev-primary-2));
  color: #fff;
  font-weight: 950;
  box-shadow: 0 10px 26px color-mix(in srgb, var(--ev-primary) 24%, transparent);
}

.ev-brand-text {
  overflow: hidden;
  color: var(--ev-text);
  font-weight: 880;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ev-nav {
  height: calc(100dvh - var(--ev-topbar-h));
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 11px 9px 24px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.ev-nav-label {
  padding: 8px 11px;
  color: var(--ev-muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.ev-nav-link {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  min-height: 43px;
  margin: 2px 0;
  padding: 0 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ev-text-2);
  font-size: 13px;
  font-weight: 760;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.ev-nav-link:hover,
.ev-nav-link.is-active {
  background: var(--ev-primary-soft);
  color: var(--ev-primary-2);
}

.ev-nav-icon {
  display: inline-flex;
  width: 34px;
  height: 34px;
  min-width: 34px;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.ev-nav-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ev-nav-caret {
  display: inline-flex;
  justify-content: center;
  color: var(--ev-muted);
}

.ev-nav-children {
  display: none;
  margin: 3px 0 8px 25px;
  padding-left: 8px;
  border-left: 1px solid var(--ev-border);
}

.ev-nav-group.is-open > .ev-nav-children {
  display: block;
}

.ev-nav-group.is-open > .ev-nav-parent .ev-nav-caret {
  transform: rotate(180deg);
}

.ev-sidebar-toggle,
.evh-icon-btn,
.ev-topbar-btn {
  display: inline-flex;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--ev-border);
  border-radius: 13px;
  background: var(--ev-surface);
  color: var(--ev-text);
  cursor: pointer;
}

.ev-sidebar-toggle:hover,
.evh-icon-btn:hover,
.ev-topbar-btn:hover {
  border-color: color-mix(in srgb, var(--ev-primary) 45%, var(--ev-border));
  background: var(--ev-primary-soft);
  color: var(--ev-primary-2);
}

.ev-shell {
  width: auto;
  min-width: 0;
  min-height: 100vh;
  margin-left: var(--ev-sidebar-w);
  transition: margin-left .18s ease;
}

.ev-topbar,
.evh-topbar {
  position: sticky;
  top: 0;
  z-index: 1200;
  display: grid;
  grid-template-columns: minmax(190px, auto) minmax(220px, 480px) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
  min-height: var(--ev-topbar-h);
  padding: 8px 16px;
  overflow: visible;
  border-bottom: 1px solid var(--ev-border-soft);
  background: color-mix(in srgb, var(--ev-surface) 90%, transparent);
  box-shadow: var(--ev-shadow-sm);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.evh-left,
.evh-actions {
  display: flex;
  align-items: center;
  min-width: 0;
}

.evh-left {
  gap: 9px;
}

.evh-actions {
  justify-content: flex-end;
  gap: 7px;
}

.evh-actions > * {
  flex: 0 0 auto;
}

.evh-network,
.evh-business-cart {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border: 1px solid var(--ev-border);
  border-radius: 13px;
  background: var(--ev-surface);
  color: var(--ev-text);
  font: inherit;
  text-decoration: none;
}

.evh-network { color: var(--ev-success, #18734f); }
.evh-network i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.evh-network.is-offline { color: var(--ev-danger, #b4232f); }
.evh-business-cart { position: relative; cursor: pointer; }
.evh-business-cart__copy { display: grid; line-height: 1.05; text-align: left; }
.evh-business-cart__copy small { color: var(--ev-muted); font-size: 10px; }
.evh-business-cart__copy strong { font-size: 12px; }
.evh-business-cart > b { min-width: 20px; padding: 2px 5px; border-radius: 999px; background: var(--ev-primary); color: #fff; font-size: 10px; text-align: center; }


.evh-phone-demo {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  gap: 9px;
  padding: 5px 12px 5px 5px;
  border: 1px solid color-mix(in srgb, var(--ev-primary) 42%, var(--ev-border));
  border-radius: 16px;
  background: color-mix(in srgb, var(--ev-primary-soft) 82%, var(--ev-surface));
  color: var(--ev-text);
  text-decoration: none;
  box-shadow: 0 6px 24px color-mix(in srgb, var(--ev-primary) 10%, transparent);
}

.evh-phone-demo:hover,
.evh-phone-demo:focus-visible {
  border-color: var(--ev-primary);
  background: color-mix(in srgb, var(--ev-primary-soft) 94%, var(--ev-surface));
  color: var(--ev-primary-2);
}

.evh-phone-demo__icon {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--ev-primary), var(--ev-primary-2));
  color: #fff;
}

.evh-phone-demo__icon .evh-svg {
  width: 19px;
  height: 19px;
}

.evh-phone-demo__copy {
  display: grid;
  gap: 3px;
  line-height: 1.15;
  text-align: left;
  white-space: nowrap;
}

.evh-phone-demo__copy strong {
  font-size: 13px;
}

.evh-phone-demo__copy small {
  color: var(--ev-muted);
  font-size: 10px;
}

@media (max-width: 1180px) {
  .evh-phone-demo {
    min-width: 46px;
    padding: 3px;
  }

  .evh-phone-demo__copy {
    display: none;
  }
}

.evh-mobile-menu,
.ev-mobile-menu {
  display: none;
}

.evh-context {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 44px;
  color: var(--ev-text);
  text-decoration: none;
}

.evh-context-mark {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--ev-primary-soft);
  color: var(--ev-primary-2);
  font-weight: 950;
}

.evh-user {
  min-width: 44px;
  min-height: 44px;
}

.evh-context-copy,
.evh-user-copy {
  display: grid;
  min-width: 0;
}

.evh-context-copy strong,
.evh-user-copy strong,
.evh-context-copy small,
.evh-user-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.evh-context-copy strong,
.evh-user-copy strong {
  color: var(--ev-text);
  font-size: 13px;
  font-weight: 850;
}

.evh-context-copy small,
.evh-user-copy small {
  color: var(--ev-muted);
  font-size: 11px;
  font-weight: 700;
}

.evh-search,
.ev-search {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--ev-border);
  border-radius: 14px;
  background: var(--ev-surface-2);
  color: var(--ev-muted);
}

.evh-search input,
.ev-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ev-text);
}

.evh-search kbd {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  padding: 0 6px;
  border: 1px solid var(--ev-border);
  border-radius: 7px;
  background: var(--ev-surface);
  color: var(--ev-muted);
  font-family: inherit;
  font-size: 10px;
}

.evh-search-open {
  display: none;
}

.evh-search-dialog[hidden] {
  display: none;
}

.evh-search-dialog {
  position: fixed;
  inset: 0;
  z-index: 2200;
  display: grid;
  align-items: start;
  justify-items: center;
  padding: max(18px, env(safe-area-inset-top, 0px)) 14px 18px;
  overflow-y: auto;
  background: color-mix(in srgb, var(--ev-bg) 64%, transparent);
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
}

.evh-search-dialog__panel {
  width: min(720px, 100%);
  margin-top: clamp(42px, 10vh, 120px);
  padding: 18px;
  border: 1px solid var(--ev-border);
  border-radius: 22px;
  background: var(--ev-surface);
  color: var(--ev-text);
  box-shadow: var(--ev-shadow-lg);
}

.evh-search-dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.evh-search-dialog__head > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.evh-search-dialog__head h2 {
  margin: 0;
  color: var(--ev-text);
  font-size: clamp(20px, 4vw, 28px);
  line-height: 1.15;
}

.evh-search-dialog__eyebrow {
  color: var(--ev-muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.evh-search-dialog__form {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 6px;
  border: 1px solid var(--ev-border);
  border-radius: 16px;
  background: var(--ev-surface-2);
  color: var(--ev-muted);
}

.evh-search-dialog__form > .evh-svg {
  margin-left: 8px;
}

.evh-search-dialog__form input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ev-text);
  font: inherit;
  font-size: 16px;
}

.evh-search-dialog__submit {
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--ev-primary), var(--ev-primary-2));
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

body.evh-search-dialog-open {
  overflow: hidden;
}

.evh-menu-wrap {
  position: relative;
  flex: 0 0 auto;
}

.evh-user,
.ev-user-pill {
  display: inline-flex;
  min-width: 44px;
  max-width: 250px;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  padding: 3px 10px 3px 3px;
  border: 1px solid var(--ev-border);
  border-radius: 999px;
  background: var(--ev-surface);
  color: var(--ev-text);
  cursor: pointer;
}

.evh-avatar,
.ev-user-pill > span:first-child {
  display: inline-flex;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--ev-primary), var(--ev-primary-2));
  color: #fff;
  font-weight: 950;
}

.evh-avatar-lg {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
}

.evh-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  border: 2px solid var(--ev-surface);
  border-radius: 999px;
  background: var(--ev-danger);
}

.evh-dropdown {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  z-index: 1800;
  display: none;
  min-width: 190px;
  overflow: hidden;
  border: 1px solid var(--ev-border);
  border-radius: 17px;
  background: var(--ev-surface);
  color: var(--ev-text);
  box-shadow: var(--ev-shadow-lg);
}

.evh-menu-wrap.is-open .evh-dropdown {
  display: block;
}

.evh-dropdown-wide {
  width: min(420px, calc(100vw - 28px));
}

.evh-dropdown-small {
  width: 190px;
  padding: 8px;
}

.evh-dropdown-user {
  width: 250px;
  padding: 8px;
}

.evh-dropdown-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--ev-border-soft);
}

.evh-dropdown-small a,
.evh-dropdown-user a {
  display: flex;
  min-height: 39px;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  border-radius: 10px;
  color: var(--ev-text);
  font-size: 13px;
  font-weight: 740;
  text-decoration: none;
}

.evh-dropdown-small a:hover,
.evh-dropdown-user a:hover {
  background: var(--ev-surface-2);
}

.evh-danger {
  color: var(--ev-danger) !important;
}

.evh-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 12px;
  margin-bottom: 5px;
  border-bottom: 1px solid var(--ev-border-soft);
}

.evh-user-card > div {
  display: grid;
  min-width: 0;
}

.evh-app-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
}

.evh-app-tile {
  display: grid;
  min-height: 82px;
  align-content: center;
  justify-items: center;
  gap: 7px;
  padding: 9px;
  border: 1px solid var(--ev-border-soft);
  border-radius: 14px;
  background: var(--ev-surface-2);
  color: var(--ev-text);
  text-align: center;
  text-decoration: none;
}

.evh-app-tile:hover {
  border-color: color-mix(in srgb, var(--ev-primary) 42%, var(--ev-border));
  background: var(--ev-primary-soft);
}

.evh-app-tile > span {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--ev-primary-soft);
  color: var(--ev-primary-2);
}

.evh-app-tile strong {
  font-size: 12px;
  font-weight: 820;
}

.ev-main {
  width: min(1540px, 100%);
  min-width: 0;
  margin: 0 auto;
  padding: 22px 20px 44px;
}

.ev-footer {
  width: 100%;
  margin-left: 0;
  border-top: 1px solid var(--ev-border-soft);
  background: color-mix(in srgb, var(--ev-surface) 86%, transparent);
}

.ev-footer__inner {
  width: min(1540px, 100%);
  margin: 0 auto;
  padding: 17px 20px;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto auto;
  align-items: center;
  gap: 16px;
}

.ev-footer__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.ev-footer__mark {
  display: inline-flex;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  background: var(--ev-primary-soft);
  color: var(--ev-primary-2);
  font-weight: 950;
}

.ev-footer__copy {
  display: grid;
  min-width: 0;
}

.ev-footer__copy strong,
.ev-footer__copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ev-footer__copy small,
.ev-footer__meta {
  color: var(--ev-muted);
  font-size: 12px;
}

.ev-footer__nav {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}

.ev-footer__nav a {
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--ev-text-2);
  font-size: 12px;
  font-weight: 740;
  text-decoration: none;
}

.ev-footer__nav a:hover {
  background: var(--ev-primary-soft);
  color: var(--ev-primary-2);
}

.ev-footer__meta {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  white-space: nowrap;
}

.ev-sidebar-backdrop {
  display: none;
}

@media (min-width: 768px) {
  body.ev-sidebar-collapsed .ev-sidebar {
    width: var(--ev-sidebar-rail);
  }

  body.ev-sidebar-collapsed .ev-shell {
    margin-left: var(--ev-sidebar-rail);
  }

  body.ev-sidebar-collapsed:not(.ev-sidebar-peek) .ev-sidebar-brand {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 0;
  }

  body.ev-sidebar-collapsed:not(.ev-sidebar-peek) .ev-brand {
    grid-template-columns: 39px;
  }

  body.ev-sidebar-collapsed:not(.ev-sidebar-peek) .ev-brand-text,
  body.ev-sidebar-collapsed:not(.ev-sidebar-peek) .ev-sidebar-toggle,
  body.ev-sidebar-collapsed:not(.ev-sidebar-peek) .ev-nav-label,
  body.ev-sidebar-collapsed:not(.ev-sidebar-peek) .ev-nav-text,
  body.ev-sidebar-collapsed:not(.ev-sidebar-peek) .ev-nav-caret {
    display: none;
  }

  body.ev-sidebar-collapsed:not(.ev-sidebar-peek) .ev-nav-link {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 0;
  }

  body.ev-sidebar-collapsed.ev-sidebar-peek .ev-sidebar {
    width: var(--ev-sidebar-w);
    box-shadow: 18px 0 42px rgba(15, 23, 42, .24);
  }
}


/* Session changes preserve drafts and pause stale actions until deliberate navigation. */
.ev-auth-session-stale [data-ui-topbar],
.ev-auth-session-stale [data-ui-sidebar],
.ev-auth-session-stale [data-ever-mobile-dock] { opacity: .72; }
[data-ui-topbar][data-auth-chrome-fallback="1"] { opacity: 1; }
.ev-auth-session-notice {
  position: sticky; top: 0; z-index: 2000; display: flex; flex-wrap: wrap; align-items: center;
  gap: 12px; padding: 16px; color: var(--ev-text, #172033);
  background: var(--ev-surface, #fff); border-bottom: 2px solid var(--ev-primary, #3155c6);
  font-size: 16px; line-height: 1.5;
}
.ev-auth-session-notice[hidden] { display: none; }
.ev-auth-session-notice p { flex: 1 1 280px; margin: 0; }
.ev-auth-session-notice button { min-height: 44px; font: inherit; }
