.topbar-shell {
  position: sticky;
  top: 0;
  z-index: 9;
  background: #fff;
  border-bottom: 1px solid #e3e5eb;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.topbar-shell .app-header {
  position: static;
  top: auto;
  z-index: auto;
  margin-bottom: 0;
  min-height: 64px;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  border-bottom: 1px solid #e3e5eb;
}

.header-actions {
  display: flex;
  align-items: center;
  margin-left: auto;
  gap: 0.5rem;
}

.header-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  min-width: 40px;
  height: 37px;
  min-height: 37px;
  box-sizing: border-box;
}

.header-action-btn--ai {
  width: auto;
  min-width: 40px;
  padding-left: 0.45rem;
  padding-right: 0.45rem;
  flex: 0 1 auto;
  max-width: min(42vw, 220px);
}

.header-action-btn i {
  line-height: 1;
}

.header-action-btn__label {
  display: none;
}

.header-notification-trigger {
  overflow: visible;
}

.header-notification-trigger i {
  font-size: 1.5rem !important;
}

.header-actions .header-notification-trigger .count {
  position: absolute;
  top: 1px !important;
  right: 2px !important;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  line-height: 1;
}

.dense-toolbar {
  padding: 0.75rem;
  background: #fff;
}

.dense-toolbar__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.dense-toolbar__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.dense-toolbar .btn,
.dense-toolbar .dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.dense-toolbar .btn i,
.dense-toolbar .dropdown-toggle i {
  font-size: 1rem;
  line-height: 1;
}

.dense-toolbar__label {
  display: inline;
}

.dense-toolbar .dropdown-menu {
  z-index: 1050;
}

.dense-toolbar .dropdown {
  position: relative;
}

.app-body {
  padding-top: 1rem;
}

.records-card {
  border-color: #dfe4ec;
}

.records-card .card-header {
  background: #fff;
  padding: 1rem 1.25rem;
}

.records-card .card-body {
  padding: 1rem;
  background: #fff;
}

.records-content-frame {
  background: #fff;
}

.records-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.records-toolbar__lead {
  min-width: 0;
}

.records-toolbar .breadcrumb {
  margin-bottom: 0.4rem;
}

.records-toolbar__title {
  margin: 0 0 0.2rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: #202634;
}

.records-toolbar__description {
  margin: 0;
  color: #617187;
  font-size: 0.82rem;
  line-height: 1.4;
}

.records-toolbar__controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.records-view-switcher {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.2rem;
  border: 1px solid #d7deea;
  border-radius: 10px;
  background: #f8fafc;
}

.records-view-switcher .btn {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #66758a;
  box-shadow: none;
}

.records-view-switcher .btn.active {
  background: #1f57c3;
  color: #fff;
  box-shadow: 0 6px 14px rgba(31, 87, 195, 0.18);
}

.records-view {
  display: none;
}

.records-view.is-active {
  display: block;
}

.records-list {
  margin: 0;
}

.records-list .list-group-item {
  border-left: 0;
  border-right: 0;
  padding: 0.82rem 1rem 0.78rem 1.55rem;
  position: relative;
}

.records-list .list-group-item.records-row-active,
.records-table tbody tr.records-row-active {
  background: #f6f9ff;
}

.records-list .list-group-item::before {
  content: "";
  position: absolute;
  left: 0.75rem;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cfd8e6;
  transform: translateY(-50%);
  transition: background-color 160ms ease, box-shadow 160ms ease;
}

.records-list .list-group-item.records-row-active::before {
  background: #1f57c3;
  box-shadow: 0 0 0 4px rgba(31, 87, 195, 0.12);
}

.records-table tbody tr td:first-child {
  position: relative;
  padding-left: 1.55rem;
}

.records-table tbody tr td:first-child::before {
  content: "";
  position: absolute;
  left: 0.75rem;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cfd8e6;
  transform: translateY(-50%);
  transition: background-color 160ms ease, box-shadow 160ms ease;
}

.records-table.table-striped > tbody > tr.odd > td,
.records-table.table-striped > tbody > tr:nth-of-type(odd) > td {
  background: #ffffff !important;
}

.records-table.table-striped > tbody > tr.even > td,
.records-table.table-striped > tbody > tr:nth-of-type(even) > td {
  background: #eef2f7 !important;
}

.records-table tbody tr.records-row-active > td {
  background: #e8f0ff !important;
}

.records-table tbody tr.records-row-active td:first-child::before {
  background: #1f57c3;
  box-shadow: 0 0 0 4px rgba(31, 87, 195, 0.12);
}

