/* TheaCRM v2.8.424 – UI foundation / mobile layout guard
   Bez přepisu šablon: společné třídy, bezpečné mobilní odsazení a ochrana
   proti překryvu spodní mobilní lišty s tlačítky/formuláři + fullscreen režim rychlého záchytu úkolu. */
:root{
  --thea-ui-bg:#f6f8f7;
  --thea-ui-surface:#fff;
  --thea-ui-border:rgba(16,24,40,.10);
  --thea-ui-text:#182230;
  --thea-ui-muted:#667085;
  --thea-ui-primary:#198754;
  --thea-ui-primary-soft:rgba(25,135,84,.10);
  --thea-ui-radius:18px;
  --thea-ui-radius-sm:14px;
  --thea-ui-shadow:0 12px 30px rgba(16,24,40,.07);
  --thea-ui-safe-bottom:calc(var(--thea-mobile-bottom-nav-height,70px) + env(safe-area-inset-bottom,0px));
}

.thea-ui-page,
.thea-page,
.thea-work-page,
.thea-directory-page{
  color:var(--thea-ui-text);
}

.thea-ui-card,
.thea-card,
.thea-work-card,
.thea-page .card,
.thea-work-page .card,
.thea-directory-page .card{
  border-color:var(--thea-ui-border) !important;
  border-radius:var(--thea-ui-radius) !important;
}

.thea-ui-title,
.thea-page h1,
.thea-work-page h1,
.thea-directory-page h1{
  letter-spacing:-.025em;
}

.thea-ui-muted,
.thea-page .text-muted,
.thea-work-page .text-muted,
.thea-directory-page .text-muted{
  color:var(--thea-ui-muted) !important;
}

.thea-ui-actions,
.thea-form-actions,
.thea-page-actions,
.thea-detail-actions,
.form-actions,
.action-buttons,
.actions-row{
  display:flex;
  align-items:center;
  gap:.55rem;
  flex-wrap:wrap;
}

.thea-sticky-actions,
.thea-toolbar-sticky,
.thea-mobile-sticky-actions{
  position:sticky;
  bottom:0;
  z-index:20;
  background:rgba(255,255,255,.92);
  border:1px solid var(--thea-ui-border);
  border-radius:var(--thea-ui-radius);
  padding:.75rem;
  box-shadow:0 -10px 28px rgba(16,24,40,.10);
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
}

.thea-ui-chip{
  display:inline-flex;
  align-items:center;
  gap:.35rem;
  border:1px solid var(--thea-ui-border);
  background:#fff;
  color:#344054;
  border-radius:999px;
  padding:.25rem .55rem;
  font-size:.84rem;
  font-weight:700;
}

.thea-ui-scroll-x,
.thea-table-scroll,
.table-responsive{
  -webkit-overflow-scrolling:touch;
}

.thea-ui-break,
.thea-card,
.thea-page,
.thea-work-page,
.thea-directory-page{
  overflow-wrap:anywhere;
}

@media (max-width:767.98px){
  html,body{overflow-x:hidden;}

  /* Jedno místo pro bezpečný spodní prostor. mobile-bottom-nav.css přidává základ,
     zde jistíme stránky s vlastními wrappery a staršími šablonami. */
  body.thea-has-mobile-bottom-nav:not(.thea-mobile-bottom-nav-disabled){
    padding-bottom:var(--thea-ui-safe-bottom) !important;
  }

  body.thea-has-mobile-bottom-nav:not(.thea-mobile-bottom-nav-disabled) .content,
  body.thea-has-mobile-bottom-nav:not(.thea-mobile-bottom-nav-disabled) main.content,
  body.thea-has-mobile-bottom-nav:not(.thea-mobile-bottom-nav-disabled) .main-content,
  body.thea-has-mobile-bottom-nav:not(.thea-mobile-bottom-nav-disabled) .page-content,
  body.thea-has-mobile-bottom-nav:not(.thea-mobile-bottom-nav-disabled) .app-content,
  body.thea-has-mobile-bottom-nav:not(.thea-mobile-bottom-nav-disabled) #content,
  body.thea-has-mobile-bottom-nav:not(.thea-mobile-bottom-nav-disabled) .thea-content{
    padding-bottom:calc(var(--thea-ui-safe-bottom) + 20px) !important;
  }

  body.thea-mobile-bottom-nav-disabled,
  body.thea-mobile-bottom-nav-disabled.thea-has-mobile-bottom-nav{
    padding-bottom:0 !important;
  }

  body.thea-mobile-bottom-nav-disabled .thea-mobile-bottom-nav,
  body.thea-mobile-bottom-nav-disabled .thea-mobile-quick-add-backdrop{
    display:none !important;
    visibility:hidden !important;
    pointer-events:none !important;
  }

  .thea-page,
  .thea-work-page,
  .thea-directory-page,
  .thea-list-page,
  .responsive-container{
    width:100% !important;
    max-width:100% !important;
  }

  .thea-page > .bg-white,
  .thea-work-page > .bg-white,
  .thea-directory-page > .bg-white,
  .thea-page > .thea-card,
  .thea-work-page > .thea-card,
  .thea-directory-page > .thea-card{
    margin-left:0 !important;
    margin-right:0 !important;
  }

  .thea-ui-actions,
  .thea-form-actions,
  .thea-page-actions,
  .thea-detail-actions,
  .form-actions,
  .action-buttons,
  .actions-row,
  .btn-toolbar{
    gap:.45rem;
  }

  .thea-ui-actions > .btn,
  .thea-form-actions > .btn,
  .thea-page-actions > .btn,
  .thea-detail-actions > .btn,
  .form-actions > .btn,
  .action-buttons > .btn{
    min-height:42px;
  }

  /* Nejčastější zdroj překryvů: sticky/fixed submit/toolbar dole. */
  body.thea-has-mobile-bottom-nav:not(.thea-mobile-bottom-nav-disabled) .thea-sticky-actions,
  body.thea-has-mobile-bottom-nav:not(.thea-mobile-bottom-nav-disabled) .thea-toolbar-sticky,
  body.thea-has-mobile-bottom-nav:not(.thea-mobile-bottom-nav-disabled) .thea-mobile-sticky-actions,
  body.thea-has-mobile-bottom-nav:not(.thea-mobile-bottom-nav-disabled) .compose-actions,
  body.thea-has-mobile-bottom-nav:not(.thea-mobile-bottom-nav-disabled) .email-compose-actions,
  body.thea-has-mobile-bottom-nav:not(.thea-mobile-bottom-nav-disabled) .mobile-sticky-actions,
  body.thea-has-mobile-bottom-nav:not(.thea-mobile-bottom-nav-disabled) .sticky-bottom-actions{
    bottom:calc(var(--thea-mobile-bottom-nav-height,70px) + env(safe-area-inset-bottom,0px) + 10px) !important;
  }

  body.thea-mobile-bottom-nav-disabled .thea-sticky-actions,
  body.thea-mobile-bottom-nav-disabled .thea-toolbar-sticky,
  body.thea-mobile-bottom-nav-disabled .thea-mobile-sticky-actions,
  body.thea-mobile-bottom-nav-disabled .compose-actions,
  body.thea-mobile-bottom-nav-disabled .email-compose-actions,
  body.thea-mobile-bottom-nav-disabled .mobile-sticky-actions,
  body.thea-mobile-bottom-nav-disabled .sticky-bottom-actions{
    bottom:calc(env(safe-area-inset-bottom,0px) + 10px) !important;
  }

  .modal-footer,
  .offcanvas-footer{
    padding-bottom:calc(1rem + env(safe-area-inset-bottom,0px));
  }

  .table-responsive{
    border-radius:var(--thea-ui-radius-sm);
  }

  .table-responsive table{
    min-width:max-content;
  }

  .btn,
  .form-control,
  .form-select{
    min-height:40px;
  }

  .input-group > .btn{
    min-height:40px;
  }

  .dropdown-menu{
    max-width:calc(100vw - 18px);
  }

  .thea-mobile-hide{display:none !important;}
  .thea-mobile-full{width:100% !important;}
  .thea-mobile-stack{display:flex !important; flex-direction:column !important; align-items:stretch !important;}
  .thea-mobile-safe-bottom{padding-bottom:calc(var(--thea-ui-safe-bottom) + 16px) !important;}
}

@media (min-width:768px){
  .thea-desktop-hide{display:none !important;}
}

