/* ================ ================ VARIABLES ================ ================ */
:root {
  --brand-primary-bg: #14244b;
  --brand-primary-text: #14244b;
  --on-primary: #ffffff;

  --brand-secondary-bg: #db261c;
  --brand-secondary-text: #db261c;
  --on-secondary: #ffffff;

  --brand-gradient-dark: linear-gradient(to bottom right, #14244b, #0e172e);

  --dark-text: #14244b;
  --light-text: #ffffff;

  --dark-bg: #f1f1f1;
  --light-bg: #f9f9f9;

  --radius: 8px;

  --btn-primary-bg: var(--brand-primary-bg);
  --btn-primary-text: var(--on-primary);
  --btn-primary-bg-hov: #1a1a1a;

  --btn-secondary-bg: var(--brand-secondary-bg);
  --btn-secondary-text: var(--on-secondary);
  --btn-secondary-bg-hov: #eaeaea;

  --btn-white-bg: transparent;
  --btn-white-text: #ffffff;
  --btn-white-border: #ffffff;
  --btn-white-bg-hov: #ffffff;
  --btn-white-text-hov: #111111;

  --btn-padding-y: 7px;
  --btn-padding-x: 35px;
  --btn-radius: var(--radius);

  --link-color: var(--brand-primary-text);
  --link-underline: var(--brand-primary-text);

  --field-bg: #ffffff;
  --field-text: #111111;
  --field-border: #e5e7eb;
  --field-radius: var(--radius);
  --field-padding-y: 10px;
  --field-padding-x: 16px;

  --panel-bg: #ffffff;
  --panel-border: #e5e7eb;
  --panel-radius: var(--radius);
  --panel-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);

  --content-max-width: 72ch;
  --p: 15px;
  --h1: 28px;
  --h2: 24px;
  --h3: 20px;
  --h4: 18px;
  --h5: 16px;
  --h6: 14px;
  --space-lg: 15px;
  --space-md: 12px;
  --space-sm: 8px;
  --space-xs: 6px;

  /* Tabele (django-tables2 / .table-container) — gęste; klasy Tailwind na <table> nadpisują bez poniższych */
  --table-font-size: 0.75rem;
  --table-line-height: 1.4;
  --table-pad-y: 0.6rem;
  --table-pad-x: 0.4rem;
  --table-head-pad-y: 0.65rem;

  --transition: 0.3s ease-in-out;
}

/* ================ ================ FONTS ================ ================ */
* {
  font-family: "Jost", sans-serif;
}

/* ================ ================ COLORS ================ ================ */
.text-dark {
  color: var(--dark-text);
}
.text-light {
  color: var(--light-text);
}

.text-primary {
  color: var(--brand-primary-text);
}
.text-secondary {
  color: var(--brand-secondary-text);
}

.bg-primary {
  background-color: var(--brand-primary-bg);
  color: var(--on-primary);
}
.bg-secondary {
  background-color: var(--brand-secondary-bg);
  color: var(--on-secondary);
}

.bg-muted-light {
  background-color: var(--light-bg);
}
.bg-muted-dark {
  background-color: var(--dark-bg);
}

.bg-gradient {
  background: var(--brand-gradient-dark);
}

/* ================ ================ BUTTONS ================ ================ */
.btn {
  padding: var(--btn-padding-y) var(--btn-padding-x);
  border-radius: var(--btn-radius);
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
}

.btn-primary {
  background-color: var(--btn-primary-bg);
  color: var(--on-primary);
}
.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--btn-secondary-bg);
}

.btn-secondary {
  background-color: var(--btn-secondary-bg);
  color: var(--on-secondary);
}
.btn-secondary:hover,
.btn-secondary:focus {
  background-color: var(--btn-primary-bg);
}

.btn-white-outlined {
  background-color: var(--btn-white-bg);
  color: var(--btn-white-text);
  border: 1px solid var(--btn-white-border);
}
.btn-white-outlined:hover,
.btn-white-outlined:focus {
  background-color: var(--btn-white-bg-hov);
  color: var(--btn-white-text-hov);
  border-color: var(--btn-white-bg-hov);
}

.btn-light {
  padding: var(--btn-padding-y) 0 !important;
  background-color: transparent;
  color: var(--dark-text);  
  transition: var(--transition);
}
.btn-light:hover {
  opacity: 0.5;
}

/* Przełączniki w modalach wyceny biura — stały rozmiar; tylko kolor (bez btn-primary/btn-light) */
#quote-handle-modal .quote-handle-modal-box button.quote-modal-pool-tab,
#quote-multi-modal .quote-handle-modal-box button.quote-modal-pool-tab {
  box-sizing: border-box !important;
  padding: 0 !important;
  font-weight: 500 !important;
  opacity: 1 !important;
  background-color: #fff !important;
  color: #14244b !important;
  border: 1px solid #d1d5db !important;
}
#quote-handle-modal .quote-handle-modal-box button.quote-modal-pool-tab:hover:not(.is-active),
#quote-multi-modal .quote-handle-modal-box button.quote-modal-pool-tab:hover:not(.is-active) {
  background-color: #f9fafb !important;
}
#quote-handle-modal .quote-handle-modal-box button.quote-modal-pool-tab.is-active,
#quote-multi-modal .quote-handle-modal-box button.quote-modal-pool-tab.is-active {
  background-color: #14244b !important;
  color: #fff !important;
  border-color: #14244b !important;
}

