@import url("./theme.css");

.page-loader {
  position: fixed;
  inset: 0;
  background: rgba(15, 17, 22, 0.35);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 2000;
}

.page-loader.is-visible {
  opacity: 1;
  pointer-events: all;
}

.page-loader__spinner {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  animation: loader-spin 0.8s linear infinite;
}

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

.main-nav {
  --nav-bg: #0f1116;
  --nav-border: rgba(255, 255, 255, 0.08);
  --nav-text: rgba(255, 255, 255, 0.72);
  --nav-text-strong: #ffffff;
  --nav-accent: #00d4ff;
  background: linear-gradient(120deg, #0f1116 0%, #131923 45%, #0b1018 100%);
  border-bottom: 1px solid var(--nav-border);
  padding: 0.35rem 1.2rem;
  position: sticky;
  top: 0;
  z-index: 1030;
}

.main-nav .navbar-brand {
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  transition: background 0.2s ease;
}

.main-nav .navbar-brand:hover {
  background: rgba(255, 255, 255, 0.06);
}

.main-nav .navbar-brand img {
  width: 190px;
  height: auto;
  display: block;
}

.main-nav .nav-link {
  color: var(--nav-text);
  padding: 0.35rem 0.2rem;
  margin-right: 1rem;
  letter-spacing: 0.2px;
  position: relative;
  transition: color 0.2s ease;
}

.main-nav .nav-link:hover,
.main-nav .nav-link:focus {
  color: var(--nav-text-strong);
}

.main-nav .nav-link.active {
  color: var(--nav-text-strong);
}

.main-nav .nav-link.active::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.45rem;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--nav-accent), transparent 80%);
}

.main-nav .nav-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 0.75rem 0 0.2rem;
}

.main-nav .navbar-toggler {
  border-color: rgba(255, 255, 255, 0.2);
}

.main-nav .navbar-toggler-icon {
  filter: invert(1);
}

.main-nav .profile-toggle img {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.22);
}

@media (min-width: 992px) {
  .main-nav .navbar-nav .dropdown:hover > .dropdown-menu {
    display: block;
  }

  .main-nav .navbar-nav .dropdown > .dropdown-menu {
    margin-top: 0;
  }
}

@media (max-width: 992px) {
  .main-nav {
    padding: 0.45rem 0.85rem;
  }

  .main-nav .navbar-brand img {
    width: 160px;
  }

  .main-nav .nav-link {
    margin: 0.35rem 0;
  }

  .main-nav .nav-divider {
    display: none;
  }
}

.search-bar {
  position: relative;
}

.search-bar .form-control {
  border-color: #d9dee7;
  box-shadow: none;
  border-right: 0;
}

.search-bar .form-control:focus {
  border-color: #b6c3d9;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.12);
}

.search-bar .form-control,
.search-bar .search-btn {
  border-radius: 0.6rem;
}

.search-bar .form-control {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.search-bar .search-btn {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  background-color: #0d6efd;
  border-color: #0d6efd;
  color: #fff;
}

.search-bar .search-btn:hover,
.search-bar .search-btn:focus {
  background-color: #0b5ed7;
  border-color: #0b5ed7;
  color: #fff;
}

.search-bar .search-btn i {
  font-size: 1rem;
  line-height: 1;
}

.table-fragment-loader {
  position: absolute;
  inset: 0;
  background: var(--app-surface);
  padding: 0.75rem;
  z-index: 5;
}

a,
a:visited,
.table a,
.table a:visited,
.page-link,
.page-link:visited,
.btn.btn-link,
.btn-link {
  color: #111111;
  text-decoration: none;
}

a:hover,
a:focus-visible,
.table a:hover,
.table a:focus-visible,
.page-link:hover,
.page-link:focus-visible,
.btn.btn-link:hover,
.btn.btn-link:focus-visible,
.btn-link:hover,
.btn-link:focus-visible {
  color: #111111;
  text-decoration: none;
}

[data-theme="dark"] a,
[data-theme="dark"] a:visited,
[data-theme="dark"] .table a,
[data-theme="dark"] .table a:visited,
[data-theme="dark"] .page-link,
[data-theme="dark"] .page-link:visited,
[data-theme="dark"] .btn.btn-link,
[data-theme="dark"] .btn-link {
  color: #e6edf3;
}

[data-theme="dark"] a:hover,
[data-theme="dark"] a:focus-visible,
[data-theme="dark"] .table a:hover,
[data-theme="dark"] .table a:focus-visible,
[data-theme="dark"] .page-link:hover,
[data-theme="dark"] .page-link:focus-visible,
[data-theme="dark"] .btn.btn-link:hover,
[data-theme="dark"] .btn.btn-link:focus-visible,
[data-theme="dark"] .btn-link:hover,
[data-theme="dark"] .btn-link:focus-visible {
  color: #ffffff;
  text-decoration: none;
}

.table-select-col {
  width: 44px;
}

.table-json {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
  border-collapse: separate;
  border-spacing: 0;
}

.table-json th,
.table-json td {
  vertical-align: middle;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  padding: 0.5rem 0.65rem;
  line-height: 1.2;
  color: var(--app-text);
  border-color: var(--app-border);
}

.table-json th[data-col-key] {
  white-space: nowrap;
  min-width: max-content;
}

.list-page-container {
  max-width: min(96vw, 1800px) !important;
}

.table-json tbody tr {
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.table-json tbody tr:hover {
  background-color: rgba(13, 110, 253, 0.06);
  box-shadow: inset 0 0 0 1px rgba(13, 110, 253, 0.25);
  transform: translateY(-1px);
}

[data-theme="dark"] .table-json tbody tr:hover {
  background-color: rgba(59, 130, 246, 0.12);
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.35);
}

.inline-edit-cell {
  position: relative;
}

.inline-edit-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  max-width: 100%;
}

