:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #f8fafb;
  --border: #e4eaf0;
  --border-strong: #d5dee8;
  --text: #263456;
  --heading: #102348;
  --muted: #71809d;
  --tree: #009b82;
  --tree-hover: #00866f;
  --tree-dark: #073c36;
  --tree-deep: #052f2b;
  --tree-soft: #e9f8f4;
  --lime: #9bd800;
  --blue: #2f7de1;
  --blue-soft: #eaf2ff;
  --yellow: #b87909;
  --yellow-soft: #fff4dc;
  --red: #dc3545;
  --red-soft: #fdecef;
  --gray-soft: #eef2f6;
  --shadow: 0 12px 28px rgba(16, 35, 72, 0.07);
  --shadow-soft: 0 4px 14px rgba(16, 35, 72, 0.06);
}

* {
  box-sizing: border-box;
}

body.auth-pending {
  min-height: 100vh;
  overflow: hidden;
}

body.auth-pending > * {
  visibility: hidden;
}

body.auth-pending::before {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  visibility: visible;
  color: #087968;
  background: #f4f7f8;
  content: "Validando acesso...";
  font-size: 14px;
  font-weight: 600;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(233, 248, 244, 0.62) 0, rgba(244, 246, 248, 0) 330px),
    var(--bg);
  font-family: "IBM Plex Sans", Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(0, 155, 130, 0.2);
  outline-offset: 2px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -8px;
  margin-left: -8px;
}

.row > * {
  width: 100%;
  padding-right: 8px;
  padding-left: 8px;
}

.col,
.col-lg {
  flex: 1 0 0%;
}

.col-12 {
  flex: 0 0 auto;
  width: 100%;
}

.g-3 {
  row-gap: 16px;
}

.d-flex {
  display: flex;
}

.d-grid {
  display: grid;
}

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

.align-items-center {
  align-items: center;
}

.align-items-start {
  align-items: flex-start;
}

.justify-content-between {
  justify-content: space-between;
}

.justify-content-center {
  justify-content: center;
}

.justify-content-xl-end,
.justify-content-end {
  justify-content: flex-end;
}

.gap-2 {
  gap: 8px;
}

.gap-3 {
  gap: 16px;
}

.px-4 {
  padding-right: 24px;
  padding-left: 24px;
}

.text-decoration-none {
  text-decoration: none;
}

.bg-white {
  background: #fff;
}