.records-list__title {
  margin: 0;
  color: #202634;
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.25;
}

.records-list__subtitle {
  margin: 0 0 0.26rem;
  color: #607089;
  font-size: 0.77rem;
}

.records-badges {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.35rem;
  margin-bottom: 0.32rem;
  max-width: 100%;
  vertical-align: top;
}

.records-badges .records-list__title {
  margin-right: 0.15rem;
}

.records-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0.06rem 0.4rem;
  border: 1px solid #cfd7e5;
  background: #fff;
  color: #41505f;
  font-size: 0.7rem;
  white-space: nowrap;
}

.records-list__meta {
  margin-top: 0.42rem;
  color: #607089;
  font-size: 0.76rem;
  padding-top: 0.38rem;
  border-top: 1px solid #eef2f7;
}

.records-list__description {
  margin: 0;
  color: #313c47;
  line-height: 1.3;
  font-size: 0.79rem;
}

#sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10;
}

.sidepanel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1040;
  background: rgba(15, 23, 42, 0.32);
  backdrop-filter: blur(4px);
}

.sidepanel {
  position: fixed;
  top: 0;
  bottom: 0;
  z-index: 1050;
  width: min(420px, calc(100vw - 1.5rem));
  background: #fff;
  box-shadow: 0 22px 44px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  transition: transform 220ms ease;
}

.sidepanel--left {
  left: 0;
  transform: translateX(-100%);
}

.sidepanel--right {
  right: 0;
  width: var(--ai-panel-width, min(680px, calc(100vw - 1.5rem)));
  transform: translateX(100%);
}

.sidepanel.is-open {
  transform: translateX(0);
}

.sidepanel__header {
  min-height: 64px;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e3e5eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.sidepanel__header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.sidepanel-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.sidepanel__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.sidepanel__body {
  flex: 1 1 auto;
  overflow: auto;
  padding: 1.25rem;
  background: #f8f9fc;
}

#ai-panel .sidepanel__body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

#ai-panel .sidepanel__body > [data-assistant-root] {
  display: flex;
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.sidepanel__section + .sidepanel__section {
  margin-top: 1rem;
}

.sidepanel__card {
  padding: 1rem;
  border: 1px solid #e3e5eb;
  border-radius: 16px;
  background: #fff;
}

.sidepanel__field {
  margin: 0;
}

.sidepanel__field .form-label {
  margin-bottom: 0.38rem;
}

.sidepanel__actions {
  padding-top: 0.35rem;
}

.sidepanel__actions .btn {
  width: 100%;
}

.sidepanel__eyebrow {
  margin-bottom: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6e7985;
}

.sidepanel__prompt {
  min-height: 140px;
  resize: vertical;
}

.sidepanel__list {
  margin: 0;
  padding-left: 1.1rem;
  color: #617187;
}

.assistant-home,
.assistant-chat-screen {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  width: 100%;
  height: 100%;
  min-height: 0;
  flex: 1 1 auto;
}

.assistant-home > .sidepanel__section,
.assistant-chat-screen > .sidepanel__section {
  margin-top: 0 !important;
}

.assistant-chat-screen {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-content: stretch;
  overflow: hidden;
}

.assistant-chat-screen.is-hidden,
.assistant-home.is-hidden {
  display: none;
}

.assistant-panel__sidebar,
.assistant-panel__hero,
.assistant-panel__stats-shell,
.assistant-panel__timeline-shell,
.assistant-panel__composer-shell {
  border-radius: 18px;
  border: 1px solid #d8e0ea;
  background: linear-gradient(180deg, #fbfcfe 0%, #f3f6fa 100%);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.045);
}

.assistant-panel__sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
}

.assistant-sidebar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.assistant-sidebar__head--compact {
  justify-content: flex-end;
}

.assistant-sidebar__new {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
}

.assistant-chat-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  padding-right: 0.2rem;
}

.assistant-chat-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.55rem;
  border: 1px solid #e5eaf1;
  border-radius: 16px;
  background: #f4f7fb;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.assistant-chat-card.is-active {
  background: #eaf1fb;
  border-color: #b7c9e8;
  box-shadow: inset 0 0 0 1px rgba(35, 91, 199, 0.08);
}

.assistant-chat-card__main,
.assistant-chat-card__delete {
  appearance: none;
  border: 0;
  background: transparent;
}

.assistant-chat-card__main {
  text-align: left;
  width: 100%;
  padding: 0.9rem 0.95rem;
  cursor: pointer;
}