.inline-edit-text {
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  word-break: break-word;
}

.inline-edit-wrap.is-editing {
  display: flex;
  width: 100%;
}

.inline-edit-trigger {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--app-muted);
  line-height: 1;
}

.table-json tbody tr:hover .inline-edit-trigger,
.table-json tbody tr:focus-within .inline-edit-trigger,
.table-json td.inline-edit-cell:hover .inline-edit-trigger,
.inline-edit-wrap:focus-within .inline-edit-trigger,
.inline-edit-wrap.is-editing .inline-edit-trigger {
  opacity: 1;
  pointer-events: auto;
}

.inline-edit-trigger:hover {
  color: var(--app-text);
}

.inline-edit-editor {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.inline-edit-editor .form-control {
  min-width: 0;
  width: 0;
  flex: 1 1 auto;
  height: calc(1.5em + 0.45rem + 2px);
  padding: 0.15rem 0.45rem;
  font-size: 0.875rem;
}

.inline-edit-editor .btn {
  flex: 0 0 auto;
}

.inline-edit-save-btn {
  --bs-btn-padding-y: 0.08rem;
  --bs-btn-padding-x: 0.3rem;
  --bs-btn-font-size: 0.72rem;
  --bs-btn-border-radius: 0.3rem;
  line-height: 1;
}

.inline-edit-save-btn .bi {
  font-size: 0.72rem;
}

.inline-edit-popover {
  position: fixed;
  z-index: 2300;
  min-width: 220px;
  max-width: min(420px, calc(100vw - 16px));
  border: 1px solid var(--app-border);
  border-radius: 0.6rem;
  background: var(--app-surface);
  box-shadow: var(--app-shadow);
  padding: 0.45rem;
}

.inline-edit-popover__body {
  min-width: 0;
}

.inline-edit-popover__actions {
  display: flex;
  justify-content: stretch;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

.inline-edit-popover__actions .btn {
  flex: 1 1 0;
  width: 100%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.inline-edit-popover__suggestions {
  max-height: 180px;
  overflow: auto;
}

.table-json thead th {
  background: var(--app-table-head);
  color: var(--app-text);
  border-bottom: 1px solid var(--app-border);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.table-json tbody tr:nth-child(odd) {
  background: var(--app-table-row-alt);
}

.table-json tbody tr:nth-child(even) {
  background: var(--app-table-row);
}

.table-json tbody tr:hover {
  background: var(--app-surface-alt);
}

.table-json tbody tr:nth-child(odd) > td {
  background: var(--app-table-row-alt);
}

.table-json tbody tr:nth-child(even) > td {
  background: var(--app-table-row);
}

.table-json tbody tr:hover > td {
  background: var(--app-surface-alt);
}

.tasks-project-header > td {
  background: rgba(13, 110, 253, 0.14) !important;
  color: var(--app-text);
  font-weight: 700;
  border-top: 1px solid rgba(13, 110, 253, 0.28);
  border-bottom: 1px solid rgba(13, 110, 253, 0.18);
}

[data-theme="dark"] .tasks-project-header > td {
  background: rgba(96, 165, 250, 0.22) !important;
  border-top-color: rgba(96, 165, 250, 0.5);
  border-bottom-color: rgba(96, 165, 250, 0.35);
}

.tasks-project-header .staff-booking-add-btn {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.tasks-project-header:hover .staff-booking-add-btn,
.tasks-project-header:focus-within .staff-booking-add-btn {
  opacity: 1;
  pointer-events: auto;
}

.permission-category {
  border: 1px solid var(--app-border);
  border-radius: 0.5rem;
  overflow: hidden;
  background: var(--app-surface);
}

.permission-category-title {
  padding: 0.6rem 0.9rem;
  font-weight: 700;
  border-bottom: 1px solid var(--app-border);
  background: var(--app-surface-alt);
}

.permission-grid-header {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(360px, 2fr);
  gap: 1rem;
  padding: 0.45rem 0.9rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--app-text-muted);
  border-bottom: 1px solid var(--app-border);
}

.permission-grid-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(360px, 2fr);
  gap: 1rem;
  align-items: start;
  padding: 0.55rem 0.9rem;
  margin: 0;
  border-bottom: 1px solid var(--app-border);
}

.permission-grid-row:last-child {
  border-bottom: 0;
}

.permission-grid-row:hover {
  background: var(--app-surface-alt);
}

.permission-grid-key {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
}

.permission-grid-key code {
  white-space: normal;
  word-break: break-word;
}

.permission-grid-desc {
  display: inline-flex;
  flex-direction: column;
  gap: 0.15rem;
}

.permission-grid-label {
  font-weight: 600;
}

.permission-grid-help {
  color: var(--app-text-muted);
}

@media (max-width: 991px) {
  .permission-grid-header,
  .permission-grid-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
}

.table-json td[data-col-key="quantity"],
.table-json td[data-col-key="weight"],
.table-json td[data-col-key="purchaseYear"],
.table-json td[data-col-key="status"] {
  white-space: normal;
}

.table-json td[data-col-key="actions"],
.table-json th[data-col-key="actions"] {
  white-space: nowrap;
  text-align: right;
}

@media (min-width: 992px) {
  .table-json.row-hover-actions th[data-col-key="actions"] {
    position: sticky;
    right: 0;
    width: 1px !important;
    min-width: 1px !important;
    max-width: 1px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    border-left-width: 0 !important;
    border-right-width: 0 !important;
    color: transparent !important;
    font-size: 0 !important;
    z-index: 12;
    background: var(--app-table-head);
  }

  .table-json.row-hover-actions td[data-col-key="actions"] {
    position: sticky;
    right: 0;
    width: 1px !important;
    min-width: 1px !important;
    max-width: 1px !important;
    padding: 0 !important;
    border-left-width: 0 !important;
    border-right-width: 0 !important;
    position: sticky;
    overflow: visible !important;
    z-index: 22;
    background: var(--app-table-row);
  }

  .table-json.row-hover-actions td[data-col-key="actions"] .row-actions {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.08s ease;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    z-index: 35;
    white-space: nowrap;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 0.55rem;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    padding: 0.2rem 0.25rem;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  }

  .table-json.row-hover-actions tbody tr:hover td[data-col-key="actions"] .row-actions,
  .table-json.row-hover-actions tbody tr:focus-within td[data-col-key="actions"] .row-actions,
  .table-json.row-hover-actions tbody tr.row-selected td[data-col-key="actions"] .row-actions {
    opacity: 1;
    pointer-events: auto;
  }

  .table-json.row-hover-actions tbody tr:nth-child(odd) td[data-col-key="actions"] {
    background: var(--app-table-row-alt);
  }

  .table-json.row-hover-actions tbody tr:nth-child(even) td[data-col-key="actions"] {
    background: var(--app-table-row);
  }

  .table-json.row-hover-actions tbody tr:hover td[data-col-key="actions"] {
    background: var(--app-surface-alt);
  }
}

.table-json .badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.table-json .sort-btn {
  white-space: nowrap;
  text-align: left;
  line-height: 1.2;
  color: inherit;
}

/* Responsive table behavior for list pages */
.table-responsive {
  overflow-x: auto;
  overflow-y: visible !important;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 991.98px) {
  .list-page-container {
    max-width: 100% !important;
    padding-left: 0.55rem;
    padding-right: 0.55rem;
  }

  .table-json {
    table-layout: auto;
  }

  .table-json th,
  .table-json td {
    padding: 0.42rem 0.5rem;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
  }

  .table-json td[data-col-key="actions"],
  .table-json th[data-col-key="actions"] {
    overflow: visible;
    text-overflow: clip;
  }
}

a.btn:not(.btn-link),
a.btn:not(.btn-link):visited {
  color: var(--bs-btn-color, #fff) !important;
  text-decoration: none;
}

a.btn:not(.btn-link):hover,
a.btn:not(.btn-link):focus-visible {
  color: var(--bs-btn-hover-color, var(--bs-btn-color, #fff)) !important;
  text-decoration: none;
}

.project-info .info-header {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.project-info .info-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-size: 0.95rem;
  color: var(--app-text);
}

.project-info .info-block {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.project-info .info-block h5 {
  margin-bottom: 0.75rem;
}

.project-info .info-tabs .nav-link {
  color: var(--app-text);
}

.project-info .info-tabs .nav-link.active {
  background: var(--app-surface-alt);
  border-color: var(--app-border);
}

.project-info .info-list {
  white-space: pre-line;
}

[data-theme="dark"] .project-info .info-list,
[data-theme="dark"] .project-info .info-list p,
[data-theme="dark"] .project-info .info-list span,
[data-theme="dark"] .project-info .info-list div,
[data-theme="dark"] .project-info .info-list li,
[data-theme="dark"] .project-info .info-list strong,
[data-theme="dark"] .project-info .info-list em {
  color: var(--app-text) !important;
}

.project-section-tabs .nav-link {
  color: var(--app-text);
}

.project-section-tabs .nav-link.active {
  background: var(--app-surface);
  border-color: var(--app-border);
}

.project-storage .project-storage-card,
.project-status .project-status-card,
.project-status .project-status-task {
  border: 1px solid var(--app-border);
  background: var(--app-surface);
  box-shadow: var(--app-shadow);
}

.project-storage .project-storage-card .card-body,
.project-status .project-status-card .card-body,
.project-status .project-status-task .card-body {
  padding: 1rem 1.15rem;
}

.project-storage .drive-embed-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #ffffff;
}

[data-theme="dark"] .project-storage .drive-embed-frame {
  /* Visual fallback when embedded provider does not support dark theme */
  filter: invert(0.91) hue-rotate(180deg) saturate(0.78) contrast(0.92);
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] .project-storage .drive-embed-frame {
    filter: invert(0.91) hue-rotate(180deg) saturate(0.78) contrast(0.92);
  }
}

.project-status .project-status-task ul {
  padding-left: 1rem;
  margin-bottom: 0;
}

.project-status .project-status-task li {
  margin-bottom: 0.3rem;
}

.project-status .task-user-list {
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--app-border);
  border-radius: 0.5rem;
  padding: 0.5rem;
  display: grid;
  gap: 0.35rem;
}

.project-status .task-user-item {
  display: flex;
  align-items: center;
  padding: 0.2rem 0.1rem;
  font-size: 0.92rem;
  cursor: pointer;
}

.project-status .table td,
.project-status .table th {
  vertical-align: middle;
}

.project-status .table-responsive {
  overflow-x: auto;
  overflow-y: visible;
}

.project-status .task-list-table {
  table-layout: auto;
  min-width: 1180px;
}

.project-status .task-list-table th:nth-child(1),
.project-status .task-list-table td:nth-child(1) {
  min-width: 240px;
}

.project-status .task-list-table th:nth-child(4),
.project-status .task-list-table td:nth-child(4) {
  min-width: 220px;
}

.project-status .task-list-table th:nth-child(7),
.project-status .task-list-table td:nth-child(7) {
  min-width: 150px;
  white-space: nowrap;
}

.project-status .task-list-table th:last-child,
.project-status .task-list-table td:last-child {
  width: 74px;
  white-space: nowrap;
}

.project-status .task-list-table td:last-child .btn {
  white-space: nowrap;
}

.project-status .task-actions-toggle {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.project-status .dropdown-menu {
  z-index: 2100;
}

.project-status .task-action-menu {
  position: fixed;
  z-index: 2200;
  min-width: 180px;
  border: 1px solid var(--app-border);
  background: var(--app-surface);
  box-shadow: var(--app-shadow);
  padding: 0.35rem 0;
}

.project-status .task-action-menu__item {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--app-text);
  padding: 0.45rem 0.75rem;
  text-align: left;
}

.project-status .task-action-menu__item:hover,
.project-status .task-action-menu__item:focus-visible {
  background: var(--app-surface-alt);
}

.project-status .task-action-menu__item--danger {
  color: #dc3545;
}

.project-list-action-menu {
  position: fixed;
  z-index: 2200;
  min-width: 180px;
  border: 1px solid var(--app-border);
  background: var(--app-surface);
  box-shadow: var(--app-shadow);
  padding: 0.35rem 0;
  border-radius: 0.45rem;
}

.project-list-action-menu__item {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--app-text);
  padding: 0.45rem 0.75rem;
  text-align: left;
}

.project-list-action-menu__item:hover,
.project-list-action-menu__item:focus-visible {
  background: var(--app-surface-alt);
}

.project-list-action-menu__item--danger {
  color: #dc3545;
}

.project-warehouse .warehouse-table th,
.project-warehouse .warehouse-table td {
  border-color: var(--app-border);
}

.project-warehouse .warehouse-table th {
  background: var(--app-surface-alt);
  color: var(--app-text);
}

.project-warehouse .warehouse-table td {
  background: var(--app-surface);
  color: var(--app-text);
}

.booking-list .booking-summary-table td {
  vertical-align: middle;
}

.booking-list .booking-summary-img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  background: #f1f5f9;
  border-radius: 0.5rem;
  padding: 6px;
}

.booking-list .booking-summary-table {
  color: var(--app-text);
  --bs-table-bg: var(--app-surface);
  --bs-table-color: var(--app-text);
  --bs-table-striped-bg: var(--app-surface-alt);
}

.booking-list .booking-summary-table td,
.booking-list .booking-summary-table th {
  border-color: var(--app-border);
}

.booking-list .booking-summary-table tbody tr {
  background: var(--app-surface);
}

.project-settlement .settlement-table {
  --bs-table-bg: var(--app-surface);
  --bs-table-color: var(--app-text);
  --bs-table-border-color: var(--app-border);
  --bs-table-striped-bg: var(--app-surface-alt, rgba(255, 255, 255, 0.04));
}

.booking-detail .booking-shell {
  display: grid;
  gap: 1.75rem;
}

@media (min-width: 1200px) {
  .booking-detail .booking-shell {
    grid-template-columns: minmax(0, 1fr) 360px;
    align-items: start;
  }
}

.booking-detail .booking-cart {
  border: 1px solid var(--app-border);
  background: var(--app-surface);
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: var(--app-shadow);
  max-height: 520px;
  overflow: hidden;
}

@media (min-width: 1200px) {
  .booking-detail .booking-cart {
    position: sticky;
    top: 1rem;
  }
}

.booking-detail .booking-cart__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.booking-detail .booking-cart__header h5 {
  margin-bottom: 0.35rem;
}

.booking-detail .booking-cart__items {
  display: block;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.booking-detail .booking-selected-table {
  color: var(--app-text);
  --bs-table-bg: var(--app-surface);
  --bs-table-color: var(--app-text);
  --bs-table-striped-bg: var(--app-surface-alt);
}

.booking-detail .booking-selected-table td,
.booking-detail .booking-selected-table th {
  border-color: var(--app-border);
  padding: 0.7rem 0.6rem;
  vertical-align: middle;
}

.booking-detail .booking-selected-table tr.booking-cart-row--pending-remove td {
  background: rgba(220, 53, 69, 0.14);
}

.booking-detail .booking-selected-table th:nth-child(3),
.booking-detail .booking-selected-table td:nth-child(3) {
  width: 78px;
  white-space: nowrap;
  padding-right: 0.75rem;
}

.booking-detail .booking-selected-table th:nth-child(4),
.booking-detail .booking-selected-table td:nth-child(4) {
  width: 36px;
}

.booking-detail .booking-selected-table th:nth-child(2),
.booking-detail .booking-selected-table td:nth-child(2) {
  width: auto;
  min-width: 0;
}

.booking-detail .booking-selected-table th:nth-child(1),
.booking-detail .booking-selected-table td:nth-child(1) {
  width: 52px;
}

.booking-detail .cart-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 0.5rem;
  background: #f1f5f9;
  padding: 6px;
}

.booking-detail .cart-title {
  font-weight: 600;
}

.booking-detail .cart-meta {
  font-size: 0.8rem;
  color: var(--app-muted);
}

.booking-detail .cart-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  justify-content: flex-end;
  align-items: flex-end;
}

.booking-detail .cart-actions .btn {
  min-width: 32px;
  padding: 0.12rem 0.45rem;
}

.booking-detail .cart-item {
  border: 1px solid var(--app-border);
  border-radius: 1rem;
  background: var(--app-surface);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.booking-detail .cart-item img {
  width: 100%;
  height: 140px;
  object-fit: contain;
  padding: 20px;
  box-sizing: border-box;
  background: #f1f5f9;
}

.booking-detail .cart-item__body {
  padding: 0.75rem 0.85rem 0.9rem;
  display: grid;
  gap: 0.35rem;
}

.booking-detail .cart-item__title {
  font-weight: 600;
}

.booking-detail .cart-item__meta {
  font-size: 0.85rem;
  color: var(--app-muted);
}

.booking-detail .catalog-toolbar {
  margin-bottom: 1rem;
}

.booking-detail .catalog-layout {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 992px) {
  .booking-detail .catalog-layout {
    grid-template-columns: 200px minmax(0, 1fr);
    align-items: start;
  }
}

.booking-detail .catalog-categories {
  border: 1px solid var(--app-border);
  border-radius: 1rem;
  padding: 1rem;
  background: var(--app-surface);
  box-shadow: var(--app-shadow);
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 992px) {
  .booking-detail .catalog-categories {
    position: sticky;
    top: 1rem;
  }
}

.booking-detail .catalog-categories__title {
  font-weight: 600;
  color: var(--app-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.booking-detail .category-divider {
  height: 1px;
  background: var(--app-border);
  margin: 0.5rem 0;
}

.booking-detail .category-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid transparent;
  border-radius: 0.75rem;
  padding: 0.5rem 0.65rem;
  background: transparent;
  text-align: left;
  width: 100%;
  cursor: pointer;
  transition: all 0.2s ease;
}

.booking-detail .category-item img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 0.5rem;
  background: #f1f5f9;
  padding: 4px;
}

.booking-detail .category-item:hover {
  border-color: var(--app-border);
  background: var(--app-surface-alt);
}

.booking-detail .category-item.active {
  border-color: var(--app-primary);
  background: rgba(59, 130, 246, 0.12);
}

.booking-detail .catalog-category-header {
  margin-top: 0.25rem;

  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.booking-detail .catalog-category-section + .catalog-category-section {
  margin-top: 1.5rem;
}

.booking-detail .catalog-type-section + .catalog-type-section {
  margin-top: 1rem;
}


.booking-detail .catalog-category-header img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 0.75rem;
  background: #f1f5f9;
  padding: 6px;
}

.booking-detail .catalog-type-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.booking-detail .catalog-type-header img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 0.65rem;
  background: #f1f5f9;
  padding: 5px;
}

.booking-detail .catalog-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}

