html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  /* Prevent scrolling on the body */
  font-family: Arial, sans-serif;
  background-color: #f4f2ec;
}

@font-face {
  font-family: 'Open Sans';
  src: url('fonts/OpenSans-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@media screen and (max-width: 580px),
screen and (max-height: 800px) {
  .daterangepicker {
    height: 90vh;
    overflow: auto;
  }
}

a {
  text-decoration: none;
  color: black;
}

#main-content {
  display: flex;
  width: 100%;
  flex-direction: column;
}

#header {
  --header-action-size: 50px;
  width: 100%;
  box-sizing: border-box;
  height: 64px;
  background-color: var(--brand-header-bg, black);
  color: #fff;
  border-bottom: 4px solid var(--brand-primary, #7F5CA3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 10px;
  flex-shrink: 0;
  position: relative;
  z-index: 20;
}

body.app-menu-open {
  background-image:
    radial-gradient(circle at 12% 18%, rgba(246, 189, 48, 0.16), transparent 18%),
    radial-gradient(circle at 84% 10%, rgba(127, 92, 163, 0.14), transparent 22%),
    linear-gradient(rgba(0, 0, 0, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.04) 1px, transparent 1px);
  background-size: auto, auto, 28px 28px, 28px 28px;
  background-position: 0 0, 0 0, center center, center center;
}

#logo {
  width: 200px;
  height: 51px;
  flex-shrink: 0;
}

#logo-small {
  width: 51px;
  height: 51px;
  display: none;
  flex-shrink: 0;
}

/* Standardizes any per-org branding/logo.svg + logo-small.svg to fit its box
   regardless of the source file's own intrinsic size/aspect ratio — scales down
   an oversized logo, scales up an undersized one, never distorts or overflows
   the 64px header (see ADR 0006 §3: box geometry lives here, not in theme.css). */
#logo img,
#logo-small img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#header-nav-shell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  flex: 0 1 auto;
}

.header-action-slot {
  position: relative;
  z-index: 1;
  width: var(--header-action-size);
  height: var(--header-action-size);
  flex-shrink: 0;
}

.small-control {
  width: var(--header-action-size);
  height: var(--header-action-size);
  flex-shrink: 0;
}

.is-mobile-only {
  display: none;
}

.header-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--header-action-size);
  height: var(--header-action-size);
  min-height: var(--header-action-size);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: white;
  cursor: pointer;
  font-weight: bold;
  font-size: inherit;
  box-shadow: none;
  text-align: left;
}

#menu {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  flex: 0 1 auto;
  overflow: hidden;
}

.menu-dynamic-links {
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.menu-link {
  border-right: 1px solid #f6bd30;
  color: white;
  display: inline-flex;
  align-items: center;
  font-weight: bold;
  min-height: 44px;
  padding: 0px 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

.menu-link:hover {
  color: #f6bd30;
}

.menu-link-optional.is-overflow-hidden {
  display: none;
}

#menu-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-left: 10px;
}

.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 34px;
  margin-left: 10px;
  padding: 2px;
  border: 1px solid rgba(246, 189, 48, 0.65);
  background: rgba(255, 255, 255, 0.08);
  box-sizing: border-box;
  flex-shrink: 0;
}

.language-switch__option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: bold;
  line-height: 1;
}

.language-switch__option:hover,
.language-switch__option:focus-visible {
  color: #f6bd30;
}

.language-switch__option.is-active {
  background: #f6bd30;
  color: #111;
}

.app-menu-trigger {
  position: relative;
}

.app-menu-trigger:hover {
  color: #f6bd30;
}

.app-menu-trigger::before {
  content: '';
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.62);
  transition: background-color 0.2s ease;
}

.app-menu-trigger:hover::before,
.app-menu-trigger:focus-visible::before {
  background: rgba(0, 0, 0, 0.75);
}