.btn {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

.btn-group {
  display: inline-flex;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table-responsive {
  overflow-x: auto;
}

.mb-0 {
  margin-bottom: 0;
}

.text-center {
  text-align: center;
}

.text-secondary {
  color: var(--muted) !important;
}

.py-5 {
  padding-top: 48px !important;
  padding-bottom: 48px !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.container-fluid {
  width: 100%;
  max-width: 1480px;
  margin-right: auto;
  margin-left: auto;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: 76px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(16, 35, 72, 0.03);
}

.brand {
  display: inline-flex;
  align-items: center;
  color: var(--heading);
}

.brand:hover {
  color: var(--heading);
}

.brand-logo {
  display: block;
  width: 107px;
  height: 36px;
  object-fit: contain;
}

.top-menu-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  min-height: 40px;
  padding: 0;
  color: var(--heading);
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 15px;
  font-weight: 700;
}

[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: -38px;
  z-index: 300;
  width: max-content;
  max-width: 180px;
  padding: 6px 9px;
  color: #fff;
  border-radius: 6px;
  background: var(--tree-deep);
  box-shadow: var(--shadow-soft);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.top-menu-button i {
  color: var(--tree);
  font-size: 18px;
}

.top-menu-button:hover {
  color: var(--tree);
  background: var(--tree-soft);
}

.top-menu-button:focus-visible {
  color: var(--tree);
}

.top-menu-button .bi-box-arrow-right {
  color: var(--red);
}

.avatar {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-left: 10px;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  border-radius: 50%;
  background: var(--tree);
  box-shadow: inset 0 -8px 16px rgba(0, 0, 0, 0.08);
}

.breadcrumb-bar,
.page-header {
  position: relative;
  isolation: isolate;
  color: #fff;
  background:
    radial-gradient(circle at 18% 20%, rgba(0, 155, 130, 0.24), transparent 26%),
    linear-gradient(135deg, var(--tree-deep), var(--tree-dark));
  overflow: hidden;
}

.breadcrumb-bar::after,
.page-header::after {
  content: none;
}

.breadcrumb-bar {
  min-height: 44px;
  display: flex;
  align-items: end;
  padding-top: 12px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  font-weight: 700;
}

.breadcrumb-bar strong {
  color: #23d0b6;
}

.page-header {
  padding: 28px 0 36px;
}

.page-header h1 {
  max-width: 920px;
  margin: 0 0 12px;
  color: #fff;
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: 0;
}

.page-header p {
  max-width: 820px;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 18px;
  line-height: 1.45;
}

.btn-tree,
.btn-tree:hover,
.btn-tree:focus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding-inline: 18px;
  color: #fff;
  border: 1px solid rgba(0, 155, 130, 0.4);
  border-radius: 8px;
  background: var(--tree);
  box-shadow: 0 10px 24px rgba(0, 80, 68, 0.18);
  font-size: 16px;
  font-weight: 700;
}

.btn-tree:hover {
  background: var(--tree-hover);
}

.btn-tree.compact {
  min-height: 42px;
  box-shadow: none;
}

.summary-panel {
  margin-top: 24px;
  margin-bottom: 24px;
}

.summary-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  min-height: 116px;
  height: 100%;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.summary-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  color: var(--tree);
  border: 1px solid rgba(0, 155, 130, 0.14);
  border-radius: 8px;
  background: var(--tree-soft);
  font-size: 24px;
}

.summary-icon.blue {
  color: var(--blue);
  border-color: rgba(47, 125, 225, 0.18);
  background: var(--blue-soft);
}

.summary-icon.success {
  color: #159a72;
  background: #e7f7ef;
}

.summary-icon.danger {
  color: var(--red);
  border-color: rgba(220, 53, 69, 0.16);
  background: var(--red-soft);
}

.summary-card p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
}

.summary-card strong {
  display: block;
  color: var(--heading);
  font-size: 34px;
  line-height: 1;
}

.metric-context {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}

.requests-panel {
  margin-bottom: 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: visible;
}

.requests-toolbar {
  padding: 24px 26px 16px;
}

.requests-toolbar h2 {
  margin: 0 0 6px;
  color: var(--heading);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.requests-toolbar p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.search-box {
  position: relative;
  flex: 1 1 360px;
  max-width: 460px;
}

.search-box i {
  position: absolute;
  left: 14px;
  top: 50%;
  color: var(--muted);
  font-size: 18px;
  transform: translateY(-50%);
}

.search-box input {
  width: 100%;
  min-height: 44px;
  padding: 0 16px 0 44px;
  color: var(--heading);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #fff;
  outline: none;
}

.search-box input::placeholder {
  color: #8a97ad;
}

.view-toggle {
  min-height: 44px;
  padding: 3px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface-soft);
}

.view-toggle .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 106px;
  min-height: 36px;
  color: var(--muted);
  border: 0;
  border-radius: 6px !important;
  font-weight: 700;
}

.view-toggle .btn.active {
  color: #fff;
  background: var(--tree);
  box-shadow: 0 3px 8px rgba(0, 80, 68, 0.12);
}

.btn-filter,
.btn-icon-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  color: var(--heading);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #fff;
  font-weight: 700;
}

.btn-filter:hover,
.btn-icon-outline:hover,
.page-button:hover,
.action-chip:hover,
.icon-action:hover,
.card-menu:hover {
  border-color: rgba(0, 155, 130, 0.34);
  background: var(--tree-soft);
}

.btn-filter[aria-expanded="true"] {
  color: var(--tree);
  border-color: rgba(0, 155, 130, 0.45);
  background: var(--tree-soft);
}

.btn-filter span {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  color: #fff;
  border-radius: 999px;
  background: var(--tree);
  font-size: 12px;
}

.btn-icon-outline {
  width: 44px;
  padding: 0;
  font-size: 18px;
}

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

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  color: #087e6a;
  border: 1px solid rgba(0, 155, 130, 0.12);
  border-radius: 999px;
  background: var(--tree-soft);
  font-size: 13px;
  font-weight: 700;
}