@media (prefers-color-scheme:dark){
  :root{
    --thea-ui-bg:#0f131b;
    --thea-ui-surface:#161a24;
    --thea-ui-border:#2a2f3a;
    --thea-ui-text:#e9ecef;
    --thea-ui-muted:#aab4c2;
    --thea-ui-primary-soft:rgba(158,230,182,.10);
    --thea-ui-shadow:0 12px 30px rgba(0,0,0,.28);
  }

  .thea-sticky-actions,
  .thea-toolbar-sticky,
  .thea-mobile-sticky-actions{
    background:rgba(22,26,36,.92);
  }

  .thea-ui-chip{background:#161a24;color:#e9ecef;border-color:#2a2f3a;}
}


/* TheaCRM v2.8.411 – directory list polish (contacts/organizations without template rewrite) */
.thea-directory-list .appbar{
  border-bottom:1px solid var(--thea-ui-border) !important;
}
.thea-directory-list .organization-card{
  border-color:var(--thea-ui-border) !important;
  border-radius:var(--thea-ui-radius-sm) !important;
  background:var(--thea-ui-surface);
  box-shadow:0 1px 3px rgba(16,24,40,.04);
}
.thea-directory-list .organization-card:hover{
  background:linear-gradient(135deg, #fff, #f7fff8) !important;
  border-color:rgba(25,135,84,.25) !important;
}
.thea-directory-list .alpha-rail{
  bottom:calc(var(--thea-mobile-bottom-nav-height,70px) + env(safe-area-inset-bottom,0px) + 8px) !important;
}
.thea-directory-list .alpha-btn{
  min-width:28px;
  text-align:center;
  font-weight:800;
}
@media (max-width:767.98px){
  .thea-directory-list .thea-card,
  .thea-directory-list > .bg-white{
    padding:.9rem !important;
    border-radius:0 !important;
    box-shadow:none !important;
  }
  .thea-directory-list .appbar{
    top:0;
    padding:.35rem 0 .45rem !important;
    margin-bottom:.55rem !important;
  }
  .thea-directory-list .appbar h2{
    font-size:1.45rem;
  }
  .thea-directory-list .organization-card{
    margin-right:36px;
    padding:.82rem .88rem !important;
  }
}

/* TheaCRM v2.8.411 – quick task capture modal on mobile.
   Rychlé nadiktování úkolu je pracovní fullscreen obrazovka. Na telefonu nesmí
   být vidět horní base lišta ani spodní rychlá lišta, jinak se dialog překrývá. */
html.thea-task-capture-modal-open,
body.thea-task-capture-modal-open{
  overflow:hidden !important;
  height:100dvh !important;
}
body.thea-task-capture-modal-open{
  padding-bottom:0 !important;
}
body.thea-task-capture-modal-open .header,
body.thea-task-capture-modal-open .sidebar,
body.thea-task-capture-modal-open .thea-mobile-bottom-nav,
body.thea-task-capture-modal-open .thea-mobile-quick-add-backdrop{
  display:none !important;
  visibility:hidden !important;
  pointer-events:none !important;
}
body.thea-task-capture-modal-open .content,
body.thea-task-capture-modal-open main.content,
body.thea-task-capture-modal-open .main-content{
  padding-top:0 !important;
  padding-bottom:0 !important;
}
#quickTaskCaptureModal{
  z-index:2147482100 !important;
}
.modal-backdrop:has(+ #quickTaskCaptureModal),
body.thea-task-capture-modal-open .modal-backdrop{
  z-index:2147482000 !important;
}
@media (max-width:767.98px){
  #quickTaskCaptureModal.modal.show{
    position:fixed !important;
    inset:0 !important;
    display:block !important;
    width:100vw !important;
    height:100dvh !important;
    padding:0 !important;
    overflow:hidden !important;
    background:var(--thea-ui-bg);
  }
  #quickTaskCaptureModal .modal-dialog{
    width:100vw !important;
    max-width:100vw !important;
    height:100dvh !important;
    min-height:100dvh !important;
    margin:0 !important;
    transform:none !important;
  }
  #quickTaskCaptureModal .modal-content{
    width:100vw !important;
    height:100dvh !important;
    min-height:100dvh !important;
    max-height:100dvh !important;
    border:0 !important;
    border-radius:0 !important;
    display:flex !important;
    flex-direction:column !important;
    overflow:hidden !important;
    background:var(--thea-ui-surface) !important;
  }
  #quickTaskCaptureModal form{
    min-height:0 !important;
    height:100% !important;
    display:flex !important;
    flex-direction:column !important;
  }
  #quickTaskCaptureModal .modal-header{
    flex:0 0 auto;
    padding:.85rem .95rem !important;
    border-bottom:1px solid var(--thea-ui-border) !important;
    background:var(--thea-ui-surface) !important;
  }
  #quickTaskCaptureModal .modal-title{
    font-size:1.05rem !important;
    font-weight:900 !important;
  }
  #quickTaskCaptureModal .modal-body{
    flex:1 1 auto;
    min-height:0;
    overflow-y:auto;
    -webkit-overflow-scrolling:touch;
    padding:.9rem .95rem !important;
  }
  #quickTaskCaptureModal textarea[name="raw_note"]{
    min-height:38dvh !important;
    height:42dvh !important;
    max-height:50dvh !important;
    font-size:1rem !important;
    line-height:1.35 !important;
    resize:vertical;
  }
  #quickTaskCaptureModal .modal-footer{
    flex:0 0 auto;
    display:grid !important;
    grid-template-columns:1fr 1fr;
    gap:.55rem;
    padding:.72rem .95rem calc(.72rem + env(safe-area-inset-bottom,0px)) !important;
    border-top:1px solid var(--thea-ui-border) !important;
    background:var(--thea-ui-surface) !important;
  }
  #quickTaskCaptureModal .modal-footer .btn{
    width:100%;
    min-height:46px;
    margin:0 !important;
  }
}
@media (prefers-color-scheme:dark){
  .thea-directory-list .organization-card:hover{background:#18251f !important;}
  #quickTaskCaptureModal.modal.show{background:var(--thea-ui-bg);}
}


/* TheaCRM v2.8.411 – work modules polish (tasks / reports / projects / forms)
   Cíl: sjednocení bez velkého přepisu šablon. Řeší karty, formuláře, mobilní
   mezery a akční tlačítka tak, aby nelezla pod spodní lištu. */
.thea-work-page .bg-white.rounded.shadow-sm,
.thea-projects-page .bg-white.rounded.shadow-sm,
.thea-tasks-page .bg-white.rounded.shadow-sm,
.thea-files-page .bg-white.rounded.shadow-sm{
  border:1px solid var(--thea-ui-border);
  box-shadow:var(--thea-ui-shadow) !important;
}
.thea-work-page h1,
.thea-work-page h2,
.thea-work-page .page-title,
.thea-work-page .project-page-title{
  color:#1f5f34 !important;
  font-weight:900;
  letter-spacing:-.035em;
}
.thea-work-page .form-label{
  font-weight:700;
  color:#344054;
}
.thea-work-page .form-text,
.thea-work-page .small.text-muted{
  color:var(--thea-ui-muted) !important;
}
.thea-work-page .form-control,
.thea-work-page .form-select{
  border-color:var(--thea-ui-border);
  border-radius:13px;
}
.thea-work-page .form-control:focus,
.thea-work-page .form-select:focus{
  border-color:rgba(25,135,84,.52);
  box-shadow:0 0 0 .22rem rgba(25,135,84,.13);
}
.thea-work-page textarea.form-control{
  line-height:1.45;
}
.thea-work-page .btn{
  border-radius:12px;
  font-weight:700;
}
.thea-task-form-actions,
.thea-project-form-actions{
  display:flex;
  justify-content:flex-end;
  gap:.55rem;
  flex-wrap:wrap;
  margin-top:1rem;
}
.thea-report-form-card,
.task-report-card,
.report-detail-card,
.project-command-center,
.project-command-tile,
.project-tab-content .card,
.thea-project-clean-card{
  border-color:var(--thea-ui-border) !important;
}
.project-command-tile,
.task-row,
.task-card,
.report-attachment-card{
  transition:background .16s ease,border-color .16s ease,box-shadow .16s ease,transform .16s ease;
}
.project-command-tile:hover,
.report-attachment-card:hover{
  border-color:rgba(25,135,84,.24) !important;
  box-shadow:0 8px 22px rgba(16,24,40,.08);
}
.thea-work-page .input-group .btn{
  border-radius:12px;
}
.thea-work-page .badge{
  border-radius:999px;
}

@media (max-width:767.98px){
  .thea-work-page,
  .thea-projects-page,
  .thea-tasks-page,
  .thea-files-page{
    padding-left:.55rem !important;
    padding-right:.55rem !important;
  }
  .thea-work-page > .bg-white,
  .thea-work-page .thea-card,
  .thea-work-card,
  .thea-project-clean-card{
    border-radius:18px !important;
    padding:1rem !important;
  }
  .thea-work-page h1,
  .thea-work-page h2,
  .thea-work-page .project-page-title{
    font-size:1.45rem !important;
    line-height:1.12;
    margin-bottom:.85rem !important;
  }
  .thea-work-page .row.g-3,
  .thea-work-page .row.g-2{
    --bs-gutter-x:.65rem;
    --bs-gutter-y:.75rem;
  }
  .thea-work-page form .mb-3{
    margin-bottom:.9rem !important;
  }
  .thea-work-page .form-control,
  .thea-work-page .form-select{
    min-height:44px;
    font-size:16px; /* mobilní prohlížeče nezvětšují input */
  }
  .thea-work-page textarea.form-control{
    min-height:112px;
  }
  .thea-task-form-actions,
  .thea-project-form-actions,
  .thea-work-page form > .text-end,
  .thea-work-page .form-actions,
  .thea-work-page .actions-row{
    position:sticky;
    bottom:calc(var(--thea-mobile-bottom-nav-height,70px) + env(safe-area-inset-bottom,0px) + 10px);
    z-index:18;
    display:grid !important;
    grid-template-columns:1fr;
    gap:.5rem;
    background:rgba(255,255,255,.94);
    border:1px solid var(--thea-ui-border);
    border-radius:18px;
    padding:.65rem;
    margin-left:-.15rem;
    margin-right:-.15rem;
    box-shadow:0 -10px 24px rgba(16,24,40,.10);
    backdrop-filter:blur(12px);
    -webkit-backdrop-filter:blur(12px);
  }
  body.thea-mobile-bottom-nav-disabled .thea-task-form-actions,
  body.thea-mobile-bottom-nav-disabled .thea-project-form-actions,
  body.thea-mobile-bottom-nav-disabled .thea-work-page form > .text-end,
  body.thea-mobile-bottom-nav-disabled .thea-work-page .form-actions,
  body.thea-mobile-bottom-nav-disabled .thea-work-page .actions-row{
    bottom:calc(env(safe-area-inset-bottom,0px) + 10px);
  }
  .thea-task-form-actions .btn,
  .thea-project-form-actions .btn,
  .thea-work-page form > .text-end .btn,
  .thea-work-page .form-actions .btn,
  .thea-work-page .actions-row .btn{
    width:100%;
    min-height:46px;
    margin:0 !important;
  }
  .project-command-center{
    margin-left:-.25rem;
    margin-right:-.25rem;
    padding:.85rem !important;
    border-radius:20px !important;
  }
  .project-command-actions{
    display:grid !important;
    grid-template-columns:1fr 1fr;
    width:100%;
    gap:.5rem !important;
  }
  .project-command-actions .btn{
    width:100%;
    white-space:normal;
    min-height:42px;
  }
  .project-command-tiles{
    --bs-gutter-x:.5rem;
    --bs-gutter-y:.5rem;
  }
  .project-command-tile{
    padding:.72rem !important;
    border-radius:15px !important;
    min-height:76px;
  }
  .tasks-table-responsive,
  .table-responsive{
    margin-left:-.35rem;
    margin-right:-.35rem;
    width:calc(100% + .7rem);
  }
  .report-gallery-grid{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }
  .report-detail-page,
  .task-report-page{
    padding-bottom:calc(var(--thea-ui-safe-bottom) + 24px) !important;
  }
}

@media (prefers-color-scheme:dark){
  .thea-work-page .bg-white.rounded.shadow-sm,
  .thea-projects-page .bg-white.rounded.shadow-sm,
  .thea-tasks-page .bg-white.rounded.shadow-sm,
  .thea-files-page .bg-white.rounded.shadow-sm,
  .thea-task-form-actions,
  .thea-project-form-actions{
    background:#161a24 !important;
    border-color:#2a2f3a !important;
  }
  .thea-work-page .form-label{color:#e9ecef;}
  .thea-work-page h1,
  .thea-work-page h2,
  .thea-work-page .project-page-title{color:#9ee6b6 !important;}
}

/* TheaCRM v2.8.411 – invoices / offers / files UI polish
   Bez přepisu šablon: sjednocujeme dokladové seznamy, formuláře a detailní akce
   přes existující třídy a body marker z thea-ui-foundation.js. */
body.thea-doc-ui-page .responsive-container,
body.thea-doc-ui-page .files-list-wrap,
body.thea-doc-ui-page .files-form-wrap,
body.thea-doc-ui-page .files-detail-wrap{
  width:min(1180px, 100%);
}
body.thea-doc-ui-page .bg-white.rounded.shadow-sm,
body.thea-doc-ui-page .thea-card{
  border:1px solid var(--thea-ui-border) !important;
  box-shadow:var(--thea-ui-shadow) !important;
}
body.thea-doc-ui-page h1,
body.thea-doc-ui-page h2,
body.thea-doc-ui-page .files-title,
body.thea-doc-ui-page .files-form-title{
  color:#1f5f34 !important;
  font-weight:900 !important;
  letter-spacing:-.035em;
}
body.thea-doc-ui-page .thea-document-toolbar,
body.thea-doc-ui-page .files-header,
body.thea-doc-ui-page .files-form-wrap .d-flex.justify-content-between,
body.thea-doc-ui-page .files-detail-wrap > .bg-white > .d-flex:first-child{
  gap:.75rem;
}
body.thea-doc-ui-page .summary-card,
body.thea-doc-ui-page .invoice-card,
body.thea-doc-ui-page .offer-card,
body.thea-doc-ui-page .files-list-card,
body.thea-doc-ui-page .files-detail-wrap .bg-white,
body.thea-doc-ui-page .files-bulk-tools,
body.thea-doc-ui-page .files-selected-card,
body.thea-doc-ui-page .files-drop-zone{
  border-color:var(--thea-ui-border) !important;
  border-radius:var(--thea-ui-radius-sm) !important;
}
body.thea-doc-ui-page .summary-card,
body.thea-doc-ui-page .files-bulk-tools,
body.thea-doc-ui-page .files-drop-zone{
  background:linear-gradient(135deg,#fff,#f8fbf8) !important;
}
body.thea-doc-ui-page .summary-value,
body.thea-doc-ui-page .files-title,
body.thea-doc-ui-page .files-form-title{
  font-variant-numeric:tabular-nums;
}
body.thea-doc-ui-page .invoice-card,
body.thea-doc-ui-page .offer-card,
body.thea-doc-ui-page .files-list-card{
  transition:background .16s ease,border-color .16s ease,box-shadow .16s ease,transform .16s ease;
}
body.thea-doc-ui-page .invoice-card:hover,
body.thea-doc-ui-page .offer-card:hover,
body.thea-doc-ui-page .files-list-card:hover{
  box-shadow:0 10px 26px rgba(16,24,40,.09) !important;
}
body.thea-doc-ui-page .form-label{
  font-weight:700;
  color:#344054;
}
body.thea-doc-ui-page .form-text,
body.thea-doc-ui-page .small.text-muted,
body.thea-doc-ui-page .summary-label,
body.thea-doc-ui-page .files-meta,
body.thea-doc-ui-page .files-meta-line strong{
  color:var(--thea-ui-muted) !important;
}
body.thea-doc-ui-page .form-control,
body.thea-doc-ui-page .form-select,
body.thea-doc-ui-page .input-group-text{
  border-color:var(--thea-ui-border);
  border-radius:13px;
}
body.thea-doc-ui-page .form-control:focus,
body.thea-doc-ui-page .form-select:focus{
  border-color:rgba(25,135,84,.52);
  box-shadow:0 0 0 .22rem rgba(25,135,84,.13);
}
body.thea-doc-ui-page .btn{
  border-radius:12px;
  font-weight:700;
}
body.thea-doc-ui-page .btn-ghost{
  border-radius:999px !important;
}
body.thea-doc-ui-page .badge,
body.thea-doc-ui-page .files-pill,
body.thea-doc-ui-page .files-type-badge{
  border-radius:999px !important;
  font-weight:800;
}
body.thea-doc-ui-page .table{
  vertical-align:middle;
}
body.thea-doc-ui-page .table thead th{
  color:#344054;
  font-size:.82rem;
  letter-spacing:.01em;
  text-transform:uppercase;
}
body.thea-doc-ui-page .table td,
body.thea-doc-ui-page .table th{
  border-color:rgba(16,24,40,.08);
}
body.thea-doc-ui-page .offcanvas{
  border-color:var(--thea-ui-border);
}
body.thea-doc-ui-page .dropdown-menu{
  border-color:var(--thea-ui-border);
  border-radius:14px;
  box-shadow:0 12px 34px rgba(16,24,40,.14);
}
body.thea-doc-ui-page .files-actions,
body.thea-doc-ui-page .files-detail-actions,
body.thea-doc-ui-page .thea-ui-document-actions{
  gap:.45rem;
}

@media (max-width:767.98px){
  body.thea-doc-ui-page .responsive-container,
  body.thea-doc-ui-page .files-list-wrap,
  body.thea-doc-ui-page .files-form-wrap,
  body.thea-doc-ui-page .files-detail-wrap{
    width:100% !important;
    max-width:100% !important;
    padding-left:.55rem !important;
    padding-right:.55rem !important;
  }
  body.thea-doc-ui-page .bg-white.rounded.shadow-sm,
  body.thea-doc-ui-page .thea-card,
  body.thea-doc-ui-page .files-list-wrap > .bg-white,
  body.thea-doc-ui-page .files-form-wrap > .bg-white,
  body.thea-doc-ui-page .files-detail-wrap > .bg-white{
    padding:1rem !important;
    border-radius:18px !important;
  }
  body.thea-doc-ui-page h1,
  body.thea-doc-ui-page h2,
  body.thea-doc-ui-page .files-title,
  body.thea-doc-ui-page .files-form-title{
    font-size:1.38rem !important;
    line-height:1.12;
    margin-bottom:.45rem !important;
  }
  body.thea-doc-ui-page .thea-document-toolbar,
  body.thea-doc-ui-page .files-header,
  body.thea-doc-ui-page .files-detail-wrap > .bg-white > .d-flex:first-child,
  body.thea-doc-ui-page .files-form-wrap > .bg-white > .d-flex:first-child{
    align-items:flex-start !important;
  }
  body.thea-doc-ui-page .thea-document-toolbar h2,
  body.thea-doc-ui-page .files-header h2,
  body.thea-doc-ui-page .files-detail-wrap h2{
    overflow:hidden;
    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
  }
  body.thea-doc-ui-page .row.g-3,
  body.thea-doc-ui-page .row.g-2{
    --bs-gutter-x:.65rem;
    --bs-gutter-y:.75rem;
  }
  body.thea-doc-ui-page .summary-card{
    padding:.72rem .85rem !important;
  }
  body.thea-doc-ui-page .summary-value{
    font-size:1.08rem !important;
  }
  body.thea-doc-ui-page .invoice-card,
  body.thea-doc-ui-page .offer-card,
  body.thea-doc-ui-page .files-list-card{
    padding:.9rem !important;
    margin-bottom:.72rem !important;
  }
  body.thea-doc-ui-page .invoice-card .d-flex.justify-content-between,
  body.thea-doc-ui-page .offer-card .d-flex.justify-content-between,
  body.thea-doc-ui-page .files-list-card .d-flex.justify-content-between{
    gap:.55rem;
  }
  body.thea-doc-ui-page .form-control,
  body.thea-doc-ui-page .form-select{
    min-height:44px;
    font-size:16px;
  }
  body.thea-doc-ui-page textarea.form-control{
    min-height:108px;
  }
  body.thea-doc-ui-page .table-responsive{
    margin-left:-.35rem;
    margin-right:-.35rem;
    width:calc(100% + .7rem);
  }
  body.thea-doc-ui-page .files-filter-grid,
  body.thea-doc-ui-page .files-filter-grid-secondary{
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:.55rem !important;
  }
  body.thea-doc-ui-page .files-actions{
    display:flex !important;
    flex-wrap:wrap;
    justify-content:flex-end;
    min-width:0 !important;
  }
  body.thea-doc-ui-page .files-actions .btn-ghost{
    width:42px;
    height:42px;
  }
  body.thea-doc-ui-page .files-detail-actions{
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:.5rem !important;
  }
  body.thea-doc-ui-page .files-detail-actions .btn,
  body.thea-doc-ui-page .files-detail-actions form,
  body.thea-doc-ui-page .files-detail-actions form .btn{
    width:100% !important;
  }
  body.thea-doc-ui-page .thea-doc-form-actions,
  body.thea-doc-ui-page form > .mt-4.d-flex.gap-2,
  body.thea-doc-ui-page form > .d-flex.gap-2.mt-4{
    position:sticky;
    bottom:calc(var(--thea-mobile-bottom-nav-height,70px) + env(safe-area-inset-bottom,0px) + 10px);
    z-index:18;
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:.5rem !important;
    background:rgba(255,255,255,.94);
    border:1px solid var(--thea-ui-border);
    border-radius:18px;
    padding:.65rem;
    margin-left:-.15rem;
    margin-right:-.15rem;
    box-shadow:0 -10px 24px rgba(16,24,40,.10);
    backdrop-filter:blur(12px);
    -webkit-backdrop-filter:blur(12px);
  }
  body.thea-mobile-bottom-nav-disabled.thea-doc-ui-page .thea-doc-form-actions,
  body.thea-mobile-bottom-nav-disabled.thea-doc-ui-page form > .mt-4.d-flex.gap-2,
  body.thea-mobile-bottom-nav-disabled.thea-doc-ui-page form > .d-flex.gap-2.mt-4{
    bottom:calc(env(safe-area-inset-bottom,0px) + 10px);
  }
  body.thea-doc-ui-page .thea-doc-form-actions .btn,
  body.thea-doc-ui-page form > .mt-4.d-flex.gap-2 .btn,
  body.thea-doc-ui-page form > .d-flex.gap-2.mt-4 .btn,
  body.thea-doc-ui-page form > .mt-4.d-flex.gap-2 form,
  body.thea-doc-ui-page form > .d-flex.gap-2.mt-4 form{
    width:100% !important;
    min-height:46px;
    margin:0 !important;
  }
  body.thea-doc-ui-page .offcanvas.offcanvas-end,
  body.thea-doc-ui-page .offcanvas.offcanvas-bottom{
    max-width:100vw !important;
    border-radius:18px 18px 0 0;
  }
  body.thea-doc-ui-page .offcanvas-body{
    padding-bottom:calc(var(--thea-ui-safe-bottom) + 16px) !important;
  }
  body.thea-doc-ui-page .pagination{
    flex-wrap:wrap;
    justify-content:center;
    gap:.25rem;
  }
}

@media (prefers-color-scheme:dark){
  body.thea-doc-ui-page .bg-white.rounded.shadow-sm,
  body.thea-doc-ui-page .thea-card,
  body.thea-doc-ui-page .summary-card,
  body.thea-doc-ui-page .invoice-card,
  body.thea-doc-ui-page .offer-card,
  body.thea-doc-ui-page .files-list-card,
  body.thea-doc-ui-page .files-bulk-tools,
  body.thea-doc-ui-page .files-drop-zone,
  body.thea-doc-ui-page .thea-doc-form-actions,
  body.thea-doc-ui-page form > .mt-4.d-flex.gap-2,
  body.thea-doc-ui-page form > .d-flex.gap-2.mt-4{
    background:#161a24 !important;
    border-color:#2a2f3a !important;
  }
  body.thea-doc-ui-page h1,
  body.thea-doc-ui-page h2,
  body.thea-doc-ui-page .files-title,
  body.thea-doc-ui-page .files-form-title{color:#9ee6b6 !important;}
  body.thea-doc-ui-page .form-label{color:#e9ecef;}
  body.thea-doc-ui-page .dropdown-menu{background:#161a24;border-color:#2a2f3a;}
}

/* TheaCRM v2.8.411 – customer portal + email UI polish */
.thea-client-ui-page,
.thea-email-ui-page,
.thea-email-accounts-ui-page{
  color:var(--thea-ui-text);
}

/* Customer portal: sjednocení bez přepisu šablon. */
.thea-client-ui-page .client-card,
.thea-client-ui-page .client-list-item,
.thea-client-ui-page .client-stat,
.thea-client-ui-page .client-alert,
.thea-client-ui-page .client-action-card{
  border-color:var(--thea-ui-border) !important;
  border-radius:var(--thea-ui-radius) !important;
  box-shadow:0 10px 28px rgba(16,24,40,.06);
}
.thea-client-ui-page .client-list-title,
.thea-client-ui-page h1,
.thea-client-ui-page h2,
.thea-client-ui-page .client-section-title{
  letter-spacing:-.022em;
}
.thea-client-ui-page .client-actions,
.thea-client-ui-page .client-toolbar,
.thea-client-ui-page .client-form-actions{
  display:flex;
  align-items:center;
  gap:.55rem;
  flex-wrap:wrap;
}
.thea-client-ui-page .client-muted,
.thea-client-ui-page .text-muted{
  color:var(--thea-ui-muted) !important;
}
.thea-client-ui-page .table-client,
.thea-client-ui-page .table{
  border-color:var(--thea-ui-border);
}
.thea-client-ui-page .form-control,
.thea-client-ui-page .form-select{
  border-color:var(--thea-ui-border);
}
.thea-client-ui-page .form-control:focus,
.thea-client-ui-page .form-select:focus{
  border-color:rgba(25,135,84,.65);
  box-shadow:0 0 0 .2rem rgba(25,135,84,.12);
}

/* E-mailový klient: sjednocení containerů a mobilních akcí. */
.thea-email-ui-page .email-app-container,
.thea-email-ui-page .email-layout,
.thea-email-ui-page .email-main,
.thea-email-ui-page .email-detail,
.thea-email-ui-page .email-list,
.thea-email-ui-page .email-compose,
.thea-email-ui-page .email-card,
.thea-email-accounts-ui-page .card,
.thea-email-accounts-ui-page .table-responsive{
  border-color:var(--thea-ui-border) !important;
  border-radius:var(--thea-ui-radius) !important;
}
.thea-email-ui-page .email-toolbar,
.thea-email-ui-page .message-actions,
.thea-email-ui-page #message-actions,
.thea-email-ui-page .email-compose-actions,
.thea-email-ui-page .email-detail-actions,
.thea-email-accounts-ui-page .page-actions{
  display:flex;
  align-items:center;
  gap:.5rem;
  flex-wrap:wrap;
}
.thea-email-ui-page .email-toolbar .btn,
.thea-email-ui-page #message-actions .btn,
.thea-email-ui-page .message-actions .btn{
  min-height:38px;
}
.thea-email-ui-page .email-subject,
.thea-email-ui-page .message-subject,
.thea-email-ui-page h1,
.thea-email-ui-page h2{
  letter-spacing:-.022em;
}
.thea-email-ui-page .email-attachment,
.thea-email-ui-page .attachment-chip,
.thea-email-ui-page .attachment-card{
  border-color:var(--thea-ui-border) !important;
  border-radius:var(--thea-ui-radius-sm) !important;
}

@media (max-width:767.98px){
  .thea-client-ui-page .container,
  .thea-client-ui-page .container-fluid,
  .thea-client-ui-page main,
  .thea-client-ui-page .client-main{
    width:100% !important;
    max-width:100% !important;
    padding-left:.75rem !important;
    padding-right:.75rem !important;
    padding-bottom:calc(var(--thea-ui-safe-bottom) + 18px) !important;
  }
  .thea-client-ui-page .client-card{
    padding:1rem !important;
  }
  .thea-client-ui-page .client-actions,
  .thea-client-ui-page .client-toolbar,
  .thea-client-ui-page .client-form-actions{
    align-items:stretch;
  }
  .thea-client-ui-page .client-actions > .btn,
  .thea-client-ui-page .client-actions > a.btn,
  .thea-client-ui-page .client-toolbar > .btn,
  .thea-client-ui-page .client-form-actions > .btn{
    flex:1 1 auto;
    min-width:min(100%, 132px);
    min-height:42px;
  }
  .thea-client-ui-page .client-list-item{
    padding:.9rem !important;
  }
  .thea-client-ui-page .client-list-meta{
    gap:.45rem !important;
    flex-wrap:wrap !important;
  }
  .thea-client-ui-page .client-pill{
    white-space:normal !important;
  }
  .thea-client-ui-page table{
    font-size:.92rem;
  }

  /* E-mail: mobilně spíš aplikace než stránka. Hlídá překryv se spodní lištou. */
  body.thea-email-ui-page.thea-has-mobile-bottom-nav:not(.thea-mobile-bottom-nav-disabled) .email-app-container,
  body.thea-email-ui-page.thea-has-mobile-bottom-nav:not(.thea-mobile-bottom-nav-disabled) .email-layout{
    min-height:calc(100dvh - var(--navbar-height,56px) - var(--thea-mobile-bottom-nav-height,70px) - env(safe-area-inset-bottom,0px)) !important;
    max-height:calc(100dvh - var(--navbar-height,56px) - var(--thea-mobile-bottom-nav-height,70px) - env(safe-area-inset-bottom,0px)) !important;
  }
  body.thea-email-ui-page.thea-mobile-bottom-nav-disabled .email-app-container,
  body.thea-email-ui-page.thea-mobile-bottom-nav-disabled .email-layout{
    min-height:calc(100dvh - var(--navbar-height,56px) - env(safe-area-inset-bottom,0px)) !important;
    max-height:calc(100dvh - var(--navbar-height,56px) - env(safe-area-inset-bottom,0px)) !important;
  }
  .thea-email-ui-page .email-toolbar,
  .thea-email-ui-page .message-actions,
  .thea-email-ui-page #message-actions{
    overflow-x:auto;
    flex-wrap:nowrap;
    -webkit-overflow-scrolling:touch;
    padding-bottom:.25rem;
  }
  .thea-email-ui-page .email-toolbar > *,
  .thea-email-ui-page .message-actions > *,
  .thea-email-ui-page #message-actions > *{
    flex:0 0 auto;
  }
  .thea-email-ui-page .email-compose-actions,
  .thea-email-ui-page .compose-actions{
    position:sticky;
    bottom:calc(var(--thea-mobile-bottom-nav-height,70px) + env(safe-area-inset-bottom,0px) + 10px);
    z-index:30;
    background:rgba(255,255,255,.94);
    border:1px solid var(--thea-ui-border);
    border-radius:var(--thea-ui-radius);
    box-shadow:0 -10px 28px rgba(16,24,40,.10);
    backdrop-filter:blur(14px);
    -webkit-backdrop-filter:blur(14px);
    padding:.65rem;
  }
  .thea-email-ui-page.thea-mobile-bottom-nav-disabled .email-compose-actions,
  .thea-email-ui-page.thea-mobile-bottom-nav-disabled .compose-actions{
    bottom:calc(env(safe-area-inset-bottom,0px) + 10px);
  }
  .thea-email-ui-page .email-compose-actions .btn,
  .thea-email-ui-page .compose-actions .btn{
    min-height:42px;
  }
  .thea-email-ui-page .email-list,
  .thea-email-ui-page .email-detail{
    min-width:0 !important;
  }
  .thea-email-accounts-ui-page .container,
  .thea-email-accounts-ui-page .container-fluid{
    width:100% !important;
    max-width:100% !important;
  }
}

@media (prefers-color-scheme:dark){
  .thea-email-ui-page .email-compose-actions,
  .thea-email-ui-page .compose-actions{
    background:rgba(22,26,36,.94);
  }
}


/* TheaCRM v2.8.411 – settings/admin/operations polish
   Bez přepisu šablon: sjednocení nastavení, uživatelů, rolí, notifikací,
   diagnostiky, skladů, strojů, volání, poptávek a provozních tabulek. */
.thea-settings-ui-page .thea-settings-grid .card,
.thea-settings-ui-page .card,
.thea-admin-ui-page .card,
.thea-ops-ui-page .card,
.thea-notifications-ui-page .card,
.thea-stock-ui-page .card,
.thea-machines-ui-page .card,
.thea-calls-ui-page .card,
.thea-inquiries-ui-page .card{
  border-color:var(--thea-ui-border) !important;
  border-radius:var(--thea-ui-radius) !important;
  box-shadow:var(--thea-ui-shadow) !important;
}

.thea-settings-ui-page .card-header,
.thea-admin-ui-page .card-header,
.thea-ops-ui-page .card-header,
.thea-notifications-ui-page .card-header,
.thea-stock-ui-page .card-header,
.thea-machines-ui-page .card-header,
.thea-calls-ui-page .card-header,
.thea-inquiries-ui-page .card-header{
  border-color:var(--thea-ui-border) !important;
  background:var(--thea-ui-surface) !important;
  border-top-left-radius:var(--thea-ui-radius) !important;
  border-top-right-radius:var(--thea-ui-radius) !important;
}

.thea-settings-ui-page .thea-settings-grid .card{
  transition:transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.thea-settings-ui-page .thea-settings-grid .card:hover{
  transform:translateY(-2px);
  border-color:rgba(25,135,84,.28) !important;
  box-shadow:0 18px 42px rgba(16,24,40,.11) !important;
}

.thea-admin-ui-page .table,
.thea-settings-ui-page .table,
.thea-ops-ui-page .table,
.thea-notifications-ui-page .table,
.thea-stock-ui-page .table,
.thea-machines-ui-page .table,
.thea-calls-ui-page .table,
.thea-inquiries-ui-page .table{
  vertical-align:middle;
}

.thea-admin-ui-page .table thead th,
.thea-settings-ui-page .table thead th,
.thea-ops-ui-page .table thead th,
.thea-notifications-ui-page .table thead th,
.thea-stock-ui-page .table thead th,
.thea-machines-ui-page .table thead th,
.thea-calls-ui-page .table thead th,
.thea-inquiries-ui-page .table thead th{
  color:var(--thea-ui-muted);
  font-size:.78rem;
  text-transform:uppercase;
  letter-spacing:.045em;
  white-space:nowrap;
}

.thea-admin-ui-page .badge,
.thea-settings-ui-page .badge,
.thea-ops-ui-page .badge,
.thea-notifications-ui-page .badge,
.thea-stock-ui-page .badge,
.thea-machines-ui-page .badge,
.thea-calls-ui-page .badge,
.thea-inquiries-ui-page .badge{
  border-radius:999px;
  padding:.38em .62em;
}

.thea-admin-ui-page .btn,
.thea-settings-ui-page .btn,
.thea-ops-ui-page .btn,
.thea-notifications-ui-page .btn,
.thea-stock-ui-page .btn,
.thea-machines-ui-page .btn,
.thea-calls-ui-page .btn,
.thea-inquiries-ui-page .btn{
  border-radius:12px;
}

.thea-admin-ui-page .form-control,
.thea-admin-ui-page .form-select,
.thea-settings-ui-page .form-control,
.thea-settings-ui-page .form-select,
.thea-ops-ui-page .form-control,
.thea-ops-ui-page .form-select,
.thea-stock-ui-page .form-control,
.thea-stock-ui-page .form-select,
.thea-machines-ui-page .form-control,
.thea-machines-ui-page .form-select,
.thea-calls-ui-page .form-control,
.thea-calls-ui-page .form-select,
.thea-inquiries-ui-page .form-control,
.thea-inquiries-ui-page .form-select{
  border-radius:14px;
  border-color:var(--thea-ui-border);
}

.thea-admin-ui-page .form-label,
.thea-settings-ui-page .form-label,
.thea-ops-ui-page .form-label,
.thea-stock-ui-page .form-label,
.thea-machines-ui-page .form-label,
.thea-calls-ui-page .form-label,
.thea-inquiries-ui-page .form-label{
  font-weight:700;
  color:var(--thea-ui-text);
}

.thea-admin-ui-page .alert,
.thea-settings-ui-page .alert,
.thea-ops-ui-page .alert,
.thea-notifications-ui-page .alert,
.thea-stock-ui-page .alert,
.thea-machines-ui-page .alert,
.thea-calls-ui-page .alert,
.thea-inquiries-ui-page .alert{
  border-radius:var(--thea-ui-radius);
}

/* Detail/list akce v provozních modulech – na PC zůstanou normální, na mobilu dostanou bezpečné odsazení. */
.thea-admin-ui-page .page-actions,
.thea-settings-ui-page .page-actions,
.thea-ops-ui-page .page-actions,
.thea-stock-ui-page .page-actions,
.thea-machines-ui-page .page-actions,
.thea-calls-ui-page .page-actions,
.thea-inquiries-ui-page .page-actions,
.thea-admin-ui-page .header-actions,
.thea-settings-ui-page .header-actions,
.thea-ops-ui-page .header-actions{
  display:flex;
  gap:.55rem;
  align-items:center;
  flex-wrap:wrap;
}

@media (max-width:767.98px){
  .thea-settings-ui-page .container,
  .thea-admin-ui-page .container,
  .thea-ops-ui-page .container,
  .thea-stock-ui-page .container,
  .thea-machines-ui-page .container,
  .thea-calls-ui-page .container,
  .thea-inquiries-ui-page .container,
  .thea-settings-ui-page .container-fluid,
  .thea-admin-ui-page .container-fluid,
  .thea-ops-ui-page .container-fluid,
  .thea-stock-ui-page .container-fluid,
  .thea-machines-ui-page .container-fluid,
  .thea-calls-ui-page .container-fluid,
  .thea-inquiries-ui-page .container-fluid{
    width:100% !important;
    max-width:100% !important;
    padding-left:12px !important;
    padding-right:12px !important;
  }

  .thea-settings-ui-page h1,
  .thea-admin-ui-page h1,
  .thea-ops-ui-page h1,
  .thea-stock-ui-page h1,
  .thea-machines-ui-page h1,
  .thea-calls-ui-page h1,
  .thea-inquiries-ui-page h1,
  .thea-settings-ui-page .h1,
  .thea-admin-ui-page .h1,
  .thea-ops-ui-page .h1{
    font-size:1.55rem !important;
  }

  .thea-settings-ui-page .thea-settings-grid{ gap:.75rem !important; }
  .thea-settings-ui-page .thea-settings-grid .card-body{ padding:1rem !important; }
  .thea-settings-ui-page .thea-settings-grid h2{ font-size:1rem !important; }

  .thea-admin-ui-page .d-flex.justify-content-between,
  .thea-settings-ui-page .d-flex.justify-content-between,
  .thea-ops-ui-page .d-flex.justify-content-between,
  .thea-stock-ui-page .d-flex.justify-content-between,
  .thea-machines-ui-page .d-flex.justify-content-between,
  .thea-calls-ui-page .d-flex.justify-content-between,
  .thea-inquiries-ui-page .d-flex.justify-content-between{
    gap:.75rem;
  }

  .thea-admin-ui-page .d-flex.justify-content-between > .btn,
  .thea-settings-ui-page .d-flex.justify-content-between > .btn,
  .thea-ops-ui-page .d-flex.justify-content-between > .btn{
    flex:0 0 auto;
  }

  .thea-admin-ui-page .card-body,
  .thea-settings-ui-page .card-body,
  .thea-ops-ui-page .card-body,
  .thea-notifications-ui-page .card-body,
  .thea-stock-ui-page .card-body,
  .thea-machines-ui-page .card-body,
  .thea-calls-ui-page .card-body,
  .thea-inquiries-ui-page .card-body{
    padding:1rem !important;
  }

  .thea-admin-ui-page .table-responsive,
  .thea-settings-ui-page .table-responsive,
  .thea-ops-ui-page .table-responsive,
  .thea-notifications-ui-page .table-responsive,
  .thea-stock-ui-page .table-responsive,
  .thea-machines-ui-page .table-responsive,
  .thea-calls-ui-page .table-responsive,
  .thea-inquiries-ui-page .table-responsive{
    margin-left:-.35rem;
    margin-right:-.35rem;
    padding-left:.35rem;
    padding-right:.35rem;
  }

  .thea-admin-ui-page .offcanvas.offcanvas-bottom,
  .thea-settings-ui-page .offcanvas.offcanvas-bottom,
  .thea-ops-ui-page .offcanvas.offcanvas-bottom,
  .thea-stock-ui-page .offcanvas.offcanvas-bottom,
  .thea-machines-ui-page .offcanvas.offcanvas-bottom,
  .thea-calls-ui-page .offcanvas.offcanvas-bottom,
  .thea-inquiries-ui-page .offcanvas.offcanvas-bottom{
    border-top-left-radius:24px;
    border-top-right-radius:24px;
    max-height:calc(100dvh - 72px);
  }

  .thea-admin-ui-page .offcanvas-body,
  .thea-settings-ui-page .offcanvas-body,
  .thea-ops-ui-page .offcanvas-body,
  .thea-stock-ui-page .offcanvas-body,
  .thea-machines-ui-page .offcanvas-body,
  .thea-calls-ui-page .offcanvas-body,
  .thea-inquiries-ui-page .offcanvas-body{
    padding-bottom:calc(var(--thea-ui-safe-bottom) + 16px) !important;
  }

  .thea-admin-ui-page form > .mt-4.d-flex.gap-2,
  .thea-settings-ui-page form > .mt-4.d-flex.gap-2,
  .thea-ops-ui-page form > .mt-4.d-flex.gap-2,
  .thea-stock-ui-page form > .mt-4.d-flex.gap-2,
  .thea-machines-ui-page form > .mt-4.d-flex.gap-2,
  .thea-calls-ui-page form > .mt-4.d-flex.gap-2,
  .thea-inquiries-ui-page form > .mt-4.d-flex.gap-2,
  .thea-admin-ui-page form > .d-flex.gap-2.mt-4,
  .thea-settings-ui-page form > .d-flex.gap-2.mt-4,
  .thea-ops-ui-page form > .d-flex.gap-2.mt-4,
  .thea-stock-ui-page form > .d-flex.gap-2.mt-4,
  .thea-machines-ui-page form > .d-flex.gap-2.mt-4,
  .thea-calls-ui-page form > .d-flex.gap-2.mt-4,
  .thea-inquiries-ui-page form > .d-flex.gap-2.mt-4{
    position:sticky;
    bottom:calc(var(--thea-mobile-bottom-nav-height,70px) + env(safe-area-inset-bottom,0px) + 10px);
    z-index:24;
    background:rgba(255,255,255,.94);
    border:1px solid var(--thea-ui-border);
    border-radius:var(--thea-ui-radius);
    box-shadow:0 -10px 28px rgba(16,24,40,.10);
    padding:.65rem;
    backdrop-filter:blur(14px);
    -webkit-backdrop-filter:blur(14px);
  }

  .thea-admin-ui-page form > .mt-4.d-flex.gap-2 > .btn,
  .thea-settings-ui-page form > .mt-4.d-flex.gap-2 > .btn,
  .thea-ops-ui-page form > .mt-4.d-flex.gap-2 > .btn,
  .thea-stock-ui-page form > .mt-4.d-flex.gap-2 > .btn,
  .thea-machines-ui-page form > .mt-4.d-flex.gap-2 > .btn,
  .thea-calls-ui-page form > .mt-4.d-flex.gap-2 > .btn,
  .thea-inquiries-ui-page form > .mt-4.d-flex.gap-2 > .btn{
    flex:1 1 auto;
    min-height:42px;
  }
}

@media (prefers-color-scheme:dark){
  .thea-admin-ui-page .card,
  .thea-settings-ui-page .card,
  .thea-ops-ui-page .card,
  .thea-notifications-ui-page .card,
  .thea-stock-ui-page .card,
  .thea-machines-ui-page .card,
  .thea-calls-ui-page .card,
  .thea-inquiries-ui-page .card,
  .thea-settings-ui-page .thea-settings-grid .card{
    background:var(--thea-ui-surface) !important;
  }

  @media (max-width:767.98px){
    .thea-admin-ui-page form > .mt-4.d-flex.gap-2,
    .thea-settings-ui-page form > .mt-4.d-flex.gap-2,
    .thea-ops-ui-page form > .mt-4.d-flex.gap-2,
    .thea-stock-ui-page form > .mt-4.d-flex.gap-2,
    .thea-machines-ui-page form > .mt-4.d-flex.gap-2,
    .thea-calls-ui-page form > .mt-4.d-flex.gap-2,
    .thea-inquiries-ui-page form > .mt-4.d-flex.gap-2,
    .thea-admin-ui-page form > .d-flex.gap-2.mt-4,
    .thea-settings-ui-page form > .d-flex.gap-2.mt-4,
    .thea-ops-ui-page form > .d-flex.gap-2.mt-4,
    .thea-stock-ui-page form > .d-flex.gap-2.mt-4,
    .thea-machines-ui-page form > .d-flex.gap-2.mt-4,
    .thea-calls-ui-page form > .d-flex.gap-2.mt-4,
    .thea-inquiries-ui-page form > .d-flex.gap-2.mt-4{
      background:rgba(22,26,36,.94);
    }
  }
}

/* ======================================================================
   TheaCRM v2.8.414 – dashboard + calendar + global search polish
   Navazuje na UI foundation vrstvy 2.8.406–2.8.411.
   Cíl: sjednotit zbývající přehledové obrazovky bez přepisu šablon.
   ====================================================================== */

.thea-dashboard-ui-page .container,
.thea-dashboard-ui-page .container-fluid,
.thea-calendar-ui-page .container,
.thea-calendar-ui-page .container-fluid,
.thea-global-search-ui-page .container,
.thea-global-search-ui-page .container-fluid{
  max-width: 1480px;
}

.thea-dashboard-ui-page #dashboard-grid,
.thea-dashboard-ui-page .grid-stack,
.thea-ui-dashboard-grid{
  --thea-dashboard-gap: 1rem;
}

.thea-dashboard-ui-page .thea-dashboard-widget,
.thea-dashboard-ui-page .card.thea-dashboard-widget,
.thea-dashboard-ui-page .grid-stack-item-content > .card,
.thea-dashboard-ui-page .grid-stack-item-content > .thea-dashboard-widget,
.thea-ui-dashboard-widget{
  border: 1px solid var(--thea-ui-border) !important;
  border-radius: var(--thea-ui-radius-lg) !important;
  box-shadow: var(--thea-ui-shadow) !important;
  overflow: hidden;
}

.thea-dashboard-ui-page .thea-dashboard-widget .card-header,
.thea-dashboard-ui-page .card.thea-dashboard-widget .card-header,
.thea-ui-dashboard-widget .card-header{
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(247,250,248,.96));
  border-bottom: 1px solid var(--thea-ui-border);
  min-height: 48px;
}

.thea-dashboard-ui-page .thea-widget-row,
.thea-dashboard-ui-page .list-group-item,
.thea-dashboard-ui-page .thea-dashboard-widget li{
  border-radius: 14px;
}

.thea-dashboard-ui-page .fab-wrap,
.thea-dashboard-ui-page .thea-ui-safe-fab{
  bottom: calc(var(--thea-mobile-bottom-nav-height, 70px) + env(safe-area-inset-bottom, 0px) + 16px) !important;
}

.thea-dashboard-ui-page .thea-widget-menu .dropdown-menu,
.thea-dashboard-ui-page .thea-ui-dashboard-menu.dropdown-menu{
  border-radius: 16px;
  border: 1px solid var(--thea-ui-border);
  box-shadow: 0 18px 45px rgba(16,24,40,.16);
}

.thea-calendar-ui-page .calendar-card,
.thea-calendar-ui-page .thea-ui-calendar-surface,
.thea-calendar-ui-page .capacity-card,
.thea-calendar-ui-page .planner-card,
.thea-calendar-ui-page .kanban-card,
.thea-calendar-ui-page .card{
  border: 1px solid var(--thea-ui-border) !important;
  border-radius: var(--thea-ui-radius-lg) !important;
  box-shadow: var(--thea-ui-shadow) !important;
  background: var(--thea-ui-surface) !important;
}

.thea-calendar-ui-page .fc,
.thea-calendar-ui-page #task-calendar,
.thea-calendar-ui-page #calendar{
  --fc-border-color: rgba(16,24,40,.10);
  --fc-today-bg-color: rgba(31,122,58,.075);
}

.thea-calendar-ui-page .fc .fc-toolbar-title{
  font-weight: 850;
  color: var(--thea-ui-text);
}

.thea-calendar-ui-page .fc .fc-button,
.thea-calendar-ui-page .thea-ui-calendar-button{
  border-radius: 999px !important;
  font-weight: 700 !important;
  box-shadow: none !important;
}

.thea-calendar-ui-page .fc .fc-daygrid-event,
.thea-calendar-ui-page .fc .fc-timegrid-event{
  border-radius: 9px;
  padding: 2px 4px;
}

.thea-calendar-ui-page .fc .fc-scrollgrid,
.thea-calendar-ui-page .fc-theme-standard td,
.thea-calendar-ui-page .fc-theme-standard th{
  border-color: rgba(16,24,40,.10);
}

.thea-global-search-ui-page .thea-global-search-panel,
.thea-global-search-ui-page .thea-ui-search-surface{
  border: 1px solid var(--thea-ui-border);
  border-radius: var(--thea-ui-radius-lg);
  background: var(--thea-ui-surface);
  box-shadow: var(--thea-ui-shadow);
}

.thea-global-search-ui-page .input-group-text,
.thea-global-search-ui-page .form-control,
.thea-global-search-ui-page .form-select{
  border-color: var(--thea-ui-border);
}

.thea-global-search-ui-page .thea-global-search-help{
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

.thea-global-search-ui-page .thea-global-search-help span{
  border: 1px solid var(--thea-ui-border);
  background: rgba(31,122,58,.07);
  color: var(--thea-ui-text-muted);
  border-radius: 999px;
  padding: .25rem .55rem;
}

.thea-global-search-ui-page .thea-global-search-results,
.thea-global-search-ui-page .thea-ui-search-results{
  display: grid;
  gap: .65rem;
}

.thea-global-search-ui-page .thea-global-search-result,
.thea-global-search-ui-page .thea-ui-search-result-card,
.thea-global-search-ui-page .search-result,
.thea-global-search-ui-page .result-card{
  border: 1px solid var(--thea-ui-border) !important;
  border-radius: 16px !important;
  background: var(--thea-ui-surface) !important;
}

/* Globální dotažení proti překryvu spodní lišty u všech foundation stránek. */
@media (max-width: 767.98px){
  .thea-dashboard-ui-page,
  .thea-calendar-ui-page,
  .thea-global-search-ui-page{
    padding-bottom: calc(var(--thea-ui-safe-bottom) + 8px) !important;
  }

  .thea-dashboard-ui-page .container,
  .thea-dashboard-ui-page .container-fluid,
  .thea-calendar-ui-page .container,
  .thea-calendar-ui-page .container-fluid,
  .thea-global-search-ui-page .container,
  .thea-global-search-ui-page .container-fluid{
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .thea-dashboard-ui-page h1,
  .thea-calendar-ui-page h1,
  .thea-global-search-ui-page h1,
  .thea-dashboard-ui-page .h1,
  .thea-calendar-ui-page .h1,
  .thea-global-search-ui-page .h1{
    font-size: 1.5rem !important;
    line-height: 1.16;
  }

  .thea-dashboard-ui-page .row.g-4{ --bs-gutter-y: .85rem; }

  .thea-dashboard-ui-page #dashboard-grid,
  .thea-dashboard-ui-page .grid-stack{
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: .85rem !important;
    height: auto !important;
  }

  .thea-dashboard-ui-page #dashboard-grid .grid-stack-item,
  .thea-dashboard-ui-page .grid-stack .grid-stack-item{
    position: relative !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    transform: none !important;
    height: auto !important;
  }

  .thea-dashboard-ui-page #dashboard-grid .grid-stack-item-content,
  .thea-dashboard-ui-page .grid-stack .grid-stack-item-content{
    position: relative !important;
    inset: auto !important;
    height: auto !important;
  }

  .thea-dashboard-ui-page .thea-dashboard-widget .card-body,
  .thea-dashboard-ui-page .card.thea-dashboard-widget .card-body,
  .thea-ui-dashboard-widget .card-body{
    padding: .9rem !important;
  }

  .thea-dashboard-ui-page .fab-wrap,
  .thea-dashboard-ui-page .thea-ui-safe-fab{
    bottom: calc(var(--thea-mobile-bottom-nav-height, 70px) + env(safe-area-inset-bottom, 0px) + 10px) !important;
    right: 12px !important;
  }

  .thea-calendar-ui-page .calendar-card,
  .thea-calendar-ui-page .thea-ui-calendar-surface{
    padding: .65rem !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .thea-calendar-ui-page .fc .fc-toolbar,
  .thea-calendar-ui-page .fc .fc-header-toolbar,
  .thea-calendar-ui-page .thea-ui-calendar-toolbar{
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: .55rem !important;
    align-items: stretch !important;
  }

  .thea-calendar-ui-page .fc .fc-toolbar-chunk{
    display: flex !important;
    justify-content: center;
    flex-wrap: wrap;
    gap: .35rem;
  }

  .thea-calendar-ui-page .fc .fc-toolbar-title{
    font-size: 1.05rem !important;
    text-align: center;
  }

  .thea-calendar-ui-page .fc .fc-button{
    min-height: 38px;
    padding: .36rem .62rem !important;
    font-size: .82rem !important;
  }

  .thea-calendar-ui-page .fc-view-harness{
    min-height: 560px;
  }

  .thea-calendar-ui-page .fc .fc-col-header-cell-cushion,
  .thea-calendar-ui-page .fc .fc-daygrid-day-number{
    font-size: .82rem;
  }

  .thea-calendar-ui-page .fc .fc-event-title,
  .thea-calendar-ui-page .fc .fc-event-time{
    font-size: .78rem;
  }

  .thea-global-search-ui-page .thea-global-search-panel,
  .thea-global-search-ui-page .thea-ui-search-surface{
    padding: 1rem !important;
    border-radius: 20px;
  }

  .thea-global-search-ui-page .input-group.input-group-lg > .form-control,
  .thea-global-search-ui-page .input-group.input-group-lg > .input-group-text{
    min-height: 48px;
    font-size: 1rem;
  }

  .thea-global-search-ui-page .thea-global-search-help span{
    font-size: .78rem;
  }
}

@media (prefers-color-scheme: dark){
  .thea-dashboard-ui-page .thea-dashboard-widget .card-header,
  .thea-dashboard-ui-page .card.thea-dashboard-widget .card-header,
  .thea-ui-dashboard-widget .card-header{
    background: linear-gradient(180deg, rgba(30,34,44,.98), rgba(22,26,36,.96));
  }
}

/* --------------------------------------------------------------------------
   TheaCRM v2.8.414 – modal + mobile interaction polish
   -------------------------------------------------------------------------- */
:root{
  --thea-ui-modal-radius: 24px;
  --thea-ui-modal-header-height: 62px;
  --thea-ui-mobile-action-height: 70px;
}

.thea-ui-interaction-page .modal-content,
.thea-client-ui-page .modal-content{
  border: 1px solid var(--thea-ui-border, rgba(15,23,42,.1));
  border-radius: var(--thea-ui-modal-radius);
  box-shadow: 0 24px 72px rgba(15,23,42,.22);
  overflow: hidden;
}

.thea-ui-interaction-page .modal-header,
.thea-client-ui-page .modal-header{
  border-bottom: 1px solid var(--thea-ui-border, rgba(15,23,42,.1));
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,251,248,.96));
}

.thea-ui-interaction-page .modal-footer,
.thea-client-ui-page .modal-footer,
.thea-ui-modal-actions{
  border-top: 1px solid var(--thea-ui-border, rgba(15,23,42,.1));
  background: rgba(255,255,255,.96);
}

.thea-ui-interaction-page .offcanvas,
.thea-client-ui-page .offcanvas{
  border-color: var(--thea-ui-border, rgba(15,23,42,.1));
  box-shadow: 0 -18px 54px rgba(15,23,42,.20);
}

.thea-ui-interaction-page .offcanvas-header,
.thea-client-ui-page .offcanvas-header{
  border-bottom: 1px solid var(--thea-ui-border, rgba(15,23,42,.1));
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,251,248,.96));
}

.thea-ui-interaction-page .offcanvas-body,
.thea-client-ui-page .offcanvas-body{
  -webkit-overflow-scrolling: touch;
}

.thea-ui-action-row,
.thea-ui-form-actions,
.thea-ui-detail-actions,
.thea-ui-list-actions{
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  align-items: center;
}

.thea-ui-action-row .btn,
.thea-ui-form-actions .btn,
.thea-ui-detail-actions .btn,
.thea-ui-list-actions .btn{
  border-radius: 999px;
}

.thea-ui-upload-surface,
.thea-ui-file-dropzone,
.thea-ui-attachment-zone{
  border: 1px dashed rgba(31,122,58,.30) !important;
  border-radius: 18px !important;
  background: rgba(31,122,58,.045) !important;
  padding: .85rem !important;
}

.thea-ui-upload-surface input[type="file"],
.thea-ui-file-dropzone input[type="file"],
.thea-ui-attachment-zone input[type="file"]{
  border-radius: 14px;
  background: var(--thea-ui-surface, #fff);
}

@media (max-width: 767.98px){
  /* Když je otevřený mobilní modal, modal má vlastní pracovní plochu a UI appky se schová. */
  html.thea-ui-modal-open-mobile,
  body.thea-ui-modal-open-mobile{
    overflow: hidden !important;
  }

  body.thea-ui-modal-open-mobile .navbar,
  body.thea-ui-modal-open-mobile .main-navbar,
  body.thea-ui-modal-open-mobile .thea-navbar,
  body.thea-ui-modal-open-mobile .top-navbar,
  body.thea-ui-modal-open-mobile #theaMobileBottomNav,
  body.thea-ui-modal-open-mobile .thea-mobile-bottom-nav,
  body.thea-ui-modal-open-mobile #theaMobileQuickAddBackdrop,
  body.thea-ui-modal-open-mobile .thea-mobile-quick-add-backdrop{
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  body.thea-ui-modal-open-mobile{
    padding-bottom: 0 !important;
  }

  .thea-ui-mobile-fullscreen-modal.modal,
  .modal.thea-ui-mobile-fullscreen-modal{
    padding: 0 !important;
  }

  .thea-ui-mobile-fullscreen-modal .modal-dialog{
    width: 100% !important;
    max-width: 100% !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    margin: 0 !important;
    display: flex;
    align-items: stretch;
  }

  @supports not (height: 100dvh){
    .thea-ui-mobile-fullscreen-modal .modal-dialog{
      height: 100vh !important;
      min-height: 100vh !important;
    }
  }

  .thea-ui-mobile-fullscreen-modal .modal-content{
    width: 100%;
    min-height: 100%;
    max-height: 100dvh;
    border-radius: 0 !important;
    border: 0 !important;
    display: flex;
    flex-direction: column;
  }

  .thea-ui-mobile-fullscreen-modal .modal-header{
    flex: 0 0 auto;
    min-height: var(--thea-ui-modal-header-height);
    padding: .85rem 1rem;
    position: sticky;
    top: 0;
    z-index: 5;
  }

  .thea-ui-mobile-fullscreen-modal .modal-title{
    font-size: 1.08rem !important;
    line-height: 1.18;
  }

  .thea-ui-mobile-fullscreen-modal .modal-body{
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px)) !important;
  }

  .thea-ui-mobile-fullscreen-modal .modal-footer,
  .thea-ui-modal-actions{
    flex: 0 0 auto;
    position: sticky;
    bottom: 0;
    z-index: 6;
    padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom, 0px)) !important;
    gap: .55rem;
  }

  .thea-ui-mobile-fullscreen-modal .modal-footer .btn,
  .thea-ui-modal-actions .btn{
    min-height: 44px;
  }

  .thea-ui-mobile-fullscreen-modal textarea,
  .thea-ui-mobile-fullscreen-modal input,
  .thea-ui-mobile-fullscreen-modal select{
    font-size: 16px !important;
  }

  /* Speciální režim pro modal Nadiktovat úkol. */
  #quickTaskCaptureModal.thea-ui-mobile-fullscreen-modal .modal-body{
    display: flex;
    flex-direction: column;
    gap: .85rem;
  }

  #quickTaskCaptureModal.thea-ui-mobile-fullscreen-modal textarea,
  #quickTaskCaptureModal.thea-ui-mobile-fullscreen-modal textarea[name="raw_note"]{
    min-height: min(48dvh, 420px) !important;
    resize: vertical;
  }

  /* Offcanvas filtry a spodní panely nesmí končit pod spodní lištou. */
  .thea-ui-mobile-filter-offcanvas,
  .offcanvas.thea-ui-mobile-filter-offcanvas,
  .offcanvas.offcanvas-bottom{
    max-height: calc(100dvh - var(--navbar-height, 56px)) !important;
    border-radius: 22px 22px 0 0 !important;
  }

  .thea-ui-mobile-filter-offcanvas .offcanvas-body,
  .offcanvas.offcanvas-bottom .offcanvas-body{
    padding-bottom: calc(var(--thea-ui-safe-bottom, 90px) + 10px) !important;
  }

  .thea-ui-mobile-filter-offcanvas .offcanvas-footer,
  .offcanvas.offcanvas-bottom .offcanvas-footer,
  .thea-ui-offcanvas-actions{
    position: sticky;
    bottom: 0;
    z-index: 4;
    background: var(--thea-ui-surface, #fff);
    padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom, 0px)) !important;
    border-top: 1px solid var(--thea-ui-border, rgba(15,23,42,.1));
  }

  /* Obecné akční řádky na mobilu – tlačítka se skládají a mají bezpečný spodní prostor. */
  .thea-ui-action-row,
  .thea-ui-form-actions,
  .thea-ui-detail-actions,
  .thea-ui-list-actions{
    width: 100%;
  }

  .thea-ui-action-row > .btn,
  .thea-ui-form-actions > .btn,
  .thea-ui-detail-actions > .btn,
  .thea-ui-list-actions > .btn,
  .thea-ui-action-row > form,
  .thea-ui-form-actions > form,
  .thea-ui-detail-actions > form,
  .thea-ui-list-actions > form{
    flex: 1 1 auto;
    min-width: min(100%, 132px);
  }

  .thea-ui-action-row > form > .btn,
  .thea-ui-form-actions > form > .btn,
  .thea-ui-detail-actions > form > .btn,
  .thea-ui-list-actions > form > .btn{
    width: 100%;
  }

  .thea-ui-sticky-actions-detected,
  .thea-ui-mobile-sticky-actions,
  .thea-doc-form-actions,
  .thea-work-form-actions,
  .thea-ui-admin-form-actions{
    bottom: calc(var(--thea-mobile-bottom-nav-height, 70px) + env(safe-area-inset-bottom, 0px) + 8px) !important;
  }

  .thea-ui-wide-table-card table,
  .thea-auto-table-responsive table{
    min-width: 640px;
  }

  .thea-auto-table-responsive{
    border-radius: 16px;
    border: 1px solid var(--thea-ui-border, rgba(15,23,42,.1));
    background: var(--thea-ui-surface, #fff);
  }

  .thea-auto-table-responsive table{
    margin-bottom: 0;
  }

  .thea-ui-upload-surface,
  .thea-ui-file-dropzone,
  .thea-ui-attachment-zone{
    padding: .75rem !important;
    border-radius: 16px !important;
  }
}

