@import url("https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@24,500,1,0");

/**
 * @file reports.css
 * @brief Reports tab styling
 * @note Extends the existing Bootstrap and settings visual language for reports-specific layouts
 * @copyright Copyright (c) 2026 GLT Design. All rights reserved.
 */

.reports-user-initials {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.material-symbols-rounded {
  font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24;
}

.reports-nav-column,
.reports-main-column {
  position: relative;
}

.reports-sidebar {
  position: sticky;
  top: 1rem;
  z-index: 40;
}

.reports-sidebar-card {
  overflow: visible !important;
}

.reports-nav-header {
  gap: 0.75rem;
}

.reports-nav-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.reports-nav-title-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reports-nav-panel {
  position: relative;
}

.reports-nav .list-group-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  border: none;
  padding: 0.875rem 1.25rem;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
  white-space: nowrap;
}

.reports-nav .list-group-item:hover {
  background-color: #f8f9fa;
  border-left-color: #0d6efd;
  transform: translateX(2px);
}

.reports-nav .list-group-item.active {
  background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
  color: #ffffff;
  border-left-color: #0a58ca;
  font-weight: 500;
}

.reports-nav .list-group-item.active i,
.reports-nav .list-group-item.active code,
.reports-nav .list-group-item.active .reports-nav-item-icon {
  color: #ffffff;
}

.reports-nav-item-icon {
  width: 1.35rem;
  min-width: 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6c757d;
  line-height: 1;
}

.reports-nav-item-icon i {
  font-size: 1.05rem;
}

.reports-nav-item-icon-material {
  font-size: 1.3rem;
}

.reports-nav-item-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reports-nav-toggle {
  display: none;
  align-items: center;
  gap: 0.35rem;
  min-width: 6.5rem;
  border: 1px solid #c8d0d8;
  background-color: #ffffff;
  color: #4f5e6f;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  white-space: nowrap;
}

.reports-nav-toggle:hover {
  background-color: #f8fafc;
  border-color: #b7c0c9;
  color: #3f4d5d;
  transform: none;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}

.reports-nav-toggle:focus,
.reports-nav-toggle:focus-visible {
  color: #3f4d5d;
  border-color: #9cb6d6;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.12);
}

#reports {
  position: relative;
}

.reports-toast-container {
  --reports-toast-edge-offset: 1rem;
  position: absolute;
  top: var(--reports-toast-edge-offset);
  right: var(--reports-toast-edge-offset);
  z-index: 1080;
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
}

.reports-toast-container .toast {
  width: min(22rem, calc(100vw - 5rem));
  margin-bottom: 0;
  pointer-events: auto;
}

.reports-processing-overlay {
  position: fixed;
  inset: 0;
  z-index: 1090;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.36);
  backdrop-filter: blur(3px);
}

.reports-processing-dialog {
  width: min(30rem, calc(100vw - 2rem));
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.35rem;
  border-radius: 1rem;
  background: #ffffff;
  box-shadow: 0 24px 56px rgba(15, 23, 42, 0.22);
}

.reports-processing-spinner-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.35rem;
  min-width: 3.35rem;
  height: 3.35rem;
  border-radius: 1rem;
  background: #eef2ff;
}

.reports-processing-title {
  font-weight: 700;
  color: #1f2d3d;
}

.reports-processing-message {
  color: #5b6776;
}

.reports-success-toast {
  background: rgba(25, 135, 84, 0.9);
  backdrop-filter: blur(6px);
}

.reports-runtime-shell .card,
.reports-config-shell .card {
  border-radius: var(--bs-border-radius);
  overflow: hidden;
}

.reports-runtime-filters-card {
  overflow: visible !important;
}

.reports-runtime-filters-card .card-body,
.reports-runtime-filters-card .card-header {
  overflow: visible;
}

.reports-runtime-table tfoot td {
  background-color: #f8fafc;
}

.reports-runtime-table th,
.reports-runtime-table td {
  white-space: nowrap;
}

.reports-eyebrow {
  letter-spacing: 0.08em;
}

.reports-runtime-actions {
  min-width: 10.75rem;
  align-items: stretch;
}

.reports-runtime-action-btn {
  white-space: nowrap;
  min-width: 10.75rem;
}