#quote-handle-modal .quote-handle-modal-box button.quote-modal-col-tab,
#quote-multi-modal .quote-handle-modal-box button.quote-modal-col-tab {
  box-sizing: border-box !important;
  padding: 7px 16px !important;
  font-weight: 500 !important;
  opacity: 1 !important;
  border: none !important;
  background-color: transparent !important;
  color: #14244b !important;
}
#quote-handle-modal .quote-handle-modal-box button.quote-modal-col-tab.is-active,
#quote-multi-modal .quote-handle-modal-box button.quote-modal-col-tab.is-active {
  background-color: #14244b !important;
  color: #fff !important;
}
#quote-handle-modal .quote-handle-modal-box button.quote-modal-col-tab:hover:not(.is-active),
#quote-multi-modal .quote-handle-modal-box button.quote-modal-col-tab:hover:not(.is-active) {
  opacity: 0.65 !important;
}

/* Top-of-view action groups: separators + primary/secondary at end */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.header-actions > * {
  display: inline-flex;
  align-items: center;
  position: relative;
}

.header-actions .btn-light + .btn-light {
  position: relative;
  padding-left: 0.75rem;
}

.header-actions .btn-light + .btn-light::before {
  content: "|";
  position: absolute;
  left: 0;
  color: #d1d5db;
}

.header-actions .btn-primary,
.header-actions .btn-secondary {
  order: 99;
}

/* ================ ================ LINKS ================ ================ */
.link-primary {
  color: var(--link-color);
  text-decoration: none;
  transition: var(--transition);
}
.link-primary:hover {
  opacity: 0.5;
}

.link-header {
  color: #ffffff;
  text-decoration: none;
  background-image: linear-gradient(#ffffff, #ffffff);
  background-size: 0% 0.1em;
  background-position: 100% 100%;
  background-repeat: no-repeat;
  transition: background-size var(--transition), color var(--transition);
}
.link-header:hover,
.link-header:focus,
.link-header:active {
  background-size: 100% 0.1em;
  background-position-x: 0%;
}

.aside-link {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: start;
  gap: 5px;
  color: var(--light-text);
  text-decoration: none;
  transition: var(--transition);
  opacity: 0.6;
  font-size: 15px
}
.aside-link:hover {
  opacity: 1;
}
.aside-link svg {
  transform: scale(0.8);
}

/* ================ ================ SHADOWS ================ ================ */
.shadow-soft {
  box-shadow: 0 1px 6px 0 rgba(0, 0, 0, 0.08);
}

/* ================ ================ CONTENT ================ ================ */
.content-box p {
  font-size: var(--p);
  text-align: justify;
}
.content-box h1 {
  font-size: var(--h1);
  margin: 0 0 var(--space-lg);
}
.content-box h2 {
  font-size: var(--h2);
  margin: var(--space-lg) 0 var(--space-md);
}
.content-box h3 {
  font-size: var(--h3);
  margin: var(--space-lg) 0 var(--space-sm);
}
.content-box h4 {
  font-size: var(--h4);
  margin: 0 0 var(--space-sm);
}
.content-box h5 {
  font-size: var(--h5);
  margin: 0 0 var(--space-xs);
}
.content-box h6 {
  font-size: var(--h6);
  margin: 0 0 4px;
}
.content-box ol,
.content-box ul {
  margin-bottom: var(--space-lg);
}
.content-box ol {
  list-style-type: decimal;
}
.content-box ul {
  list-style-type: disc;
}
.content-box li {
  margin-left: 20px;
}
.content-box ul ul,
.content-box ol ol,
.content-box ul ol,
.content-box ol ul {
  margin-left: 20px;
}

/* ================ ================ BORDERS ================ ================ */
.border-primary {
  border: 1px solid var(--brand-primary-bg);
}

/* ================ ================ FORMS / INPUTS ================ ================ */
.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--dark-text);
}

.form-label .required {
  color: #dc2626;
  margin-left: 2px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="search"],
input[type="url"],
textarea,
select,
.form-control {
  width: 100%;
  padding: var(--field-padding-y) var(--field-padding-x);
  border-radius: var(--field-radius);
  border: 1px solid var(--field-border);
  background-color: var(--field-bg);
  color: var(--field-text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition),
    background-color var(--transition);
  appearance: none;
  -webkit-appearance: none;
}

select:not([multiple]) {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2314244b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  padding-right: 2.35rem;
}

textarea,
textarea.form-control {
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #9ca3af;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus,
.form-control:focus {
  border-color: var(--brand-primary-bg);
  box-shadow: 0 0 0 1px rgba(34, 117, 200, 0.1);
  background-color: #ffffff;
}

select.select-modal-header {
  width: auto !important;
  min-height: 2.25rem;
  height: 2.25rem;
  line-height: 1.35;
  font-size: 0.8125rem;
  border-radius: 0.75rem;
  padding: 0.25rem 1.75rem 0.25rem 0.625rem !important;
  border: 1px solid var(--brand-primary-bg) !important;
  background-color: #fff !important;
  flex-shrink: 0;
  appearance: none !important;
  -webkit-appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2314244b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.4rem center !important;
  background-size: 0.875rem !important;
}

select.select-modal-header--pricing {
  width: 7.25rem !important;
  min-width: 7.25rem;
}

select.select-modal-header--employee {
  width: 11.5rem !important;
  min-width: 9.5rem;
  max-width: 13.5rem;
}

select.select-modal-header:focus {
  border-color: var(--brand-primary-bg) !important;
  box-shadow: 0 0 0 1px rgba(20, 36, 75, 0.12);
  outline: none;
  background-color: #fff !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2314244b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E") !important;
}

/* Stały rozmiar okien obsługi zapytania – bez skakania przy przełączaniu zakładek */
.quote-handle-modal-box {
  height: auto;
  min-height: 0;
  max-height: none;
}

.handle-modal-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
  height: calc(100dvh - 1rem);
  max-height: calc(100dvh - 1rem);
}