@media (prefers-color-scheme: dark){
  .thea-ui-interaction-page .modal-content,
  .thea-client-ui-page .modal-content,
  .thea-auto-table-responsive{
    background: #161a24;
    border-color: rgba(255,255,255,.12);
  }
  .thea-ui-interaction-page .modal-header,
  .thea-client-ui-page .modal-header,
  .thea-ui-interaction-page .modal-footer,
  .thea-client-ui-page .modal-footer,
  .thea-ui-interaction-page .offcanvas-header,
  .thea-client-ui-page .offcanvas-header,
  .thea-ui-mobile-filter-offcanvas .offcanvas-footer,
  .offcanvas.offcanvas-bottom .offcanvas-footer,
  .thea-ui-offcanvas-actions{
    background: #171b25;
    border-color: rgba(255,255,255,.12);
  }
  .thea-ui-upload-surface,
  .thea-ui-file-dropzone,
  .thea-ui-attachment-zone{
    background: rgba(105,194,130,.08) !important;
    border-color: rgba(105,194,130,.28) !important;
  }
}


/* --------------------------------------------------------------------------
   TheaCRM v2.8.414 – tables + filters final pass
   Finální sjednocení tabulek, filtrů, paginatorů a mobilních seznamů bez
   zásahu do jednotlivých šablon. Pravidla jsou opt-in přes JS třídy, aby se
   nerozbily kalendáře, datatables a speciální komponenty. */
