/* SoneBoost 5.2: paired foreground/background states and a single menu scroll.
   Loaded last in the shared public and authenticated layouts. */
.sb-panel, .sb-public {
  --text-muted: #97a6bb;
}
.sb-panel { color-scheme: dark; }
.sb-public { color-scheme: dark; }
.sb-panel .block, .sb-panel .card, .sb-panel .modal-content { color: #d4ddea; }
.sb-panel .text-secondary { color: #b4c1d3 !important; }
.sb-panel .font-size-h3, .sb-panel .font-size-h4 { color: #eaf0f7; }

/* Bootstrap's .form-control-alt and :disabled/[readonly] rules previously
   won only the background cascade, leaving light text on a white field. */
.sb-panel .form-control,
.sb-panel .form-control.form-control-alt,
.sb-panel .custom-select,
.sb-panel textarea,
.sb-panel select {
  color: #eaf0f7;
  -webkit-text-fill-color: #eaf0f7;
  caret-color: #eaf0f7;
  background-color: #131c2a;
  border: 1px solid #4b5d77;
  border-radius: .5rem;
  font: inherit;
}
.sb-panel .form-control[readonly],
.sb-panel .form-control:disabled,
.sb-panel .custom-select:disabled,
.sb-panel textarea[readonly],
.sb-panel textarea:disabled,
.sb-panel select:disabled {
  color: #d4ddea;
  -webkit-text-fill-color: #d4ddea;
  background-color: #1c293b;
  opacity: 1;
}
.sb-panel .form-control:focus,
.sb-panel .custom-select:focus,
.sb-panel textarea:focus,
.sb-panel select:focus {
  color: #fff;
  -webkit-text-fill-color: #fff;
  background-color: #131c2a;
  border-color: #a5b4fc;
  outline: 2px solid #a5b4fc;
  outline-offset: 2px;
  box-shadow: none;
}
.sb-panel .form-control::placeholder,
.sb-panel textarea::placeholder { color: #a2b0c2; opacity: 1; -webkit-text-fill-color: #a2b0c2; }
.sb-panel input:-webkit-autofill {
  -webkit-text-fill-color: #eaf0f7;
  -webkit-box-shadow: 0 0 0 1000px #131c2a inset;
  caret-color: #eaf0f7;
}
.sb-panel select option { color: #eaf0f7; background: #131c2a; }
.sb-panel textarea { display: block; inline-size: 100%; padding: .85rem 1rem; resize: vertical; min-block-size: 9rem; }
.sb-panel .input-group-text { color: #c9d5e6; background: #1c293b; border-color: #4b5d77; }
.sb-panel .form-control-plaintext { color: #eaf0f7; }
.sb-panel .table .thead-light th { color: #c9d5e6; background: #1c293b; border-color: #334155; }
.sb-panel .bg-body-dark { color: #eaf0f7; background: #131c2a !important; }
.sb-panel .list-group-item,
.sb-panel .list-group-item-action { color: #d4ddea; background: #131c2a; border-color: #334155; }
.sb-panel .list-group-item-action:hover,
.sb-panel .list-group-item-action:focus { color: #fff; background: #24344c; }
.sb-panel .dropdown-menu { color: #eaf0f7; background: #0d141f; border-color: #334155; }
.sb-panel .dropdown-menu .dropdown-item { color: #d4ddea; }
.sb-panel .dropdown-menu .dropdown-item:hover,
.sb-panel .dropdown-menu .dropdown-item:focus { color: #fff; background: #24344c; }
.sb-panel .sb-notification { color: #eaf0f7; background: #0d141f; border-inline-start: 3px solid transparent; }
.sb-panel .sb-notification.is-unread { color: #eaf0f7; background: #1c293b; border-inline-start-color: #a5b4fc; }
.sb-panel .sb-notification > a,
.sb-panel .sb-notification > a.text-dark { color: #eaf0f7 !important; background: transparent; }
.sb-panel .sb-notification > a:hover,
.sb-panel .sb-notification > a:focus { color: #fff !important; background: #24344c; }
.sb-panel .sb-notification .text-muted { color: #b4c1d3 !important; }
.sb-panel #page-header .dropdown-menu { max-inline-size: calc(100vw - 1rem); max-block-size: calc(100dvh - 6rem); overflow-y: auto; }
.sb-panel .btn-light, .sb-panel .btn-alt-secondary { color: #eaf0f7; background: #24344c; border-color: #4b5d77; }
.sb-panel .btn-light:hover, .sb-panel .btn-alt-secondary:hover { color: #fff; background: #334765; }
.sb-panel .btn:disabled { opacity: .75; }
.sb-panel .modal-header .close { color: #eaf0f7; opacity: 1; text-shadow: none; }
.sb-panel #edit-ticket-modal .modal-content { max-block-size: calc(100dvh - 2rem); overflow-y: auto; }
.sb-panel .form-control-file { color: #eaf0f7; max-inline-size: 100%; }
.sb-login-challenge { margin-block: 1rem; min-inline-size: 0; }
.sb-panel .select2-container--default .select2-selection--single,
.sb-panel .select2-dropdown,
.sb-panel .select2-search__field { color: #eaf0f7; background: #131c2a; border-color: #4b5d77; }
.sb-panel .select2-container--default .select2-selection__rendered { color: #eaf0f7; }

/* Identity and copyright never enter the scrollable menu. Dashmix gives
   .content-side overflow-x:hidden; that implicitly creates overflow-y:auto.
   Reset BOTH axes and intrinsic sizing on the menu content to prevent nesting. */
.sb-panel #page-container #sidebar { display: flex; flex-direction: column; block-size: 100vh; block-size: 100dvh; overflow: hidden !important; }
.sb-panel #sidebar > .smini-hidden,
.sb-panel #sidebar > .smini-visible-block,
.sb-panel #sidebar > .sb-sidebar-identity,
.sb-panel #sidebar > .bm-sidebar-copy { flex: 0 0 auto; }
.sb-panel #page-container #sidebar > .bm-sidebar-body {
  display: block;
  flex: 1 1 0%;
  min-block-size: 0;
  block-size: auto;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior-y: contain;
  scrollbar-width: thin;
  scrollbar-color: #71839c #0d141f;
  scrollbar-gutter: stable;
}
.sb-panel #page-container #sidebar .bm-sidebar-body .content-side {
  block-size: auto !important;
  max-block-size: none !important;
  overflow: visible !important;
  padding-block-end: 1.25rem;
}
.sb-panel #page-container #sidebar .bm-sidebar-body .nav-main { block-size: auto; overflow: visible; }
.sb-panel .sb-sidebar-identity { display: flex; align-items: center; gap: .9rem; padding: 1.1rem 1.2rem; border-block-end: 1px solid #263348; }
.sb-panel .sb-sidebar-identity img { flex: 0 0 48px; }
.sb-panel .sb-sidebar-identity__text { min-inline-size: 0; }
.sb-panel .sb-sidebar-identity__text a { display: block; color: #eaf0f7; overflow-wrap: anywhere; line-height: 1.4; }
.sb-panel .sb-sidebar-identity__text > div { margin-block-start: .3rem; color: #b4c1d3; }
.sb-panel #sidebar .bm-sidebar-copy { padding: .85rem 1.2rem; margin: 0; color: #a2b0c2; background: #0d141f; }
.sb-panel #sidebar .nav-main-link-icon { color: #a2b0c2; }
.sb-panel #page-container { min-inline-size: 0; }
.sb-panel #app, .sb-panel #main-container { min-inline-size: 0; }
.sb-panel .table-responsive { max-inline-size: 100%; }

/* Spacious ticket thread and native editors work even if an optional
   rich-text library is missing. No remote editor dependency is required. */
.sb-panel .sb-ticket-layout { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(0, 2.5fr); gap: 1.5rem; align-items: start; }
.sb-panel .sb-ticket-summary, .sb-panel .sb-ticket-thread { min-inline-size: 0; background: #0d141f; border: 1px solid #263348; border-radius: 1rem; }
.sb-panel .sb-ticket-summary { padding: 1.25rem; }
.sb-panel .sb-ticket-summary dl { margin: 0; }
.sb-panel .sb-ticket-summary dt { margin-block-start: 1rem; font-size: .8rem; color: #a2b0c2; }
.sb-panel .sb-ticket-summary dd { color: #eaf0f7; overflow-wrap: anywhere; }
.sb-panel .sb-ticket-thread__head { padding: 1.4rem 1.5rem; border-block-end: 1px solid #263348; }
.sb-panel .sb-ticket-thread__head h2 { margin: 0 0 .35rem; font-size: 1.3rem; overflow-wrap: anywhere; }
.sb-panel .sb-ticket-messages { padding: 1.5rem; min-block-size: 22rem; max-block-size: 65vh; overflow-y: auto; scrollbar-width: thin; }
.sb-panel .sb-ticket-message { max-inline-size: 90%; margin-block-end: 1.25rem; }
.sb-panel .sb-ticket-message.is-own { margin-inline-start: auto; }
.sb-panel .sb-ticket-message__meta { color: #a2b0c2; font-size: .78rem; margin-block-end: .45rem; }
.sb-panel .sb-ticket-message__body { padding: 1rem 1.15rem; border: 1px solid #334155; border-radius: .85rem; color: #eaf0f7; background: #131c2a; line-height: 1.7; overflow-wrap: anywhere; }
.sb-panel .sb-ticket-message.is-own .sb-ticket-message__body { background: #1c2942; border-color: #4b5d77; }
.sb-panel .sb-ticket-compose { padding: 1.25rem 1.5rem; border-block-start: 1px solid #263348; }
.sb-panel .sb-ticket-editor { min-block-size: 12rem; line-height: 1.65; }
.sb-panel .sb-ticket-compose .btn { margin-block-start: 1rem; min-block-size: 2.8rem; }
.sb-panel #edit-ticket-modal .modal-dialog { max-inline-size: 760px; }
.sb-panel #edit-ticket-modal .form-group > label { display: block; }
.sb-customer .ticket-area td .btn-danger { display: none; }

/* Public field states, including readonly/API URL and browser autofill. */
.sb-public .bm-input { color: #eaf0f7; background-color: #131c2a; border-color: #4b5d77; }
.sb-public .bm-input[readonly], .sb-public .bm-input:disabled { color: #d4ddea; background-color: #1c293b; opacity: 1; }
.sb-public .bm-input::placeholder { color: #a2b0c2; opacity: 1; }

/* The homepage sign-in is an intentional light card on the dark hero. All
   descendant tokens are paired locally, so labels/errors/autofill stay legible. */
.sb-public .bm-lp__hero-form { inline-size: 100%; max-inline-size: 36rem; }
.sb-public .bm-lp__hero-form .bm-lp__card {
  --text-primary: #111827;
  --text-secondary: #334155;
  --text-muted: #526176;
  --color-action: #4338ca;
  --surface-overlay: #f8fafc;
  color-scheme: light;
  color: #111827;
  background: #fff;
  border: 1px solid #d5ddec;
  padding: clamp(1.25rem, 3vw, 2.5rem);
  border-radius: 1.1rem;
  box-shadow: 0 24px 70px -24px #000a;
}
.sb-public .bm-lp__hero-form .bm-lp__card-title { color: #111827; }
.sb-public .bm-lp__hero-form .bm-lp__card-sub,
.sb-public .bm-lp__hero-form label { color: #475569; }
.sb-public .bm-lp__hero-form a:not(.bm-btn) { color: #4338ca; }
.sb-public .bm-lp__hero-form .bm-input,
.sb-public .bm-lp__hero-form .bm-input[readonly] {
  color: #111827; -webkit-text-fill-color: #111827; caret-color: #111827;
  background: #f8fafc; border: 1px solid #8796ad;
}
.sb-public .bm-lp__hero-form .bm-input:focus { outline: 2px solid #4338ca; outline-offset: 2px; border-color: #4338ca; }
.sb-public .bm-lp__hero-form .bm-input::placeholder { color: #526176; -webkit-text-fill-color: #526176; }
.sb-public .bm-lp__hero-form input:-webkit-autofill { -webkit-text-fill-color: #111827; -webkit-box-shadow: 0 0 0 1000px #f8fafc inset; }
.sb-public .bm-lp__hero-form .bm-auth__alert { color: #991b1b; background: #fef2f2; }
.sb-public .bm-lp__hero-form .bm-input-error { color: #b91c1c; }
.sb-public .bm-lp__hero-form .bm-btn--primary { color: #fff; }
@media (min-width: 992px) {
  .sb-public .bm-lp__hero-grid { grid-template-columns: minmax(0, 1.2fr) minmax(410px, 1fr); gap: clamp(2rem, 6vw, 7rem); }
}
@media (max-width: 991.98px) {
  .sb-panel .sb-ticket-layout { grid-template-columns: 1fr; }
  .sb-public .bm-lp__hero-grid { grid-template-columns: minmax(0, 1fr); }
  .sb-public .bm-lp__hero-form { margin-inline: auto; }
}
@media (max-width: 575.98px) {
  .sb-panel .sb-ticket-messages, .sb-panel .sb-ticket-compose { padding: 1rem; }
  .sb-panel .sb-ticket-message { max-inline-size: 100%; }
  .sb-panel #edit-ticket-modal .modal-dialog { margin-inline: .5rem; }
}
@media (prefers-reduced-motion: reduce) {
  .sb-panel *, .sb-public * { scroll-behavior: auto !important; }
}
