/* Volitelné: elegantní font, pokud chceš */
/* Pokud nechceš Google Fonts, smaž tento řádek */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600&family=Inter:wght@400;500;600&display=swap');

:root{
  --bg: #dfdfd9;
  --ink: #0e2a47;
  --muted: #5d7188;

  --header: #0e2a47;
  --footer: #0e2a47;

  --panel: rgba(255,255,255,0.55);
  --panel-strong: rgba(255,255,255,0.75);
  --line: rgba(14,42,71,0.15);
  --shadow: 0 10px 30px rgba(0,0,0,0.10);
}

*{ box-sizing: border-box; }
html, body{ height: 100%; }

body{
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, Calibri, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  overflow-x: hidden;
}

h1, h2, h3, .brand-name{
  font-family: "Cormorant Garamond", Athena, Georgia, "Times New Roman", serif;
  letter-spacing: 0.2px;
}

.container{
  width: min(1500px, calc(100% - 48px));
  margin: 0 auto;
}

.page-container{
  width: min(1500px, calc(100% - 48px));
  margin: 0 auto;
  padding-inline: 0;
}

/* Header */
  .site-header{
  background: var(--header);
  color: var(--bg);
  border-bottom: 1px solid rgba(255,255,255,0.12);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 72px;
}

.header-left{
  display: flex;
  align-items: center;
  gap: 22px;
  min-width: 0;
  flex: 1;
}

.brand{
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-logo{
  width: 34px;
  height: 34px;
  object-fit: contain;
  display: block;
}

.brand-text{
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-name{
  font-size: 20px;
  font-weight: 600;
}

.brand-sub{
  font-size: 12px;
  opacity: 0.85;
  margin-top: 2px;
}

/* Tabs */
.nav-tabs{
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
}

.tab{
  color: rgba(223,223,217,0.95);
  text-decoration: none;
  padding: 8px 10px;
  white-space: nowrap;
  flex: 0 0 auto;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  font-size: 13px;
  transition: transform 120ms ease, background 120ms ease;
}

.tab:hover{
  background: rgba(255,255,255,0.12);
  transform: translateY(-1px);
}

.tab-dropdown{
  position: relative;
}

.tab-dropdown-toggle{
  display: inline-flex;
  align-items: center;
  cursor: default;
}

.tab-dropdown-menu{
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 190px;
  background: #fff;
  border: 1px solid rgba(14,42,71,0.16);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.16);
  padding: 8px;
  display: none;
  z-index: 200;
}

.tab-dropdown:hover .tab-dropdown-menu,
.tab-dropdown:focus-within .tab-dropdown-menu{
  display: grid;
  gap: 6px;
}

.tab-dropdown-menu a{
  display: block;
  text-decoration: none;
  color: var(--ink);
  padding: 9px 11px;
  border-radius: 9px;
  font-size: 13px;
}

.tab-dropdown-menu a:hover,
.tab-dropdown-menu a:focus-visible{
  background: rgba(14,42,71,0.08);
  outline: none;
}

.header-right{
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-actions{
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.header-actions-toggle{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: var(--bg);
  font-weight: 600;
  cursor: pointer;
}

.header-actions-toggle:hover,
.header-actions-toggle:focus-visible,
.header-actions-toggle:active{
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.35);
  outline: none;
}

.header-actions-menu{
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: #fff;
  border: 1px solid rgba(14,42,71,0.16);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.16);
  padding: 8px;
  display: grid;
  gap: 6px;
  z-index: 120;
}

.header-actions-menu[hidden]{
  display: none !important;
}

.header-actions-menu a,
.header-actions-menu button{
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 10px 12px;
  border-radius: 9px;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
}

.header-actions-menu .menu-item{
  position: relative;
  padding-left: 40px;
}

.header-actions-menu .menu-item::before{
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  background-size: 18px 18px;
  background-repeat: no-repeat;
  opacity: 0.85;
}

.header-actions-menu .menu-admin::before{
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZmlsbD0iIzBlMmE0NyIgZD0iTTEyIDJhNSA1IDAgMCAxIDUgNXYxaDFhMyAzIDAgMCAxIDMgM3Y1YTYgNiAwIDAgMS02IDZIOWE2IDYgMCAwIDEtNi02di01YTMgMyAwIDAgMSAzLTNoMVY3YTUgNSAwIDAgMSA1LTV6bS0zIDdWN2EzIDMgMCAwIDEgNiAwdjJIOXptMyA0YTIgMiAwIDAgMC0xIDMuNzMyVjE5aDJ2LTIuMjY4QTIgMiAwIDAgMCAxMiAxM3oiLz48L3N2Zz4=");
}

/* Generic autocomplete select used across forms */
.autocomplete-select {
  position: relative;
}

.autocomplete-select > select.js-autocomplete-select {
  display: none;
}

.autocomplete-select-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(14,42,71,0.14);
  background: rgba(255,255,255,0.88);
  color: var(--ink);
}

.autocomplete-select-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.autocomplete-select-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  background: #fff;
  border: 1px solid rgba(14,42,71,0.16);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.16);
  max-height: 260px;
  overflow: auto;
  padding: 6px;
}

.autocomplete-select-item {
  width: 100%;
  display: block;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 10px 12px;
  border-radius: 9px;
  cursor: pointer;
}

.autocomplete-select-item:hover {
  background: rgba(14,42,71,0.08);
}

.autocomplete-select-empty {
  padding: 10px 12px;
  color: rgba(14,42,71,0.66);
}

.header-actions-menu .menu-profile::before{
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZmlsbD0iIzBlMmE0NyIgZD0iTTEyIDNhNSA1IDAgMSAxIDAgMTBhNSA1IDAgMCAxIDAtMTB6bTAgMTJjNC40MTggMCA4IDIuMjM5IDggNXYxSDR2LTFjMC0yLjc2MSAzLjU4Mi01IDgtNXoiLz48L3N2Zz4=");
}

