/* V6 portal navigation: top priority modules, full right-side menu. */
body[data-app="admin"], body[data-app="client"] { background: #f5faf7; }

.portal-topbar { position: fixed; top: 0; right: 0; left: 0; z-index: 320; display: flex; min-height: 74px; align-items: center; gap: 18px; padding: 8px 18px; border-bottom: 1px solid #82968d; background: #ffffff; box-shadow: 0 3px 14px rgba(24, 65, 51, .07); }
.portal-topbar .portal-brand { flex: 0 0 auto; padding: 0; }
.portal-topbar .portal-title { min-width: 150px; flex: 1 1 auto; text-align: center; }
.portal-topbar .portal-title h1 { margin: 0; overflow: hidden; font-size: 1.25rem; text-overflow: ellipsis; white-space: nowrap; }
.portal-topbar .top-tools { flex: 0 0 auto; }

.module-strip { position: fixed; top: 74px; right: 0; left: 0; z-index: 210; min-height: 132px; border-bottom: 1px solid #82968d; background: rgba(255, 255, 255, .98); box-shadow: 0 7px 19px rgba(24, 65, 51, .07); transform: translateY(0); transition: transform .15s ease-in-out, box-shadow .15s ease-in-out; }
.module-strip.nav-hidden { box-shadow: none; transform: translateY(calc(-100% - 2px)); }
.module-strip-inner { display: flex; width: 100%; max-width: 1300px; min-height: 132px; align-items: center; justify-content: center; gap: 12px; margin: 0 auto; padding: 11px 18px; overflow-x: auto; }
.module-tile { position: relative; display: inline-flex; width: 126px; min-width: 126px; min-height: 106px; align-items: center; justify-content: flex-end; flex-direction: column; gap: 8px; padding: 15px 9px 12px; border: 3px solid transparent; border-radius: 15px; background: #201c29; color: #bdf5ef; box-shadow: 0 5px 12px rgba(23, 20, 30, .13); cursor: pointer; text-align: center; transition: transform .12s ease-in-out, border-color .12s ease-in-out, background-color .12s ease-in-out, box-shadow .12s ease-in-out; }
.module-tile:hover { border-color: #79d9c5; background: #292433; transform: translateY(-2px); }
.module-tile:focus { outline: 3px solid #a75e00; outline-offset: 3px; }
.module-tile.is-active { border-color: #79d9c5; background: #17231f; box-shadow: 0 0 0 2px #ffffff, 0 0 0 5px #28785c; }
.module-tile > i { font-size: 2rem; line-height: 1; }
.module-tile > span { display: block; width: 100%; overflow: hidden; color: #bdf5ef; font-size: .78rem; font-weight: 900; letter-spacing: .045em; line-height: 1.2; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.module-tile > small { position: absolute; top: 7px; right: 7px; min-width: 24px; padding: 2px 6px; border-radius: 999px; background: #bdf5ef; color: #17231f; font-size: .65rem; font-weight: 900; }

.portal-workspace { min-height: 100vh; margin-left: 0; }
.portal-main { width: 100%; max-width: none; margin: 0; padding: 237px clamp(19px, 3vw, 52px) 58px; }

.portal-menu { display: inline-flex; width: 58px; height: 54px; align-items: center; justify-content: center; flex-direction: column; gap: 2px; flex: 0 0 58px; padding: 3px; border: 0; border-radius: 11px; background: transparent; color: #17231f; cursor: pointer; }
.portal-menu:hover { background: #edf8f2; }
.portal-menu:focus { outline: 3px solid #a75e00; outline-offset: 2px; }
.menu-label { font-size: .58rem; font-weight: 900; letter-spacing: .08em; line-height: 1; text-transform: uppercase; }
.menu-glyph { position: relative; display: block; width: 30px; height: 30px; }
.menu-glyph i { position: absolute; display: block; transition: top .12s ease-in-out, right .12s ease-in-out, bottom .12s ease-in-out, left .12s ease-in-out, transform .12s ease-in-out, opacity .12s ease-in-out; }
.menu-glyph .dot-top-left, .menu-glyph .dot-top-right, .menu-glyph .dot-bottom-left, .menu-glyph .dot-bottom-right { width: 8px; height: 8px; border: 2px solid #18523e; border-radius: 50%; }
.menu-glyph .dot-top-left { top: 0; left: 0; }
.menu-glyph .dot-top-right { top: 0; right: 0; }
.menu-glyph .dot-bottom-left { bottom: 0; left: 0; }
.menu-glyph .dot-bottom-right { right: 0; bottom: 0; }
.menu-glyph .line-top, .menu-glyph .line-bottom { right: 10px; left: 10px; height: 2px; border-radius: 2px; background: #18523e; }
.menu-glyph .line-left, .menu-glyph .line-right { top: 10px; bottom: 10px; width: 2px; border-radius: 2px; background: #18523e; }
.menu-glyph .line-top { top: 3px; }
.menu-glyph .line-bottom { bottom: 3px; }
.menu-glyph .line-left { left: 3px; }
.menu-glyph .line-right { right: 3px; }
.portal-menu[aria-expanded="true"] .menu-glyph .dot-top-left, .portal-menu[aria-expanded="true"] .menu-glyph .dot-top-right, .portal-menu[aria-expanded="true"] .menu-glyph .dot-bottom-left, .portal-menu[aria-expanded="true"] .menu-glyph .dot-bottom-right { top: 11px; right: 11px; bottom: 11px; left: 11px; opacity: 0; }
.portal-menu[aria-expanded="true"] .menu-glyph .line-top, .portal-menu[aria-expanded="true"] .menu-glyph .line-bottom, .portal-menu[aria-expanded="true"] .menu-glyph .line-left, .portal-menu[aria-expanded="true"] .menu-glyph .line-right { transform: rotate(45deg); }
.portal-menu[aria-expanded="true"] .menu-glyph .line-top { right: 20px; left: 0; }
.portal-menu[aria-expanded="true"] .menu-glyph .line-left { top: 20px; bottom: 0; }
.portal-menu[aria-expanded="true"] .menu-glyph .line-bottom { right: 0; left: 20px; }
.portal-menu[aria-expanded="true"] .menu-glyph .line-right { top: 0; bottom: 20px; }

.portal-sidebar { position: fixed; top: 82px; right: 12px; bottom: auto; left: auto; z-index: 310; display: flex; width: 320px; max-width: calc(100vw - 24px); max-height: calc(100vh - 94px); flex-direction: column; padding: 18px 16px 16px; overflow-y: auto; border: 1px solid #82968d; border-radius: 0 0 0 20px; background: #ffffff; box-shadow: 0 18px 52px rgba(10, 36, 27, .24); opacity: 0; visibility: hidden; transform: translateY(-9px) scale(.985); transform-origin: top right; transition: transform .15s ease-in-out, opacity .15s ease-in-out, visibility .15s ease-in-out; }
.portal-sidebar.is-open { opacity: 1; visibility: visible; transform: translateX(0); }
.menu-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 3px 16px; border-bottom: 1px solid #82968d; }
.menu-panel-head h2 { margin: 3px 0 0; font-size: 1.5rem; }
.sidebar-close { display: inline-grid; flex: 0 0 auto; }
.portal-sidebar .portal-nav { margin-top: 14px; }
.portal-sidebar .sidebar-foot { margin-top: auto; padding-top: 18px; }
.portal-sidebar .portal-user { padding-top: 15px; }
.menu-logout { display: block; margin-top: 12px; padding: 12px 10px 2px; border-top: 1px solid #82968d; color: #83303a; font-size: .8rem; font-weight: 900; text-decoration: underline; text-underline-offset: 3px; }
.portal-overlay { display: none; }
.portal-overlay.is-visible { opacity: 1; visibility: visible; }
.modal-layer { z-index: 500; }
.context-menu { z-index: 520; }

html[data-theme="dark"] body[data-app="admin"], html[data-theme="dark"] body[data-app="client"] { background: #0d1713; }
html[data-theme="dark"] .portal-topbar, html[data-theme="dark"] .module-strip, html[data-theme="dark"] .portal-sidebar { border-color: #5d756b; background: #18231f; color: #f3f8f5; }
html[data-theme="dark"] .module-strip { box-shadow: 0 7px 19px rgba(0, 0, 0, .22); }
html[data-theme="dark"] .portal-menu { color: #f3f8f5; }
html[data-theme="dark"] .portal-menu:hover { background: #23342d; }
html[data-theme="dark"] .portal-menu:focus, html[data-theme="dark"] .module-tile:focus { outline-color: #ffbd4a; }
html[data-theme="dark"] .menu-glyph i { border-color: #a6eee0; background-color: #a6eee0; }
html[data-theme="dark"] .menu-glyph .dot-top-left, html[data-theme="dark"] .menu-glyph .dot-top-right, html[data-theme="dark"] .menu-glyph .dot-bottom-left, html[data-theme="dark"] .menu-glyph .dot-bottom-right { background-color: transparent; }
html[data-theme="dark"] .menu-panel-head, html[data-theme="dark"] .menu-logout { border-color: #5d756b; }
html[data-theme="dark"] .menu-logout { color: #ffb4ba; }

html[data-large-text="true"] .module-strip-inner { justify-content: center; }
html[data-large-text="true"] .module-tile > span { font-size: .83rem; }

@media (max-width: 1199px) and (min-width: 768px) {
  .module-strip { min-height: 118px; }
  .module-strip-inner { min-height: 118px; gap: 7px; padding: 9px 10px; }
  .module-tile { width: 105px; min-width: 105px; min-height: 94px; gap: 7px; padding: 11px 6px 9px; }
  .module-tile > i { font-size: 1.7rem; }
  .module-tile > span { font-size: .68rem; }
  .portal-main { padding-top: 221px; }
  .portal-search { width: min(25vw, 250px); }
}

@media (max-width: 900px) {
  .portal-topbar .portal-brand span, .portal-search { display: none; }
  .portal-topbar .portal-title { min-width: 0; text-align: left; }
  .portal-sidebar { width: 320px; max-width: calc(100vw - 24px); }
}

@media (max-width: 767px) {
  .portal-topbar { position: sticky; min-height: 72px; padding: 8px 10px; }
  .portal-topbar .portal-brand img { width: 38px; height: 38px; }
  .portal-topbar .portal-title .eyebrow { display: none; }
  .portal-topbar .portal-title h1 { font-size: 1rem; }
  .portal-topbar .top-tools { gap: 5px; }
  .top-tools > .avatar, .theme-button .theme-label, .menu-label { display: none; }
  .theme-button { width: 46px; height: 46px; justify-content: center; flex: 0 0 46px; padding: 0; }
  .portal-menu { width: 46px; height: 46px; flex-basis: 46px; }
  .module-strip { position: relative; top: auto; min-height: 0; transform: none; }
  .module-strip.nav-hidden { transform: none; }
  .module-strip-inner { display: grid; min-height: 0; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 11px 12px; overflow: visible; }
  .module-tile { width: 100%; min-width: 0; min-height: 88px; gap: 6px; padding: 11px 4px 8px; border-width: 2px; border-radius: 12px; }
  .module-tile > i { font-size: 1.55rem; }
  .module-tile > span { font-size: .66rem; }
  .module-tile > small { top: 4px; right: 4px; min-width: 20px; padding: 1px 4px; font-size: .58rem; }
  .module-tile-secondary { display: none; }
  .portal-main { padding: 24px 12px 44px; }
  .portal-sidebar { top: 0; right: 0; bottom: 0; width: 370px; max-width: 90vw; max-height: none; padding: 20px 17px 17px; border-width: 0 0 0 1px; border-radius: 0; box-shadow: -20px 0 65px rgba(10, 36, 27, .28); transform: translateX(105%); }
  .portal-sidebar.is-open { transform: translateX(0); }
  .portal-overlay { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 400; display: block; width: 100%; height: auto; padding: 0; border: 0; background: rgba(9, 27, 21, .58); opacity: 0; visibility: hidden; cursor: pointer; transition: opacity .15s ease-in-out, visibility .15s ease-in-out; }
  .portal-overlay.is-visible { opacity: 1; visibility: visible; }
  .portal-sidebar { z-index: 410; }

  .mobile-cards-panel { border: 0; background: transparent; box-shadow: none; }
  .mobile-cards, .mobile-cards tbody, .mobile-cards tr, .mobile-cards td { display: block; width: 100%; }
  .mobile-cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .mobile-cards tbody tr { margin-bottom: 12px; padding: 14px; border: 1px solid #82968d; border-radius: 15px; background: #ffffff; box-shadow: 0 5px 18px rgba(24, 65, 51, .07); }
  .mobile-cards td { display: grid; grid-template-columns: minmax(92px, 34%) minmax(0, 1fr); align-items: center; gap: 10px; padding: 8px 0; border: 0; color: #43574f; white-space: normal; }
  .mobile-cards td::before { content: attr(data-label); color: #43574f; font-size: .7rem; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
  .mobile-cards .person { min-width: 0; }
  .mobile-cards .person small { overflow-wrap: anywhere; white-space: normal; }
  .mobile-cards td[data-label="Akce"] .icon-button { justify-self: start; }
  .mobile-cards-scroll { overflow: visible; }

  .modal-layer { align-items: start; padding: 8px; overflow-y: auto; }
  .modal-card { width: 100%; max-width: 100%; max-height: calc(100vh - 16px); margin: auto; padding: 25px 14px 17px; overflow-x: hidden; }
  .modal-body, .modal-body .form-grid, .modal-body .field, .modal-body .choice-group, .modal-body .choice-grid, .modal-body .choice-card, .modal-body .smart-select { min-width: 0; max-width: 100%; }
  .modal-body .choice-card-body { min-width: 0; align-items: flex-start; }
  .modal-body .choice-card-body > span { min-width: 0; }
  .modal-body .choice-card strong, .modal-body .choice-card small { overflow-wrap: anywhere; word-break: break-word; }
  .modal-body .smart-select-panel { position: relative; top: auto; right: auto; left: auto; margin-top: 7px; }
}

@media (max-width: 520px) {
  .portal-topbar { gap: 7px; }
  .portal-topbar .portal-title h1 { font-size: .94rem; }
  .module-strip-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .module-tile { min-height: 84px; }
}

html[data-theme="dark"] .mobile-cards tbody tr { border-color: #5d756b; background: #18231f; }

@media (prefers-reduced-motion: reduce) {
  .module-strip, .module-tile, .portal-sidebar, .portal-overlay, .menu-glyph i { transition: none; }
}