.filter-chip i {
  font-size: 14px;
}

.clear-filters {
  min-height: 34px;
  padding: 0 6px;
  color: var(--tree);
  border: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
}

.advanced-filters {
  display: none;
  grid-template-columns: repeat(3, minmax(180px, 1fr)) auto;
  gap: 14px;
  align-items: end;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.advanced-filters.open {
  display: grid;
}

.table-view,
.kanban-view {
  display: none;
}

.table-view.active {
  display: block;
}

.kanban-view.active {
  display: flex;
}

.table-responsive {
  max-height: 520px;
  overflow-x: auto;
  scrollbar-gutter: stable;
  border-top: 1px solid var(--border);
}

.table {
  min-width: 1560px;
  table-layout: auto;
  border-color: var(--border);
}

.table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 14px 18px;
  color: var(--muted);
  border-bottom-color: var(--border);
  background: #fbfcfe;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
}

.table tbody td {
  padding: 14px 18px;
  color: var(--text);
  border-color: var(--border);
  font-size: 15px;
  white-space: nowrap;
  overflow-wrap: normal;
  vertical-align: middle;
}

.table [data-column="actions"] { width: 128px; }
.table [data-column="id"] { width: 148px; }
.table [data-column="generator"] { width: 150px; }
.table [data-column="cnpj"] { width: 190px; }
.table [data-column="date"] { width: 142px; }
.table [data-column="status"] { width: 190px; }
.table [data-column="materials"] { width: 210px; }
.table [data-column="address"] { width: 240px; }
.table [data-column="tags"] { width: 150px; }
.table [data-column="documents"] { width: 175px; }

.table tbody td strong {
  color: #06235c;
  font-weight: 700;
}

.table tbody tr {
  transition: background 0.16s ease, box-shadow 0.16s ease;
}

.table tbody tr:hover {
  background: #fbfdfc;
  box-shadow: inset 3px 0 0 var(--tree);
}

.sort-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  color: inherit;
  border: 0;
  background: transparent;
  font: inherit;
  white-space: nowrap;
}

.sort-button i {
  color: var(--tree);
  font-size: 11px;
}

.status-badge,
.tag-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 3px 11px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.status-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: currentColor;
}

.status-badge.draft {
  color: #5c6577;
  background: var(--gray-soft);
}

.status-badge.requested,
.status-badge.running {
  color: var(--blue);
  background: var(--blue-soft);
}

.status-badge.approval,
.status-badge.scheduled {
  color: var(--yellow);
  background: var(--yellow-soft);
}

.status-badge.finished,
.status-badge.done {
  color: #159a72;
  background: #e7f7ef;
}

.status-badge.rejected,
.status-badge.canceled {
  color: var(--red);
  background: var(--red-soft);
}

.tag-badge {
  margin: 2px 6px 2px 0;
  color: #087e6a;
  background: var(--tree-soft);
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.table-actions > * {
  flex: 0 0 36px;
  width: 36px;
}

.action-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  min-height: 36px;
  padding: 0;
  color: var(--tree);
  border: 0;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  font-weight: 700;
}

.action-chip.danger {
  color: var(--red);
  background: #fff;
}

.icon-action,
.card-menu {
  display: inline-grid;
  place-items: center;
  min-width: 36px;
  width: 36px;
  height: 36px;
  color: var(--heading);
  border: 0;
  border-radius: 8px;
  background: #fff;
  font-size: 18px;
}

.table-actions .dropdown-menu-custom {
  right: auto;
  left: 0;
}

.menu-wrap,
.kanban-card {
  position: relative;
}