.header-actions-menu .menu-mindlab::before{
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230e2a47'%3E%3Cpath d='M10.5 2a2.5 2.5 0 0 0-2.5 2.5V6H6.5A2.5 2.5 0 0 0 4 8.5v1.5H2v4h2v1.5A2.5 2.5 0 0 0 6.5 18H8v1.5a2.5 2.5 0 0 0 2.5 2.5H12v-2h-1.5a.5.5 0 0 1-.5-.5V18h4v1.5a.5.5 0 0 1-.5.5H12v2h1.5a2.5 2.5 0 0 0 2.5-2.5V18h1.5a2.5 2.5 0 0 0 2.5-2.5V14h2v-4h-2V8.5A2.5 2.5 0 0 0 17.5 6H16V4.5A2.5 2.5 0 0 0 13.5 2H12v2h1.5a.5.5 0 0 1 .5.5V6h-4V4.5a.5.5 0 0 1 .5-.5H12V2h-1.5ZM6.5 8H8v2H6V8.5a.5.5 0 0 1 .5-.5Zm9.5 0h1.5a.5.5 0 0 1 .5.5V10h-2V8Zm2 6v1.5a.5.5 0 0 1-.5.5H16v-2h2Zm-10 2H6.5a.5.5 0 0 1-.5-.5V14h2v2Zm2 0v-8h4v8h-4Z'/%3E%3C/svg%3E");
}

.header-actions-menu .menu-finance::before{
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCAyNCAyNCc+PHBhdGggZmlsbD0nIzBlMmE0NycgZD0nTTEzIDJoLTJ2MmMtMi43NjEgMC01IDEuNzktNSA0IDAgMS43MiAxLjEwMSAzLjE2IDMuNSA0bDMuMjM5IDEuMDhjMS4xMjQuMzc1IDEuNzYxLjk2NiAxLjc2MSAxLjkxNCAwIDEuMzgxLTEuMzQzIDItMi41IDItaC0xYy0xLjEwMyAwLTItLjg5Ny0yLTJINnYxYzAgMi4zODkgMS42ODkgMy43MTIgNCAzLjk1MVYyMmgydi0yYzIuNzYxIDAgNS0xLjc5IDUtNHMtMi4zOS0zLjY3Mi00LTIuMTY2bC0zLjQyMS0xLjE0QzguNjQzIDExLjE5IDEwLjEyNCAxMCAxMSAxMGgxYzEuMTAzIDAgMiAuODk3IDIgMmgydjFjMC0yLjM4OS0xLjY4OS0zLjcxMi00LTMuOTUxVjJ6Jy8+PC9zdmc+");
}

.header-actions-menu .menu-plan::before{
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230e2a47'%3E%3Cpath d='M4 20h16v2H4v-2Zm2-2a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h12l4 4v8a2 2 0 0 1-2 2H6Zm0-2h14V9h-3a2 2 0 0 1-2-2V6H6v10Zm2-2h2v-3H8v3Zm3 0h2V8h-2v6Zm3 0h2v-2h-2v2Z'/%3E%3C/svg%3E");
}

.header-actions-menu .menu-management::before{
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230e2a47'%3E%3Cpath d='M12 2 3 6v6c0 5.25 3.438 9.937 9 11 5.562-1.063 9-5.75 9-11V6l-9-4Zm0 2.18 7 3.11V12c0 4.141-2.602 7.85-7 8.96C7.602 19.85 5 16.141 5 12V7.29l7-3.11Zm-1 4.82v6h2V9h-2Zm0 8v2h2v-2h-2Z'/%3E%3C/svg%3E");
}

.header-actions-menu .menu-partners::before{
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZmlsbD0iIzBlMmE0NyIgZD0iTTE2IDExYTQgNCAwIDEgMC00LTRhNCA0IDAgMCAwIDQgNHptLTggMGE0IDQgMCAxIDAtNC00YTQgNCAwIDAgMCA0IDR6bTAgMmMtMy4zMTQgMC02IDEuNzktNiA0djJoOHYtMmMwLTEuMDc3LjM1Ni0yLjA3My45NTYtMi45MTJBOS43MyA5LjczIDAgMCAxIDggMTN6bTggMGMtMy4zMTQgMC02IDEuNzktNiA0djJoMTJ2LTJjMC0yLjIxLTIuNjg2LTQtNi00eiIvPjwvc3ZnPg==");
}

.header-actions-menu .menu-processors::before{
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZmlsbD0iIzBlMmE0NyIgZD0iTTExIDIuNWEyLjUgMi41IDAgMCAxIDIuNSAyLjV2MUgxNWEzIDMgMCAwIDEgMyAzdjhhMyAzIDAgMCAxLTMgM0g5YTMgMyAwIDAgMS0zLTN2LThhMyAzIDAgMCAxIDMtM2gxLjVWNWEyLjUgMi41IDAgMCAxIDIuNS0yLjV6bTAgMmEuNS41IDAgMCAwLS41LjV2MUgxMnYtMWEuNS41IDAgMCAwLS41LS41em0tMyA4LjV2Mmgydi0yaC0yem00IDBoNnYyaC02di0yem0tNCA0djJoMnYtMmgtMnptNCAwaDZ2MmgtNnYtMnoiLz48L3N2Zz4=");
}

.header-actions-menu .menu-structure::before{
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230e2a47'%3E%3Cpath d='M16 11h-3V8.82A3.001 3.001 0 0 0 15 6a3 3 0 1 0-6 0c0 1.3.84 2.4 2 2.82V11H8c-1.1 0-2 .9-2 2v3.18A3.001 3.001 0 0 0 4 19a3 3 0 1 0 6 0c0-1.3-.84-2.4-2-2.82V13h3v3.18A3.001 3.001 0 0 0 9 19a3 3 0 1 0 6 0c0-1.3-.84-2.4-2-2.82V13h3v3.18A3.001 3.001 0 0 0 14 19a3 3 0 1 0 6 0c0-1.3-.84-2.4-2-2.82V13c0-1.1-.9-2-2-2zm-9-4a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm0 13a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm5 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm5 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2z'/%3E%3C/svg%3E");
}

.header-actions-menu .menu-controlling::before{
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZmlsbD0iIzBlMmE0NyIgZD0iTTQgMTloMTZ2Mkg0di0yem0xLTEwaDN2OGgtM1Y5em01LTRoM3YxMmgtM1Y1em01IDZoM3Y2aC0zdjZ6Ii8+PC9zdmc+");
}