.handle-modal-stack .quote-handle-modal-box {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  max-height: none;
}

.handle-view-switch {
  display: inline-flex;
  align-items: center;
  align-self: center;
  flex-wrap: nowrap;
  padding: 0.22rem;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

.handle-view-switch__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.38rem 0.9rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #64748b;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}

.handle-view-switch__btn:hover {
  color: #0f172a;
}

.handle-view-switch__btn.is-active {
  background: #14244b;
  color: #fff;
}

.handle-view-switch__btn.hidden {
  display: none !important;
}

.handle-view-switch__icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

input[disabled],
textarea[disabled],
select[disabled],
.form-control[disabled],
input[readonly],
textarea[readonly],
select[readonly],
.form-control[readonly] {
  background-color: #f3f4f6;
  color: #6b7280;
  cursor: not-allowed;
}

.form-group.has-error input,
.form-group.has-error textarea,
.form-group.has-error select,
input.is-invalid,
textarea.is-invalid,
select.is-invalid {
  border-color: #dc2626;
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.05);
}

.file-dropzone-wrapper {
  position: relative;
}

.file-dropzone-wrapper input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.file-dropzone-wrapper:has(.is-invalid) .file-dropzone {
  border-color: #dc2626;
  background-color: #fef2f2;
}

.form-error,
.js-field-hint {
  margin-top: 4px;
  font-size: 0.8rem;
  color: #dc2626;
}

input[type="checkbox"].is-invalid,
input[type="radio"].is-invalid {
  outline: 2px solid #dc2626;
  outline-offset: 2px;
}

.form-help {
  margin-top: 4px;
  font-size: 0.8rem;
  color: #6b7280;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 16px;
  height: 16px;
}

.form-actions {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.file-upload-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px dashed #14244b;
    padding: 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
}

.file-upload-wrapper:hover {
    border-color: #db261c;
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-upload-label {
    display: block;
    font-size: 14px;
    color: #6b7280;
}

.file-upload-filename {
    display: block;
    margin-top: 4px;
}

/* ================ ================ TOAST ================ ================ */
.toast-root{
  position: fixed;
  top: 1rem; right: 1rem;
  z-index: 10100;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  pointer-events: none;
}

.toast{
  pointer-events: auto;
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: .75rem;
  min-width: 260px;
  max-width: 520px;
  padding: .875rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(15,23,42,.08);
  background: #fff;
  box-shadow: 0 10px 20px rgba(2,8,23,.08);
  transition: transform var(--transition), opacity var(--transition), box-shadow var(--transition);
  transform: translateY(0);
  opacity: 1;
}

.toast.is-hiding{
  opacity: 0;
  transform: translateY(-8px);
  box-shadow: none;
}

.toast__icon { width: 24px; height: 24px; opacity: .9; }
.toast__body { font-size: 14px; color: #0f172a; }
.toast__close{
  margin-left: .5rem;
  border: none; background: transparent;
  font-size: 18px; line-height: 1; cursor: pointer;
  color: rgba(15,23,42,.6);
  padding: 0 .25rem;
}
.toast__close:hover{ color: rgba(15,23,42,.9); }

.toast--success{ border-color: rgba(16,185,129,.35); background: linear-gradient(0deg, rgba(16,185,129,.06), rgba(16,185,129,.06)), #fff; }
.toast--info   { border-color: rgba(59,130,246,.35); background: linear-gradient(0deg, rgba(59,130,246,.06), rgba(59,130,246,.06)), #fff; }
.toast--warning{ border-color: rgba(245,158,11,.35); background: linear-gradient(0deg, rgba(245,158,11,.08), rgba(245,158,11,.08)), #fff; }
.toast--error  { border-color: rgba(239,68,68,.35); background: linear-gradient(0deg, rgba(239,68,68,.08), rgba(239,68,68,.08)), #fff; }

.toast--success .toast__icon{ color:#059669; }
.toast--info    .toast__icon{ color:#2563eb; }
.toast--warning .toast__icon{ color:#d97706; }
.toast--error   .toast__icon{ color:#b91c1c; }

/* ================ ================ ASIDE ================ ================ */
#sidebar {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
  overflow: hidden;
  transition: width .3s ease;
  z-index: 50;
}

/* Scroll listy linków — natywny pasek ukryty, odstęp po prawej z paddingu sidebara */
#sidebar .aside-nav-scroll-wrap {
  position: relative;
  flex: 1 1 0;
  height: 0;
  min-height: 0;
  overflow: hidden;
}

#sidebar .aside-nav-scroll {
  height: 100%;
  width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0;
  margin: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#sidebar .aside-nav-scroll::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

#sidebar .aside-nav-scroll > nav {
  display: flex;
  flex-direction: column;
  padding-bottom: 1.5rem;
}

#sidebar.is-collapsed {
  width: 72px;
  padding-right: 0;
}

#sidebar.is-collapsed:hover {
  width: 220px;
  padding-right: 1.5rem;
}

#layout-main {
  transition: margin-left .3s ease;
  height: 100%;
  max-height: 100dvh;
}

#layout-main .layout-topbar {
  flex-shrink: 0;
}

#layout-main .layout-main-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

#layout-main.is-collapsed {
  margin-left: 72px;
}

#sidebar.is-collapsed .brand-text {
  display: none;
}

#sidebar.is-collapsed nav p,
#sidebar.is-collapsed nav span {
  display: none;
}