.assistant-chat-card__delete {
  width: 36px;
  height: 36px;
  margin: 0.7rem 0.7rem 0 0;
  border-radius: 11px;
  color: #7c8798;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.assistant-chat-card__delete i {
  font-size: 1rem;
  line-height: 1;
  display: block;
}

.assistant-chat-card__delete:hover {
  background: #eef2f8;
  color: #344256;
}

.assistant-chat-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.assistant-chat-card__title {
  color: #162031;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.35;
}

.assistant-chat-card__count {
  min-width: 28px;
  height: 28px;
  padding: 0 0.45rem;
  border-radius: 999px;
  background: #dce5f3;
  color: #2d3f56;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
}

.assistant-chat-card__preview {
  margin-top: 0.45rem;
  color: #5d6b80;
  font-size: 0.76rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.assistant-chat-card__meta {
  margin-top: 0.55rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  color: #7b8797;
  font-size: 0.71rem;
}

.assistant-panel__eyebrow,
.assistant-panel__section-title {
  color: #6c7888;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.assistant-panel__title {
  margin: 0.35rem 0 0;
  color: #172133;
  font-size: 0.98rem;
  line-height: 1.35;
  font-weight: 700;
}

.assistant-hero__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.assistant-hero__title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.assistant-stat-card {
  padding: 0.72rem 0.8rem;
  border-radius: 12px;
  border: 1px solid #e1e7ef;
  background: rgba(255, 255, 255, 0.76);
}

.assistant-stat-card__label {
  display: block;
  color: #7b8798;
  font-size: 0.72rem;
  line-height: 1.2;
}

.assistant-stat-card__value {
  display: block;
  margin-top: 0.28rem;
  color: #1f2b3d;
  font-size: 0.87rem;
  line-height: 1.35;
  font-weight: 700;
}

.assistant-panel__stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin-top: 0.8rem;
}