.dropdown-menu-custom {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  display: none;
  width: 210px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.dropdown-menu-custom.open {
  display: grid;
}

.floating-dropdown-menu {
  position: fixed;
  right: auto;
  z-index: 1000;
  max-height: calc(100vh - 24px);
  margin: 0;
  overflow-y: auto;
}

.dropdown-menu-custom button {
  min-height: 38px;
  padding: 0 10px;
  text-align: left;
  color: var(--text);
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-weight: 600;
}

.dropdown-menu-custom button:hover {
  background: #f4f8f7;
}

.danger-text {
  color: var(--red) !important;
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 26px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.page-size,
.page-button {
  min-height: 38px;
  color: var(--heading);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #fff;
}

.page-size {
  padding: 0 42px 0 12px;
}

.page-button {
  min-width: 38px;
}

.page-button.active {
  color: var(--tree);
  border-color: rgba(0, 155, 130, 0.4);
  background: var(--tree-soft);
  font-weight: 700;
}

.page-button.disabled {
  color: #c4ced8;
  background: #fbfcfd;
}

.kanban-view {
  gap: 16px;
  padding: 22px;
  border-top: 1px solid var(--border);
  overflow-x: auto;
  align-items: stretch;
}

.kanban-view section {
  flex: 0 0 310px;
  min-height: 360px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.kanban-column-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  margin-bottom: 12px;
}

.kanban-view h3 {
  margin: 4px;
  color: var(--heading);
  font-size: 16px;
  font-weight: 700;
}

.collapse-column {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  color: var(--tree);
  border: 0;
  border-radius: 8px;
  background: var(--tree-soft);
}

.kanban-column-content {
  min-width: 0;
}

.kanban-view section.collapsed {
  flex-basis: 58px;
  width: 58px;
  min-height: 360px;
  padding: 10px;
}

.kanban-column.collapsed .kanban-column-header {
  display: grid;
  justify-items: center;
}

.kanban-column.collapsed h3 {
  max-height: 220px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.kanban-column.collapsed .kanban-column-content {
  display: none;
}

.kanban-card {
  display: grid;
  z-index: 1;
  gap: 10px;
  margin-bottom: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(16, 35, 72, 0.04);
  cursor: grab;
  overflow: visible;
}

.kanban-card.menu-open {
  z-index: 100;
}

.kanban-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
}

.kanban-card-header .menu-wrap {
  z-index: 110;
  margin-left: auto;
}

.kanban-card .dropdown-menu-custom {
  top: calc(100% + 4px);
  right: 0;
  z-index: 120;
}

.kanban-card p,
.kanban-card small {
  margin: 0;
  color: var(--muted);
}

.kanban-card strong {
  color: var(--heading);
}

.generator-line {
  color: var(--text) !important;
  font-weight: 700;
}

.empty-column {
  margin: 0;
  padding: 16px;
  color: var(--muted);
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  background: #fff;
}

.kanban-card.dragging {
  opacity: 0.45;
  cursor: grabbing;
}

.kanban-column {
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.kanban-column.drag-over {
  border-color: var(--tree);
  background: var(--tree-soft);
  box-shadow: inset 0 0 0 2px rgba(0, 155, 130, 0.12);
}

.modal-backdrop-custom,
.confirm-backdrop,
.utility-backdrop,
.tour-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(3, 32, 47, 0.5);
}

.modal-backdrop-custom.open,
.confirm-backdrop.open,
.utility-backdrop.open,
.tour-backdrop.open {
  display: flex;
}

.tour-backdrop {
  z-index: 300;
  padding: 0;
  background: transparent;
  pointer-events: none;
}

.tour-backdrop.open {
  display: block;
}

.guided-tour {
  position: fixed;
  z-index: 301;
  width: min(360px, calc(100vw - 24px));
  border: 1px solid rgba(0, 155, 130, 0.2);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(5, 47, 43, 0.24);
  overflow: hidden;
  pointer-events: auto;
  transition: left 0.18s ease, top 0.18s ease;
}

.guided-tour-header,
.guided-tour-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 16px;
}

.guided-tour-header {
  border-bottom: 1px solid var(--border);
}

.guided-tour-header > span {
  color: var(--tree);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.tour-skip {
  min-height: 36px;
  padding: 0 8px;
  color: var(--muted);
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
}

.tour-skip:hover,
.tour-skip:focus-visible {
  color: var(--tree);
  background: var(--tree-soft);
}

.guided-tour-body {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: start;
  gap: 0 13px;
  padding: 18px 16px 16px;
  text-align: left;
}

.guided-tour-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  color: var(--tree);
  border-radius: 12px;
  background: var(--tree-soft);
  font-size: 21px;
}

.guided-tour-body small {
  color: var(--tree);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.guided-tour-body h2 {
  margin: 4px 0 6px;
  color: var(--heading);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.guided-tour-body p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.tour-progress {
  display: flex;
  gap: 7px;
  grid-column: 1 / -1;
  justify-content: center;
  margin-top: 16px;
}

.tour-progress span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--border-strong);
  transition: width 0.18s ease, background-color 0.18s ease;
}

.tour-progress span.active {
  width: 24px;
  background: var(--tree);
}

.tour-progress span.completed {
  background: #9bd800;
}

.guided-tour-footer {
  justify-content: center;
  border-top: 1px solid var(--border);
  background: var(--surface-soft);
}

.tour-action-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--tree-dark);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.tour-action-state i {
  color: var(--tree);
}