#sidebar.is-collapsed .sidebar-logout {
  display: none;
}

#sidebar.is-collapsed:hover .brand-text {
  display: block;
}

#sidebar.is-collapsed:hover nav p,
#sidebar.is-collapsed:hover nav span:not([data-nav-badge]) {
  display: inline;
}

#sidebar.is-collapsed:hover nav [data-nav-badge] {
  display: inline-flex;
}

#sidebar.is-collapsed:hover .sidebar-logout {
  display: flex;
}

.icon-collapsed {
  display: none;
}

#sidebar.is-collapsed .icon-expanded {
  display: none;
}

#sidebar.is-collapsed .icon-collapsed {
  display: block;
}

/* ================ Office toolbar switches (jak monitor zleceń) ================ */
.settings-switch {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: 0.75rem;
  background: rgba(20, 36, 75, 0.06);
  flex-shrink: 0;
}

.office-list-switch-group {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.settings-switch__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.85rem;
  border-radius: 0.55rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #475569;
  text-decoration: none;
  border: 0;
  background: transparent;
  white-space: nowrap;
  margin: 0;
  line-height: 1.2;
  cursor: pointer;
}

.settings-switch__btn:hover {
  color: #0f172a;
}

.settings-switch__btn.is-active {
  background: #14244b;
  color: #fff;
}

.settings-switch--split {
  display: flex;
  width: 100%;
  flex-wrap: nowrap;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  padding: 0.2rem;
}

.settings-switch--split .settings-switch__btn {
  flex: 1 1 50%;
  gap: 0.35rem;
  font-size: 0.8rem;
  border-radius: 0.55rem;
}

.settings-switch--split .settings-switch__btn svg {
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
}

.mon-toolbar .settings-switch,
.mon-toolbar__actions .settings-switch {
  flex-shrink: 0;
}

/* ================ ================ TABLES ================ ================ */
/* overflow na wrapperze, nie na <table> — inaczej niektóre przeglądarki obcinają inline-flex w komórkach (badge). */
.table-container {
  border-radius: 0.75rem;
  overflow: hidden;
}

.table-container table {
  width: 100%;
  border-radius: 0;
  overflow: visible;
}

.table-container thead {
    background-color: var(--brand-primary-bg); 
    color: #fff;
}

.table-container thead th {
    padding: var(--table-head-pad-y) var(--table-pad-x);
    font-weight: 600;
    text-align: left;
    font-size: var(--table-font-size);
    line-height: var(--table-line-height);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    vertical-align: middle;
}

.table-container thead th.text-right,
.table-container tbody td.text-right {
    text-align: right;
}

.table-container tbody td {
    padding: var(--table-pad-y) var(--table-pad-x);
    font-size: var(--table-font-size);
    line-height: var(--table-line-height);
    vertical-align: middle;
}

.table-container tbody tr.even {
    background-color: #eaeaea; 
}

.table-container tbody tr.odd {
    background-color: #e3e3e3;
}

.table-container tbody tr:hover {
    background-color: #cfcfcf; 
}

.table-container th.orderable a {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    text-decoration: none;
    color: inherit;
}

.table-container th.orderable a:hover {
    text-decoration: underline;
}

.table-container th.orderable.asc a::after {
    content: "▲";
    font-size: 0.65rem;
}

.table-container th.orderable.desc a::after {
    content: "▼";
    font-size: 0.65rem;
}

.table-container thead th.office-icon-col,
.table-container tbody td.office-icon-col {
    text-align: center;
    vertical-align: middle;
    width: 3.25rem;
    min-width: 3rem;
    max-width: 3.75rem;
    line-height: 0;
}

.table-container th.office-icon-col.orderable a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 1.5rem;
    line-height: 0;
    gap: 0;
}

.table-container th.office-icon-col.orderable a::after {
    display: none;
}

.table-container .office-icon-header,
.table-container .office-icon-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    line-height: 0;
}

.table-container .office-icon-header svg,
.table-container .office-icon-cell svg {
    display: block;
    flex-shrink: 0;
}

/* django-tables2 pagination */
.table-container .pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.7rem;
    padding-left: 0;
    list-style: none;
}

.table-container .pagination li {
    list-style: none;
}

.table-container .pagination a,
.table-container .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.75rem;
    height: 1.75rem;
    padding: 0 0.5rem;
    border-radius: 0.4rem;
    font-size: 0.75rem;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #111827;
    text-decoration: none;
}

.table-container .pagination .active a,
.table-container .pagination .active span {
    background: var(--brand-primary-bg);
    border-color: var(--brand-primary-bg);
    color: #fff;
}


/* Repetytorium – wiersze bez poświadczenia */
.repetytorium-row-no-certified {
    border-left: 3px solid #dc2626 !important;
}

/* Repetytorium – kolumny uzupełniane przez tłumacza (nad paskami wierszy / striped) */
.repetytorium-superuser-table tbody td.repetytorium-col-translator {
    background-color: #e0f2fe !important;
}

.repetytorium-superuser-table tbody tr:hover td.repetytorium-col-translator {
    background-color: #bae6fd !important;
}

.repetytorium-superuser-table thead th.repetytorium-col-translator {
    background-color: #7dd3fc !important;
    color: #0c4a6e !important;
    border-bottom-color: rgba(12, 74, 110, 0.25) !important;
}