.reports-runtime-record-count {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: #eef2ff;
  color: #3650a4;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.reports-runtime-results-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.reports-runtime-page-size {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.reports-runtime-page-size-label {
  margin-bottom: 0;
  font-size: 0.84rem;
  font-weight: 600;
  color: #526172;
  white-space: nowrap;
}

.reports-runtime-page-size .form-select {
  min-width: 5.75rem;
}

.reports-runtime-pagination-wrap {
  padding: 1rem 1rem 1.05rem;
  border-top: 1px solid #e9eef5;
  background: #fbfdff;
}

.reports-runtime-pagination .page-link {
  min-width: 2.4rem;
  text-align: center;
  border-radius: 0.55rem;
}

.reports-runtime-pagination .page-item + .page-item {
  margin-left: 0.25rem;
}

.reports-runtime-pagination .page-item.active .page-link {
  box-shadow: 0 8px 20px rgba(13, 110, 253, 0.18);
}

.reports-export-scope-options {
  display: grid;
  gap: 0.75rem;
}

.reports-export-scope-card.btn {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding: 0.95rem 1rem;
  border-radius: 0.9rem;
  text-align: left;
  box-shadow: none;
}

.reports-export-scope-title {
  font-weight: 700;
}

.reports-export-scope-meta {
  font-size: 0.92rem;
  color: #5b6776;
  white-space: normal;
}

.btn-check:checked + .reports-export-scope-card .reports-export-scope-meta,
.btn-check:active + .reports-export-scope-card .reports-export-scope-meta {
  color: rgba(255, 255, 255, 0.9);
}

.reports-runtime-multiselect-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  text-align: left;
}

.reports-runtime-multiselect-toggle::after {
  margin-left: auto;
}

.reports-runtime-multiselect-summary {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reports-runtime-multiselect-menu {
  width: 100%;
  max-height: 16rem;
  overflow-y: auto;
  padding: 0.65rem 0.85rem;
}

.reports-runtime-multiselect-row + .reports-runtime-multiselect-row {
  margin-top: 0.45rem;
}

.reports-runtime-table-scroll {
  overflow-x: auto;
  scrollbar-width: thin;
}

.reports-runtime-table-scroll.can-drag {
  cursor: grab;
}

.reports-runtime-table-scroll.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.reports-runtime-table-scroll.is-dragging * {
  user-select: none;
}

.reports-editor-section {
  padding: 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--bs-border-radius);
}

.reports-admin-note {
  background: linear-gradient(180deg, #fbfdff 0%, #f5f8fc 100%);
}

.reports-admin-table thead th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6c757d;
  font-weight: 700;
  border-bottom-width: 1px;
}

.reports-admin-table tbody td {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.reports-preset-title {
  font-weight: 600;
  color: #1f2d3d;
  margin-bottom: 0.25rem;
}

.reports-preset-code code {
  color: #0f172a;
  font-size: 0.9rem;
}

.reports-preset-meta-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}

.reports-preset-meta-label {
  min-width: 4.5rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6c757d;
  font-weight: 700;
}

.reports-preset-meta-value {
  color: #1f2d3d;
  font-weight: 500;
}

.reports-menu-material-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.reports-preset-menu-icon-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  min-height: 2.5rem;
  padding: 0.25rem;
  border-radius: var(--bs-border-radius);
  background: #eef2ff;
  color: #3650a4;
}

.reports-preset-menu-icon {
  font-size: 1.35rem;
}

.reports-preset-icon-preview {
  min-height: 2.625rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid #dbe3ef;
  border-radius: var(--bs-border-radius);
  background: #fbfdff;
  color: #1f2d3d;
}

.reports-preset-icon-preview-symbol {
  font-size: 1.5rem;
  color: #3650a4;
}

.reports-preset-icon-preview-label {
  font-weight: 600;
}

.reports-order-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: #eef2f7;
  color: #334155;
  font-weight: 700;
}

.reports-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  border: 1px solid transparent;
}

.reports-status-visible {
  background: rgba(25, 135, 84, 0.12);
  color: #146c43;
  border-color: rgba(25, 135, 84, 0.2);
}

.reports-status-hidden {
  background: rgba(108, 117, 125, 0.12);
  color: #495057;
  border-color: rgba(108, 117, 125, 0.18);
}

.reports-status-active {
  background: rgba(13, 110, 253, 0.12);
  color: #0a58ca;
  border-color: rgba(13, 110, 253, 0.18);
}