.tour-target {
  position: relative !important;
  z-index: 290 !important;
  outline: 3px solid #9bd800 !important;
  outline-offset: 3px;
  animation: tour-target-pulse 1.05s ease-in-out infinite;
}

@keyframes tour-target-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(155, 216, 0, 0.25), 0 0 0 rgba(155, 216, 0, 0);
    filter: brightness(1);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(155, 216, 0, 0.45), 0 0 24px rgba(155, 216, 0, 0.55);
    filter: brightness(1.16) saturate(1.2);
  }
}

.request-modal {
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  width: min(1040px, 100%);
  max-height: calc(100vh - 48px);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(16, 35, 72, 0.26);
  overflow: hidden;
}

.modal-header-custom {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 28px;
  color: #fff;
  background:
    radial-gradient(circle at 86% 12%, rgba(0, 155, 130, 0.28), transparent 24%),
    linear-gradient(90deg, var(--tree-deep), #07584e);
}

.modal-header-custom span {
  color: #25d4ba;
  font-weight: 700;
}

.modal-header-custom h2 {
  margin: 4px 0 6px;
  font-size: 28px;
  font-weight: 700;
}

.modal-header-custom p {
  margin: 0;
  color: rgba(255, 255, 255, 0.84);
}

.icon-only {
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  height: 38px;
  color: #fff;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
}

.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-header-actions .icon-only.active {
  color: var(--tree-deep);
  background: #fff;
}

.form-progress {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border);
}

.form-progress button {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 8px 10px;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 999px;
  background: #f5f8fa;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}

.form-progress button > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e8edf2;
}

.form-progress button small {
  font-size: 13px;
  font-weight: 700;
}

.form-progress button.active {
  color: var(--tree);
  border-color: rgba(0, 155, 130, 0.22);
  background: var(--tree-soft);
}

.form-progress button.active > span,
.form-progress button.completed > span {
  color: #fff;
  background: var(--tree);
}

.request-form {
  display: grid;
  gap: 16px;
  padding: 22px 28px 28px;
  overflow-y: auto;
}

.form-step {
  display: none;
}

.form-step.active {
  display: grid;
}

fieldset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
  margin: 0;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

legend {
  float: none;
  width: auto;
  padding: 0 8px;
  margin: 0;
  color: var(--heading);
  font-size: 18px;
  font-weight: 700;
}

label {
  display: grid;
  gap: 7px;
  color: var(--heading);
  font-size: 14px;
  font-weight: 700;
}

.field-label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.attachment-field {
  display: grid;
  gap: 7px;
  color: var(--heading);
  font-size: 14px;
  font-weight: 700;
}

.field-help-button {
  display: inline-grid;
  flex: 0 0 24px;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  color: var(--tree);
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 15px;
}

.field-help-button:hover,
.field-help-button:focus-visible {
  background: var(--tree-soft);
}

.field-help-button[data-tooltip]::after {
  bottom: calc(100% + 8px);
  width: 220px;
  max-width: min(220px, 70vw);
  white-space: normal;
}

.span-2 {
  grid-column: span 2;
}

.materials-list {
  display: grid;
  gap: 12px;
}

.material-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(160px, 1fr) minmax(120px, 0.65fr) minmax(110px, 0.55fr) 42px;
  align-items: end;
  gap: 12px;
}

.remove-material {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--red);
  border: 0;
  border-radius: 8px;
  background: var(--red-soft);
}

.remove-material:disabled {
  color: #aab4c0;
  background: var(--gray-soft);
  cursor: not-allowed;
}