/* Repetytorium – kontener: pełna szerokość panelu, przewijanie w .repetytorium-table-scroll--x (nie overflow:hidden – obcinałoby pasek) */
.repetytorium-table-wrapper {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    border-radius: 1rem;
    overflow: visible;
}

.repetytorium-table-scroll {
    -webkit-overflow-scrolling: touch;
}

/* Tylko repetytorium: poziome przewijanie, bez wpływu na inne tabele */
.repetytorium-table-scroll--x {
    display: block;
    max-width: 100%;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: visible;
    border-radius: 0.75rem;
}

/* Repetytorium – nagłówki kolumn w jednej linii */
.repetytorium-superuser-table thead th {
    white-space: nowrap;
}

/* Repetytorium – numery/nazwy bez zawijania */
.repetytorium-col-nowrap {
    white-space: nowrap;
}

/* W normalnym .table-container tabela ma width:100% i nigdy nie „pcha” przewijania; tu szer. z treści + min. */
#layout-main .repetytorium-table-wrapper .table-container .repetytorium-superuser-table,
.repetytorium-table-wrapper .table-container .repetytorium-superuser-table {
    width: auto !important;
    min-width: 1200px;
    table-layout: auto;
    max-width: none;
}

/* Linki w tabeli repetytorium */
.repetytorium-superuser-table a.repetytorium-table-link {
    font-weight: 600;
    text-decoration: underline;
    transition: opacity 0.3s ease-in-out;
    color: var(--brand-primary-text, #14244b);
}

.repetytorium-superuser-table a.repetytorium-table-link:hover {
    opacity: 0.5;
}

/* GOV — rejestr tłumaczy przysięgłych MS */
.gov-translator-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.gov-translator-table-wrapper .table-container {
    overflow: visible;
}

#layout-main .gov-translator-table-wrapper .table-container .gov-translator-table,
.gov-translator-table-wrapper .table-container .gov-translator-table {
    width: auto !important;
    min-width: 1200px;
    table-layout: auto;
    max-width: none;
}

.gov-translator-table td.gov-col-nowrap,
.gov-translator-table th.gov-col-nowrap {
    white-space: nowrap;
    width: 1%;
}

.gov-translator-table .gov-col-nowrap-inline {
    white-space: nowrap;
}

.gov-translator-table td.gov-col-address-cell,
.gov-translator-table th.gov-col-address-cell {
    width: 1%;
    max-width: 11ch;
    white-space: nowrap;
    overflow: hidden;
    padding-right: 0.25rem;
}

.gov-translator-table .gov-col-address {
    display: inline-block;
    max-width: 11ch;
    white-space: nowrap;
    overflow: hidden;
    vertical-align: middle;
    cursor: default;
}

#layout-main .table-container .accounts-table--translators {
    width: 100%;
}

#layout-main .table-container .accounts-table--translators:not(.accounts-table--translators-favorites) {
    table-layout: fixed;
}

#layout-main .table-container .accounts-table--translators-favorites {
    table-layout: fixed;
}

#layout-main .table-container .accounts-table--translators-favorites .translators-col-identity {
    width: 20%;
    overflow: hidden;
    vertical-align: top;
}

#layout-main .table-container .accounts-table--translators-favorites .translators-combos-col {
    width: 40%;
    overflow: hidden;
    vertical-align: top;
}

#layout-main .table-container .accounts-table--translators .translators-col-type {
    width: 5.75rem;
    min-width: 5.75rem;
    white-space: nowrap;
    box-sizing: border-box;
}

.translator-combos-tip {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(12rem, max-content));
    gap: 0.2rem 1rem;
    max-width: min(46rem, calc(100vw - 2.5rem));
}

#layout-main .table-container .accounts-table--translators thead th {
    white-space: nowrap !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    overflow: hidden;
    text-overflow: ellipsis;
}

#layout-main .table-container .accounts-table--translators tbody td {
    word-break: normal !important;
    overflow-wrap: normal !important;
}

#layout-main .table-container .accounts-table--translators:not(.accounts-table--translators-favorites) .translators-col-identity {
    white-space: nowrap;
    overflow: hidden;
    vertical-align: top;
    text-overflow: ellipsis;
}

#layout-main .table-container .accounts-table--translators:not(.accounts-table--translators-favorites) .translators-col-name {
    width: 15%;
}

#layout-main .table-container .accounts-table--translators:not(.accounts-table--translators-favorites) .translators-col-email {
    width: 16%;
    max-width: 16%;
}

#layout-main .table-container .accounts-table--translators:not(.accounts-table--translators-favorites) .translators-col-email a {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#layout-main .table-container .accounts-table--translators:not(.accounts-table--translators-favorites) .translators-col-phone {
    width: 9%;
}

#layout-main .table-container .accounts-table--translators .translators-col-company {
    width: 16%;
    max-width: 16%;
    overflow: hidden;
    vertical-align: top;
}

#layout-main .table-container .accounts-table--translators:not(.accounts-table--translators-favorites) .translators-combos-col {
    width: 9%;
    max-width: 9%;
    white-space: nowrap;
    overflow: hidden;
    vertical-align: top;
}

#layout-main .table-container .accounts-table--translators .translators-col-stat {
    width: 6.5%;
    white-space: nowrap;
}

#layout-main .table-container .accounts-table--translators .translators-col-actions {
    width: 3%;
    white-space: nowrap;
}