.booking-detail .catalog-card {
  border: 1px solid var(--app-border);
  border-radius: 1rem;
  padding: 0.75rem;
  background: var(--app-surface);
  box-shadow: var(--app-shadow);
  position: relative;
  display: grid;
  gap: 0.75rem;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.booking-detail .catalog-card:hover {
  transform: translateY(-2px);
  border-color: var(--app-primary);
}

.booking-detail .catalog-card__actions {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: flex;
  gap: 0.35rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.booking-detail .catalog-card:hover .catalog-card__actions {
  opacity: 1;
}

.booking-detail .catalog-card img {
  width: 100%;
  height: 140px;
  object-fit: contain;
  background: #f1f5f9;
  border-radius: 0.75rem;
  padding: 12px;
}

.booking-detail .catalog-card__title {
  font-weight: 600;
}

.booking-detail .catalog-card__meta {
  font-size: 0.85rem;
  color: var(--app-muted);
  min-height: 1.2rem;
}

.booking-detail .catalog-card__availability {
  font-size: 0.85rem;
  color: var(--app-muted);
}

.booking-detail .catalog-card__selected-badge {
  position: absolute;
  left: 0.5rem;
  top: 0.5rem;
  background: rgba(59, 130, 246, 0.85);
  color: #fff;
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-size: 0.75rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.booking-detail .catalog-card.is-selected .catalog-card__selected-badge {
  opacity: 1;
}

.booking-detail .catalog-card-wrap.is-unavailable .catalog-card {
  opacity: 0.5;
  pointer-events: none;
}

.booking-detail .catalog-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1200;
}

.booking-detail .catalog-modal.active {
  display: flex;
}

.booking-detail .catalog-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
}

.booking-detail .catalog-modal__panel {
  position: relative;
  background: var(--app-surface);
  border-radius: 1rem;
  padding: 1.5rem;
  width: min(480px, 90vw);
  z-index: 1;
  box-shadow: var(--app-shadow);
}

.booking-detail .catalog-modal__close {
  position: absolute;
  right: 1rem;
  top: 1rem;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  cursor: pointer;
}

.booking-detail .catalog-modal__content {
  display: grid;
  gap: 1rem;
  grid-template-columns: 120px 1fr;
  align-items: start;
}

.booking-detail .catalog-modal__content img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  background: #f1f5f9;
  border-radius: 1rem;
  padding: 8px;
}