.app-menu-trigger__icon {
  width: 30px;
  height: 30px;
  display: block;
  border-radius: 3px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background:
    linear-gradient(#f6bd30, #f6bd30) left top / 12px 12px no-repeat,
    linear-gradient(#f6bd30, #f6bd30) right top / 12px 12px no-repeat,
    linear-gradient(#f6bd30, #f6bd30) left bottom / 12px 12px no-repeat,
    linear-gradient(#f6bd30, #f6bd30) right bottom / 12px 12px no-repeat;
}

.app-menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 100;
}

.app-menu-panel {
  position: fixed;
  top: 0;
  left: 50%;
  width: min(920px, calc(100vw - 24px));
  max-height: min(780px, calc(100dvh - 24px));
  padding: 24px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(249, 243, 231, 0.96)),
    #fdf9f1;
  border: 1px solid rgba(127, 92, 163, 0.14);
  border-radius: 28px;
  box-shadow:
    18px 18px 0 -10px rgba(127, 92, 163, 0.32),
    0 30px 90px rgba(0, 0, 0, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(16px);
  transform: translate(-50%, calc(-100% - 24px)) scale(0.98);
  transform-origin: top center;
  transition: transform 0.34s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.24s ease;
  will-change: transform, opacity;
  z-index: 101;
  overflow: hidden;
  opacity: 0;
}

.app-menu-panel[hidden] {
  display: none !important;
}

body.app-menu-open .app-menu-backdrop {
  opacity: 1;
  pointer-events: auto;
}

body.app-menu-open .app-menu-panel {
  transform: translate(-50%, 12px) scale(1);
  opacity: 1;
}

.app-menu-panel__header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
  padding-bottom: 14px;
  background: rgba(253, 249, 241, 0.98);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.app-menu-panel__eyebrow {
  margin: 0 0 4px;
  color: #f6bd30;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-menu-panel__title {
  margin: 0;
  color: #17141f;
  font-size: 30px;
  line-height: 1.1;
}

.app-menu-close {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid rgba(127, 92, 163, 0.5);
  border-radius: 999px;
  background: rgba(246, 189, 48, 0.12);
  color: #2b2239;
  cursor: pointer;
}

.app-menu-panel__body {
  display: grid;
  gap: 16px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.app-menu-panel__content-mobile {
  display: block;
}

.app-menu-panel__content-desktop {
  display: none;
}

.app-menu-panel__footer {
  display: flex;
  justify-content: stretch;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.app-menu-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 12px 18px;
  border-radius: 14px;
  border: 1px solid rgba(173, 40, 40, 0.42);
  background: linear-gradient(180deg, rgba(255, 238, 238, 0.96), rgba(252, 221, 221, 0.96));
  color: #6d0f0f;
  font-weight: bold;
  text-decoration: none;
  box-sizing: border-box;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.app-menu-logout:hover,
.app-menu-logout:focus-visible {
  color: #fff6f6;
  border-color: rgba(173, 40, 40, 0.85);
  background: linear-gradient(180deg, rgba(173, 40, 40, 0.94), rgba(142, 24, 24, 0.94));
  transform: translateY(-1px);
}

.app-menu-section {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.app-menu-section__title {
  margin: 0 0 10px;
  color: #6e5a88;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-left: 12px;
  border-left: 3px solid #7F5CA3;
}

.app-menu-section__links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.app-menu-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 88px;
  padding: 16px 18px;
  border: 1px solid rgba(127, 92, 163, 0.16);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(251, 246, 236, 0.94)),
    #fefcf7;
  color: #221c2d;
  font-weight: bold;
  box-sizing: border-box;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.app-menu-card:hover {
  color: #f6bd30;
  border-color: rgba(246, 189, 48, 0.65);
  background:
    linear-gradient(180deg, rgba(255, 251, 240, 0.99), rgba(252, 245, 228, 0.96)),
    #fffdf8;
  box-shadow:
    14px 14px 0 -9px rgba(127, 92, 163, 0.34),
    0 16px 30px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.app-menu-card__icon {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(255, 247, 230, 0.95);
  border: 1px solid rgba(246, 189, 48, 0.52);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.55);
  color: #4c3868;
}

.app-menu-card__icon svg {
  width: 30px;
  height: 30px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-menu-card__text {
  min-width: 0;
  display: flex;
  align-items: center;
}

.app-menu-card__title {
  display: block;
  font-size: 16px;
  line-height: 1.25;
  color: inherit;
}

.app-menu-card:nth-child(4n + 2) .app-menu-card__icon,
.app-menu-card:nth-child(4n + 3) .app-menu-card__icon {
  background: rgba(255, 245, 222, 0.96);
  border-color: rgba(246, 189, 48, 0.6);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.6);
}

.responsive-menu {
  display: none;
  flex-shrink: 0;
}

/* Primary header mode defaults (mobile first). */
#header.app-menu-primary #menu {
  display: none;
}

#header.app-menu-primary #menu-actions {
  display: flex;
}

#header.app-menu-primary .responsive-menu {
  display: none;
}

@media (min-width: 960px) {
  #header.app-menu-primary #menu {
    display: flex;
  }

  #header.app-menu-primary #menu-actions {
    display: flex;
  }

  #header.app-menu-primary.no-app-menu #menu-actions {
    display: none;
  }

  .app-menu-panel__content-mobile {
    display: none;
  }

  .app-menu-panel__content-desktop {
    display: block;
  }
}