#layout-main .table-container:has(.accounts-table--translators-office) {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
}

#layout-main .table-container .accounts-table--translators-office .translators-col-invitation {
    width: 11rem;
    min-width: 11rem;
    white-space: nowrap;
}

#layout-main .table-container .accounts-table--translators-office .translators-col-actions {
    width: 2.75rem;
    min-width: 2.75rem;
}

.repetytorium-superuser-table a.repetytorium-open-doc:hover svg {
    opacity: 1;
}

/*
 * Repetytorium: django_tables2 opakowuje tabelę w *własny* .table-container (bootstrap.html),
 * więc paddingi trafiają tylko przy selektorze .repetytorium-table-wrapper (wyższa specyfika niż
 * sam #layout-main .table-container z końca pliku). Globalne .table-container { overflow:hidden }
 * obcina szeroką tabelę — tu reset do visible, inaczej brak przewijania w poziomie.
 */
#layout-main .repetytorium-table-wrapper .table-container {
    overflow: visible;
    /* żeby szer. treści tabeli rozszerzała pasek przewijania, nie 100% rodzica */
    width: max-content;
    min-width: 100%;
    max-width: none;
}

#layout-main .repetytorium-table-wrapper .table-container thead th,
#layout-main .repetytorium-table-wrapper .table-container tbody td,
#layout-main .repetytorium-table-wrapper .table-container tfoot td,
#layout-main .repetytorium-table-wrapper .table-container tfoot th {
    padding: 0.25rem 0.3rem !important;
    font-size: 0.75rem !important;
    line-height: 1.35 !important;
}

/* Treść: środek w pionie; Uwagi wielowierszowe — od góry */
#layout-main .repetytorium-table-wrapper .table-container tbody td,
#layout-main .repetytorium-table-wrapper .table-container tfoot td,
#layout-main .repetytorium-table-wrapper .table-container tfoot th {
    vertical-align: middle !important;
}

#layout-main .repetytorium-table-wrapper .table-container tbody td.repetytorium-col-notes,
#layout-main .repetytorium-table-wrapper .table-container tfoot td.repetytorium-col-notes {
    vertical-align: top !important;
}

/* Nagłówki: czytelniejsze jak w reszcie aplikacji (zmienne z :root) */
#layout-main .repetytorium-table-wrapper .table-container thead th {
    padding: var(--table-head-pad-y) var(--table-pad-x) !important;
    vertical-align: middle;
    line-height: 1.45 !important;
}

/* Akcje: bez width:1% (ścinało kolumnę przy wielu min-width) + twardo bez łamania (overflow-wrap z layoutu) */
#layout-main .repetytorium-table-wrapper .table-container .repetytorium-superuser-table th.repetytorium-col-actions,
#layout-main .repetytorium-table-wrapper .table-container .repetytorium-superuser-table td.repetytorium-col-actions {
    box-sizing: border-box;
    white-space: nowrap !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    min-width: 6.5rem !important;
    width: auto;
}

#layout-main .repetytorium-table-wrapper .table-container .repetytorium-col-actions .btn {
    display: inline-block;
    white-space: nowrap !important;
    max-width: none;
}

/* Uwagi: tylko ta kolumna twardo ograniczona; bez klasy shrink-0 w tabeli */
#layout-main .repetytorium-table-wrapper .table-container .repetytorium-superuser-table th.repetytorium-col-notes,
#layout-main .repetytorium-table-wrapper .table-container .repetytorium-superuser-table td.repetytorium-col-notes {
    white-space: normal !important;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 14rem;
    min-width: 0;
    line-height: 1.35;
}

/* Globalne layout: mniej agresywne łamanie; bez Uwag i Akcji (Akcje = osobna reguła; inaczej nadpisuje overflow-wrap) */
#layout-main .repetytorium-table-wrapper .table-container .repetytorium-superuser-table tbody td:not(.repetytorium-col-notes):not(.repetytorium-col-actions),
#layout-main .repetytorium-table-wrapper .table-container .repetytorium-superuser-table tfoot td:not(.repetytorium-col-notes):not(.repetytorium-col-actions) {
    word-break: normal !important;
    overflow-wrap: break-word !important;
}

/* ================ ================ BADGES ================ ================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid transparent;
  white-space: nowrap;
}

/* Domyślna / neutralna */
.badge--neutral {
  background-color: #e5e7eb;
  color: #374151;
  border-color: #d1d5db;
}

/* Nowe */
.badge--status-new {
  background-color: rgba(37, 99, 235, 0.06); 
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.35);
}

/* W realizacji */
.badge--status-in-progress {
  background-color: rgba(245, 158, 11, 0.08);
  color: #d97706;
  border-color: rgba(245, 158, 11, 0.45);
}

/* Weryfikacja przez klienta */
.badge--status-verification {
  background-color: rgba(139, 92, 246, 0.08); 
  color: #6d28d9;                           
  border-color: rgba(139, 92, 246, 0.45);   
}

/* Zrealizowane */
.badge--status-completed {
  background-color: rgba(16, 185, 129, 0.08); 
  color: #059669;
  border-color: rgba(16, 185, 129, 0.45);
}

/* Anulowane */
.badge--status-cancelled {
  background-color: rgba(239, 68, 68, 0.08); 
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.45);
}

/* BRAK ofert – czerwony */
.badge--brak {
  background-color: #dc2626;
  color: #ffffff;
  border-color: #b91c1c;
}