.reports-status-inactive {
  background: rgba(255, 193, 7, 0.18);
  color: #946200;
  border-color: rgba(255, 193, 7, 0.22);
}

.reports-action-group .btn {
  min-width: 5.2rem;
}

.reports-button-busy {
  pointer-events: none;
  white-space: nowrap;
}

.reports-config-shell .table td code {
  color: #0f172a;
}

.reports-catalog-block {
  padding: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: var(--bs-border-radius);
  background: #fcfdff;
}

@media (max-width: 1199.98px) {
  .reports-nav-toggle {
    display: inline-flex;
  }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
  #reports-container .reports-nav-column {
    flex: 0 0 5.75rem;
    max-width: 5.75rem;
    z-index: 60;
  }

  #reports-container .reports-main-column {
    flex: 1 1 0;
    max-width: calc(100% - 5.75rem);
  }

  #reports-container[data-nav-mode="rail"]:not(.reports-nav-expanded) .reports-nav-header {
    justify-content: center;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  #reports-container[data-nav-mode="rail"]:not(.reports-nav-expanded) .reports-nav-title,
  #reports-container[data-nav-mode="rail"]:not(.reports-nav-expanded) .reports-nav-toggle-label,
  #reports-container[data-nav-mode="rail"]:not(.reports-nav-expanded) .reports-nav-item-label {
    display: none;
  }

  #reports-container[data-nav-mode="rail"]:not(.reports-nav-expanded) .reports-nav-toggle {
    width: 100%;
    min-width: 0;
    justify-content: center;
    padding-left: 0.7rem;
    padding-right: 0.7rem;
  }

  #reports-container[data-nav-mode="rail"]:not(.reports-nav-expanded) .reports-nav .list-group-item {
    justify-content: center;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  #reports-container[data-nav-mode="rail"].reports-nav-expanded .reports-sidebar-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 18rem;
    box-shadow: 0 24px 56px rgba(15, 23, 42, 0.2);
    z-index: 1040;
  }
}

@media (max-width: 991.98px) {
  #reports-container .reports-nav-column,
  #reports-container .reports-main-column {
    flex: 0 0 100%;
    max-width: 100%;
  }

  #reports-container[data-nav-mode="hamburger"] .reports-nav-panel {
    position: absolute;
    top: calc(100% + 0.65rem);
    right: 0;
    width: min(22rem, calc(100vw - 2rem));
    padding: 0;
    background: #ffffff;
    border: 1px solid #dbe3ef;
    border-radius: var(--bs-border-radius);
    box-shadow: 0 24px 56px rgba(15, 23, 42, 0.2);
    overflow: hidden;
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px) scale(0.98);
    transform-origin: top right;
    transition:
      opacity 0.18s ease,
      transform 0.24s cubic-bezier(0.22, 1, 0.36, 1),
      visibility 0s linear 0.24s;
  }

  #reports-container[data-nav-mode="hamburger"].reports-nav-expanded .reports-nav-panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
    transition:
      opacity 0.18s ease,
      transform 0.24s cubic-bezier(0.22, 1, 0.36, 1),
      visibility 0s linear 0s;
  }
}

@media (prefers-reduced-motion: reduce) {
  #reports-container[data-nav-mode="hamburger"] .reports-nav-panel {
    transition: none;
  }
}

@media (max-width: 767.98px) {
  .reports-admin-table thead {
    display: none;
  }

  .reports-admin-table,
  .reports-admin-table tbody,
  .reports-admin-table tr,
  .reports-admin-table td {
    display: block;
    width: 100%;
  }

  .reports-admin-table tr {
    border-bottom: 1px solid #e9ecef;
  }

  .reports-admin-table td {
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
    border: 0;
  }

  .reports-action-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.5rem;
  }

  .reports-action-group .btn {
    border-radius: var(--bs-border-radius) !important;
  }

  .reports-runtime-actions,
  .reports-runtime-action-btn {
    width: 100%;
    min-width: 0;
  }

  .reports-runtime-results-toolbar {
    justify-content: stretch;
  }

  .reports-toast-container {
    --reports-toast-edge-offset: 0.75rem;
  }

  .reports-toast-container .toast {
    width: min(100%, calc(100vw - 2rem));
  }
}