.thea-ui-table-shell,
.thea-auto-table-responsive{
  border:1px solid var(--thea-ui-border);
  border-radius:var(--thea-ui-radius);
  background:var(--thea-ui-surface);
  box-shadow:0 8px 24px rgba(16,24,40,.045);
  overflow:auto;
  -webkit-overflow-scrolling:touch;
}

.thea-ui-table-shell > table,
.thea-auto-table-responsive > table,
table.thea-ui-data-table{
  margin-bottom:0 !important;
}

table.thea-ui-data-table thead th{
  color:#344054;
  background:rgba(248,250,252,.92);
  border-bottom:1px solid var(--thea-ui-border) !important;
  font-size:.78rem;
  font-weight:800;
  letter-spacing:.015em;
  text-transform:uppercase;
  white-space:nowrap;
}

table.thea-ui-data-table tbody td{
  vertical-align:middle;
  border-color:rgba(16,24,40,.075) !important;
}

table.thea-ui-data-table tbody tr{
  transition:background .14s ease, box-shadow .14s ease;
}

table.thea-ui-data-table tbody tr:hover{
  background:rgba(25,135,84,.035);
}

.thea-ui-table-actions,
table.thea-ui-data-table td:last-child:has(.btn),
table.thea-ui-data-table td:last-child:has(.dropdown),
table.thea-ui-data-table td:last-child:has(form){
  white-space:nowrap;
}