.booking-detail .modal-availability {
  font-size: 0.9rem;
  color: var(--app-muted);
  margin-bottom: 0.5rem;
}

.booking-detail .modal-quantity {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.booking-detail .modal-contents {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--app-border);
  display: grid;
  gap: 0.75rem;
}

.booking-detail .modal-contents-list {
  display: grid;
  gap: 0.5rem;
}

.booking-detail .modal-contents-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.booking-detail .modal-contents-item img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 0.65rem;
  background: #f1f5f9;
  padding: 4px;
}

.booking-detail .modal-contents-count {
  margin-left: auto;
  color: var(--app-muted);
  font-size: 0.85rem;
}

.booking-detail .category-types {
  max-height: 260px;
  overflow-y: auto;
  padding-right: 0.35rem;
  display: grid;
  gap: 0.35rem;
}

.booking-detail .type-item {
  border: none;
  background: transparent;
  text-align: left;
  padding: 0.35rem 0.5rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s ease;
}

.booking-detail .type-item img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  border-radius: 0.5rem;
  background: #f1f5f9;
  padding: 4px;
}

.booking-detail .type-item:hover,
.booking-detail .type-item.active {
  background: var(--app-surface-alt);
}
@media (max-width: 767.98px) {
  .desktop-inline-actions {
    display: none !important;
  }
}