.add-material-button {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--tree);
  border: 1px dashed rgba(0, 155, 130, 0.45);
  background: var(--tree-soft);
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  color: var(--heading);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #fff;
  outline: none;
}

select {
  appearance: none;
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.25 6 6.25 11 1.25' fill='none' stroke='%2371809d' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
}

textarea {
  min-height: 94px;
  padding: 12px 14px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--tree);
  box-shadow: 0 0 0 3px rgba(0, 155, 130, 0.12);
}

input[readonly],
textarea[readonly] {
  color: var(--muted);
  background: var(--surface-soft);
  cursor: default;
}

.upload-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 88px;
  color: var(--muted);
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  background: var(--surface-soft);
  cursor: pointer;
}

.upload-box i {
  color: var(--tree);
  font-size: 20px;
}

.upload-box.is-readonly {
  cursor: default;
}

.modal-footer-custom {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 18px 28px;
  border-top: 1px solid var(--border);
}

.modal-footer-spacer {
  flex: 1;
}

.history-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: none;
  width: min(440px, 92%);
  padding: 24px;
  border-left: 1px solid var(--border);
  background: #fff;
  box-shadow: -16px 0 40px rgba(16, 35, 72, 0.16);
  overflow-y: auto;
}

.history-panel.open {
  display: block;
}

.history-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.history-panel-header span {
  color: var(--tree);
  font-size: 13px;
  font-weight: 700;
}

.history-panel-header h3 {
  margin: 4px 0 0;
  color: var(--heading);
  font-size: 22px;
}

.history-panel-header .icon-only {
  color: var(--heading);
  background: var(--surface-soft);
}

.timeline {
  position: relative;
  display: grid;
  padding: 20px 0;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 30px;
  bottom: 30px;
  left: 17px;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 14px;
  padding-bottom: 24px;
}

.timeline-marker {
  z-index: 1;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: #fff;
  border: 4px solid #fff;
  border-radius: 50%;
  background: var(--tree);
  font-size: 12px;
}

.timeline-item strong,
.timeline-item small {
  display: block;
}

.timeline-item strong {
  color: var(--heading);
  line-height: 1.4;
}

.timeline-item small {
  margin-top: 6px;
  color: var(--muted);
}

.empty-history {
  color: var(--muted);
}

.btn-outline-tree {
  color: var(--tree);
  border-color: rgba(0, 155, 130, 0.35);
  background: #fff;
  font-weight: 700;
}

.btn-outline-tree:hover {
  color: var(--tree-hover);
  border-color: rgba(0, 155, 130, 0.5);
  background: var(--tree-soft);
}

.btn-danger-soft {
  color: #b21e31;
  border: 1px solid #ffc5cd;
  background: var(--red-soft);
  font-weight: 700;
}

.confirm-dialog {
  width: min(460px, 100%);
  padding: 28px;
  border-radius: 8px;
  background: #fff;
  text-align: center;
}

.danger-mark {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  margin: 0 auto 16px;
  color: var(--red);
  border-radius: 8px;
  background: var(--red-soft);
  font-size: 26px;
}

.confirm-dialog h2 {
  margin: 0;
  color: var(--heading);
  font-size: 24px;
  font-weight: 700;
}

.confirm-dialog p {
  margin: 12px 0 22px;
  color: var(--muted);
  line-height: 1.5;
}

.info-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  color: var(--tree);
  border-radius: 50%;
  background: var(--tree-soft);
  font-size: 26px;
}

.field-help-dialog {
  max-width: 460px;
}

.approval-assignment-dialog {
  max-width: 520px;
}

.approval-assignment-form {
  display: grid;
  gap: 12px;
  text-align: left;
}

.approval-assignment-form label {
  font-size: 13px;
}

.approval-assignment-form input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  color: var(--body);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #fff;
}

.approval-assignment-form .form-feedback {
  margin: 0;
}

.utility-modal {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(760px, 100%);
  max-height: calc(100vh - 48px);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(16, 35, 72, 0.26);
  overflow: hidden;
}

.utility-modal.settings-modal {
  width: min(680px, 100%);
}

.utility-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  color: #fff;
  background: linear-gradient(100deg, var(--tree-deep), #07584e);
}

