/* =====================================================
   WIRTZ MARKETING · TOPBAR COMPACT
   ===================================================== */

.wm-topbar {
  --topbar-height: 56px;

  position: sticky;
  top: 0;
  z-index: 120;

  display: grid;
  grid-template-columns: minmax(170px,1fr) minmax(180px,280px) minmax(170px,1fr);
  align-items: center;
  gap: 18px;

  width: 100%;
  min-height: 56px;
  padding: 0 18px;

  background: var(--wm-surface);
  color: var(--wm-text);
  border-bottom: 1px solid var(--wm-border);
  box-shadow: none;
}

/* LEFT */

.wm-topbar .wm-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.wm-topbar .wm-topbar-sidebar,
.wm-topbar .wm-icon-button {
  display: grid;
  place-items: center;

  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;

  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--wm-text);

  transition: background 140ms ease;
}

.wm-topbar .wm-icon-button:hover {
  background: var(--wm-surface-3);
  border-color: var(--wm-border);
}

.wm-topbar .wm-icon-button svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.8;
}

.wm-topbar .wm-topbar-separator {
  width: 1px;
  height: 19px;
  flex-shrink: 0;
  background: var(--wm-border);
}

.wm-topbar-location {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.wm-topbar-context {
  display: none;
}

.wm-topbar-current {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.wm-topbar-current-marker {
  width: 4px;
  height: 4px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--wm-text);
}

.wm-topbar-current h1 {
  margin: 0;
  overflow: hidden;
  color: var(--wm-text);

  font-size: 13px;
  font-weight: 800;
  letter-spacing: -.15px;
  line-height: 1.3;

  white-space: nowrap;
  text-overflow: ellipsis;
}

/* SEARCH */

.wm-topbar-center {
  display: flex;
  width: 100%;
  min-width: 0;
}

.wm-topbar .wm-search {
  display: flex;
  align-items: center;
  gap: 9px;

  width: 100%;
  height: 33px;
  padding: 0 10px;

  background: var(--wm-surface-2);
  border: 1px solid var(--wm-border);
  border-radius: 7px;
}

.wm-topbar .wm-search:focus-within {
  border-color: var(--wm-border-strong);
}

.wm-topbar .wm-search > svg {
  width: 14px;
  height: 14px;
  color: var(--wm-muted);
}

.wm-topbar .wm-search input {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 100%;

  border: none;
  outline: none;
  background: transparent;
  color: var(--wm-text);

  font-size: 11px;
  font-weight: 600;
}

.wm-topbar .wm-search input::placeholder {
  color: var(--wm-subtle);
}

.wm-topbar .wm-search kbd {
  padding: 2px 5px;
  border: 1px solid var(--wm-border);
  border-radius: 4px;
  background: var(--wm-surface);
  color: var(--wm-muted);
  font-size: 10px;
}

/* RIGHT */

.wm-topbar .wm-topbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  min-width: 0;
}

.wm-topbar-status {
  display: none;
}

.wm-notification-anchor,
.wm-user-anchor {
  position: relative;
  display: flex;
  align-items: center;
}

/* USER */

.wm-topbar .wm-topbar-user {
  display: flex;
  align-items: center;
  gap: 7px;

  min-height: 36px;
  max-width: 160px;
  padding: 3px 5px;

  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--wm-text);
}

.wm-topbar .wm-topbar-user:hover {
  background: var(--wm-surface-2);
  border-color: var(--wm-border);
}

.wm-topbar .wm-user-avatar {
  display: grid;
  place-items: center;

  width: 29px;
  height: 29px;
  flex-shrink: 0;

  background: var(--wm-surface-3);
  border: 1px solid var(--wm-border-strong);
  border-radius: 7px;

  color: var(--wm-text);
  font-size: 11px;
  font-weight: 800;
}

.wm-user-identity {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
  text-align: left;
}

.wm-user-identity strong {
  max-width: 95px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 11px;
  font-weight: 800;
}