@media (min-width: 768px) {
  .mobile-actions-toggle {
    display: none !important;
  }
}

#bookingInfoModal .booking-info-calendar th,
#bookingInfoModal .booking-info-calendar td,
#caseBookingInfoModal .booking-info-calendar th,
#caseBookingInfoModal .booking-info-calendar td,
#toolBookingsInline .booking-info-calendar th,
#toolBookingsInline .booking-info-calendar td {
  vertical-align: middle;
}

#bookingInfoModal .booking-info-calendar td.is-active-day,
#caseBookingInfoModal .booking-info-calendar td.is-active-day,
#toolBookingsInline .booking-info-calendar td.is-active-day {
  background: #dc3545;
  color: #ffffff;
  border-radius: 0.45rem;
}

#bookingInfoModal .booking-info-calendar td.is-booked-day,
#caseBookingInfoModal .booking-info-calendar td.is-booked-day,
#toolBookingsInline .booking-info-calendar td.is-booked-day {
  background: #dbeafe;
  color: #1e3a8a;
  border-radius: 0.45rem;
}

[data-theme="dark"] #bookingInfoModal .modal-content,
[data-theme="dark"] #caseBookingInfoModal .modal-content {
  background: var(--app-surface);
  color: var(--app-text);
  border-color: var(--app-border);
}