.utility-modal-header span {
  color: #5ce1cc;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.utility-modal-header h2 {
  margin: 4px 0 0;
  font-size: 25px;
  font-weight: 700;
}

.utility-modal-body {
  padding: 24px;
  overflow-y: auto;
}

.help-content > p {
  margin: 0 0 22px;
  color: var(--body);
  line-height: 1.6;
}

.help-flow {
  display: grid;
  gap: 12px;
}

.help-flow article {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-soft);
}

.help-flow article > span,
.settings-section-heading > span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--tree);
  border-radius: 9px;
  background: var(--tree-soft);
  font-size: 18px;
}

.help-flow strong {
  color: var(--heading);
}

.help-flow p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.utility-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: #fff;
}

.utility-modal-footer .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.account-summary {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-soft);
}

.account-summary-avatar {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: #fff;
  border-radius: 50%;
  background: var(--tree);
  font-weight: 700;
}

.account-summary strong,
.account-summary small {
  display: block;
}

.account-summary strong {
  color: var(--heading);
}

.account-summary small {
  margin-top: 3px;
  color: var(--muted);
}

.settings-form {
  display: grid;
  gap: 16px;
}

.settings-form + .settings-form {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.settings-section-heading {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.settings-section-heading h3,
.danger-zone h3 {
  margin: 0;
  color: var(--heading);
  font-size: 17px;
  font-weight: 700;
}

.settings-section-heading p,
.danger-zone p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.settings-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.settings-form label,
.account-delete-form label {
  display: grid;
  gap: 7px;
  color: var(--heading);
  text-align: left;
  font-size: 13px;
  font-weight: 700;
}

.settings-form input,
.account-delete-form input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  color: var(--body);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #fff;
}

.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 28px;
  padding: 18px;
  border: 1px solid #ffd3d9;
  border-radius: 9px;
  background: #fff8f9;
}

.danger-zone .btn,
.account-delete-form .btn {
  flex: 0 0 auto;
}

.form-feedback {
  display: none;
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}

.form-feedback.visible {
  display: block;
}

.form-feedback.success {
  color: #08725f;
  background: var(--tree-soft);
}

.form-feedback.danger {
  color: #ad1f31;
  background: var(--red-soft);
}

.button-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: button-spin 0.7s linear infinite;
}

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

.account-delete-form {
  display: grid;
  gap: 14px;
}

.app-footer {
  padding: 18px 0;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: #fff;
  font-weight: 600;
}

.app-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 14px 18px;
  color: #fff;
  border-radius: 8px;
  background: var(--tree-dark);
  box-shadow: 0 16px 36px rgba(5, 47, 43, 0.28);
  font-weight: 700;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.app-toast.danger {
  background: #9e2331;
}

.app-toast.open {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 576px) {
  .d-sm-flex {
    display: flex;
  }
}

@media (min-width: 768px) {
  .col-md-6 {
    flex: 0 0 auto;
    width: 50%;
  }

  .flex-md-row {
    flex-direction: row;
  }
}

@media (min-width: 992px) {
  .col-lg {
    flex: 1 0 0%;
    width: auto;
  }

  .col-lg-auto {
    flex: 0 0 auto;
    width: auto;
  }

  .flex-lg-row {
    flex-direction: row;
  }
}

@media (min-width: 1200px) {
  .col-xl-3 {
    flex: 0 0 auto;
    width: 25%;
  }

  .col-xl-4 {
    flex: 0 0 auto;
    width: 33.333333%;
  }

  .col-xl-8 {
    flex: 0 0 auto;
    width: 66.666667%;
  }

  .justify-content-xl-end {
    justify-content: flex-end;
  }
}

@media (max-width: 1180px) {
  .top-menu-button span {
    display: none;
  }

  .top-menu-button {
    width: 40px;
    padding: 0;
  }

  .search-box {
    max-width: none;
  }
}

@media (max-width: 992px) {
  .advanced-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .search-box {
    flex: 0 0 auto;
  }
}