.wm-user-identity small {
  max-width: 95px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--wm-muted);
  font-size: 9px;
  font-weight: 600;
}

.wm-topbar .wm-user-chevron {
  width: 12px;
  height: 12px;
  color: var(--wm-muted);
}

/* DROPDOWNS */

.wm-topbar .wm-user-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 200;

  width: 240px;
  padding: 6px;

  background: var(--wm-surface);
  border: 1px solid var(--wm-border-strong);
  border-radius: 9px;
  box-shadow: 0 10px 25px #00000025;
}

.wm-topbar .wm-user-menu-header {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 12px;
  border-bottom: 1px solid var(--wm-border);
}

.wm-topbar .wm-user-menu-header strong {
  font-size: 12px;
}

.wm-topbar .wm-user-menu-header span {
  overflow-wrap: anywhere;
  font-size: 10px;
  color: var(--wm-muted);
}

.wm-topbar .wm-user-menu a,
.wm-topbar .wm-user-menu button {
  display: flex;
  align-items: center;
  gap: 10px;

  width: 100%;
  min-height: 36px;
  padding: 8px 10px;

  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--wm-text);
  text-align: left;

  font-size: 11px;
  font-weight: 700;
}

.wm-topbar .wm-user-menu a:hover,
.wm-topbar .wm-user-menu button:hover {
  background: var(--wm-surface-3);
}

.wm-topbar .wm-user-menu a span,
.wm-topbar .wm-user-menu button span {
  flex: 1;
}

.wm-topbar .wm-user-menu svg {
  width: 15px;
  height: 15px;
}

.wm-topbar .wm-menu-separator {
  margin: 6px 0;
  border-top: 1px solid var(--wm-border);
}

/* BELL */

.wm-topbar .wm-bell-count {
  position: absolute;
  top: -5px;
  right: -5px;
  z-index: 2;

  display: grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  padding: 0 3px;

  border-radius: 9px;
  background: #c84545;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
}

.wm-topbar .wm-bell-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: -45px;
  z-index: 205;

  width: min(350px, calc(100vw - 24px));
  max-height: 450px;
  overflow: hidden;

  border: 1px solid var(--wm-border-strong);
  border-radius: 9px;
  background: var(--wm-surface);
  box-shadow: 0 12px 30px #00000030;
}

/* RESPONSIVE */

@media (max-width: 1200px) {
  .wm-topbar {
    grid-template-columns: minmax(140px,1fr) minmax(150px,240px) auto;
    gap: 12px;
    padding: 0 14px;
  }
}

@media (max-width: 950px) {
  .wm-topbar {
    grid-template-columns: minmax(0,1fr) auto;
  }

  .wm-topbar-center {
    display: none;
  }
}

@media (max-width: 650px) {
  .wm-topbar {
    min-height: 54px;
    padding: 0 10px;
    gap: 5px;
  }

  .wm-topbar .wm-topbar-left,
  .wm-topbar .wm-topbar-right {
    gap: 5px;
  }

  .wm-topbar .wm-topbar-separator {
    display: none;
  }

  .wm-topbar-current h1 {
    font-size: 12px;
  }

  .wm-topbar .wm-user-identity,
  .wm-topbar .wm-user-chevron {
    display: none;
  }

  .wm-topbar .wm-user-avatar {
    width: 28px;
    height: 28px;
  }

  .wm-topbar .wm-bell-panel {
    position: fixed;
    top: 59px;
    right: 10px;
  }

  .wm-topbar .wm-user-menu {
    position: fixed;
    top: 59px;
    right: 10px;
  }
}

@media (max-width: 380px) {
  .wm-topbar-current-marker {
    display: none;
  }

  .wm-topbar .wm-topbar-left,
  .wm-topbar .wm-topbar-right {
    gap: 3px;
  }
}

/* ========================================================
   WIRTZ MARKETING · DATE & TIME TOPBAR
   ======================================================== */