[data-theme="dark"] #bookingInfoModal .modal-header,
[data-theme="dark"] #caseBookingInfoModal .modal-header {
  border-bottom-color: var(--app-border);
}

[data-theme="dark"] #bookingInfoModal .booking-info-calendar,
[data-theme="dark"] #caseBookingInfoModal .booking-info-calendar {
  --bs-table-bg: var(--app-surface);
  --bs-table-color: var(--app-text);
  --bs-table-border-color: var(--app-border);
}

[data-theme="dark"] #toolBookingsInline .booking-info-calendar {
  --bs-table-bg: var(--app-surface);
  --bs-table-color: var(--app-text);
  --bs-table-border-color: var(--app-border);
}

[data-theme="dark"] #bookingInfoModal .booking-info-calendar th,
[data-theme="dark"] #caseBookingInfoModal .booking-info-calendar th,
[data-theme="dark"] #toolBookingsInline .booking-info-calendar th {
  background: var(--app-table-head);
}

[data-theme="dark"] #bookingInfoModal .booking-info-calendar td.is-active-day,
[data-theme="dark"] #caseBookingInfoModal .booking-info-calendar td.is-active-day,
[data-theme="dark"] #toolBookingsInline .booking-info-calendar td.is-active-day {
  background: #dc3545;
  color: #ffffff;
  border-radius: 0.45rem;
}

[data-theme="dark"] #bookingInfoModal .booking-info-calendar td.is-booked-day,
[data-theme="dark"] #caseBookingInfoModal .booking-info-calendar td.is-booked-day,
[data-theme="dark"] #toolBookingsInline .booking-info-calendar td.is-booked-day {
  background: #1e3a8a;
  color: #bfdbfe;
  border-radius: 0.45rem;
}

[data-theme="dark"] #bookingInfoModal .booking-info-list .list-group-item,
[data-theme="dark"] #caseBookingInfoModal .booking-info-list .list-group-item,
[data-theme="dark"] #toolBookingsInline .booking-info-list .list-group-item {
  background: var(--app-surface);
  color: var(--app-text);
  border-color: var(--app-border);
}

#bookingInfoModal .booking-info-list .list-group-item.is-active-project,
#caseBookingInfoModal .booking-info-list .list-group-item.is-active-project,
#toolBookingsInline .booking-info-list .list-group-item.is-active-project {
  background: #fde2e4;
  border-color: #dc3545;
  color: #5a0b00;
}