@media (max-width: 768px) {
  .app-topbar {
    min-height: 68px;
  }

  .brand-logo {
    width: 96px;
    height: 32px;
  }

  .top-menu {
    gap: 0 !important;
  }

  .avatar {
    width: 40px;
    height: 40px;
    margin-left: 4px;
    font-size: 15px;
  }

  .breadcrumb-bar {
    min-height: 36px;
  }

  .page-header {
    padding: 20px 0 26px;
  }

  .page-header h1 {
    font-size: 30px;
  }

  .page-header p {
    font-size: 16px;
  }

  .btn-tree {
    width: 100%;
  }

  .summary-card {
    min-height: 104px;
  }

  .requests-toolbar {
    padding: 20px 16px 14px;
  }

  .view-toggle,
  .view-toggle .btn,
  .btn-filter,
  .btn-icon-outline,
  .search-box {
    width: 100%;
  }

  .btn-icon-outline {
    display: none;
  }

  .advanced-filters,
  .form-progress,
  fieldset {
    grid-template-columns: 1fr;
  }

  .table-responsive {
    max-height: none;
    overflow: visible;
    border-top: 1px solid var(--border);
  }

  .table {
    min-width: 0;
  }

  .table thead {
    display: none;
  }

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

  .table tbody {
    padding: 12px;
    background: var(--surface-soft);
  }

  .table tbody tr {
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
  }

  .table tbody tr:hover {
    box-shadow: none;
  }

  .table tbody td {
    display: grid;
    grid-template-columns: 126px minmax(0, 1fr);
    gap: 12px;
    padding: 12px 14px;
    white-space: normal;
  }

  .table tbody td[data-column] {
    width: 100%;
  }

  .table tbody td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  .status-badge {
    min-height: 24px;
    padding: 2px 8px;
    font-size: 11px;
  }

  .table tbody td[data-column="status"] .status-badge {
    justify-self: start;
  }

  .status-badge::before {
    width: 6px;
    height: 6px;
    margin-right: 6px;
  }

  .table-actions {
    align-items: stretch;
  }

  .action-chip {
    flex: 0 0 36px;
  }

  .table-footer {
    padding: 14px 16px;
  }

  .span-2 {
    grid-column: auto;
  }

  .modal-footer-custom {
    display: grid;
  }

  .modal-footer-spacer {
    display: none;
  }

  .material-row {
    grid-template-columns: 1fr 1fr 42px;
  }

  .material-row label:first-child {
    grid-column: 1 / -1;
  }

  .material-row label:nth-child(2) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .container-fluid.px-4 {
    padding-right: 16px !important;
    padding-left: 16px !important;
  }

  .avatar {
    display: none;
  }

  .brand {
    gap: 8px;
  }

  .summary-panel {
    margin-top: 16px;
  }

  .summary-card {
    grid-template-columns: 48px minmax(0, 1fr);
    padding: 16px;
  }

  .summary-icon {
    width: 48px;
    height: 48px;
  }

  .requests-toolbar {
    padding: 16px 14px 12px;
  }

  .requests-toolbar h2 {
    margin-bottom: 4px;
    font-size: 18px;
  }

  .requests-toolbar p {
    font-size: 13px;
  }

  .filter-row {
    gap: 8px;
    margin-top: 12px;
  }

  .filter-chip {
    min-height: 32px;
    padding: 0 10px;
    font-size: 12px;
  }

  .table tbody {
    padding: 10px;
  }

  .table tbody td {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .table-actions {
    flex-wrap: wrap;
  }

  .modal-backdrop-custom,
  .confirm-backdrop,
  .utility-backdrop,
  .tour-backdrop {
    padding: 10px;
  }

  .guided-tour-header,
  .guided-tour-footer {
    padding: 12px 14px;
  }

  .guided-tour-body {
    padding: 16px 14px 14px;
  }

  .guided-tour-body h2 {
    font-size: 17px;
  }

  .request-modal {
    max-height: calc(100vh - 20px);
  }

  .modal-header-custom,
  .request-form,
  .modal-footer-custom,
  .form-progress {
    padding-left: 16px;
    padding-right: 16px;
  }

  .utility-modal {
    max-height: calc(100vh - 20px);
  }

  .utility-modal-header,
  .utility-modal-body,
  .utility-modal-footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .utility-modal-footer,
  .danger-zone {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 360px) {
  #helpdeskLink {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .guided-tour {
    transition: none;
  }

  .tour-target {
    animation: none;
  }
}