.assistant-panel__timeline-shell {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.assistant-panel__timeline {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 0.85rem;
  min-height: 0;
  overflow: auto;
  padding-right: 0.35rem;
  padding-bottom: 0.15rem;
}

.assistant-panel__empty {
  color: #617187;
  font-size: 0.83rem;
  line-height: 1.5;
}

.assistant-panel__empty--large {
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.assistant-message {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  max-width: 88%;
  padding: 0.95rem 1rem;
  border-radius: 18px;
  border: 1px solid #e5eaf1;
  background: rgba(255, 255, 255, 0.96);
}

.assistant-message--user {
  margin-left: auto;
  background: #edf4ff;
  border-color: #cfe0ff;
}

.assistant-message--assistant {
  margin-right: auto;
  background: #f2f5f9;
}

.assistant-message.is-pending {
  opacity: 0.72;
}

.assistant-message__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.assistant-message__role {
  color: #1f57c3;
  font-size: 0.69rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.assistant-message__time {
  color: #8190a4;
  font-size: 0.69rem;
}

.assistant-message__content {
  color: #223042;
  font-size: 0.84rem;
  line-height: 1.56;
}

.assistant-panel__composer {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  min-height: 0;
}

.assistant-panel__composer-shell {
  display: block;
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
  margin-top: 0;
  overflow: visible;
}

.assistant-panel__label {
  margin-bottom: 0;
}

.assistant-panel__textarea {
  min-height: 124px;
  max-height: 30vh;
  resize: vertical;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
}

.assistant-panel__composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.assistant-panel__status {
  color: #6e7b8e;
  font-size: 0.75rem;
  line-height: 1.4;
}

.assistant-panel__send {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.assistant-panel__note {
  color: #7a8699;
  font-size: 0.73rem;
  line-height: 1.35;
}

@media (max-width: 1199px) {
  .assistant-panel__sidebar {
    max-height: 320px;
  }
}

@media (max-width: 767px) {
  .assistant-hero__head,
  .assistant-panel__composer-footer,
  .assistant-sidebar__head,
  .assistant-hero__title-wrap,
  .sidepanel__header-actions {
    flex-direction: column;
    align-items: stretch;
  }

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

  .assistant-message {
    max-width: 100%;
  }
}

.sidebar-brand-toggle {
  display: none;
  margin-left: auto;
  width: 38px;
  height: 38px;
  padding: 0;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.entity-modal__hint {
  margin: 0;
  color: #607089;
  font-size: 0.78rem;
}

.entity-modal__schema-slot {
  border: 1px dashed #cfd7e5;
  border-radius: 10px;
  padding: 0.9rem 1rem;
  background: #f8fafc;
  color: #607089;
  font-size: 0.79rem;
}

.entity-modal__footer-note {
  margin-right: auto;
  color: #7a8798;
  font-size: 0.75rem;
}

.entity-modal__confirm {
  color: #374151;
  font-size: 0.9rem;
  line-height: 1.5;
}

.filters-form .form-control,
.filters-form .form-select {
  background: #ffffff;
}

.form-label.is-required::after {
  content: " *";
  color: #ce385b;
}

.toastify.app-notice {
  max-width: 380px;
  min-width: 312px;
  padding: 14px 48px 14px 14px;
  border-radius: 16px;
  border: 1px solid #d9dee7;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.16);
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.01em;
  background-image: none;
  background-color: #ffffff;
  color: #3b4655;
  display: inline-flex;
  align-items: flex-start;
  gap: 0;
  cursor: default;
}

.toastify.app-notice .app-notice__inner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
}

.toastify.app-notice .app-notice__icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  flex: 0 0 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  background: #edf3ff;
  color: #235bc7;
}

.toastify.app-notice .app-notice__icon i {
  font-size: 17px;
  line-height: 1;
  font-weight: 400;
}

.toastify.app-notice .app-notice__message {
  padding-top: 2px;
  padding-right: 4px;
}

.toastify.app-notice .toast-close {
  top: 12px;
  right: 12px;
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f6f8fb;
  color: #8a94a6;
  border: 0;
  box-shadow: none;
  font-size: 17px;
  line-height: 1;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.toastify.app-notice .toast-close:hover {
  background: #ebeff5;
  color: #243041;
  transform: translateY(-1px);
}

.toastify.app-notice--success {
  background-color: #ffffff;
  border-color: #d4e3bf;
}

.toastify.app-notice--error {
  background-color: #ffffff;
  border-color: #f0c5cf;
}

.toastify.app-notice--success .app-notice__icon {
  background: #eef6e1;
  border-color: #d4e3bf;
  color: #5b871a;
}

.toastify.app-notice--error .app-notice__icon {
  background: #fff0f2;
  border-color: #f0c5cf;
  color: #cb4464;
}

.toastify.app-notice--warning {
  background-color: #ffffff;
  border-color: #f1ddb0;
}

.toastify.app-notice--warning .app-notice__icon {
  background: #fff6dd;
  border-color: #f1ddb0;
  color: #bc8708;
}

.toastify.app-notice--info {
  background-color: #ffffff;
  border-color: #cbd6eb;
}

.toastify.app-notice--info .app-notice__icon {
  background: #edf3ff;
  border-color: #cbd6eb;
  color: #235bc7;
}

.toastify.app-notice::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 999px;
  background: #d9dee7;
}

.toastify.app-notice--success::before {
  background: #6e9c27;
}

.toastify.app-notice--error::before {
  background: #ce385b;
}

.toastify.app-notice--warning::before {
  background: #be8808;
}

.toastify.app-notice--info::before {
  background: #0a50d8;
}

@media (max-width: 767.98px) {
  .toastify.app-notice {
    min-width: 0;
    max-width: calc(100vw - 24px);
    width: calc(100vw - 24px);
    padding-right: 46px;
  }
}

@media (min-width: 768px) {
  .header-action-btn__label {
    display: inline;
  }

  .header-action-btn--ai {
    gap: 0.45rem;
    padding-left: 0.85rem;
    padding-right: 0.85rem;
    max-width: none;
  }

  .header-action-btn--ai i {
    font-size: 1.1rem !important;
  }
}

@media (max-width: 767.98px) {
  .page-wrapper.toggled .topbar-shell #toggle-sidebar {
    visibility: hidden;
  }

  .page-wrapper.toggled .sidebar-brand-toggle {
    display: inline-flex;
    background: #53810c;
    border-color: #53810c;
    color: #fff;
  }

  .page-wrapper.toggled .sidebar-brand-toggle i {
    color: #fff;
  }

  .page-wrapper.toggled .app-brand-sm {
    opacity: 0;
    pointer-events: none;
  }

  .records-toolbar {
    flex-direction: column;
  }

  .records-toolbar__controls {
    width: 100%;
    justify-content: space-between;
    margin-left: 0;
  }

  .assistant-panel__composer-footer {
    align-items: stretch;
  }

  .assistant-panel__composer-footer .btn {
    width: 100%;
  }
}