#bookingInfoModal .booking-info-list .list-group-item.is-active-project .text-danger,
#caseBookingInfoModal .booking-info-list .list-group-item.is-active-project .text-danger,
#toolBookingsInline .booking-info-list .list-group-item.is-active-project .text-danger {
  color: #b02a37 !important;
}

[data-theme="dark"] #bookingInfoModal .booking-info-list .list-group-item.is-active-project,
[data-theme="dark"] #caseBookingInfoModal .booking-info-list .list-group-item.is-active-project,
[data-theme="dark"] #toolBookingsInline .booking-info-list .list-group-item.is-active-project {
  background: #3b0a0f;
  border-color: #dc3545;
  color: #ffffff;
}

[data-theme="dark"] #bookingInfoModal .booking-info-list .list-group-item.is-active-project .text-danger,
[data-theme="dark"] #caseBookingInfoModal .booking-info-list .list-group-item.is-active-project .text-danger,
[data-theme="dark"] #toolBookingsInline .booking-info-list .list-group-item.is-active-project .text-danger {
  color: #ff9aa2 !important;
}

.app-toast-container {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 2200;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: min(360px, calc(100vw - 2rem));
  pointer-events: none;
}

.app-toast {
  --toast-accent: #0d6efd;
  --toast-ttl: 3000ms;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--app-border);
  background: var(--app-surface);
  color: var(--app-text);
  border-radius: 0.7rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  padding: 0.8rem 2.2rem 0.9rem 0.9rem;
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  pointer-events: auto;
}

.app-toast.is-visible {
  animation: toast-in 180ms ease forwards;
}

.app-toast.is-leaving {
  animation: toast-out 180ms ease forwards;
}

.app-toast--success {
  --toast-accent: #20a35a;
}

.app-toast--error {
  --toast-accent: #dc3545;
}

.app-toast--info {
  --toast-accent: #0d6efd;
}

.app-toast__title {
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
  color: var(--toast-accent);
}

.app-toast__message {
  font-size: 0.92rem;
  line-height: 1.35;
  word-break: break-word;
}

.app-toast__close {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  border: 0;
  background: transparent;
  color: var(--app-text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
}

.app-toast__close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--app-text);
}

.app-toast__progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  background: var(--toast-accent);
  transform-origin: left center;
  animation: toast-progress var(--toast-ttl) linear forwards;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}

@keyframes toast-progress {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

.booking-list-card.is-entering {
  opacity: 0;
  transform: translateY(10px);
}

.booking-list-card.is-entering.is-entered {
  animation: booking-card-in 220ms ease forwards;
  animation-delay: var(--booking-enter-delay, 0ms);
}

@keyframes booking-card-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.task-chat-container {
  border: 1px solid var(--app-border);
  border-radius: 12px;
  padding: 0.75rem;
  background: var(--app-surface-alt, #f8fafc);
}

.task-chat-thread {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 48vh;
  overflow: auto;
  padding-right: 0.25rem;
}

.task-chat-message {
  display: flex;
  flex-direction: column;
  max-width: 82%;
}

.task-chat-message--own {
  align-self: flex-end;
}

.task-chat-message--other {
  align-self: flex-start;
}

.task-chat-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--app-text-muted);
  margin-bottom: 0.2rem;
}

.task-chat-message--own .task-chat-meta {
  justify-content: flex-end;
}

.task-chat-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  margin-left: 0.3rem;
}

.task-chat-action-btn {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  opacity: 0.7;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.task-chat-action-btn:hover,
.task-chat-action-btn:focus-visible {
  opacity: 1;
  background: rgba(128, 128, 128, 0.2);
}

.task-chat-action-btn--danger:hover,
.task-chat-action-btn--danger:focus-visible {
  color: #dc3545;
}

.task-chat-bubble {
  border-radius: 14px;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--app-border);
  background: var(--app-surface);
}