.wm-topbar [hidden] {
  display: none !important;
}

.wm-topbar {
  grid-template-columns: minmax(150px, 1fr) auto minmax(150px, 1fr);
  gap: 14px;
}

.wm-topbar-center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.wm-date-anchor {
  position: relative;
  min-width: 0;
}

.wm-date-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 33px;
  padding: 0 11px;
  border-radius: 7px;
  border: 1px solid var(--wm-border-strong);
  background: var(--wm-surface-2);
  color: var(--wm-text);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}

.wm-date-toggle:hover,
.wm-date-toggle[aria-expanded="true"] {
  border-color: var(--wm-text);
  background: var(--wm-surface-3);
}

.wm-date-toggle svg {
  width: 14px;
  height: 14px;
  color: var(--wm-muted);
}

.wm-date-toggle svg:last-child {
  width: 11px;
  height: 11px;
}

.wm-date-toggle strong {
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.wm-date-divider {
  width: 1px;
  height: 15px;
  background: var(--wm-border-strong);
}

.wm-date-panel {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 220;
  width: 304px;
  max-width: calc(100vw - 20px);
  padding: 16px;
  border: 1px solid var(--wm-border-strong);
  border-radius: 10px;
  background: var(--wm-surface);
  color: var(--wm-text);
  box-shadow: 0 15px 30px #00000025;
  animation: wm-date-appear 150ms ease-out both;
}

.wm-date-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--wm-border);
}

.wm-date-panel-header strong {
  font-size: 12px;
  font-weight: 800;
}

.wm-date-panel-header span {
  font-size: 10px;
  color: var(--wm-muted);
}

.wm-date-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 13px 0;
}

.wm-date-controls strong {
  font-size: 12px;
  font-weight: 800;
  text-transform: capitalize;
}

.wm-date-controls button {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border-radius: 6px;
  border: 1px solid var(--wm-border);
  color: var(--wm-text);
  background: var(--wm-surface-2);
  cursor: pointer;
}

.wm-date-controls button svg {
  width: 15px;
  height: 15px;
}

.wm-date-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.wm-cal-weekday,
.wm-cal-day,
.wm-cal-empty {
  display: grid;
  place-items: center;
  min-width: 0;
  height: 32px;
  font-size: 11px;
}

.wm-cal-weekday {
  font-size: 10px;
  font-weight: 800;
  color: var(--wm-muted);
}

.wm-cal-day {
  border-radius: 6px;
  color: var(--wm-text);
  font-weight: 600;
}

.wm-cal-day.is-today {
  background: var(--wm-text);
  color: var(--wm-surface);
  font-weight: 800;
}

.wm-date-panel-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 13px;
  margin-top: 11px;
  border-top: 1px solid var(--wm-border);
}

.wm-date-panel-footer a,
.wm-date-panel-footer button {
  padding: 7px 9px;
  border: 1px solid var(--wm-border);
  border-radius: 6px;
  background: var(--wm-surface-2);
  color: var(--wm-text);
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

@keyframes wm-date-appear {
  from { opacity: 0; translate: 0 -5px; }
  to { opacity: 1; translate: 0 0; }
}

@media (max-width: 950px) {
  .wm-topbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .wm-topbar .wm-topbar-center {
    display: flex;
    grid-column: 2;
    grid-row: 1;
  }

  .wm-topbar .wm-topbar-right {
    grid-column: 2;
    grid-row: 1;
    margin-right: 0;
  }

  .wm-topbar .wm-topbar-center {
    display: none;
  }
}

@media (max-width: 650px) {
  .wm-topbar .wm-topbar-center {
    display: flex;
    position: fixed;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
  }

  .wm-date-toggle {
    background: var(--wm-surface);
    border-color: var(--wm-border-strong);
    box-shadow: 0 3px 14px #00000025;
  }

  .wm-date-panel {
    top: auto;
    bottom: calc(100% + 12px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .wm-date-panel {
    animation: none;
  }
}