.thea-ui-filter-surface,
.thea-filter-surface,
.thea-ui-page form.thea-ui-filter-form,
.thea-work-page form.thea-ui-filter-form,
.thea-directory-page form.thea-ui-filter-form{
  border:1px solid var(--thea-ui-border);
  border-radius:var(--thea-ui-radius);
  background:linear-gradient(180deg,#fff,rgba(248,250,252,.96));
  box-shadow:0 8px 24px rgba(16,24,40,.045);
  padding:.85rem;
}

.thea-ui-filter-surface .form-control,
.thea-ui-filter-surface .form-select,
.thea-ui-filter-form .form-control,
.thea-ui-filter-form .form-select{
  border-radius:13px;
}

.thea-ui-filter-actions{
  display:flex;
  gap:.5rem;
  flex-wrap:wrap;
  align-items:center;
  justify-content:flex-end;
}

.thea-ui-filter-chip-row{
  display:flex;
  gap:.4rem;
  flex-wrap:wrap;
  align-items:center;
}

.thea-ui-empty-state,
.table tbody tr.thea-ui-empty-row td{
  color:var(--thea-ui-muted);
  text-align:center;
  padding:1.15rem !important;
}

.thea-ui-pagination,
.pagination{
  gap:.25rem;
  flex-wrap:wrap;
}

.thea-ui-pagination .page-link,
.pagination .page-link{
  border-radius:999px !important;
  min-width:38px;
  text-align:center;
  border-color:var(--thea-ui-border);
}

.thea-ui-card-list,
.thea-mobile-card-list{
  display:grid;
  gap:.7rem;
}

@media (max-width:767.98px){
  .thea-ui-filter-surface,
  .thea-filter-surface,
  .thea-ui-filter-form{
    padding:.75rem;
    border-radius:18px;
  }

  .thea-ui-filter-surface .row,
  .thea-ui-filter-form .row{
    --bs-gutter-x:.55rem;
    --bs-gutter-y:.55rem;
  }

  .thea-ui-filter-actions,
  .thea-ui-filter-form .d-flex.justify-content-end,
  .thea-ui-filter-form .d-flex.gap-2.justify-content-end{
    justify-content:stretch !important;
  }

  .thea-ui-filter-actions > .btn,
  .thea-ui-filter-form .d-flex.justify-content-end > .btn,
  .thea-ui-filter-form .d-flex.gap-2.justify-content-end > .btn{
    flex:1 1 auto;
    min-width:min(44vw,180px);
  }

  .thea-ui-table-shell,
  .thea-auto-table-responsive,
  .table-responsive{
    border-radius:16px;
  }

  table.thea-ui-data-table{
    font-size:.92rem;
  }

  table.thea-ui-mobile-card-table{
    border-collapse:separate !important;
    border-spacing:0 .65rem !important;
    min-width:0 !important;
  }

  table.thea-ui-mobile-card-table thead{
    position:absolute !important;
    width:1px !important;
    height:1px !important;
    padding:0 !important;
    margin:-1px !important;
    overflow:hidden !important;
    clip:rect(0,0,0,0) !important;
    white-space:nowrap !important;
    border:0 !important;
  }

  table.thea-ui-mobile-card-table,
  table.thea-ui-mobile-card-table tbody,
  table.thea-ui-mobile-card-table tr,
  table.thea-ui-mobile-card-table td{
    display:block !important;
    width:100% !important;
  }

  table.thea-ui-mobile-card-table tr{
    border:1px solid var(--thea-ui-border);
    border-radius:18px;
    background:#fff;
    box-shadow:0 8px 22px rgba(16,24,40,.055);
    overflow:hidden;
  }

  table.thea-ui-mobile-card-table td{
    border:0 !important;
    border-bottom:1px solid rgba(16,24,40,.065) !important;
    padding:.62rem .78rem !important;
    min-height:42px;
  }

  table.thea-ui-mobile-card-table td:last-child{
    border-bottom:0 !important;
  }

  table.thea-ui-mobile-card-table td[data-label]::before{
    content:attr(data-label);
    display:block;
    margin-bottom:.15rem;
    color:var(--thea-ui-muted);
    font-size:.72rem;
    font-weight:800;
    letter-spacing:.02em;
    text-transform:uppercase;
  }

  table.thea-ui-mobile-card-table td:has(.btn),
  table.thea-ui-mobile-card-table td:has(.dropdown),
  table.thea-ui-mobile-card-table td:has(form){
    display:flex !important;
    flex-wrap:wrap;
    gap:.42rem;
    align-items:center;
  }

  table.thea-ui-mobile-card-table td:has(.btn)::before,
  table.thea-ui-mobile-card-table td:has(.dropdown)::before,
  table.thea-ui-mobile-card-table td:has(form)::before{
    flex:0 0 100%;
  }

  table.thea-ui-mobile-card-table .btn{
    min-height:38px;
  }

  .thea-ui-table-toolbar,
  .thea-table-toolbar,
  .list-toolbar,
  .filter-toolbar{
    display:grid !important;
    grid-template-columns:1fr;
    gap:.55rem;
  }

  .pagination{
    justify-content:center;
  }
}

/* TheaCRM v2.8.424 – forms + validation polish
   Jemné sjednocení formulářů bez přepisu jednotlivých šablon. */
.thea-ui-form-page form:not(.navbar-search):not(.d-inline):not(.dropdown-menu form),
.thea-ui-form-surface{
  --thea-form-gap:.95rem;
}

.thea-ui-form-surface,
.thea-ui-form-page .form-card,
.thea-ui-form-page .form-section,
.thea-ui-form-page .settings-section,
.thea-ui-form-page .client-card:has(.form-control),
.thea-ui-form-page .card:has(.form-control),
.thea-ui-form-page .card:has(.form-select),
.thea-ui-form-page .card:has(textarea){
  border-color:var(--thea-ui-border) !important;
  border-radius:var(--thea-ui-radius) !important;
  box-shadow:0 10px 28px rgba(16,24,40,.055);
}

.thea-ui-form-page label,
.thea-ui-form-page .form-label,
.thea-ui-form-page .control-label{
  color:#344054;
  font-weight:750;
  letter-spacing:-.005em;
  margin-bottom:.35rem;
}

.thea-ui-form-page .form-label.required::after,
.thea-ui-form-page label.required::after,
.thea-ui-field-required > label::after,
.thea-ui-required-label::after{
  content:" *";
  color:#dc3545;
  font-weight:900;
}

.thea-ui-form-page .form-control,
.thea-ui-form-page .form-select,
.thea-ui-form-page .form-check-input,
.thea-ui-form-page .input-group-text,
.thea-ui-form-page textarea,
.thea-ui-form-page input[type="text"],
.thea-ui-form-page input[type="email"],
.thea-ui-form-page input[type="tel"],
.thea-ui-form-page input[type="number"],
.thea-ui-form-page input[type="date"],
.thea-ui-form-page input[type="datetime-local"],
.thea-ui-form-page input[type="password"]{
  border-color:rgba(16,24,40,.14);
  border-radius:14px;
  min-height:42px;
}

.thea-ui-form-page textarea.form-control,
.thea-ui-form-page textarea{
  line-height:1.45;
  resize:vertical;
}

.thea-ui-form-page .form-control:focus,
.thea-ui-form-page .form-select:focus,
.thea-ui-form-page textarea:focus{
  border-color:rgba(25,135,84,.58);
  box-shadow:0 0 0 .22rem rgba(25,135,84,.13);
}

.thea-ui-form-page .form-text,
.thea-ui-form-page .help-text,
.thea-ui-form-page .hint,
.thea-ui-form-page small.text-muted{
  color:var(--thea-ui-muted) !important;
  line-height:1.35;
}

.thea-ui-form-page .input-group > .form-control,
.thea-ui-form-page .input-group > .form-select{
  min-width:0;
}

.thea-ui-form-page .input-group > .btn,
.thea-ui-form-page .input-group > .input-group-text{
  border-radius:14px;
}

.thea-ui-form-page .input-group > :not(:first-child){
  margin-left:.35rem;
}

.thea-ui-form-page .form-check,
.thea-ui-form-page .form-switch{
  padding-top:.18rem;
  padding-bottom:.18rem;
}

.thea-ui-form-page .form-check-input:checked{
  background-color:var(--thea-ui-primary);
  border-color:var(--thea-ui-primary);
}

.thea-ui-form-page .form-control.is-invalid,
.thea-ui-form-page .form-select.is-invalid,
.thea-ui-form-page .was-validated .form-control:invalid,
.thea-ui-form-page .was-validated .form-select:invalid{
  border-color:#dc3545;
  box-shadow:0 0 0 .18rem rgba(220,53,69,.10);
}

.thea-ui-form-page .form-control.is-valid,
.thea-ui-form-page .form-select.is-valid,
.thea-ui-form-page .was-validated .form-control:valid,
.thea-ui-form-page .was-validated .form-select:valid{
  border-color:rgba(25,135,84,.62);
}

.thea-ui-form-page .invalid-feedback,
.thea-ui-form-page .valid-feedback{
  border-radius:12px;
  padding:.35rem .55rem;
  margin-top:.35rem;
  font-weight:650;
}

.thea-ui-form-page .invalid-feedback{
  color:#b42318;
  background:rgba(220,53,69,.075);
}

.thea-ui-form-page .valid-feedback{
  color:#146c43;
  background:rgba(25,135,84,.075);
}

.thea-ui-form-page .alert{
  border-radius:16px;
}

.thea-ui-form-section-title,
.thea-ui-form-page legend,
.thea-ui-form-page .section-title,
.thea-ui-form-page .form-section-title{
  color:#182230;
  font-weight:850;
  letter-spacing:-.02em;
}

.thea-ui-form-page fieldset{
  min-width:0;
}

.thea-ui-form-page .select2-container,
.thea-ui-form-page .choices,
.thea-ui-form-page .ts-wrapper{
  max-width:100%;
}

.thea-ui-form-page .select2-container .select2-selection,
.thea-ui-form-page .choices__inner,
.thea-ui-form-page .ts-control{
  border-color:rgba(16,24,40,.14) !important;
  border-radius:14px !important;
  min-height:42px !important;
  background:#fff !important;
}

.thea-ui-form-page .thea-ui-upload-surface{
  border:1px dashed rgba(25,135,84,.28);
  background:linear-gradient(180deg, rgba(25,135,84,.045), rgba(255,255,255,.85));
  border-radius:18px;
  padding:.85rem;
}

.thea-ui-form-page .thea-ui-upload-surface input[type="file"]{
  background:#fff;
}

.thea-ui-form-page .thea-ui-field-block{
  margin-bottom:var(--thea-form-gap);
}

.thea-ui-form-page .thea-ui-password-wrap{
  position:relative;
}

.thea-ui-form-page .thea-ui-password-wrap .form-control{
  padding-right:3rem;
}

.thea-ui-password-toggle{
  position:absolute;
  top:50%;
  right:.35rem;
  transform:translateY(-50%);
  width:38px;
  height:38px;
  border:0;
  border-radius:12px;
  background:transparent;
  color:var(--thea-ui-muted);
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

.thea-ui-password-toggle:hover,
.thea-ui-password-toggle:focus{
  background:var(--thea-ui-primary-soft);
  color:var(--thea-ui-primary);
}

.thea-ui-validation-summary{
  display:none;
  border:1px solid rgba(220,53,69,.22);
  background:rgba(220,53,69,.075);
  color:#b42318;
  border-radius:16px;
  padding:.7rem .85rem;
  margin-bottom:.9rem;
  font-weight:700;
}

.thea-ui-validation-summary.is-visible{
  display:block;
}

@media (max-width:767.98px){
  .thea-ui-form-page form:not(.navbar-search):not(.d-inline):not(.dropdown-menu form){
    min-width:0;
  }

  .thea-ui-form-page .row{
    --bs-gutter-x:.7rem;
    --bs-gutter-y:.75rem;
  }

  .thea-ui-form-page .form-control,
  .thea-ui-form-page .form-select,
  .thea-ui-form-page textarea,
  .thea-ui-form-page input[type="text"],
  .thea-ui-form-page input[type="email"],
  .thea-ui-form-page input[type="tel"],
  .thea-ui-form-page input[type="number"],
  .thea-ui-form-page input[type="date"],
  .thea-ui-form-page input[type="datetime-local"],
  .thea-ui-form-page input[type="password"]{
    min-height:46px;
    font-size:16px;
  }

  .thea-ui-form-page textarea.form-control,
  .thea-ui-form-page textarea{
    min-height:112px;
  }

  .thea-ui-form-page .input-group{
    align-items:stretch;
  }

  .thea-ui-form-page .input-group.thea-ui-mobile-stack,
  .thea-ui-form-page .thea-ui-mobile-stack.input-group{
    display:grid;
    grid-template-columns:1fr;
    gap:.5rem;
  }

  .thea-ui-form-page .input-group.thea-ui-mobile-stack > *,
  .thea-ui-form-page .thea-ui-mobile-stack.input-group > *{
    width:100%;
    margin-left:0 !important;
    border-radius:14px !important;
  }

  .thea-ui-form-page .thea-ui-form-actions,
  .thea-ui-form-page form > .d-flex.gap-2.mt-3,
  .thea-ui-form-page form > .d-flex.gap-2.mt-4,
  .thea-ui-form-page form > .mt-3.d-flex.gap-2,
  .thea-ui-form-page form > .mt-4.d-flex.gap-2{
    position:sticky;
    bottom:var(--thea-ui-safe-bottom);
    z-index:25;
    display:grid !important;
    grid-template-columns:1fr;
    gap:.55rem;
    background:rgba(255,255,255,.94);
    border:1px solid var(--thea-ui-border);
    border-radius:18px;
    padding:.65rem;
    box-shadow:0 -12px 28px rgba(16,24,40,.11);
    backdrop-filter:blur(14px);
    -webkit-backdrop-filter:blur(14px);
  }

  .thea-ui-form-page .thea-ui-form-actions .btn,
  .thea-ui-form-page form > .d-flex.gap-2.mt-3 .btn,
  .thea-ui-form-page form > .d-flex.gap-2.mt-4 .btn,
  .thea-ui-form-page form > .mt-3.d-flex.gap-2 .btn,
  .thea-ui-form-page form > .mt-4.d-flex.gap-2 .btn{
    width:100%;
    min-height:44px;
  }

  body.thea-mobile-bottom-nav-disabled .thea-ui-form-page .thea-ui-form-actions,
  body.thea-mobile-bottom-nav-disabled .thea-ui-form-page form > .d-flex.gap-2.mt-3,
  body.thea-mobile-bottom-nav-disabled .thea-ui-form-page form > .d-flex.gap-2.mt-4,
  body.thea-mobile-bottom-nav-disabled .thea-ui-form-page form > .mt-3.d-flex.gap-2,
  body.thea-mobile-bottom-nav-disabled .thea-ui-form-page form > .mt-4.d-flex.gap-2{
    bottom:calc(env(safe-area-inset-bottom,0px) + .55rem);
  }
}

/* TheaCRM v2.8.424 – customer portal final mobile polish
   Dotažení zákaznického portálu po foundation vrstvách: přehlednější karty,
   bezpečné mobilní odsazení, lepší galerie, tabulky a akční bloky. */
.thea-client-ui-page{
  --thea-client-gap: clamp(.8rem, 2vw, 1.1rem);
}

.thea-client-ui-page .client-main,
.thea-client-ui-page main.container,
.thea-client-ui-page main.container-fluid{
  padding-bottom:calc(var(--thea-ui-safe-bottom, 0px) + 24px);
}

.thea-client-ui-page .client-card,
.thea-client-ui-page .client-list-item,
.thea-client-ui-page .client-stat{
  overflow-wrap:anywhere;
}

.thea-client-ui-page .client-card > :last-child,
.thea-client-ui-page .client-list-item > :last-child{
  margin-bottom:0;
}

.thea-client-ui-page .client-section-title{
  display:flex;
  align-items:center;
  gap:.45rem;
  min-width:0;
}

.thea-client-ui-page .client-section-title i,
.thea-client-ui-page .client-list-title i{
  color:var(--thea-ui-primary);
}

.thea-client-ui-page .client-list-meta,
.thea-client-ui-page .client-meta,
.thea-client-ui-page .client-card-meta{
  display:flex;
  gap:.5rem .75rem;
  flex-wrap:wrap;
  align-items:center;
  color:var(--thea-ui-muted);
}

.thea-client-ui-page .client-pill,
.thea-client-ui-page .client-badge,
.thea-client-ui-page .badge{
  border-radius:999px;
}

.thea-client-ui-page .client-stat{
  min-height:100%;
}

.thea-client-ui-page .client-stat strong{
  letter-spacing:-.03em;
}

.thea-client-ui-page .client-actions .btn,
.thea-client-ui-page .client-toolbar .btn,
.thea-client-ui-page .client-form-actions .btn{
  border-radius:999px;
}

.thea-client-ui-page .client-actions .btn-client,
.thea-client-ui-page .client-form-actions .btn-client{
  box-shadow:0 10px 24px rgba(25,135,84,.15);
}

.thea-client-ui-page .table-responsive,
.thea-client-ui-page .client-table-wrap{
  border:1px solid var(--thea-ui-border);
  border-radius:var(--thea-ui-radius);
  overflow:auto;
  -webkit-overflow-scrolling:touch;
}

.thea-client-ui-page .table-responsive > .table,
.thea-client-ui-page .client-table-wrap > .table{
  margin-bottom:0;
}

.thea-client-ui-page details.client-card,
.thea-client-ui-page .client-card details{
  min-width:0;
}

.thea-client-ui-page details summary{
  min-width:0;
}

.thea-client-ui-page details summary:focus-visible,
.thea-client-ui-page .client-list-item:focus-within{
  outline:3px solid rgba(25,135,84,.18);
  outline-offset:3px;
}

.thea-client-ui-page .report-thumb,
.thea-client-ui-page .client-project-gallery-grid img,
.thea-client-ui-page img.report-thumb{
  border-radius:14px;
  box-shadow:0 8px 18px rgba(16,24,40,.10);
}

.thea-client-ui-page .client-project-gallery-grid{
  width:100%;
}

.thea-client-ui-page .client-project-gallery-grid a{
  min-width:0;
}

.thea-client-ui-page .alert{
  border-radius:var(--thea-ui-radius-sm);
}

.thea-client-ui-page .client-profile-password-panel,
.thea-client-ui-page .client-password-card{
  border:1px solid rgba(25,135,84,.16);
  background:linear-gradient(180deg, rgba(25,135,84,.04), rgba(255,255,255,.92));
}

@media (max-width:767.98px){
  .thea-client-ui-page{
    background:#f6faf7;
  }

  .thea-client-ui-page h1{
    font-size:1.42rem;
    line-height:1.16;
    margin-bottom:.85rem !important;
  }

  .thea-client-ui-page h2,
  .thea-client-ui-page .h2{
    font-size:1.15rem;
  }

  .thea-client-ui-page .client-section-title{
    font-size:1rem;
    line-height:1.2;
  }

  .thea-client-ui-page .row{
    --bs-gutter-x:.75rem;
    --bs-gutter-y:.75rem;
  }

  .thea-client-ui-page .client-card,
  .thea-client-ui-page .client-list-item,
  .thea-client-ui-page .client-stat{
    border-radius:20px !important;
    box-shadow:0 8px 22px rgba(16,24,40,.07);
  }

  .thea-client-ui-page .client-stat{
    padding:.85rem !important;
  }

  .thea-client-ui-page .client-stat span{
    font-size:.78rem;
  }

  .thea-client-ui-page .client-stat strong{
    font-size:1.05rem !important;
  }

  .thea-client-ui-page .client-actions,
  .thea-client-ui-page .client-toolbar,
  .thea-client-ui-page .client-form-actions{
    display:grid !important;
    grid-template-columns:1fr;
    gap:.5rem !important;
    width:100%;
  }

  .thea-client-ui-page .client-actions .btn,
  .thea-client-ui-page .client-toolbar .btn,
  .thea-client-ui-page .client-form-actions .btn,
  .thea-client-ui-page .client-actions a.btn,
  .thea-client-ui-page .client-toolbar a.btn,
  .thea-client-ui-page .client-form-actions a.btn{
    width:100%;
    min-height:44px;
    justify-content:center;
    display:inline-flex;
    align-items:center;
  }

  .thea-client-ui-page .client-list-meta,
  .thea-client-ui-page .client-meta,
  .thea-client-ui-page .client-card-meta{
    font-size:.86rem;
  }

  .thea-client-ui-page .client-pill,
  .thea-client-ui-page .client-badge,
  .thea-client-ui-page .badge{
    font-size:.76rem;
    line-height:1.25;
    padding:.28rem .48rem;
  }

  .thea-client-ui-page .table-responsive,
  .thea-client-ui-page .client-table-wrap{
    margin-left:-.2rem;
    margin-right:-.2rem;
    border-radius:18px;
  }

  .thea-client-ui-page .table,
  .thea-client-ui-page .table-client{
    font-size:.88rem;
  }

  .thea-client-ui-page .table td,
  .thea-client-ui-page .table th{
    padding:.55rem .6rem;
    vertical-align:middle;
  }

  .thea-client-ui-page input.form-control,
  .thea-client-ui-page select.form-select,
  .thea-client-ui-page textarea.form-control{
    font-size:16px;
    min-height:46px;
    border-radius:16px;
  }

  .thea-client-ui-page textarea.form-control{
    min-height:118px;
  }

  .thea-client-ui-page .client-project-gallery-grid{
    grid-template-columns:repeat(2, minmax(0, 1fr)) !important;
    gap:.55rem !important;
  }

  .thea-client-ui-page .client-project-gallery-summary{
    align-items:flex-start !important;
  }

  .thea-client-ui-page .client-project-gallery-icon{
    width:46px !important;
    height:46px !important;
    border-radius:16px !important;
    font-size:1.25rem !important;
  }

  .thea-client-ui-page .report-thumb{
    width:76px;
    height:76px;
    object-fit:cover;
  }

  .thea-client-ui-page .lightGallery-captions,
  .thea-client-ui-page .lg-sub-html{
    font-size:.85rem;
  }

  .thea-client-ui-page .client-actions.thea-ui-sticky-mobile-actions,
  .thea-client-ui-page .client-form-actions.thea-ui-sticky-mobile-actions{
    position:sticky;
    bottom:calc(env(safe-area-inset-bottom,0px) + .65rem);
    z-index:30;
    background:rgba(255,255,255,.95);
    border:1px solid var(--thea-ui-border);
    border-radius:20px;
    padding:.65rem;
    box-shadow:0 -12px 32px rgba(16,24,40,.13);
    backdrop-filter:blur(14px);
    -webkit-backdrop-filter:blur(14px);
  }

  body.thea-has-mobile-bottom-nav:not(.thea-mobile-bottom-nav-disabled) .thea-client-ui-page .client-actions.thea-ui-sticky-mobile-actions,
  body.thea-has-mobile-bottom-nav:not(.thea-mobile-bottom-nav-disabled) .thea-client-ui-page .client-form-actions.thea-ui-sticky-mobile-actions{
    bottom:var(--thea-ui-safe-bottom);
  }
}

@media (max-width:420px){
  .thea-client-ui-page .client-project-gallery-grid{
    grid-template-columns:1fr 1fr !important;
  }
  .thea-client-ui-page .client-card{
    padding:.9rem !important;
  }
}

/* TheaCRM v2.8.424 – chat + notifications final polish
   Final pass pro pracovní chat, veřejný zákaznický chat, notifikace a WebPush stránky. */
.thea-chat-ui-page .thea-chat-shell,
.thea-chat-ui-page .thea-chat-panel,
.thea-chat-ui-page .chat-thread,
.thea-chat-ui-page .chat-card,
.thea-chat-ui-page .card,
.thea-notifications-ui-page .card,
.thea-webpush-ui-page .card,
.thea-notifications-ui-page .notification-card,
.thea-notifications-ui-page .list-group-item,
.thea-webpush-ui-page .list-group-item{
  border-radius:var(--thea-ui-radius-lg, 22px);
  border:1px solid var(--thea-ui-border, #d9e8dd);
  box-shadow:var(--thea-ui-shadow, 0 14px 38px rgba(16,24,40,.08));
  background:var(--thea-ui-surface, #fff);
}

.thea-chat-ui-page .thea-chat-header,
.thea-chat-ui-page .chat-header,
.thea-chat-ui-page .thread-header,
.thea-notifications-ui-page .card-header,
.thea-webpush-ui-page .card-header{
  border-bottom:1px solid var(--thea-ui-border, #d9e8dd);
  background:linear-gradient(135deg, rgba(247,251,248,.98), rgba(255,255,255,.96));
  border-radius:var(--thea-ui-radius-lg, 22px) var(--thea-ui-radius-lg, 22px) 0 0;
}

.thea-chat-ui-page .thea-chat-thread-tools,
.thea-chat-ui-page .chat-toolbar,
.thea-chat-ui-page .thread-actions,
.thea-notifications-ui-page .notification-actions,
.thea-notifications-ui-page .thea-ui-actions,
.thea-webpush-ui-page .thea-ui-actions{
  display:flex;
  flex-wrap:wrap;
  gap:.5rem;
  align-items:center;
}

.thea-chat-ui-page .thea-chat-message,
.thea-chat-ui-page .message,
.thea-chat-ui-page .chat-message{
  max-width:100%;
}

.thea-chat-ui-page .thea-chat-bubble,
.thea-chat-ui-page .message-bubble,
.thea-chat-ui-page .chat-bubble{
  border-radius:18px;
  box-shadow:0 8px 22px rgba(16,24,40,.08);
  overflow-wrap:anywhere;
  word-break:break-word;
}

.thea-chat-ui-page .thea-chat-composer,
.thea-chat-ui-page .chat-composer,
.thea-chat-ui-page form[enctype="multipart/form-data"]{
  border-top:1px solid var(--thea-ui-border, #d9e8dd);
  background:rgba(255,255,255,.96);
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
}

.thea-chat-ui-page .thea-chat-composer textarea,
.thea-chat-ui-page .chat-composer textarea{
  min-height:46px;
  max-height:148px;
  resize:vertical;
}

.thea-chat-ui-page .thea-chat-attachments,
.thea-chat-ui-page .attachment-list,
.thea-chat-ui-page .chat-attachments{
  display:flex;
  flex-wrap:wrap;
  gap:.45rem;
}

.thea-chat-ui-page .thea-chat-attachments img,
.thea-chat-ui-page .attachment-list img,
.thea-chat-ui-page .chat-attachments img{
  max-width:160px;
  border-radius:14px;
  border:1px solid var(--thea-ui-border, #d9e8dd);
}

.thea-notifications-ui-page .badge,
.thea-webpush-ui-page .badge,
.thea-notifications-ui-page .notification-badge{
  border-radius:999px;
  padding:.32rem .55rem;
}

.thea-notifications-ui-page .list-group,
.thea-webpush-ui-page .list-group{
  gap:.55rem;
  display:grid;
}

.thea-notifications-ui-page .list-group-item,
.thea-webpush-ui-page .list-group-item{
  border-radius:18px !important;
  margin:0;
}

.thea-notifications-ui-page .notification-unread,
.thea-notifications-ui-page .unread,
.thea-webpush-ui-page .notification-unread,
.thea-webpush-ui-page .unread{
  border-left:5px solid var(--thea-ui-green, #1f7a3a) !important;
  background:linear-gradient(90deg, rgba(31,122,58,.10), rgba(255,255,255,.98));
}

@media (max-width:767.98px){
  .thea-chat-ui-page,
  .thea-notifications-ui-page,
  .thea-webpush-ui-page{
    --thea-chat-mobile-gap:.65rem;
  }

  .thea-chat-ui-page .container,
  .thea-chat-ui-page .container-fluid,
  .thea-notifications-ui-page .container,
  .thea-notifications-ui-page .container-fluid,
  .thea-webpush-ui-page .container,
  .thea-webpush-ui-page .container-fluid{
    padding-left:.75rem !important;
    padding-right:.75rem !important;
  }

  .thea-chat-ui-page .thea-chat-shell,
  .thea-chat-ui-page .thea-chat-panel,
  .thea-chat-ui-page .chat-thread,
  .thea-chat-ui-page .chat-card{
    border-radius:18px !important;
    min-height:0;
  }

  .thea-chat-ui-page .thea-chat-header,
  .thea-chat-ui-page .chat-header,
  .thea-chat-ui-page .thread-header{
    padding:.7rem .75rem !important;
  }

  .thea-chat-ui-page .thea-chat-header h1,
  .thea-chat-ui-page .thea-chat-header h2,
  .thea-chat-ui-page .chat-header h1,
  .thea-chat-ui-page .thread-header h1{
    font-size:1rem !important;
    line-height:1.18;
    margin:0;
    overflow:hidden;
    text-overflow:ellipsis;
    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
  }

  .thea-chat-ui-page .thea-chat-thread-tools,
  .thea-chat-ui-page .chat-toolbar,
  .thea-chat-ui-page .thread-actions,
  .thea-notifications-ui-page .notification-actions,
  .thea-webpush-ui-page .thea-ui-actions{
    display:grid !important;
    grid-template-columns:1fr;
    gap:.45rem;
    width:100%;
  }

  .thea-chat-ui-page .thea-chat-thread-tools .btn,
  .thea-chat-ui-page .chat-toolbar .btn,
  .thea-chat-ui-page .thread-actions .btn,
  .thea-notifications-ui-page .notification-actions .btn,
  .thea-webpush-ui-page .thea-ui-actions .btn{
    width:100%;
    min-height:42px;
    justify-content:center;
  }

  .thea-chat-ui-page .thea-chat-messages,
  .thea-chat-ui-page .chat-messages,
  .thea-chat-ui-page .messages{
    padding:.65rem !important;
    scroll-padding-bottom:110px;
  }

  .thea-chat-ui-page .thea-chat-bubble,
  .thea-chat-ui-page .message-bubble,
  .thea-chat-ui-page .chat-bubble{
    max-width:min(88vw, 560px) !important;
    border-radius:16px;
    font-size:.94rem;
  }

  .thea-chat-ui-page .thea-chat-composer,
  .thea-chat-ui-page .chat-composer{
    padding:.55rem .65rem calc(.55rem + env(safe-area-inset-bottom,0px)) !important;
    position:sticky;
    bottom:0;
    z-index:32;
  }

  .thea-chat-ui-page .thea-chat-composer-row,
  .thea-chat-ui-page .chat-composer-row{
    display:grid !important;
    grid-template-columns:1fr auto;
    gap:.45rem;
    align-items:end;
  }

  .thea-chat-ui-page .thea-chat-composer textarea,
  .thea-chat-ui-page .chat-composer textarea{
    font-size:16px;
    min-height:44px;
    max-height:112px;
  }

  .thea-chat-ui-page .thea-chat-composer input[type="file"],
  .thea-chat-ui-page .chat-composer input[type="file"]{
    grid-column:1 / -1;
    width:100%;
    font-size:.88rem;
  }

  .thea-chat-ui-page .reaction-menu,
  .thea-chat-ui-page .thea-chat-reactions{
    display:none !important;
  }

  .thea-notifications-ui-page .list-group,
  .thea-webpush-ui-page .list-group{
    gap:.5rem;
  }

  .thea-notifications-ui-page .list-group-item,
  .thea-webpush-ui-page .list-group-item{
    padding:.75rem !important;
  }

  .thea-notifications-ui-page table,
  .thea-webpush-ui-page table{
    font-size:.88rem;
  }
}

/* TheaCRM v2.8.424 – accessibility + compact mode cleanup
   Cíl: poslední průchod foundation vrstvy pro čitelnost, fokus, tap-targety,
   reduced motion a volitelný compact režim bez zásahu do jednotlivých modulů. */
:root{
  --thea-focus-ring: 0 0 0 .22rem rgba(31,122,58,.22);
  --thea-focus-outline: #1f7a3a;
  --thea-compact-gap: .62rem;
  --thea-compact-radius: 14px;
}

/* Přístupný skip link – vložený JS, stylovaný zde. */
.thea-skip-link{
  position:fixed;
  left:12px;
  top:10px;
  z-index:2147482500;
  transform:translateY(-150%);
  transition:transform .16s ease;
  background:#123820;
  color:#fff !important;
  border-radius:999px;
  padding:.62rem .9rem;
  font-weight:800;
  text-decoration:none;
  box-shadow:0 12px 30px rgba(15,23,42,.28);
}
.thea-skip-link:focus,
.thea-skip-link:focus-visible{ transform:translateY(0); outline:2px solid #fff; outline-offset:2px; }

/* Lepší fokus – jen přes :focus-visible, aby nerušil klik myší. */
.thea-ui-interaction-page a:focus-visible,
.thea-ui-interaction-page button:focus-visible,
.thea-ui-interaction-page .btn:focus-visible,
.thea-ui-interaction-page input:focus-visible,
.thea-ui-interaction-page select:focus-visible,
.thea-ui-interaction-page textarea:focus-visible,
.thea-ui-interaction-page [tabindex]:focus-visible,
.thea-client-ui-page a:focus-visible,
.thea-client-ui-page button:focus-visible,
.thea-client-ui-page .btn:focus-visible,
.thea-client-ui-page input:focus-visible,
.thea-client-ui-page select:focus-visible,
.thea-client-ui-page textarea:focus-visible,
.thea-client-ui-page [tabindex]:focus-visible{
  outline:2px solid var(--thea-focus-outline) !important;
  outline-offset:2px !important;
  box-shadow:var(--thea-focus-ring) !important;
}

/* Icon-only tlačítka drží minimální klikací plochu. */
.thea-ui-interaction-page .btn-icon,
.thea-ui-interaction-page .btn-ghost,
.thea-ui-interaction-page .dropdown-toggle.btn-sm,
.thea-ui-interaction-page button[aria-label],
.thea-client-ui-page .btn-icon,
.thea-client-ui-page .btn-ghost,
.thea-client-ui-page button[aria-label]{
  min-width:38px;
  min-height:38px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

@media (max-width:767.98px){
  .thea-ui-interaction-page .btn,
  .thea-ui-interaction-page button,
  .thea-ui-interaction-page input[type="button"],
  .thea-ui-interaction-page input[type="submit"],
  .thea-client-ui-page .btn,
  .thea-client-ui-page button,
  .thea-client-ui-page input[type="button"],
  .thea-client-ui-page input[type="submit"]{
    min-height:42px;
  }

  .thea-ui-interaction-page .form-check-input,
  .thea-client-ui-page .form-check-input{
    min-width:1.15rem;
    min-height:1.15rem;
  }

  .thea-ui-interaction-page .dropdown-menu,
  .thea-client-ui-page .dropdown-menu{
    border-radius:18px;
    box-shadow:0 18px 45px rgba(15,23,42,.18);
  }

  .thea-ui-interaction-page .dropdown-menu .dropdown-item,
  .thea-client-ui-page .dropdown-menu .dropdown-item{
    min-height:42px;
    display:flex;
    align-items:center;
    gap:.45rem;
    white-space:normal;
  }
}

/* Compact mode – zapíná JS podle localStorage nebo query parametru ?compact=1.
   Nezmenšuje text agresivně, spíš ubírá mezery a poloměry. */
html.thea-ui-compact,
body.thea-ui-compact{
  --thea-card-radius: var(--thea-compact-radius);
}
body.thea-ui-compact .container,
body.thea-ui-compact .container-fluid{
  --bs-gutter-x: 1rem;
}
body.thea-ui-compact .card,
body.thea-ui-compact .thea-card,
body.thea-ui-compact .client-card,
body.thea-ui-compact .list-card,
body.thea-ui-compact .thea-ui-document-surface,
body.thea-ui-compact .thea-ui-chat-surface,
body.thea-ui-compact .thea-ui-notification-surface{
  border-radius:var(--thea-compact-radius) !important;
}
body.thea-ui-compact .card-body,
body.thea-ui-compact .thea-card,
body.thea-ui-compact .client-card,
body.thea-ui-compact .list-card,
body.thea-ui-compact .thea-ui-document-surface,
body.thea-ui-compact .thea-ui-notification-surface{
  padding:.78rem !important;
}
body.thea-ui-compact .row,
body.thea-ui-compact .g-3{
  --bs-gutter-x:.75rem;
  --bs-gutter-y:.75rem;
}
body.thea-ui-compact h1{ font-size:clamp(1.28rem, 3vw, 1.85rem); }
body.thea-ui-compact h2{ font-size:clamp(1.08rem, 2.4vw, 1.35rem); }
body.thea-ui-compact .btn{ border-radius:12px; }
body.thea-ui-compact .form-control,
body.thea-ui-compact .form-select{ border-radius:12px; }
body.thea-ui-compact .table > :not(caption) > * > *{ padding:.48rem .55rem; }

@media (max-width:767.98px){
  body.thea-ui-compact .container,
  body.thea-ui-compact .container-fluid{
    padding-left:.7rem !important;
    padding-right:.7rem !important;
  }
  body.thea-ui-compact .card-body,
  body.thea-ui-compact .thea-card,
  body.thea-ui-compact .client-card,
  body.thea-ui-compact .list-card{
    padding:.72rem !important;
  }
}

/* Čitelnost u pomocných textů a disabled stavů. */
.thea-ui-interaction-page .text-muted,
.thea-ui-interaction-page .form-text,
.thea-ui-interaction-page small.text-muted,
.thea-client-ui-page .client-muted,
.thea-client-ui-page .form-text,
.thea-client-ui-page small.text-muted{
  color:#5f6f66 !important;
}
.thea-ui-interaction-page .btn:disabled,
.thea-ui-interaction-page .form-control:disabled,
.thea-ui-interaction-page .form-select:disabled,
.thea-client-ui-page .btn:disabled,
.thea-client-ui-page .form-control:disabled,
.thea-client-ui-page .form-select:disabled{
  opacity:.68;
  cursor:not-allowed;
}

/* Reduced motion – respektovat systémové nastavení. */
@media (prefers-reduced-motion: reduce){
  html:focus-within{ scroll-behavior:auto !important; }
  *, *::before, *::after{
    animation-duration:.01ms !important;
    animation-iteration-count:1 !important;
    scroll-behavior:auto !important;
    transition-duration:.01ms !important;
  }
}

/* Tisk a dlouhé texty v detailech. */
.thea-ui-interaction-page .thea-ui-long-text,
.thea-client-ui-page .thea-ui-long-text,
.thea-ui-interaction-page .description,
.thea-client-ui-page .description{
  overflow-wrap:anywhere;
  word-break:normal;
}

@media print{
  .thea-mobile-bottom-nav,
  .thea-mobile-quick-add-backdrop,
  .navbar,
  .bottom-nav,
  .thea-ui-sticky-mobile-actions,
  .thea-skip-link{
    display:none !important;
  }
  body{
    padding-bottom:0 !important;
    background:#fff !important;
  }
  .card,
  .client-card,
  .thea-card{
    box-shadow:none !important;
    border:1px solid #ddd !important;
  }
}

/* ==========================================================
   TheaCRM v2.8.421 – empty states + error pages polish
   ========================================================== */

.thea-ui-empty-state,
.thea-client-empty-state,
.thea-ui-error-page .thea-ui-error-card{
  border:1px solid rgba(31,122,58,.14) !important;
  background:linear-gradient(135deg, rgba(255,255,255,.98), rgba(244,250,246,.96)) !important;
  border-radius:24px !important;
  box-shadow:0 16px 42px rgba(15,23,42,.07) !important;
}

.thea-ui-empty-state,
.thea-client-empty-state{
  padding:1.25rem !important;
  display:flex;
  gap:1rem;
  align-items:flex-start;
  color:#1f2f26;
}

.thea-ui-empty-icon,
.thea-client-empty-icon,
.thea-ui-error-icon{
  width:54px;
  height:54px;
  border-radius:20px;
  display:grid;
  place-items:center;
  flex:0 0 auto;
  color:#14532d;
  background:linear-gradient(135deg, #e7f4eb, #f3faf5);
  border:1px solid rgba(31,122,58,.14);
  font-size:1.55rem;
}

.thea-ui-empty-title,
.thea-client-empty-title,
.thea-ui-error-title{
  font-weight:850;
  line-height:1.18;
  margin:0 0 .22rem;
  color:#14251b;
}

.thea-ui-empty-text,
.thea-client-empty-text,
.thea-ui-error-text{
  color:#5f6f66;
  margin:0;
  line-height:1.45;
}

.thea-ui-empty-actions,
.thea-client-empty-actions,
.thea-ui-error-actions{
  display:flex;
  flex-wrap:wrap;
  gap:.55rem;
  margin-top:.85rem;
}

.thea-ui-error-page{
  max-width:920px;
  margin:0 auto;
  padding:clamp(1rem, 4vw, 2.5rem) 0;
}

.thea-ui-error-card{
  overflow:hidden;
}

.thea-ui-error-card .card-body{
  padding:clamp(1.2rem, 4vw, 2.5rem) !important;
}

.thea-ui-error-code{
  display:inline-flex;
  align-items:center;
  gap:.45rem;
  font-size:.8rem;
  font-weight:800;
  letter-spacing:.045em;
  text-transform:uppercase;
  color:#5f6f66;
  background:#f2f7f4;
  border:1px solid rgba(31,122,58,.12);
  border-radius:999px;
  padding:.28rem .65rem;
  margin-bottom:.75rem;
}

.thea-ui-error-path{
  margin-top:1rem;
  border:1px solid rgba(15,23,42,.08) !important;
  background:#f8fbf9 !important;
  border-radius:18px !important;
  padding:.85rem 1rem !important;
}

.thea-ui-error-path code{
  display:block;
  white-space:normal;
  overflow-wrap:anywhere;
  color:#1f2f26;
}

.thea-ui-flash-stack .alert,
.thea-ui-interaction-page .alert,
.thea-client-ui-page .alert{
  border-radius:18px;
  border-width:1px;
  box-shadow:0 10px 26px rgba(15,23,42,.05);
}

.thea-ui-interaction-page .alert:empty,
.thea-client-ui-page .alert:empty,
.thea-ui-interaction-page .card:empty,
.thea-client-ui-page .client-card:empty{
  display:none !important;
}

/* Automaticky ošetřené prázdné řádky v tabulkách a seznamech. */
.thea-ui-empty-row td,
.thea-ui-empty-row th{
  padding:1rem !important;
  text-align:center !important;
  color:#5f6f66 !important;
  background:#f8fbf9 !important;
  border-bottom:0 !important;
}

.thea-ui-empty-row td::before,
.thea-ui-empty-row th::before{
  content:'∅';
  display:inline-grid;
  place-items:center;
  width:1.6rem;
  height:1.6rem;
  margin-right:.45rem;
  border-radius:999px;
  background:#e7f4eb;
  color:#14532d;
  font-weight:900;
}

.thea-ui-loading-surface,
.thea-client-loading-surface{
  border-radius:20px;
  border:1px solid rgba(31,122,58,.12);
  background:linear-gradient(90deg, #f6faf7, #fff, #f6faf7);
  background-size:220% 100%;
  animation:thea-ui-loading-shimmer 1.55s ease-in-out infinite;
}

@keyframes thea-ui-loading-shimmer{
  0%{ background-position:0 0; }
  100%{ background-position:220% 0; }
}

.thea-ui-save-state,
.thea-ui-submit-state,
.thea-ui-send-state{
  display:inline-flex;
  align-items:center;
  gap:.45rem;
}

.thea-ui-save-state::before,
.thea-ui-submit-state::before,
.thea-ui-send-state::before{
  content:'';
  width:.8rem;
  height:.8rem;
  border-radius:999px;
  border:2px solid currentColor;
  border-right-color:transparent;
  animation:thea-ui-spin .75s linear infinite;
}

@keyframes thea-ui-spin{ to{ transform:rotate(360deg); } }

@media (max-width:767.98px){
  .thea-ui-empty-state,
  .thea-client-empty-state{
    border-radius:20px !important;
    padding:1rem !important;
    gap:.78rem;
  }

  .thea-ui-empty-icon,
  .thea-client-empty-icon,
  .thea-ui-error-icon{
    width:46px;
    height:46px;
    border-radius:17px;
    font-size:1.28rem;
  }

  .thea-ui-error-page{
    padding:.75rem 0 calc(1rem + var(--thea-mobile-bottom-nav-height, 76px) + env(safe-area-inset-bottom, 0px));
  }

  .thea-ui-error-actions,
  .thea-ui-empty-actions,
  .thea-client-empty-actions{
    display:grid;
    grid-template-columns:1fr;
  }

  .thea-ui-error-actions .btn,
  .thea-ui-empty-actions .btn,
  .thea-client-empty-actions .btn{
    width:100%;
  }
}

/* ========================================================================
   TheaCRM v2.8.421 – badges + status colors cleanup
   ======================================================================== */
.thea-ui-status-badge,
.thea-ui-status-pill,
.thea-status-badge,
.badge.thea-ui-status-badge{
  display:inline-flex !important;
  align-items:center;
  gap:.38rem;
  max-width:100%;
  min-height:1.55rem;
  padding:.26rem .62rem !important;
  border-radius:999px !important;
  border:1px solid transparent;
  font-weight:800 !important;
  font-size:.76rem !important;
  line-height:1.1 !important;
  letter-spacing:.01em;
  white-space:nowrap;
  vertical-align:middle;
}

.thea-ui-status-badge::before,
.thea-ui-status-pill::before{
  content:'';
  width:.46rem;
  height:.46rem;
  border-radius:999px;
  background:currentColor;
  opacity:.82;
  flex:0 0 auto;
}

.thea-status-neutral{ background:#f3f6f4 !important; color:#415148 !important; border-color:#dbe5df !important; }
.thea-status-info{ background:#e8f1ff !important; color:#174ea6 !important; border-color:#bfd5ff !important; }
.thea-status-primary{ background:#e7f4eb !important; color:#14532d !important; border-color:#badfca !important; }
.thea-status-success{ background:#dcfce7 !important; color:#166534 !important; border-color:#bbf7d0 !important; }
.thea-status-warning{ background:#fff7d6 !important; color:#854d0e !important; border-color:#fde68a !important; }
.thea-status-danger{ background:#fee2e2 !important; color:#991b1b !important; border-color:#fecaca !important; }
.thea-status-muted{ background:#f4f4f5 !important; color:#52525b !important; border-color:#e4e4e7 !important; }
.thea-status-internal{ background:#f1f5f9 !important; color:#334155 !important; border-color:#cbd5e1 !important; }
.thea-status-customer{ background:#ecfdf5 !important; color:#047857 !important; border-color:#a7f3d0 !important; }
.thea-status-overdue{ background:#fee2e2 !important; color:#991b1b !important; border-color:#fecaca !important; box-shadow:0 0 0 3px rgba(239,68,68,.07); }
.thea-status-paid{ background:#dcfce7 !important; color:#166534 !important; border-color:#bbf7d0 !important; }
.thea-status-done{ background:#dcfce7 !important; color:#166534 !important; border-color:#bbf7d0 !important; }
.thea-status-draft{ background:#f4f4f5 !important; color:#52525b !important; border-color:#e4e4e7 !important; }
.thea-status-sent{ background:#e8f1ff !important; color:#174ea6 !important; border-color:#bfd5ff !important; }
.thea-status-approved{ background:#dcfce7 !important; color:#166534 !important; border-color:#bbf7d0 !important; }
.thea-status-rejected{ background:#fee2e2 !important; color:#991b1b !important; border-color:#fecaca !important; }
.thea-status-progress{ background:#e0f2fe !important; color:#075985 !important; border-color:#bae6fd !important; }
.thea-status-new{ background:#ede9fe !important; color:#5b21b6 !important; border-color:#ddd6fe !important; }

.thea-ui-status-dot{
  width:.55rem;
  height:.55rem;
  border-radius:999px;
  display:inline-block;
  background:currentColor;
  opacity:.88;
  flex:0 0 auto;
}

.thea-ui-status-legend{
  display:flex;
  flex-wrap:wrap;
  gap:.45rem;
  align-items:center;
  margin:.5rem 0;
}

.thea-ui-status-chip-row{
  display:flex;
  flex-wrap:wrap;
  gap:.35rem;
  align-items:center;
}

.thea-ui-status-count{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:1.4rem;
  height:1.4rem;
  padding:0 .38rem;
  border-radius:999px;
  background:rgba(15,23,42,.08);
  font-weight:900;
  font-size:.72rem;
}

.thea-ui-visibility-badge{
  display:inline-flex !important;
  align-items:center;
  gap:.35rem;
  border-radius:999px !important;
  padding:.22rem .56rem !important;
  font-size:.73rem !important;
  font-weight:800 !important;
  border:1px solid #dbe5df;
  background:#f8fbf9;
  color:#415148;
}
.thea-ui-visibility-badge.is-public,
.thea-ui-visibility-badge.is-customer-visible{
  background:#ecfdf5;
  color:#047857;
  border-color:#a7f3d0;
}
.thea-ui-visibility-badge.is-private,
.thea-ui-visibility-badge.is-internal{
  background:#f1f5f9;
  color:#334155;
  border-color:#cbd5e1;
}

.thea-ui-priority-high{ background:#fee2e2 !important; color:#991b1b !important; border-color:#fecaca !important; }
.thea-ui-priority-medium{ background:#fff7d6 !important; color:#854d0e !important; border-color:#fde68a !important; }
.thea-ui-priority-low{ background:#e7f4eb !important; color:#14532d !important; border-color:#badfca !important; }

@media (max-width:767.98px){
  .thea-ui-status-badge,
  .thea-ui-status-pill,
  .thea-status-badge,
  .badge.thea-ui-status-badge{
    min-height:1.72rem;
    padding:.32rem .66rem !important;
    font-size:.78rem !important;
  }

  .thea-ui-status-chip-row,
  .thea-ui-status-legend{
    gap:.4rem;
  }

  .thea-ui-status-chip-row > *,
  .thea-ui-status-legend > *{
    max-width:100%;
  }
}

.thea-ui-status-row{
  position:relative;
}
.thea-ui-status-row::before{
  content:'';
  position:absolute;
  left:0;
  top:.35rem;
  bottom:.35rem;
  width:3px;
  border-radius:999px;
  background:#dbe5df;
  opacity:.75;
}
tr.thea-ui-status-row::before{ display:none; }
tr.thea-status-overdue-row > :first-child,
tr.thea-status-danger-row > :first-child,
tr.thea-status-rejected-row > :first-child{ border-left:3px solid #ef4444 !important; }
tr.thea-status-paid-row > :first-child,
tr.thea-status-done-row > :first-child,
tr.thea-status-approved-row > :first-child{ border-left:3px solid #22c55e !important; }
tr.thea-status-warning-row > :first-child{ border-left:3px solid #f59e0b !important; }
tr.thea-status-progress-row > :first-child,
tr.thea-status-sent-row > :first-child{ border-left:3px solid #0ea5e9 !important; }
.thea-status-overdue-row::before,
.thea-status-danger-row::before,
.thea-status-rejected-row::before{ background:#ef4444; }
.thea-status-paid-row::before,
.thea-status-done-row::before,
.thea-status-approved-row::before{ background:#22c55e; }
.thea-status-warning-row::before{ background:#f59e0b; }
.thea-status-progress-row::before,
.thea-status-sent-row::before{ background:#0ea5e9; }

/* =========================================================
   TheaCRM v2.8.421 – final mobile collision audit
   Cíl: poslední bezpečnostní vrstva proti překrývání spodní mobilní lišty,
   sticky akcí, modal/offcanvas footerů a formulářových tlačítek.
   ========================================================= */
:root{
  --thea-ui-measured-bottom-nav-height: var(--thea-mobile-bottom-nav-height, 74px);
  --thea-ui-measured-top-nav-height: var(--navbar-height, 64px);
  --thea-ui-safe-bottom-gap: 14px;
  --thea-ui-action-lift: calc(var(--thea-ui-measured-bottom-nav-height) + var(--thea-ui-safe-bottom-gap) + env(safe-area-inset-bottom, 0px));
}

.thea-ui-mobile-collision-page{
  --thea-ui-current-bottom-nav-height: var(--thea-ui-measured-bottom-nav-height);
}

@media (max-width: 767.98px){
  body.thea-ui-mobile-collision-page:not(.thea-mobile-bottom-nav-disabled){
    padding-bottom: calc(var(--thea-ui-measured-bottom-nav-height) + env(safe-area-inset-bottom, 0px));
  }

  body.thea-ui-mobile-collision-page.thea-mobile-bottom-nav-disabled{
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
  }

  body.thea-ui-mobile-collision-page main,
  body.thea-ui-mobile-collision-page .main-content,
  body.thea-ui-mobile-collision-page .page-content,
  body.thea-ui-mobile-collision-page .content-wrapper,
  body.thea-ui-mobile-collision-page .container-fluid{
    scroll-padding-bottom: calc(var(--thea-ui-action-lift) + 24px);
  }

  .thea-ui-collision-lift{
    bottom: var(--thea-ui-action-lift) !important;
    z-index: 1040 !important;
  }

  .thea-ui-collision-margin-safe{
    margin-bottom: calc(var(--thea-ui-action-lift) + 10px) !important;
  }

  .thea-ui-collision-padding-safe{
    padding-bottom: calc(var(--thea-ui-action-lift) + 10px) !important;
  }

  .thea-ui-mobile-collision-page .modal.show .modal-dialog{
    margin-bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
  }

  .thea-ui-mobile-collision-page .modal.show .modal-content,
  .thea-ui-mobile-collision-page .offcanvas.show{
    max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  }

  .thea-ui-mobile-collision-page .modal-footer,
  .thea-ui-mobile-collision-page .offcanvas-footer,
  .thea-ui-mobile-collision-page .thea-ui-modal-actions,
  .thea-ui-mobile-collision-page .thea-ui-offcanvas-actions{
    padding-bottom: calc(.75rem + env(safe-area-inset-bottom, 0px)) !important;
  }

  body:not(.thea-mobile-bottom-nav-disabled) .thea-ui-mobile-collision-page .modal-footer,
  body:not(.thea-mobile-bottom-nav-disabled) .thea-ui-mobile-collision-page .offcanvas-footer{
    padding-bottom: calc(.75rem + env(safe-area-inset-bottom, 0px)) !important;
  }

  .thea-ui-mobile-collision-page input,
  .thea-ui-mobile-collision-page textarea,
  .thea-ui-mobile-collision-page select,
  .thea-ui-mobile-collision-page button,
  .thea-ui-mobile-collision-page .btn,
  .thea-ui-mobile-collision-page [tabindex]:not([tabindex="-1"]){
    scroll-margin-bottom: calc(var(--thea-ui-action-lift) + 22px);
    scroll-margin-top: calc(var(--thea-ui-measured-top-nav-height) + 14px);
  }

  .thea-ui-mobile-collision-page .dropdown-menu.show{
    max-height: min(70dvh, 460px);
    overflow:auto;
    -webkit-overflow-scrolling: touch;
  }

  .thea-ui-mobile-collision-page .table-responsive,
  .thea-ui-mobile-collision-page .thea-ui-table-scroll,
  .thea-ui-mobile-collision-page .thea-ui-safe-scroll-x{
    margin-bottom: .65rem;
    scroll-margin-bottom: calc(var(--thea-ui-action-lift) + 18px);
  }

  .thea-ui-mobile-collision-page .toast-container.position-fixed.bottom-0,
  .thea-ui-mobile-collision-page .toast-container.bottom-0{
    bottom: var(--thea-ui-action-lift) !important;
  }

  .thea-ui-mobile-collision-page .alert.position-fixed.bottom-0,
  .thea-ui-mobile-collision-page .thea-ui-bottom-toast,
  .thea-ui-mobile-collision-page .thea-ui-floating-message{
    bottom: var(--thea-ui-action-lift) !important;
  }
}

@supports not (height: 100dvh){
  @media (max-width: 767.98px){
    .thea-ui-mobile-collision-page .modal.show .modal-content,
    .thea-ui-mobile-collision-page .offcanvas.show{
      max-height: calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    }
  }
}


/* TheaCRM v2.8.424 – UI regression diagnostics */
.thea-ui-regression-page .thea-ui-diagnostics-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1rem;margin-bottom:1rem;}
.thea-ui-regression-page .thea-ui-diag-card{background:var(--thea-ui-surface,#fff);border:1px solid var(--thea-ui-border,rgba(16,24,40,.10));border-radius:var(--thea-ui-radius,18px);box-shadow:var(--thea-ui-shadow,0 12px 30px rgba(16,24,40,.07));padding:1rem;}
.thea-ui-regression-page .thea-ui-diag-label{font-size:.78rem;text-transform:uppercase;letter-spacing:.04em;color:var(--thea-ui-muted,#667085);font-weight:800;margin-bottom:.25rem;}
.thea-ui-regression-page .thea-ui-diag-value{font-size:1.55rem;font-weight:900;color:var(--thea-ui-text,#182230);line-height:1.1;}
.thea-ui-regression-page .thea-ui-checklist{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.75rem;}
.thea-ui-regression-page .thea-ui-check-item{border:1px solid var(--thea-ui-border,rgba(16,24,40,.10));border-radius:14px;padding:.75rem;background:rgba(255,255,255,.72);display:flex;gap:.65rem;align-items:flex-start;}
.thea-ui-regression-page .thea-ui-check-icon{width:28px;height:28px;border-radius:999px;display:grid;place-items:center;flex:0 0 auto;font-weight:900;}
.thea-ui-regression-page .thea-ui-check-item.is-ok .thea-ui-check-icon{background:rgba(25,135,84,.12);color:#198754;}
.thea-ui-regression-page .thea-ui-check-item.is-warn .thea-ui-check-icon{background:rgba(255,193,7,.16);color:#9a6700;}
.thea-ui-regression-page .thea-ui-risk-table code{white-space:normal;word-break:break-word;}
.thea-ui-regression-page .thea-ui-risk-table .badge{white-space:nowrap;}
@media (max-width: 991.98px){.thea-ui-regression-page .thea-ui-diagnostics-grid{grid-template-columns:repeat(2,minmax(0,1fr));}.thea-ui-regression-page .thea-ui-checklist{grid-template-columns:1fr;}}
@media (max-width: 575.98px){.thea-ui-regression-page .thea-ui-diagnostics-grid{grid-template-columns:1fr;}.thea-ui-regression-page .thea-ui-diag-value{font-size:1.35rem;}}


/* =========================================================
   TheaCRM v2.8.424 – customer communication + module header polish
   Cíl: sjednotit hlavičky modulů podle seznamu nabídek/faktur a dodat
   přehlednou komunikaci v zákaznickém portálu.
   ========================================================= */
.thea-ui-module-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
  margin-bottom:1rem;
  padding:.85rem 0;
}
.thea-ui-module-title,
.thea-ui-module-title-standalone{
  color:var(--thea-ui-primary,#198754) !important;
  font-weight:900 !important;
  letter-spacing:-.035em;
  margin-bottom:0 !important;
}
.thea-ui-module-title-standalone{
  display:inline-flex;
  align-items:center;
  gap:.45rem;
  padding:.15rem 0;
}
.thea-ui-module-header .btn-ghost-primary,
.thea-ui-module-header .btn-success,
.thea-ui-module-header .btn-primary{
  box-shadow:0 8px 20px rgba(25,135,84,.18);
}
.thea-doklady-ui-page .card,
.thea-fio-ui-page .card,
.thea-winter-ui-page .card,
.thea-stock-ui-page .card,
.thea-chat-ui-page .thea-chat-list-card,
.thea-chat-ui-page .thea-chat-shell{
  border-color:var(--thea-ui-border) !important;
  border-radius:var(--thea-ui-radius) !important;
  box-shadow:var(--thea-ui-shadow) !important;
}
.thea-doklady-ui-page .table-responsive,
.thea-fio-ui-page .table-responsive,
.thea-winter-ui-page .table-responsive,
.thea-stock-ui-page .table-responsive{
  background:var(--thea-ui-surface,#fff);
  border:1px solid var(--thea-ui-border);
  border-radius:var(--thea-ui-radius-sm);
  box-shadow:0 8px 22px rgba(16,24,40,.045);
}
.thea-client-ui-page .client-communication-card{
  border-color:rgba(25,135,84,.20) !important;
  background:linear-gradient(135deg,#ffffff,#f6fbf8) !important;
}
.client-communication-list{display:grid;gap:.55rem;}
.client-communication-item{
  display:flex !important;
  align-items:flex-start;
  gap:.75rem;
  position:relative;
}
.client-communication-item.is-new{
  border-color:rgba(25,135,84,.34) !important;
  box-shadow:inset 4px 0 0 var(--client-green,var(--thea-ui-primary,#198754));
}
.client-communication-icon{
  width:38px;
  height:38px;
  flex:0 0 auto;
  border-radius:14px;
  display:grid;
  place-items:center;
  background:rgba(25,135,84,.10);
  color:var(--thea-ui-primary,#198754);
  font-size:1.05rem;
}
.client-communication-subtitle{
  overflow:hidden;
  text-overflow:ellipsis;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
}
.thea-chat-thread-preview,
.client-communication-subtitle{word-break:break-word;}
@media (max-width:767.98px){
  .thea-ui-module-header{align-items:flex-start;flex-direction:column;padding:.5rem 0 .75rem;}
  .thea-ui-module-title,.thea-ui-module-title-standalone{font-size:1.45rem !important;line-height:1.15;}
  .client-communication-item{gap:.6rem;}
  .client-communication-icon{width:34px;height:34px;border-radius:12px;}
  .thea-client-ui-page .client-communication-card .client-actions{width:100%;justify-content:flex-start;}
}


/* =========================================================
   TheaCRM v2.8.424 – project detail layout hotfix + stocklike module headers
   ========================================================= */

/* Detail projektu je složitý dashboard/command-center. Musí být vyjmutý z příliš
   obecných list/header pravidel, jinak se top-level bloky zúží a text se láme
   po jednotlivých písmenech. */
body.thea-project-detail-layout-guard .thea-project-clean-card,
body.thea-project-detail-ui-page .thea-project-clean-card{
  display:block !important;
  column-count:auto !important;
  columns:auto !important;
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
}
body.thea-project-detail-layout-guard .thea-project-clean-card > h1,
body.thea-project-detail-layout-guard .thea-project-clean-card > .project-command-center,
body.thea-project-detail-layout-guard .thea-project-clean-card > .alert,
body.thea-project-detail-layout-guard .thea-project-clean-card > .row,
body.thea-project-detail-layout-guard .thea-project-clean-card > .nav,
body.thea-project-detail-layout-guard .thea-project-clean-card > .tab-content,
body.thea-project-detail-layout-guard .thea-project-clean-card > p,
body.thea-project-detail-layout-guard .thea-project-clean-card > .border,
body.thea-project-detail-ui-page .thea-project-clean-card > h1,
body.thea-project-detail-ui-page .thea-project-clean-card > .project-command-center,
body.thea-project-detail-ui-page .thea-project-clean-card > .alert,
body.thea-project-detail-ui-page .thea-project-clean-card > .row,
body.thea-project-detail-ui-page .thea-project-clean-card > .nav,
body.thea-project-detail-ui-page .thea-project-clean-card > .tab-content,
body.thea-project-detail-ui-page .thea-project-clean-card > p,
body.thea-project-detail-ui-page .thea-project-clean-card > .border{
  width:100% !important;
  max-width:100% !important;
  clear:both !important;
}
body.thea-project-detail-layout-guard .thea-project-clean-card,
body.thea-project-detail-layout-guard .thea-project-clean-card *,
body.thea-project-detail-ui-page .thea-project-clean-card,
body.thea-project-detail-ui-page .thea-project-clean-card *{
  word-break:normal !important;
  overflow-wrap:break-word;
  writing-mode:horizontal-tb !important;
  text-orientation:mixed !important;
}
body.thea-project-detail-layout-guard .project-page-title,
body.thea-project-detail-ui-page .project-page-title{
  display:block !important;
  white-space:normal !important;
  max-width:100% !important;
  color:#1f5f34 !important;
}
body.thea-project-detail-layout-guard .project-command-center,
body.thea-project-detail-ui-page .project-command-center{
  display:block !important;
  min-width:0 !important;
  overflow:visible !important;
}
body.thea-project-detail-layout-guard .project-command-head,
body.thea-project-detail-ui-page .project-command-head{
  min-width:min(260px,100%) !important;
  flex:1 1 280px !important;
}
body.thea-project-detail-layout-guard .project-command-actions,
body.thea-project-detail-ui-page .project-command-actions{
  min-width:260px !important;
}
body.thea-project-detail-layout-guard .project-command-tile,
body.thea-project-detail-ui-page .project-command-tile{
  min-width:0 !important;
  white-space:normal !important;
  overflow:hidden;
}
body.thea-project-detail-layout-guard .nav-tabs,
body.thea-project-detail-ui-page .nav-tabs{
  display:flex !important;
  flex-wrap:wrap !important;
  gap:.25rem;
}
body.thea-project-detail-layout-guard .nav-tabs .nav-link,
body.thea-project-detail-ui-page .nav-tabs .nav-link{
  white-space:normal !important;
  word-break:normal !important;
}
@media (min-width: 992px){
  body.thea-project-detail-layout-guard .project-command-tiles > [class*="col-"],
  body.thea-project-detail-ui-page .project-command-tiles > [class*="col-"]{
    min-width:180px;
  }
}
@media (max-width: 767.98px){
  body.thea-project-detail-layout-guard .project-command-actions,
  body.thea-project-detail-ui-page .project-command-actions{
    min-width:0 !important;
    width:100% !important;
  }
}

/* Skladový styl hlaviček pro seznamy/moduly: ikonka, nadpis, podnadpis. */
.thea-ui-stocklike-header{
  padding:1.15rem 1.25rem !important;
  margin:0 0 1rem 0 !important;
  border-bottom:1px solid var(--thea-ui-border,#e5e7eb);
  background:var(--thea-ui-surface,#fff);
  border-radius:var(--thea-ui-radius-sm,18px) var(--thea-ui-radius-sm,18px) 0 0;
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:1rem !important;
}
.thea-ui-stocklike-header .thea-ui-header-icon{
  width:48px;
  height:48px;
  border-radius:18px;
  display:grid;
  place-items:center;
  flex:0 0 auto;
  background:rgba(25,135,84,.10);
  color:var(--thea-ui-primary,#198754);
  font-size:1.35rem;
  border:1px solid rgba(25,135,84,.12);
}
.thea-ui-stocklike-header .thea-ui-header-title-wrap{
  min-width:0;
  flex:1 1 auto;
}
.thea-ui-stocklike-header .thea-ui-module-title,
.thea-ui-stocklike-header h1,
.thea-ui-stocklike-header h2{
  color:#1f6b37 !important;
  font-size:1.35rem !important;
  line-height:1.1 !important;
  margin:0 !important;
  letter-spacing:-.035em;
  font-weight:900 !important;
}
.thea-ui-stocklike-header .thea-ui-header-subtitle{
  color:var(--thea-ui-muted,#667085);
  font-size:.92rem;
  line-height:1.25;
  margin-top:.2rem;
}
.thea-ui-stocklike-header > .d-flex,
.thea-ui-stocklike-header .stock-actions,
.thea-ui-stocklike-header .header-actions{
  flex:0 0 auto;
}
@media (max-width:767.98px){
  .thea-ui-stocklike-header{
    padding:.95rem 1rem !important;
    border-radius:0 !important;
    gap:.75rem !important;
  }
  .thea-ui-stocklike-header .thea-ui-header-icon{
    width:42px;
    height:42px;
    border-radius:16px;
    font-size:1.18rem;
  }
  .thea-ui-stocklike-header .thea-ui-module-title,
  .thea-ui-stocklike-header h1,
  .thea-ui-stocklike-header h2{
    font-size:1.18rem !important;
  }
}

/* =========================================================
   TheaCRM v2.8.426 – stocklike list header regression hotfix
   Oprava: ikonka + nadpis musí tvořit levý blok a podnadpis/počet
   se nesmí vykreslovat dvakrát.
   ========================================================= */
.thea-ui-stocklike-header{
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:1rem !important;
  min-width:0 !important;
}
.thea-ui-stocklike-header .thea-ui-header-main{
  display:flex !important;
  align-items:center !important;
  gap:.75rem !important;
  min-width:0 !important;
  flex:1 1 auto !important;
}
.thea-ui-stocklike-header .thea-ui-header-main > .thea-ui-header-icon{
  flex:0 0 auto !important;
}
.thea-ui-stocklike-header .thea-ui-header-title-wrap{
  min-width:0 !important;
  flex:1 1 auto !important;
  display:block !important;
}
.thea-ui-stocklike-header .thea-ui-header-subtitle{
  display:block !important;
  color:var(--thea-ui-muted,#667085) !important;
  font-size:.92rem !important;
  line-height:1.25 !important;
  margin-top:.2rem !important;
}
.thea-ui-stocklike-header > .d-flex:last-child,
.thea-ui-stocklike-header > .stock-actions,
.thea-ui-stocklike-header > .header-actions,
.thea-ui-stocklike-header > .thea-ui-actions{
  margin-left:auto !important;
  flex:0 0 auto !important;
}
.thea-ui-stocklike-header .thea-ui-header-title-wrap ~ [data-thea-list-count],
.thea-ui-stocklike-header .thea-ui-header-title-wrap ~ .stock-subtitle,
.thea-ui-stocklike-header .thea-ui-header-title-wrap ~ small.text-muted,
.thea-ui-stocklike-header .thea-ui-header-title-wrap ~ .text-muted.small{
  display:none !important;
}
@media (max-width:767.98px){
  .thea-ui-stocklike-header{
    align-items:center !important;
    padding:.85rem .9rem .7rem !important;
  }
  .thea-ui-stocklike-header .thea-ui-header-main{
    gap:.65rem !important;
  }
  .thea-ui-stocklike-header > .d-flex:last-child,
  .thea-ui-stocklike-header > .stock-actions,
  .thea-ui-stocklike-header > .header-actions,
  .thea-ui-stocklike-header > .thea-ui-actions{
    align-self:center !important;
  }
}


/* =========================================================
   TheaCRM v2.8.427 – list UI width guard + stocklike headers
   Cíl: stránka bez globálního vodorovného posuvníku na menších noteboocích
   a stejné chování hlaviček u Kontakty / Organizace / Soubory / Doklady / Chat / Sklad.
   ========================================================= */
html,
body{
  max-width:100%;
  overflow-x:hidden;
}
.content{
  min-width:0 !important;
  box-sizing:border-box !important;
  max-width:100vw;
  overflow-x:clip;
}
@supports not (overflow: clip){
  .content{overflow-x:hidden;}
}
@media (min-width:992px){
  .content{
    width:calc(100vw - var(--sidebar-w,250px));
    max-width:calc(100vw - var(--sidebar-w,250px));
  }
  html.sidebar-collapsed .content{
    width:calc(100vw - var(--sidebar-w-collapsed,64px));
    max-width:calc(100vw - var(--sidebar-w-collapsed,64px));
  }
}
@media (max-width:991.98px){
  .content{width:100%;max-width:100vw;}
}
.content > .container,
.content > .container-fluid,
.content > .responsive-container,
.content > .thea-page,
.thea-page,
.thea-list-page,
.thea-directory-page,
.thea-card,
.stock-shell,
.stock-panel,
.files-container,
.thea-chat-page,
.thea-chat-list-card{
  min-width:0 !important;
  max-width:100% !important;
  box-sizing:border-box !important;
}
.thea-list-page .table-responsive,
.thea-page .table-responsive,
.stock-table-wrap{
  max-width:100% !important;
  overflow-x:auto !important;
  overflow-y:visible;
}
.stock-table-wrap{box-sizing:border-box;}
.thea-chat-filter-pills,
.files-quick-filters{
  min-width:0 !important;
  max-width:100% !important;
  overflow-x:auto;
}
.thea-ui-stocklike-header.appbar,
.thea-ui-stocklike-header.thea-chat-list-header,
.thea-ui-stocklike-header.thea-document-toolbar{
  position:relative !important;
  top:auto !important;
  z-index:auto !important;
  background:var(--thea-ui-surface,#fff) !important;
}
.thea-ui-stocklike-header.thea-chat-list-header{
  align-items:center !important;
  margin-bottom:1rem !important;
}
.thea-ui-stocklike-header .thea-chat-list-actions,
.thea-ui-stocklike-header .files-actions{
  margin-left:auto !important;
  flex:0 0 auto !important;
}
.thea-ui-stocklike-header .thea-chat-eyebrow{
  display:none !important;
}
.thea-ui-stocklike-header p.thea-ui-header-subtitle,
.thea-ui-stocklike-header .thea-ui-header-title-wrap > p{
  margin:.2rem 0 0 !important;
  color:var(--thea-ui-muted,#667085) !important;
  font-size:.92rem !important;
  line-height:1.25 !important;
}
.thea-ui-stocklike-header .btn-ghost,
.thea-ui-stocklike-header .stock-icon-btn{
  flex:0 0 auto;
}
body.thea-files-ui-page .files-filter-grid,
body.thea-files-ui-page .files-filter-grid-secondary{
  min-width:0;
}
@media (max-width:767.98px){
  .thea-ui-stocklike-header.appbar,
  .thea-ui-stocklike-header.thea-chat-list-header,
  .thea-ui-stocklike-header.thea-document-toolbar{
    margin-left:0 !important;
    margin-right:0 !important;
  }
  .thea-ui-stocklike-header .thea-chat-list-actions{
    gap:.35rem !important;
  }
}


/* =========================================================
   TheaCRM v2.8.428 – mobile stocklike header alignment
   Cíl: na mobilu držet ikonku + název + počet vlevo a akce vpravo.
   Oprava regresu z v2.8.427: .thea-ui-module-header na mobilu nastavoval
   flex-direction: column, takže tlačítka padala pod nadpis.
   ========================================================= */
.thea-ui-stocklike-header{
  flex-direction:row !important;
  flex-wrap:nowrap !important;
  align-items:center !important;
  justify-content:space-between !important;
  text-align:left !important;
}
.thea-ui-stocklike-header .thea-ui-header-main{
  flex:1 1 auto !important;
  min-width:0 !important;
  max-width:100% !important;
  justify-content:flex-start !important;
  text-align:left !important;
}
.thea-ui-stocklike-header .thea-ui-header-title-wrap{
  text-align:left !important;
  min-width:0 !important;
}
.thea-ui-stocklike-header .thea-ui-header-actions,
.thea-ui-stocklike-header > .d-flex:last-child,
.thea-ui-stocklike-header > .stock-actions,
.thea-ui-stocklike-header > .header-actions,
.thea-ui-stocklike-header > .thea-ui-actions,
.thea-ui-stocklike-header > .thea-chat-list-actions,
.thea-ui-stocklike-header > .files-actions{
  display:flex !important;
  flex-direction:row !important;
  align-items:center !important;
  justify-content:flex-end !important;
  flex-wrap:nowrap !important;
  gap:.35rem !important;
  margin-left:auto !important;
  flex:0 0 auto !important;
  min-width:max-content !important;
}
.thea-ui-stocklike-header .dropdown{
  flex:0 0 auto !important;
}
.thea-ui-stocklike-header .btn-ghost,
.thea-ui-stocklike-header .stock-icon-btn,
.thea-ui-stocklike-header .thea-chat-list-actions .btn{
  flex:0 0 auto !important;
}
@media (max-width:767.98px){
  .thea-ui-stocklike-header,
  .thea-ui-stocklike-header.thea-chat-list-header,
  .thea-ui-stocklike-header.thea-document-toolbar,
  .thea-ui-stocklike-header.appbar{
    flex-direction:row !important;
    flex-wrap:nowrap !important;
    align-items:center !important;
    justify-content:space-between !important;
    gap:.55rem !important;
    padding:.7rem .8rem !important;
    min-height:74px;
  }
  .thea-ui-stocklike-header .thea-ui-header-main{
    flex:1 1 auto !important;
    min-width:0 !important;
    gap:.55rem !important;
    overflow:hidden;
  }
  .thea-ui-stocklike-header .thea-ui-header-icon{
    width:42px !important;
    height:42px !important;
    border-radius:15px !important;
    font-size:1.08rem !important;
  }
  .thea-ui-stocklike-header .thea-ui-module-title,
  .thea-ui-stocklike-header h1,
  .thea-ui-stocklike-header h2{
    font-size:1.12rem !important;
    line-height:1.08 !important;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  .thea-ui-stocklike-header .thea-ui-header-subtitle,
  .thea-ui-stocklike-header p.thea-ui-header-subtitle,
  .thea-ui-stocklike-header .thea-ui-header-title-wrap > p{
    font-size:.84rem !important;
    line-height:1.2 !important;
    margin-top:.14rem !important;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  .thea-ui-stocklike-header .thea-ui-header-actions,
  .thea-ui-stocklike-header > .d-flex:last-child,
  .thea-ui-stocklike-header > .stock-actions,
  .thea-ui-stocklike-header > .header-actions,
  .thea-ui-stocklike-header > .thea-ui-actions,
  .thea-ui-stocklike-header > .thea-chat-list-actions,
  .thea-ui-stocklike-header > .files-actions{
    align-self:center !important;
    gap:.18rem !important;
    min-width:max-content !important;
  }
  .thea-ui-stocklike-header .btn-ghost,
  .thea-ui-stocklike-header .stock-icon-btn{
    width:38px !important;
    height:38px !important;
    min-width:38px !important;
    padding:0 !important;
    font-size:1.03rem !important;
  }
  .thea-ui-stocklike-header .btn-ghost-primary,
  .thea-ui-stocklike-header .btn-success,
  .thea-ui-stocklike-header .btn-primary{
    width:44px !important;
    height:44px !important;
    min-width:44px !important;
    padding:0 !important;
    border-radius:999px !important;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
  }
  .thea-ui-stocklike-header .thea-chat-list-actions .btn{
    width:40px !important;
    height:40px !important;
    min-width:40px !important;
    padding:0 !important;
    border-radius:999px !important;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    overflow:hidden;
    white-space:nowrap;
  }
  .thea-ui-stocklike-header .thea-chat-list-actions .btn i{
    margin:0 !important;
  }
  .thea-ui-stocklike-header .thea-chat-list-actions .btn{
    font-size:0 !important;
  }
  .thea-ui-stocklike-header .thea-chat-list-actions .btn i{
    font-size:1.05rem !important;
  }
}
@media (max-width:380px){
  .thea-ui-stocklike-header,
  .thea-ui-stocklike-header.thea-chat-list-header,
  .thea-ui-stocklike-header.thea-document-toolbar,
  .thea-ui-stocklike-header.appbar{
    gap:.45rem !important;
    padding-left:.65rem !important;
    padding-right:.65rem !important;
  }
  .thea-ui-stocklike-header .thea-ui-header-icon{
    width:38px !important;
    height:38px !important;
    border-radius:14px !important;
  }
  .thea-ui-stocklike-header .thea-ui-module-title,
  .thea-ui-stocklike-header h1,
  .thea-ui-stocklike-header h2{
    font-size:1.04rem !important;
  }
  .thea-ui-stocklike-header .btn-ghost,
  .thea-ui-stocklike-header .stock-icon-btn{
    width:36px !important;
    height:36px !important;
    min-width:36px !important;
  }
  .thea-ui-stocklike-header .btn-ghost-primary,
  .thea-ui-stocklike-header .btn-success,
  .thea-ui-stocklike-header .btn-primary{
    width:40px !important;
    height:40px !important;
    min-width:40px !important;
  }
}


/* =========================================================
   TheaCRM v2.8.435 – login/files/email UI polish
   ========================================================= */
.thea-login-card .thea-login-field,
.thea-login-card .thea-login-input-wrap,
.thea-login-card .thea-login-input,
.thea-login-card .thea-ui-password-wrap{
  width:100% !important;
  max-width:100% !important;
  box-sizing:border-box !important;
}
.thea-login-card .thea-login-input-wrap,
.thea-login-card .thea-ui-password-wrap{
  display:block !important;
  position:relative !important;
}
.thea-login-card .thea-ui-password-toggle{
  display:none !important;
}

body.thea-files-ui-page .thea-ui-stocklike-header.files-header,
body.thea-files-ui-page .thea-ui-stocklike-header.thea-document-toolbar{
  flex-direction:row !important;
  flex-wrap:nowrap !important;
  align-items:center !important;
  justify-content:space-between !important;
  text-align:left !important;
}
body.thea-files-ui-page .thea-ui-stocklike-header .thea-ui-header-main{
  justify-content:flex-start !important;
  text-align:left !important;
  min-width:0 !important;
  flex:1 1 auto !important;
}
body.thea-files-ui-page .thea-ui-stocklike-header .thea-ui-header-title-wrap{
  text-align:left !important;
  min-width:0 !important;
}
body.thea-files-ui-page .thea-ui-stocklike-header .thea-ui-header-actions{
  margin-left:auto !important;
  flex:0 0 auto !important;
  display:flex !important;
  align-items:center !important;
  justify-content:flex-end !important;
  flex-wrap:nowrap !important;
}
@media (max-width:767.98px){
  body.thea-files-ui-page .thea-ui-stocklike-header.files-header,
  body.thea-files-ui-page .thea-ui-stocklike-header.thea-document-toolbar{
    min-height:72px !important;
    padding:.72rem .78rem !important;
    gap:.55rem !important;
    border-radius:16px !important;
  }
  body.thea-files-ui-page .thea-ui-stocklike-header .thea-ui-header-icon{
    width:42px !important;
    height:42px !important;
    border-radius:15px !important;
  }
  body.thea-files-ui-page .thea-ui-stocklike-header .thea-ui-module-title,
  body.thea-files-ui-page .thea-ui-stocklike-header h1,
  body.thea-files-ui-page .thea-ui-stocklike-header h2{
    text-align:left !important;
  }
}