.header-actions-menu .menu-ticket::before{
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCAyNCAyNCc+PHBhdGggZmlsbD0nIzBlMmE0NycgZD0nTTQgN2EyIDIgMCAwIDEgMi0yaDEyYTIgMiAwIDAgMSAyIDJ2M2EyIDIgMCAwIDAgMCA0djNhMiAyIDAgMCAxLTIgMkg2YTIgMiAwIDAgMS0yLTJ2LTNhMiAyIDAgMCAwIDAtNFY3em01IDF2OGgyVjhIOXptNCAwdjhoMlY4aC0yeicvPjwvc3ZnPg==");
}

.header-actions-menu .menu-my-tickets::before{
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCAyNCAyNCc+PHBhdGggZmlsbD0nIzBlMmE0NycgZD0nTTUgNWgxNHYySDVWNXptMCA2aDE0djJINXYtMnptMCA2aDE0djJINXYtMnonLz48L3N2Zz4=");
}

.header-actions-menu .menu-logout::before{
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZmlsbD0iIzBlMmE0NyIgZD0iTTEwIDNoOGEyIDIgMCAwIDEgMiAydjE0YTIgMiAwIDAgMS0yIDJoLTh2LTJoOFY1aC04VjN6bS0xLjQxNCA2LjU4NkwxMCAxMUgzdjJoN2wtMS40MTQgMS40MTRMMTAgMTZsNC00bC00LTRsLTEuNDE0IDEuNDE0eiIvPjwvc3ZnPg==");
}

.header-actions-menu a:hover,
.header-actions-menu button:hover{
  background: rgba(14,42,71,0.08);
}

.mobile-menu-toggle{
  display: none;
  background: rgba(255,255,255,0.16);
  color: var(--bg);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 600;
}

.mobile-menu-toggle:hover,
.mobile-menu-toggle:focus-visible,
.mobile-menu-toggle:active{
  background: rgba(255,255,255,0.26);
  border-color: rgba(255,255,255,0.4);
  outline: none;
}

.mobile-menu{
  display: none;
  border-top: 1px solid rgba(255,255,255,0.12);
  background: var(--header);
  padding: 10px 0 14px;
  overscroll-behavior: contain;
}

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

.mobile-menu-nav,
.mobile-menu-actions{
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 24px;
}

.mobile-menu-nav a,
.mobile-menu-actions a{
  color: rgba(223,223,217,0.95);
  text-decoration: none;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
}

.mobile-menu-nav a:hover,
.mobile-menu-nav a:focus-visible,
.mobile-menu-nav a:active,
.mobile-menu-actions a:hover,
.mobile-menu-actions a:focus-visible,
.mobile-menu-actions a:active{
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,255,255,0.28);
  outline: none;
}

.mobile-menu-nav a.active{
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.34);
  font-weight: 800;
}

.mobile-menu-actions{
  margin-top: 10px;
}

.mobile-menu-section-label{
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(223,223,217,0.78);
  margin-top: 6px;
  padding: 4px 2px 0;
}

.mobile-menu-actions form{
  margin: 0;
}

.mobile-menu-actions .btn{
  width: 100%;
}

.header-client-search{
  position: relative;
  width: clamp(240px, 24vw, 360px);
  max-width: 32vw;
  z-index: 80;
}

.header-search-input{
  width: 100%;
  height: 38px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.45);
  background: rgba(255,255,255,0.92);
  color: var(--ink);
  font-weight: 500;
}

.header-search-input::placeholder{
  color: rgba(14,42,71,0.50);
}

.header-search-input:focus{
  border-color: rgba(255,255,255,0.9);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.20);
  outline: none;
}

.header-search-list{
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 1350;
  background: #fff;
  border: 1px solid rgba(14,42,71,0.16);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.16);
  max-height: 320px;
  overflow: auto;
  padding: 6px;
}

.header-search-item{
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 10px 12px;
  border-radius: 9px;
  cursor: pointer;
  font: inherit;
}

.header-search-item:hover{
  background: rgba(14,42,71,0.08);
}

.header-search-empty{
  padding: 10px 12px;
  color: rgba(14,42,71,0.66);
}

.header-link{
  color: rgba(223,223,217,0.95);
  text-decoration: none;
  font-size: 14px;
}

.header-link:hover{
  text-decoration: underline;
}

.header-management-link{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.header-management-link:hover,
.header-management-link:focus-visible,
.header-management-link:active{
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.35);
  outline: none;
}

.logout-form{ margin: 0; }

/* Buttons */
.btn{
  appearance: none;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
}

.btn-light{
  background: var(--bg);
  color: var(--ink);
  border-color: rgba(223,223,217,0.60);
}

.btn-light:hover{
  filter: brightness(0.98);
}

.btn-primary{
  background: var(--ink);
  color: var(--bg);
  border-color: rgba(255,255,255,0.10);
}

.btn-primary:hover{
  filter: brightness(1.05);
}

.btn-primary-wide{
  width: 100%;
  display: flex;
  justify-content: center;
  font-size: 16px;
  padding: 14px 18px;
  border-radius: 16px;
}

/* Form error modal */
.form-error-modal{
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.form-error-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.35);
}

.form-error-panel{
  position: relative;
  max-width: 640px;
  margin: 10vh auto 0;
  background: #fff;
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.18);
  border: 1px solid rgba(204, 43, 43, 0.18);
}