.task-chat-message--own .task-chat-bubble {
  background: color-mix(in srgb, var(--app-primary, #0d6efd) 14%, var(--app-surface));
  border-color: color-mix(in srgb, var(--app-primary, #0d6efd) 30%, var(--app-border));
}

.task-chat-text {
  line-height: 1.4;
  word-break: break-word;
}

.task-chat-attachments {
  margin-top: 0.5rem;
  display: grid;
  gap: 0.45rem;
}

.task-chat-file-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  text-decoration: none;
}

.task-chat-image-link {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-decoration: none;
}

.task-chat-image {
  max-width: min(260px, 100%);
  max-height: 180px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--app-border);
}

.task-chat-file-meta {
  font-size: 0.8rem;
}

.task-comment-dropzone {
  border: 1px dashed var(--app-border);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  font-size: 0.9rem;
  color: var(--app-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.task-comment-dropzone:hover,
.task-comment-dropzone.is-dragover {
  border-color: var(--app-primary, #0d6efd);
  color: var(--app-primary, #0d6efd);
  background: color-mix(in srgb, var(--app-primary, #0d6efd) 8%, transparent);
}

.task-comment-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.5rem;
}

.task-comment-preview-item {
  border: 1px solid var(--app-border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--app-surface);
}

.task-comment-preview-thumb {
  width: 100%;
  height: 90px;
  object-fit: cover;
  display: block;
}

.task-comment-preview-file {
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--app-text-muted);
}

.task-comment-preview-meta {
  padding: 0.35rem 0.5rem 0.45rem;
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  line-height: 1.2;
  word-break: break-word;
}

.task-comment-preview-meta span {
  color: var(--app-text-muted);
  font-size: 0.75rem;
}

.task-comment-modal__body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.task-comment-composer {
  border-top: 1px solid var(--app-border);
  padding-top: 0.75rem;
}

.task-chat-modal {
  background: #ffffff;
  color: #1f2328;
}

.task-chat-modal .modal-header {
  border-bottom-color: #dbe2ea;
}

.task-chat-modal .modal-title {
  color: #111827;
}

.task-chat-modal .btn-close {
  filter: none;
  opacity: 0.85;
}

.task-chat-modal .modal-body {
  background: #ffffff;
}

.task-chat-modal .task-chat-container {
  background: #ffffff;
  border: 0;
  border-radius: 0;
  padding: 0;
}

.task-chat-modal .task-chat-thread {
  max-height: min(58vh, 560px);
  padding: 0.5rem 0.35rem 0.25rem;
}

.task-chat-message {
  flex-direction: row;
  align-items: flex-end;
  gap: 0.45rem;
  max-width: 100%;
}

.task-chat-stack {
  display: flex;
  flex-direction: column;
  max-width: 72%;
}

.task-chat-avatar {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #d8dee6;
  color: #1f2937;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-bottom: 0.15rem;
}

.task-chat-message--own {
  justify-content: flex-end;
}

.task-chat-message--own .task-chat-stack {
  align-items: flex-end;
}

.task-chat-message--own .task-chat-avatar {
  display: inline-flex;
  margin-left: 0.2rem;
}

.task-chat-meta {
  font-size: 0.73rem;
  color: #667085;
  margin-bottom: 0.15rem;
}

.task-chat-separator {
  text-align: center;
  font-size: 0.74rem;
  color: #8b93a0;
  margin: 0.15rem 0 0.25rem;
}

.task-chat-system {
  text-align: center;
  font-size: 0.78rem;
  color: #7a828f;
  margin: 0.05rem 0 0.35rem;
}

.task-chat-message--own .task-chat-meta {
  justify-content: flex-end;
}

.task-chat-bubble {
  border-radius: 18px;
  background: #eef2f7;
  border: 0;
  color: #0f172a;
  padding: 0.48rem 0.7rem;
}

.task-chat-message--own .task-chat-bubble {
  background: #2e6df6;
  color: #fff;
}

.task-chat-message--own .task-chat-bubble .text-muted {
  color: rgba(255, 255, 255, 0.72) !important;
}

.task-chat-image {
  border: 0;
}

.task-chat-file-link {
  color: inherit;
}

.task-chat-input-row {
  display: flex;
  align-items: flex-end;
  gap: 0.35rem;
}

.task-chat-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #5b92ff;
  text-decoration: none;
}

.task-chat-icon-btn:hover,
.task-chat-icon-btn:focus-visible {
  color: #76a5ff;
  background: rgba(91, 146, 255, 0.12);
}

.task-chat-textarea.form-control {
  min-height: 34px;
  max-height: 160px;
  border-radius: 18px;
  border: 0;
  background: #eef2f7;
  color: #111827;
  padding: 0.42rem 0.75rem;
  resize: vertical;
}

.task-chat-textarea.form-control::placeholder {
  color: #8b98a8;
}

.task-chat-textarea.form-control:focus {
  background: #eef2f7;
  color: #111827;
  box-shadow: 0 0 0 2px rgba(91, 146, 255, 0.18);
}

.task-chat-send-btn {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
}

.task-comment-composer {
  border-top-color: #dbe2ea;
  padding-top: 0.5rem;
}

.task-comment-dropzone {
  background: #f6f8fb;
  border-color: #cfd9e6;
}

[data-theme="dark"] .task-chat-modal {
  background: #1f2125;
  color: #e8eaed;
}

[data-theme="dark"] .task-chat-modal .modal-header {
  border-bottom-color: #2b2e34;
}

[data-theme="dark"] .task-chat-modal .modal-title {
  color: #f1f3f4;
}

[data-theme="dark"] .task-chat-modal .btn-close {
  filter: invert(1) grayscale(1);
  opacity: 0.8;
}

[data-theme="dark"] .task-chat-modal .modal-body {
  background: #1f2125;
}

[data-theme="dark"] .task-chat-modal .task-chat-container {
  background: #1f2125;
}

[data-theme="dark"] .task-chat-avatar {
  background: #4a4d53;
  color: #fff;
}

[data-theme="dark"] .task-chat-meta {
  color: #adb5bd;
}

[data-theme="dark"] .task-chat-separator {
  color: #9aa1aa;
}

[data-theme="dark"] .task-chat-system {
  color: #9aa1aa;
}

[data-theme="dark"] .task-chat-bubble {
  background: #3f4247;
  color: #f2f4f6;
}

[data-theme="dark"] .task-chat-message--own .task-chat-bubble {
  background: #2e6df6;
  color: #ffffff;
}

[data-theme="dark"] .task-chat-textarea.form-control {
  background: #2c2f35;
  color: #edf0f2;
}

[data-theme="dark"] .task-chat-textarea.form-control::placeholder {
  color: #a4adb8;
}

[data-theme="dark"] .task-chat-textarea.form-control:focus {
  background: #2c2f35;
  color: #fff;
}

[data-theme="dark"] .task-comment-composer {
  border-top-color: #2b2e34;
}

[data-theme="dark"] .task-comment-dropzone {
  background: #26292f;
  border-color: #3a3f47;
}