/* mobilní fallback menu */
#header.app-menu-use-fallback:not(.app-menu-primary) #menu,
#header.app-menu-use-fallback:not(.app-menu-primary) #menu-actions {
  display: none;
}

#header.app-menu-use-fallback:not(.app-menu-primary) .responsive-menu {
  display: block;
}

#header.app-menu-use-fallback:not(.app-menu-primary)+.app-menu-backdrop,
#header.app-menu-use-fallback:not(.app-menu-primary)+.app-menu-backdrop+.app-menu-panel {
  display: none;
}

/* Compatibility guard: if both legacy fallback and primary classes coexist,
   keep primary app-selector behavior active. */
#header.app-menu-primary.app-menu-use-fallback #menu-actions {
  display: flex;
}

#header.app-menu-primary.app-menu-use-fallback .responsive-menu {
  display: none;
}

#header.app-menu-use-fallback .responsive-menu .menu-icon {
  cursor: pointer;
  width: 35px;
  float: right;
  padding: 27px 10px;
  position: relative;
  user-select: none;
}

#header.app-menu-use-fallback .responsive-menu .menu-icon .navicon {
  background: white;
  display: block;
  height: 5px;
  position: relative;
  width: 35px;
  margin: 2px;
  border-radius: 2px;
}

#header.app-menu-use-fallback .responsive-menu .menu-icon .navicon:before,
#header.app-menu-use-fallback .responsive-menu .menu-icon .navicon:after {
  background: white;
  content: '';
  display: block;
  height: 100%;
  position: absolute;
  width: 100%;
  border-radius: 2px;
}

#header.app-menu-use-fallback .responsive-menu .menu-icon .navicon:before {
  top: 9px;
}

#header.app-menu-use-fallback .responsive-menu .menu-icon .navicon:after {
  top: -9px;
}

#header.app-menu-use-fallback .responsive-menu ul {
  position: absolute;
  top: 56px;
  right: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: hidden;
  background-color: black;
  z-index: 102;
  max-height: 0;
  transition: max-height .2s ease-out;
}

#header.app-menu-use-fallback .responsive-menu li a {
  display: block;
  padding: 18px 20px;
  text-decoration: none;
  width: 160px;
  color: white;
  white-space: nowrap;
}

#header.app-menu-use-fallback .responsive-menu li a:hover {
  background-color: #f6bd30;
  color: black;
}

#header.app-menu-use-fallback .responsive-menu .menu-btn {
  display: none;
}

#header.app-menu-use-fallback .responsive-menu .menu-btn:checked~ul {
  max-height: calc(100vh - 56px);
  overflow: auto;
}