/* Zarchiwizowane */
.badge--status-archived {
  background-color: rgba(107, 114, 128, 0.08);
  color: #4b5563;
  border-color: rgba(107, 114, 128, 0.45);
}

/* Typ klienta (lista zapytań biura) — pełne, kontrastowe tło */
.badge--client-firma {
  background-color: #2563eb;
  color: #ffffff;
  border-color: #1d4ed8;
}

.badge--client-bt {
  background-color: #c026d3;
  color: #ffffff;
  border-color: #a21caf;
}

.badge--client-ulica {
  background-color: #0891b2;
  color: #ffffff;
  border-color: #0e7490;
}

/* Przełącznik typu tłumacza (lista Typy) — !important vs Tailwind w tabelach */
#layout-main .translator-type-switch {
  display: inline-flex !important;
  gap: 2px !important;
  background-color: #cbd5e1 !important;
  border-color: #94a3b8 !important;
}

#layout-main .translator-type-switch-opt {
  color: #475569 !important;
  background-color: transparent !important;
  border: 1px solid transparent !important;
  min-width: 2.35rem !important;
  cursor: pointer !important;
  line-height: 1.25 !important;
}

#layout-main .translator-type-switch-opt:hover:not(.is-active) {
  color: #0f172a !important;
  background-color: rgba(255, 255, 255, 0.55) !important;
}

#layout-main .translator-type-switch-opt.is-active {
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.22) !important;
}

#layout-main .translator-type-switch-opt.is-active.translator-type-switch-opt--star {
  background-color: #2563eb !important;
  border-color: #1d4ed8 !important;
}

#layout-main .translator-type-switch-opt.is-active.translator-type-switch-opt--star-a {
  background-color: #059669 !important;
  border-color: #047857 !important;
}

#layout-main .translator-type-switch-opt.is-active.translator-type-switch-opt--star-ta {
  background-color: #d97706 !important;
  border-color: #b45309 !important;
}

#layout-main .translator-type-switch-opt.is-active.translator-type-switch-opt--star-qm {
  background-color: #6366f1 !important;
  border-color: #4f46e5 !important;
}

#layout-main .translator-type-switch-opt.is-active.translator-type-switch-opt--ms {
  background-color: #64748b !important;
  border-color: #475569 !important;
}

#layout-main .translator-type-switch-opt.is-active.translator-type-switch-opt--none {
  background-color: #334155 !important;
  border-color: #1e293b !important;
}

#layout-main .translator-ms-star-qm-btn {
  border-color: #94a3b8;
  background-color: #f8fafc;
  color: #64748b;
}

#layout-main .translator-ms-star-qm-btn:hover:not(:disabled) {
  border-color: #6366f1;
  color: #4338ca;
}

#layout-main .translator-ms-star-qm-btn.is-active {
  border-color: #6366f1;
  background-color: #eef2ff;
  color: #4338ca;
}

#layout-main .translator-ms-star-qm-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Tabele ręczne (Tailwind) — !important, bo @tailwindcss/browser wstrzykuje style po tym pliku. */
#layout-main table.min-w-full.border-collapse th,
#layout-main table.min-w-full.border-collapse td,
#layout-main table.w-full.text-sm th,
#layout-main table.w-full.text-sm td,
#layout-main table.min-w-full.text-sm th,
#layout-main table.min-w-full.text-sm td,
#layout-main table.w-full.text-sm.border-collapse th,
#layout-main table.w-full.text-sm.border-collapse td,
#layout-main table.min-w-full.border.border-slate-200 th,
#layout-main table.min-w-full.border.border-slate-200 td {
  font-size: var(--table-font-size) !important;
  line-height: var(--table-line-height) !important;
  padding: var(--table-pad-y) var(--table-pad-x) !important;
  word-break: break-word;
  overflow-wrap: anywhere;
  vertical-align: middle;
}

#layout-main table.min-w-full.border-collapse thead th,
#layout-main table.w-full.text-sm thead th,
#layout-main table.min-w-full.text-sm thead th,
#layout-main table.w-full.text-sm.border-collapse thead th,
#layout-main table.min-w-full.border.border-slate-200 thead th {
  padding: var(--table-head-pad-y) var(--table-pad-x) !important;
}

#layout-main table.min-w-full td .badge,
#layout-main table.w-full td .badge,
#layout-main table.min-w-full th .badge,
#layout-main table.w-full th .badge {
  word-break: normal !important;
  overflow-wrap: normal !important;
  font-size: 11px !important;
}

/* django-tables2: wymuszenie wielkości (klasa text-sm na elemencie table z Meta.attrs). */
#layout-main .table-container > table,
#layout-main .table-container table {
  font-size: var(--table-font-size) !important;
  line-height: var(--table-line-height) !important;
}

#layout-main .table-container thead th,
#layout-main .table-container tbody td,
#layout-main .table-container tfoot td,
#layout-main .table-container tfoot th {
  font-size: var(--table-font-size) !important;
  line-height: var(--table-line-height) !important;
  padding: var(--table-pad-y) var(--table-pad-x) !important;
  /* nie dziedzicz w dół — łamie kapsułki .badge; zawijaj długie ciągi obok, nie w środku statusu */
  word-break: break-word;
  overflow-wrap: anywhere;
  vertical-align: middle;
}

#layout-main .table-container td .badge,
#layout-main .table-container th .badge {
  word-break: normal !important;
  overflow-wrap: normal !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
  vertical-align: middle;
}

#layout-main .table-container thead th {
  padding: var(--table-head-pad-y) var(--table-pad-x) !important;
}