.form-error-header{
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.form-error-title{
  font-weight: 700;
  font-size: 18px;
  color: #8b1f1f;
}

.form-error-subtitle{
  margin-top: 4px;
  color: rgba(0,0,0,0.65);
  font-size: 13px;
}

.form-error-list{
  margin: 0;
  padding-left: 18px;
  color: #4b1a1a;
  display: grid;
  gap: 6px;
}

.form-error-actions{
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
}

.has-form-errors .form-error,
.has-form-errors .field-errors,
.has-form-errors .errorlist{
  display: none;
}

/* Main */
.site-main{
  padding: 34px 0 54px;
}

/* Cards, panels */
.card{
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 22px;
}

/* Form */
label{
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
  opacity: 0.9;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
select,
textarea{
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 12px 12px;
  background: var(--panel-strong);
  color: var(--ink);
  outline: none;
}

input:focus, select:focus, textarea:focus{
  border-color: rgba(14,42,71,0.35);
}

.page-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.page-head h1,
.page-head h2{
  margin: 0;
  overflow-wrap: anywhere;
}

.page-toolbar{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar-stack{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

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

.filters-grid > *{
  min-width: 0;
}

.filters-grid .field-wide{
  grid-column: span 2;
}

.filters-actions{
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filters-actions .btn{
  min-width: 130px;
}

.table-responsive-wrap,
.table-wrap{
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.table-responsive-wrap table,
.table-wrap table{
  min-width: 100%;
}

.card-row-list tbody td,
.card-row-list tbody th{
  overflow-wrap: anywhere;
}

.badge{
  max-width: 100%;
  overflow-wrap: anywhere;
}

.break-anywhere{
  overflow-wrap: anywhere;
  word-break: break-word;
}

.modal-footer-stack{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.section-spacing-md{
  margin-top: 16px;
}

.heading-reset{
  margin-top: 0;
}

.bulk-field-full{
  grid-column: 1 / -1;
}

.bulk-field-end{
  justify-content: flex-end;
}

.inline-check-label{
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Footer */
.site-footer{
  background: var(--footer);
  color: var(--bg);
  border-top: 1px solid rgba(255,255,255,0.12);
}

.footer-grid{
  padding: 26px 0;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 18px;
}

.footer-title{
  font-family: "Cormorant Garamond", Athena, Georgia, serif;
  font-size: 18px;
  font-weight: 600;
}

.footer-head{
  font-size: 12px;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 8px;
}

.footer-text{
  font-size: 13px;
  opacity: 0.88;
  margin-top: 4px;
}

.footer-bottom{
  border-top: 1px solid rgba(255,255,255,0.12);
}

.footer-bottom-inner{
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.footer-links{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer-links a{
  color: rgba(255,255,255,0.9);
  text-decoration: none;
}

.footer-links a:hover{
  color: rgba(255,255,255,1);
  text-decoration: underline;
}

.footer-sep{
  opacity: 0.6;
}

/* Responsive */
@media (max-width: 900px){
  .footer-grid{
    grid-template-columns: 1fr;
  }
  .header-inner{
    flex-direction: column;
    align-items: stretch;
    padding: 14px 0;
  }
  .header-right{
    justify-content: flex-end;
  }
  .header-right .header-actions{
    display: none;
  }
  .mobile-menu-toggle{
    display: inline-flex;
  }
  .mobile-menu{
    display: block;
  }
}

@media (max-width: 1100px){
  .header-right .header-actions{
    display: none !important;
  }
  .mobile-menu-toggle{
    display: inline-flex !important;
  }
}

@media (max-width: 991px){
  .page-container{
    width: min(1500px, calc(100% - 28px));
  }

  .filters-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filters-grid .field-wide{
    grid-column: span 2;
  }

  .header-notifications-menu{
    width: min(420px, calc(100vw - 28px));
    right: -6px;
  }
}

@media (max-width: 575px){
  .container,
  .page-container{
    width: calc(100% - 20px);
  }

  .site-main{
    padding-top: 18px;
    padding-bottom: 28px;
  }

  .card{
    padding: 14px;
  }

  .page-head{
    align-items: stretch;
  }

  .page-toolbar,
  .toolbar-stack{
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .page-toolbar .btn,
  .toolbar-stack .btn{
    width: 100%;
  }

  .filters-grid{
    grid-template-columns: 1fr;
  }

  .filters-grid .field-wide{
    grid-column: auto;
  }

  .filters-actions{
    flex-direction: column;
  }

  .filters-actions .btn{
    width: 100%;
  }

  .header-notifications-menu{
    width: calc(100vw - 20px);
    right: 0;
  }

  .header-right{
    flex-wrap: wrap;
    justify-content: flex-start;
    width: 100%;
  }

  .header-client-search{
    order: 99;
    flex: 1 1 100%;
    max-width: 100%;
    width: 100%;
  }

  .notif-item-actions{
    flex-wrap: wrap;
  }

  .notif-item-actions .btn{
    width: 100%;
  }

  .form-error-panel{
    width: calc(100vw - 20px);
    margin-top: 6vh;
    padding: 14px;
  }

  .form-error-actions{
    justify-content: stretch;
  }

  .form-error-actions .btn{
    width: 100%;
  }

  .modal-footer-stack{
    flex-direction: column;
  }

  .modal-footer-stack .btn{
    width: 100%;
  }
}

@media (max-width: 780px){
  .site-header,
  .header-inner,
  .header-left,
  .header-right{
    max-width: 100%;
    overflow-x: clip;
  }

  .nav-tabs{
    display: none;
  }
  .header-right .header-actions{
    display: none !important;
  }
  .header-actions,
  .header-actions-toggle,
  .header-actions-menu{
    display: none !important;
  }
  .header-right .header-link,
  .header-right .header-management-link,
  .header-right .btn,
  .header-right .logout-form{
    display: none;
  }
  .mobile-menu-toggle{
    display: inline-flex;
  }
  .mobile-menu{
    display: block;
  }
  .header-client-search{
    width: 100%;
    max-width: 100%;
  }
  .footer-bottom-inner{
    flex-direction: column;
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 900px){
  .site-header .header-actions,
  .site-header .header-actions-toggle,
  .site-header .header-actions-menu{
    display: none !important;
  }
}

/* Final mobile hardening for header/navigation */
@media (max-width: 900px){
  html,
  body{
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important;
  }

  .layout-root{
    overflow-x: hidden;
  }

.site-header{
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
    overflow-y: visible;
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    z-index: 1000;
  }

  .site-header.is-mobile-menu-open{
    max-height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .site-header + .site-main{
    padding-top: calc(var(--mobile-header-offset, 156px) + 12px);
  }

  .site-header .container.header-inner{
    display: flex !important;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: calc(12px + env(safe-area-inset-top)) 14px 12px;
    min-height: auto;
    gap: 10px;
    box-sizing: border-box;
  }

  .header-inner{
    flex-direction: column;
    align-items: stretch;
  }

  .header-left,
  .header-right{
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .header-right{
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px;
  }

  .nav-tabs{
    display: none !important;
  }

  .mobile-menu-toggle{
    display: inline-flex !important;
    justify-content: center;
    width: auto;
  }

  .mobile-menu{
    position: fixed;
    left: 0;
    right: 0;
    top: calc(var(--mobile-header-offset, 156px) - 1px);
    bottom: 0;
    z-index: 1100;
    margin: 0;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .header-client-search{
    order: 10;
    grid-column: 1 / -1;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .header-notifications{
    justify-self: end;
  }

  .header-notifications-menu{
    right: 10px;
    left: 10px;
    width: auto;
    max-width: none;
    max-height: min(70dvh, 520px);
  }

  .header-right > .btn,
  .header-right > .header-link,
  .header-right > .header-management-link,
  .header-right > .logout-form{
    display: none !important;
  }

  .header-actions,
  .header-actions-toggle,
  .header-actions-menu{
    display: none !important;
  }

  .division-switch{
    flex-wrap: wrap;
    min-width: 0;
    gap: 6px;
  }

  .division-switch-label{
    display: none;
  }
}

body.mobile-menu-open{
  overflow: hidden;
}
/* --- Sticky footer layout --- */
.layout-root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-main {
  flex: 1 0 auto;
}

.site-footer {
  flex-shrink: 0;
}

.bank-grid {
    display: grid;
    grid-template-columns:
        80px   /* hlavní */
        80px   /* aktivní */
        1.5fr  /* IBAN */
        1fr    /* číslo účtu */
        120px  /* kód banky */
        90px   /* měna */
        1.5fr  /* poznámka */
        50px;  /* smazat */
    gap: 12px;
    align-items: center;
}

.bank-grid textarea {
    min-height: 40px;
    resize: vertical;
}

.nav-tabs .tab.active{
  background: rgba(14,42,71,0.10);
  border: 1px solid rgba(14,42,71,0.25);
  font-weight: 800;
}

.header-notifications{
  position: relative;
  z-index: 90;
}

.header-notifications-toggle{
  position: relative;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  min-width: 42px;
  height: 42px;
  padding: 0 10px;
  cursor: pointer;
}

.notif-badge{
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #d11a2a;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

.header-notifications-menu{
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 380px;
  max-width: calc(100vw - 24px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 10px;
  z-index: 1350;
  color: var(--ink);
}

.notif-head{
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.notif-list{
  display: grid;
  gap: 8px;
  max-height: 420px;
  overflow: auto;
}

.notif-item{
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  background: #fff;
  color: var(--ink);
}

.notif-item.unread{
  background: #f7fbff;
  border-color: #bdd6ee;
}

.notif-item-title{
  font-weight: 700;
  color: var(--ink);
}

.notif-item-message{
  font-size: 14px;
  color: #3e5065;
}

.notif-item-meta{
  font-size: 12px;
  color: #6d7f92;
  margin-top: 2px;
}

.notif-link{
  color: #0f2fcf;
  font-weight: 700;
}

.notif-link:hover{
  color: #0b2399;
}

.notif-item-actions{
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.division-switch{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 8px;
}

.division-switch-label{
  color: #d9e6f5;
  font-size: 12px;
  font-weight: 700;
}

.division-pill{
  border: 1px solid rgba(255,255,255,.45);
  background: rgba(255,255,255,.10);
  color: #fff;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.division-pill.is-active{
  background: #fff;
  color: #12385f;
  border-color: #fff;
}

/* Unified document row component */
.documents-card .doc-list{
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.documents-card .doc-row{
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(180px, 28vw, 260px);
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid #dfe5ec;
  border-radius: 12px;
  background: #fff;
}

.documents-card .doc-content{
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.documents-card .doc-icon{
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #eef3f9;
  border: 1px solid #d5dfeb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 34px;
  font-size: 16px;
}

.documents-card .doc-text{
  min-width: 0;
}

.documents-card .doc-title{
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: anywhere;
  line-height: 1.35;
  font-weight: 700;
  color: #12385f;
  text-decoration: none;
}

.documents-card .doc-title:hover{
  text-decoration: underline;
}

.documents-card .doc-meta{
  margin-top: 4px;
  color: #6a7c90;
  font-size: 12px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.documents-card .doc-actions{
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: end;
  gap: 8px;
}

.documents-card .doc-actions .btn,
.documents-card .doc-actions .doc-delete-form{
  width: auto;
  flex: 0 0 auto;
}

.documents-card .doc-actions .doc-delete-form{
  margin: 0;
}

.documents-card .doc-actions .doc-delete-form .btn{
  width: auto;
}

@media (max-width: 900px){
  .documents-card .doc-row{
    grid-template-columns: 1fr;
    align-items: start;
  }

  .documents-card .doc-actions{
    justify-content: flex-start;
  }
}

.file-drop-target.is-dragover{
  outline: 2px dashed #8ba3c0;
  outline-offset: 2px;
  background: rgba(222, 233, 245, 0.65);
}

.file-drop-toast{
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 1200;
  background: #12385f;
  color: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.16s ease, transform 0.16s ease;
  max-width: min(92vw, 380px);
}

.file-drop-toast.is-visible{
  opacity: 1;
  transform: translateY(0);
}

/* MIND Chat */
.mind-chat-widget {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1400;
}

.mind-chat-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  border: 1px solid rgba(37, 49, 99, 0.24);
  background: #ffffff;
  color: #1f2b49;
  border-radius: 999px;
  width: 54px;
  height: 54px;
  padding: 0;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(11, 18, 39, 0.16);
}

.mind-chat-pill-icon {
  font-size: 22px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mind-chat-pill-badge,
.mind-chat-mini-unread {
  display: inline-flex;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  background: #4338ca;
  color: #ffffff;
  padding: 0 6px;
}

.mind-chat-pill-badge {
  position: absolute;
  right: -2px;
  top: -2px;
}

.mind-chat-widget-panel,
.mind-chat-shell--page {
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
}

.mind-chat-widget-panel[hidden],
.mind-chat-pill[hidden] {
  display: none !important;
}

.mind-chat-widget-panel {
  width: min(880px, calc(100vw - 32px));
  height: min(620px, calc(100vh - 44px));
  display: grid;
  grid-template-rows: auto auto 1fr;
  transition: width 0.22s ease;
}

.mind-chat-widget-head,
.mind-chat-thread-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.mind-chat-thread-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.mind-chat-back-button[hidden] {
  display: none !important;
}

.mind-chat-toolbar {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  display: grid;
  gap: 8px;
}

.mind-chat-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.mind-chat-filters .is-active {
  background: #1f2b49;
  color: #ffffff;
}

.mind-chat-widget-body,
.mind-chat-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 0;
}

/* Keep widget body stretched to panel bottom so composer stays pinned. */
.mind-chat-widget-body {
  grid-row: 2 / -1;
}

.mind-chat-mobile-list-view .mind-chat-main {
  display: none;
}

.mind-chat-mobile-list-view .mind-chat-widget-body,
.mind-chat-shell.mind-chat-mobile-list-view {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}

.mind-chat-mobile-list-view .mind-chat-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 0;
}

.mind-chat-mobile-thread-view .mind-chat-sidebar {
  display: none;
}

.mind-chat-mobile-thread-view .mind-chat-widget-body,
.mind-chat-shell.mind-chat-mobile-thread-view {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}

.mind-chat-shell--page.mind-chat-mobile-thread-view {
  grid-template-columns: minmax(0, 1fr) !important;
}

.mind-chat-shell--page.mind-chat-mobile-thread-view .mind-chat-main {
  grid-column: 1 / -1;
  width: 100%;
}

.mind-chat-shell--page.mind-chat-mobile-thread-view .mind-chat-messages {
  padding: 22px 28px;
}

.mind-chat-shell--page.mind-chat-mobile-thread-view .mind-chat-composer {
  padding-left: 18px;
  padding-right: 18px;
}

.mind-chat-shell--page.mind-chat-mobile-thread-view .mind-chat-bubble {
  max-width: min(74%, 760px);
}

.mind-chat-shell--page.mind-chat-mobile-thread-view .mind-chat-bubble.is-system {
  max-width: min(68%, 700px);
}

.mind-chat-mobile-thread-view .mind-chat-toolbar {
  display: none;
}

.mind-chat-mobile-thread-view .mind-chat-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  min-height: 0;
}

.mind-chat-sidebar {
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  min-height: 0;
  background: #fbfcff;
}

.mind-chat-sidebar-head {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  color: #5d7290;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.mind-chat-list,
.mind-chat-messages {
  overflow: auto;
}

.mind-chat-client-item,
.mind-chat-thread-row {
  position: relative;
  width: 100%;
  text-align: left;
  border: 0;
  background: #ffffff;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  padding: 11px 12px;
  display: grid;
  gap: 8px;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.mind-chat-thread-row:hover,
.mind-chat-client-item:hover {
  background: #f6f9ff;
}

.mind-chat-client-item.is-active,
.mind-chat-thread-row.is-active {
  background: rgba(54, 95, 185, 0.12);
}

.mind-chat-client-item.is-group-aggregate {
  background: linear-gradient(180deg, #eef4ff 0%, #e9f0ff 100%);
  border-left: 4px solid #4f6fd6;
}

.mind-chat-client-item.is-group-aggregate:hover {
  background: linear-gradient(180deg, #e8f0ff 0%, #e1ebff 100%);
}

.mind-chat-client-item.is-client-aggregate {
  background: #ffffff;
}

.mind-chat-list-kind {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(79, 111, 214, 0.14);
  color: #284485;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.mind-chat-list-kind.is-client {
  background: rgba(15, 23, 42, 0.06);
  color: #526178;
}

.mind-chat-client-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 8px;
}

.mind-chat-client-row p {
  margin: 4px 0 0;
  color: #4b5563;
  font-size: 13px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.mind-chat-client-meta {
  font-size: 11px;
  color: #6b7280;
}

.mind-chat-thread-switches {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.mind-chat-thread-switch {
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 999px;
  font-size: 11px;
  padding: 3px 8px;
  background: #ffffff;
  cursor: pointer;
}

.mind-chat-thread-switch.is-active {
  border-color: #4338ca;
  background: #eef2ff;
  color: #312e81;
}

.mind-chat-thread-head-copy {
  display: grid;
  gap: 8px;
}

.mind-chat-thread-members {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mind-chat-thread-members[hidden] {
  display: none;
}

.mind-chat-thread-members.is-compact {
  gap: 6px;
}

.mind-chat-thread-members.is-modal {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  background: #f8fbff;
}

.mind-chat-member-chip {
  --mind-chat-accent-h: 214;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: hsl(var(--mind-chat-accent-h) 86% 96%);
  color: hsl(var(--mind-chat-accent-h) 48% 28%);
  border: 1px solid hsl(var(--mind-chat-accent-h) 56% 84%);
  font-size: 12px;
  font-weight: 700;
}

.mind-chat-member-chip.is-selected {
  box-shadow: inset 0 0 0 1px hsl(var(--mind-chat-accent-h) 62% 54% / 0.24);
}

.mind-chat-member-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: hsl(var(--mind-chat-accent-h) 62% 54%);
  flex: 0 0 auto;
}

.mind-chat-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  min-height: 0;
  background: #f6f8fc;
}

.mind-chat-messages {
  min-height: 0;
  height: 100%;
  padding: 16px;
  display: grid;
  gap: 12px;
  align-content: start;
  background: linear-gradient(180deg, #f9fbff 0%, #f5f8fc 100%);
  overflow-y: auto;
  overflow-x: hidden;
}

.mind-chat-day-divider {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: #7a8aa2;
  margin: 4px 0;
}

.mind-chat-load-older {
  justify-self: center;
  border: 1px solid rgba(28, 79, 148, 0.2);
  border-radius: 999px;
  background: #fff;
  color: #1f4f8f;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  cursor: pointer;
}

.mind-chat-bubble {
  --mind-chat-accent-h: 214;
  max-width: min(78%, 580px);
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 14px;
  padding: 10px 12px;
  background: #ffffff;
}

.mind-chat-bubble.is-outgoing {
  margin-left: auto;
  background: linear-gradient(180deg, #eaf1ff 0%, #e4ecff 100%);
  border-color: rgba(53, 95, 183, 0.24);
}

.mind-chat-bubble.is-incoming {
  border-left: 4px solid hsl(var(--mind-chat-accent-h) 68% 58%);
  background: linear-gradient(180deg, #ffffff 0%, hsl(var(--mind-chat-accent-h) 84% 98%) 100%);
}

.mind-chat-bubble.is-system {
  border-left: 0;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-color: rgba(148, 163, 184, 0.28);
}

.mind-chat-bubble header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 12px;
  color: #4b5563;
}

.mind-chat-bubble-body {
  white-space: pre-wrap;
}

.mind-chat-bubble footer {
  margin-top: 8px;
  font-size: 11px;
  color: #365fb9;
}

.mind-chat-bubble-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.mind-chat-bubble-row.is-outgoing {
  justify-content: flex-end;
}

.mind-chat-message-avatar {
  --mind-chat-accent-h: 214;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  overflow: hidden;
  background: hsl(var(--mind-chat-accent-h) 86% 95%);
  color: hsl(var(--mind-chat-accent-h) 48% 28%);
  border: 1px solid hsl(var(--mind-chat-accent-h) 58% 84%);
  font-size: 12px;
  font-weight: 700;
}

.mind-chat-message-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mind-chat-attachments {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

.mind-chat-attachments img {
  display: block;
  max-width: 220px;
  border-radius: 10px;
}

.mind-chat-file {
  color: #1d4ed8;
  text-decoration: underline;
}

.mind-chat-composer {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  background: #ffffff;
  position: sticky;
  bottom: 0;
}

.mind-chat-composer-input {
  min-height: 42px;
  max-height: 132px;
  resize: none;
  line-height: 1.45;
  padding-top: 10px;
  padding-bottom: 10px;
}

.mind-chat-composer-file-input {
  display: none;
}

.mind-chat-attach-button {
  white-space: nowrap;
}

.mind-chat-file-state {
  color: #667e9b;
  font-size: 12px;
  align-self: center;
  min-width: 80px;
  overflow-wrap: anywhere;
}

.mind-chat-group-modal-card {
  max-width: 640px;
  margin: 0 auto;
  background: #fff;
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.18);
}

.mind-chat-group-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.mind-chat-group-modal-client {
  margin-top: 10px;
  color: #64748b;
  font-size: 13px;
}

.mind-chat-group-modal-field {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.mind-chat-group-user-list {
  max-height: 280px;
  overflow: auto;
  border: 1px solid rgba(14, 42, 71, 0.14);
  border-radius: 16px;
  padding: 8px;
  background: #fbfdff;
}

.mind-chat-group-user {
  --mind-chat-accent-h: 214;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: hsl(var(--mind-chat-accent-h) 92% 97%);
  cursor: pointer;
}

.mind-chat-group-user:last-child {
  margin-bottom: 0;
}

.mind-chat-group-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: hsl(var(--mind-chat-accent-h) 70% 90%);
  color: hsl(var(--mind-chat-accent-h) 50% 26%);
  font-weight: 700;
}

.mind-chat-group-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mind-chat-group-user-copy {
  display: grid;
  gap: 2px;
}

.mind-chat-group-user-copy strong {
  color: #19324f;
}

.mind-chat-group-user-copy span {
  font-size: 12px;
  color: #607089;
}

.mind-chat-group-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.mind-chat-error,
.mind-chat-empty {
  font-size: 13px;
  color: #6b7280;
  padding: 10px 12px;
}

.mind-chat-page-card {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 18px;
  background: #ffffff;
  padding: 14px;
  width: min(1440px, calc(100vw - 36px));
  max-width: 100%;
}

.mind-chat-page-head h1 {
  margin: 0 0 4px;
}

.mind-chat-page-head p {
  margin: 0;
  color: #6b7280;
}

.mind-chat-shell--page {
  margin-top: 14px;
  min-height: 70vh;
  height: 70vh;
  max-height: 70vh;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  transition: width 0.22s ease, max-width 0.22s ease;
}

@media (min-width: 1025px) {
  .mind-chat-widget-panel.mind-chat-mobile-list-view {
    width: min(560px, calc(100vw - 32px));
  }

  .mind-chat-widget-panel.mind-chat-mobile-thread-view {
    width: min(920px, calc(100vw - 32px));
  }

  .mind-chat-shell--page {
    width: 100%;
    max-width: 100%;
  }

  .mind-chat-shell--page.mind-chat-mobile-list-view {
    width: min(620px, 100%);
    max-width: 620px;
  }

  .mind-chat-shell--page.mind-chat-mobile-thread-view {
    width: 100%;
    max-width: 100%;
  }
}

.mind-chat-thread-head-main {
  display: grid;
  gap: 4px;
}

.mind-chat-thread-head-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.mind-chat-thread-kind-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: rgba(15, 23, 42, 0.06);
  color: #526178;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.mind-chat-thread-kind-badge.is-client {
  background: rgba(47, 107, 221, 0.1);
  color: #1f4f8f;
  border-color: rgba(47, 107, 221, 0.18);
}

.mind-chat-thread-kind-badge.is-company {
  background: rgba(16, 185, 129, 0.1);
  color: #146c54;
  border-color: rgba(16, 185, 129, 0.18);
}

.mind-chat-thread-kind-badge.is-group {
  background: rgba(109, 40, 217, 0.1);
  color: #6d28d9;
  border-color: rgba(109, 40, 217, 0.16);
}

.mind-chat-thread-kind-badge.is-advisor {
  background: rgba(54, 95, 185, 0.1);
  color: #365fb9;
  border-color: rgba(54, 95, 185, 0.16);
}

.mind-chat-thread-kind-badge.is-neutral {
  background: rgba(15, 23, 42, 0.06);
  color: #526178;
  border-color: rgba(15, 23, 42, 0.08);
}

.mind-chat-thread-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: linear-gradient(180deg, #3f67be 0%, #2e56ac 100%);
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(18, 47, 102, 0.26);
  margin-right: 10px;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(24, 52, 106, 0.22);
  overflow: hidden;
}

.mind-chat-thread-avatar.has-image {
  padding: 0;
  background: #ffffff;
}

.mind-chat-thread-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mind-chat-thread-head-main span {
  font-size: 12px;
  color: #6f839e;
}

.mind-chat-shell--client .mind-chat-thread-row strong {
  color: #1f2f49;
}

.mind-chat-shell--client .mind-chat-thread-row p {
  color: #5e738f;
}

.mind-chat-bubble-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.mind-chat-bubble-row.is-outgoing {
  justify-content: flex-end;
}

.mind-chat-message-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid rgba(31, 60, 105, 0.18);
  color: #2a4a82;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.mind-chat-message-avatar.has-image {
  padding: 0;
  background: #ffffff;
}

.mind-chat-message-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mind-chat-shell--client.mind-chat-shell--single-thread {
  grid-template-columns: minmax(0, 1fr);
}

.mind-chat-shell--client.mind-chat-shell--single-thread .mind-chat-sidebar {
  display: none;
}

.client-portal-chat-page-card {
  min-height: 680px;
  height: calc(100vh - 150px);
  max-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.client-portal-chat-page-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.client-portal-chat-page-card .mind-chat-shell--page {
  flex: 1;
  min-height: 0;
  height: 100%;
  max-height: 100%;
}

.client-portal-chat-page-head h2 {
  margin: 0;
}

.client-portal-chat-page-head p {
  margin: 8px 0 0;
  color: #667d99;
  font-size: 14px;
}

.client-portal-chat-page-unread {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  background: #365fb9;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
}

.client-portal-chat-page-unread[hidden] {
  display: none !important;
}

@media (max-width: 1024px) {
  .mind-chat-widget {
    right: 8px;
    left: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
  }

  .mind-chat-widget-panel,
  .mind-chat-shell--page {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .mind-chat-widget-panel {
    height: min(78dvh, calc(100dvh - var(--mobile-header-offset, 156px) - 12px));
    max-height: min(78dvh, calc(100dvh - var(--mobile-header-offset, 156px) - 12px));
  }

  .mind-chat-widget-body,
  .mind-chat-shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(180px, 40%) minmax(0, 1fr);
  }

  .mind-chat-sidebar {
    border-right: 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    min-height: 0;
    max-height: none;
    display: flex;
    flex-direction: column;
  }

  .mind-chat-list {
    flex: 1 1 auto;
    min-height: 0;
  }

  .mind-chat-main {
    min-height: 0;
  }

  .mind-chat-composer {
    grid-template-columns: 1fr auto;
  }

  .mind-chat-file-state {
    grid-column: 1 / -1;
  }
}

@media (max-width: 767px) {
  .mind-chat-widget {
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
  }

  .mind-chat-widget-panel {
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }

  .mind-chat-widget-body {
    grid-template-rows: minmax(170px, 38%) minmax(0, 1fr);
  }

  .mind-chat-mobile-list-view .mind-chat-main {
    display: none;
  }

  .mind-chat-mobile-list-view .mind-chat-widget-body,
  .mind-chat-shell.mind-chat-mobile-list-view {
    grid-template-rows: minmax(0, 1fr);
  }

  .mind-chat-mobile-list-view .mind-chat-sidebar {
    display: flex;
    min-height: 0;
  }

  .mind-chat-mobile-thread-view .mind-chat-sidebar {
    display: none;
  }

  .mind-chat-mobile-thread-view .mind-chat-widget-body,
  .mind-chat-shell.mind-chat-mobile-thread-view {
    grid-template-rows: minmax(0, 1fr);
  }

  .mind-chat-mobile-thread-view .mind-chat-toolbar {
    display: none;
  }

  .mind-chat-mobile-thread-view .mind-chat-main {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    min-height: 0;
  }

  .mind-chat-widget-head,
  .mind-chat-thread-head {
    padding: 10px 12px;
  }

  .mind-chat-widget-actions [data-mind-chat-fullpage] {
    display: none;
  }

  .mind-chat-thread-head-main {
    min-width: 0;
    flex: 1 1 auto;
  }

  .mind-chat-thread-head-main strong,
  .mind-chat-thread-head-main span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mind-chat-back-button {
    flex-shrink: 0;
    min-height: 36px;
    padding: 6px 10px;
  }

  .mind-chat-sidebar {
    min-height: 0;
    max-height: none;
  }

  .mind-chat-messages {
    padding: 12px;
  }

  .mind-chat-bubble {
    max-width: min(92vw, 560px);
    padding: 9px 10px;
  }

  .mind-chat-composer {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "input attach"
      "state state"
      "send send";
    gap: 8px;
    padding: 10px;
  }

  .mind-chat-composer-input {
    grid-area: input;
    min-height: 40px;
  }

  .mind-chat-attach-button {
    grid-area: attach;
    min-height: 40px;
    padding-inline: 12px;
  }

  .mind-chat-file-state {
    grid-area: state;
    font-size: 11px;
    min-width: 0;
  }

  .mind-chat-composer [data-mind-chat-send] {
    grid-area: send;
    width: 100%;
    min-height: 42px;
  }
}

@media (max-width: 1024px) {
  .mind-chat-widget {
    left: auto;
    right: max(8px, env(safe-area-inset-right));
    display: flex;
    justify-content: flex-end;
    width: auto;
  }
}

@media (max-width: 767px) {
  .mind-chat-widget {
    left: auto;
    right: max(8px, env(safe-area-inset-right));
    bottom: max(8px, env(safe-area-inset-bottom));
    top: auto;
    display: flex;
    justify-content: flex-end;
    width: calc(100vw - 16px);
    padding-left: 0;
    padding-right: 0;
    pointer-events: none;
  }

  .mind-chat-widget > .mind-chat-pill {
    pointer-events: auto;
  }
}

@media (max-width: 900px) {
  .header-search-list {
    position: fixed;
    left: 10px;
    right: 10px;
    top: calc(var(--mobile-header-offset, 156px) + 8px);
    max-height: min(52dvh, 380px);
    z-index: 1500;
  }

  .header-notifications-menu {
    position: fixed;
    left: 10px;
    right: 10px;
    top: calc(var(--mobile-header-offset, 156px) + 8px);
    width: auto;
    max-width: none;
    max-height: min(68dvh, 520px);
    z-index: 1500;
  }
}