#header.app-menu-use-fallback .responsive-menu .menu-btn:checked~.menu-icon .navicon {
  background: transparent;
}

#header.app-menu-use-fallback .responsive-menu .menu-btn:checked~.menu-icon .navicon:before {
  transform: rotate(-45deg);
}

#header.app-menu-use-fallback .responsive-menu .menu-btn:checked~.menu-icon .navicon:after {
  transform: rotate(45deg);
}

#header.app-menu-use-fallback .responsive-menu .menu-btn:checked~.menu-icon:not(.steps) .navicon:before,
#header.app-menu-use-fallback .responsive-menu .menu-btn:checked~.menu-icon:not(.steps) .navicon:after {
  top: 0;
}

@media (max-width: 900px) {
  .app-menu-panel {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    padding: 20px;
    border-radius: 24px;
  }

  .app-menu-section__links {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app-menu-panel {
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    padding: 20px 16px 16px;
    border-radius: 0;
    border: 0;
    transform: translate(-50%, calc(-100% - 12px)) scale(1);
  }

  body.app-menu-open .app-menu-panel {
    transform: translate(-50%, 0) scale(1);
  }

  .app-menu-panel__title {
    font-size: 24px;
  }

  .app-menu-panel__header {
    margin-bottom: 16px;
    padding-bottom: 12px;
  }

  .app-menu-card {
    min-height: 78px;
    padding: 14px 16px;
  }

  .app-menu-trigger {
    width: var(--header-action-size);
    height: var(--header-action-size);
    min-height: var(--header-action-size);
    padding: 0;
  }
}

@media (prefers-reduced-motion: reduce) {

  .app-menu-panel,
  .app-menu-backdrop {
    transition: none;
  }
}
@media (max-width: 460px) {
  #logo {
    display: none;
  }

  #logo-small {
    display: block;
  }

  .is-mobile-only {
    display: flex;
  }

  .small-control #toggle-sidebar {
    width: var(--header-action-size);
    height: var(--header-action-size);
    min-width: var(--header-action-size);
    min-height: var(--header-action-size);
    border: 0;
    border-radius: 0;
    background:
      url('../svg/calendar.svg') center / 34px no-repeat,
      radial-gradient(circle, rgba(0, 0, 0, 0.62) 0 68%, transparent 70%);
    transition: filter 0.2s ease;
  }

  .small-control #toggle-sidebar:hover,
  .small-control #toggle-sidebar:focus-visible {
    background:
      url('../svg/calendar.svg') center / 34px no-repeat,
      radial-gradient(circle, rgba(0, 0, 0, 0.75) 0 68%, transparent 70%);
  }
}

@media (max-width: 360px) {
  #header {
    --header-action-size: 46px;
    gap: 8px;
  }

  .language-switch {
    margin-left: 6px;
  }

  .language-switch__option {
    width: 30px;
  }

  .app-menu-trigger {
    width: var(--header-action-size);
    height: var(--header-action-size);
    min-height: var(--header-action-size);
  }

  .app-menu-trigger::before {
    width: 42px;
    height: 42px;
  }

  .app-menu-trigger__icon {
    width: 22px;
    height: 22px;
    background-size: 9px 9px, 9px 9px, 9px 9px, 9px 9px;
  }

  .small-control #toggle-sidebar,
  .small-control #toggle-sidebar:hover,
  .small-control #toggle-sidebar:focus-visible {
    background-size: 30px, auto;
  }
}

/* Map meta type: live URL validity feedback on the admin input. */
.url-input.is-valid-url {
  border-color: #2e7d32;
  background-color: #eaf6ea;
}

.url-input.is-invalid-url {
  border-color: #b30000;
  background-color: #fdeaea;
}

/* Map meta type: "Naviguj" button shown to basic users in the read-only event view. */
.map-navigate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  min-width: 100%;
  padding: 10px 18px;
  background-color: var(--brand-primary, #7F5CA3);
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  box-sizing: border-box;
}