#layout-main .table-container table.accounts-table--translators th.translators-col-type,
#layout-main .table-container table.accounts-table--translators td.translators-col-type {
  padding-right: 1.35rem !important;
}

#layout-main .table-container thead th.office-icon-col,
#layout-main .table-container tbody td.office-icon-col,
#layout-main thead th.office-icon-col,
#layout-main tbody td.office-icon-col {
  text-align: center !important;
}

#layout-main .table-container th.orderable a,
#layout-main .table-container thead th a {
  font-size: inherit !important;
}

/* ===== Interaktywny onboarding nawigacji ===== */
.onboarding-root {
  position: fixed;
  inset: 0;
  z-index: 10050;
  pointer-events: none;
}

.onboarding-dim {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  pointer-events: auto;
  z-index: 10050;
}

.onboarding-ring {
  position: fixed;
  z-index: 10051;
  border-radius: 8px;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.95),
    0 0 0 4px rgba(59, 130, 246, 0.5);
  pointer-events: none;
  transition:
    top 0.18s ease,
    left 0.18s ease,
    width 0.18s ease,
    height 0.18s ease;
}

.onboarding-tooltip {
  position: fixed;
  z-index: 10052;
  width: min(340px, calc(100vw - 24px));
  max-height: min(420px, calc(100vh - 24px));
  overflow-y: auto;
  background: #fff;
  color: #0f172a;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.28);
  padding: 16px 18px 14px;
  pointer-events: auto;
}

.onboarding-tooltip__progress {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.onboarding-tooltip__title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  color: #0f172a;
}

.onboarding-tooltip__description {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.45;
  color: #475569;
}

.onboarding-tooltip__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
}

.onboarding-tooltip__nav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.onboarding-tooltip__skip {
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  text-align: left;
  line-height: 1.3;
}

.onboarding-tooltip__skip:hover {
  color: #0f172a;
}

/* App tooltips (tworzone w JS — bez utility Tailwind, żeby zawsze były widoczne) */
.js-app-tooltip {
  position: fixed;
  z-index: 100070;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #fff;
  background-color: #1f2937;
  border-radius: 0.375rem;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.15), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  pointer-events: none;
  text-align: left;
}

/* Panel tooltip (lista zleceń) — poziomy prostokąt */
.js-tooltip--panel {
  padding: 0.75rem 1rem !important;
}
.js-tooltip-panel {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: auto;
  grid-auto-columns: max-content;
  column-gap: 1.35rem;
  align-items: start;
}
.js-tooltip-panel__item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.js-tooltip-panel__label {
  opacity: 0.7;
  font-size: 0.65rem;
  line-height: 1.2;
  white-space: nowrap;
}
.js-tooltip-panel__value {
  font-weight: 600;
  font-size: 0.75rem;
  line-height: 1.25;
  white-space: nowrap;
}
@media (max-width: 1100px) {
  .js-tooltip-panel {
    grid-auto-flow: dense;
    grid-template-columns: repeat(4, max-content);
    grid-template-rows: auto auto;
    row-gap: 0.55rem;
  }
}
@media (max-width: 700px) {
  .js-tooltip-panel {
    grid-template-columns: repeat(2, max-content);
  }
}

/* Public split (zamówienie, wycena, status) — scroll tylko w lewej kolumnie, nie na <html> */
html:has(.public-split-layout),
html:has(.public-split-layout) body {
  height: 100%;
  max-height: 100dvh;
  overflow: hidden !important;
  overscroll-behavior: none;
}

html:has(.public-split-layout) body > main {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100dvh;
  min-height: 0;
  overflow: hidden !important;
}

.public-split-layout {
  flex: 1 1 auto;
  min-height: 0;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
}

.public-split-scroll {
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}

html:has(#quote-form-panel) .public-split-scroll {
  scrollbar-width: thin;
  scrollbar-color: rgba(20, 36, 75, 0.35) transparent;
  scrollbar-gutter: stable;
}
html:has(#quote-form-panel) .public-split-scroll::-webkit-scrollbar {
  width: 10px;
}
html:has(#quote-form-panel) .public-split-scroll::-webkit-scrollbar-track {
  background: transparent;
  margin: 0.75rem 0;
}
html:has(#quote-form-panel) .public-split-scroll::-webkit-scrollbar-thumb {
  background-color: rgba(20, 36, 75, 0.28);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: padding-box;
}
html:has(#quote-form-panel) .public-split-scroll::-webkit-scrollbar-thumb:hover {
  background-color: rgba(20, 36, 75, 0.48);
  border: 3px solid transparent;
  background-clip: padding-box;
}

@media (max-width: 639px) {
  html:has(#quote-form-panel) .public-split-scroll > div {
    padding-left: max(1rem, env(safe-area-inset-left, 0px));
    padding-right: max(1rem, env(safe-area-inset-right, 0px));
  }
}

/* Global search FAB — always inside the viewport (never past 100dvh) */
#office-global-search {
  position: fixed;
  right: max(1.25rem, env(safe-area-inset-right, 0px));
  bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
  z-index: 90;
  max-width: calc(100vw - 2.5rem);
}

/* Official rates: keep the Podgląd/Edycja switch on-screen */
.official-rates-page {
  padding-bottom: 6rem;
}
#official-rates-mode-switch {
  max-width: 100%;
  flex-shrink: 1;
}

/* Flatpickr — nad modalami i panelami */
.flatpickr-calendar {
  z-index: 100060 !important;
}
.flatpickr-alt-input {
  width: 100%;
}
