/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
*/

/* Bootstrap 5 theme. Keep component states in sync with the brand palette. */
:root,
[data-bs-theme="light"] {
  --eudr-green: #198754;
  --eudr-green-hover: #146c43;
  --company-green: #198754;
  --company-green-hover: #146c43;
  --bs-primary: #198754;
  --bs-primary-rgb: 25, 135, 84;
  --bs-primary-text-emphasis: #0a3622;
  --bs-primary-bg-subtle: #d1e7dd;
  --bs-primary-border-subtle: #a3cfbb;
  --bs-link-color: #198754;
  --bs-link-color-rgb: 25, 135, 84;
  --bs-link-hover-color: #146c43;
  --bs-link-hover-color-rgb: 20, 108, 67;
  --bs-body-bg: #f8f9fa;
  --bs-body-color: #212529;
  --bs-border-radius: 0.5rem;
  --bs-border-radius-lg: 0.75rem;
  --bs-box-shadow-sm: 0 2px 8px rgba(33, 37, 41, 0.04);
  --bs-focus-ring-color: rgba(25, 135, 84, 0.25);
}

/* Closure checklist: an inline status row with an explicit disclosure. */
.closure-checklist {
  --closure-checklist-color: var(--company-green);
  --closure-checklist-hover: #f6faf7;
  overflow: hidden;
  border: 1px solid #dce6df;
  border-left: 3px solid var(--closure-checklist-color);
  border-radius: 0.5rem;
  background: #fff;
}

.closure-checklist--pending {
  --closure-checklist-color: #a66b00;
  --closure-checklist-hover: #fffaf0;
}

.closure-checklist__toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 1rem;
  line-height: 1.5;
  text-align: left;
}

.closure-checklist__toggle:hover {
  background: var(--closure-checklist-hover);
}

.closure-checklist__toggle:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--closure-checklist-color) 30%, transparent);
  outline-offset: 2px;
}

.closure-checklist__icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  color: var(--closure-checklist-color);
  font-size: 1rem;
}

.closure-checklist__title {
  display: flex;
  flex: 0 1 auto;
  min-width: 0;
  font-size: 1.0625rem;
  font-weight: 600;
}

.closure-checklist__action {
  margin-left: auto;
  color: #5c6560;
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
}

.closure-checklist__action--open {
  display: none;
}

.closure-checklist__toggle[aria-expanded="true"] .closure-checklist__action--closed {
  display: none;
}

.closure-checklist__toggle[aria-expanded="true"] .closure-checklist__action--open {
  display: inline;
}

.closure-checklist__chevron {
  flex: 0 0 auto;
  color: #5c6560;
  transition: transform 0.2s ease;
}

.closure-checklist__toggle[aria-expanded="true"] .closure-checklist__chevron {
  transform: rotate(180deg);
}

.closure-checklist__body {
  padding: 1rem 0.75rem 0;
  border-top: 1px solid #dee2e6;
}

@media (max-width: 575.98px) {
  .closure-checklist__action {
    display: none;
  }
}

/* Components use Bootstrap's own custom properties for every state. */
.btn-primary,
.btn-company,
.btn-consultant,
.btn-admin {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--bs-primary);
  --bs-btn-border-color: var(--bs-primary);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #157347;
  --bs-btn-hover-border-color: #146c43;
  --bs-btn-focus-shadow-rgb: 25, 135, 84;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #146c43;
  --bs-btn-active-border-color: #13653f;
  --bs-btn-disabled-color: #fff;
  --bs-btn-disabled-bg: var(--bs-primary);
  --bs-btn-disabled-border-color: var(--bs-primary);
}

.btn-outline-primary {
  --bs-btn-color: var(--bs-primary);
  --bs-btn-border-color: var(--bs-primary);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--bs-primary);
  --bs-btn-hover-border-color: var(--bs-primary);
  --bs-btn-focus-shadow-rgb: 25, 135, 84;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #146c43;
  --bs-btn-active-border-color: #146c43;
  --bs-btn-disabled-color: var(--bs-primary);
  --bs-btn-disabled-border-color: var(--bs-primary);
}

/* Shared secondary actions, including icon buttons and destructive actions. */
.btn-action,
.btn-action-danger {
  --action-color: #146c43;
  --action-bg: #edf5ef;
  --action-border: #c9dfd0;
  --action-hover-bg: #dceee2;
  --action-hover-border: #86b7a0;
  --action-focus-rgb: 25, 135, 84;
  --bs-btn-color: var(--action-color);
  --bs-btn-bg: var(--action-bg);
  --bs-btn-border-color: var(--action-border);
  --bs-btn-hover-color: var(--action-color);
  --bs-btn-hover-bg: var(--action-hover-bg);
  --bs-btn-hover-border-color: var(--action-hover-border);
  --bs-btn-focus-shadow-rgb: var(--action-focus-rgb);
  --bs-btn-active-color: var(--action-color);
  --bs-btn-active-bg: var(--action-hover-bg);
  --bs-btn-active-border-color: var(--action-hover-border);
  --bs-btn-disabled-color: var(--action-color);
  --bs-btn-disabled-bg: var(--action-bg);
  --bs-btn-disabled-border-color: var(--action-border);
}

.btn-action-danger {
  --action-color: #b02a37;
  --action-bg: #fff1f2;
  --action-border: #f1c9ce;
  --action-hover-bg: #f8d7da;
  --action-hover-border: #e59ba3;
  --action-focus-rgb: 220, 53, 69;
}

.eudr_green,
.text-company,
.text-consultant,
.text-admin {
  color: var(--bs-primary);
}

.pagination {
  --bs-pagination-color: var(--bs-primary);
  --bs-pagination-hover-color: #146c43;
  --bs-pagination-focus-color: #146c43;
  --bs-pagination-focus-box-shadow: 0 0 0 0.25rem rgba(25, 135, 84, 0.25);
  --bs-pagination-active-bg: var(--bs-primary);
  --bs-pagination-active-border-color: var(--bs-primary);
}

.nav-pills {
  --bs-nav-pills-link-active-bg: var(--bs-primary);
}

.dropdown-menu {
  --bs-dropdown-bg: #fff;
  --bs-dropdown-link-active-bg: var(--bs-primary);
  --bs-dropdown-border-color: var(--bs-border-color);
  --bs-dropdown-padding-y: 0.5rem;
  box-shadow: var(--bs-box-shadow-sm);
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: #86b7a0;
  box-shadow: 0 0 0 0.25rem rgba(25, 135, 84, 0.15);
}

.form-control:not(:disabled),
.form-select:not(:disabled) {
  background-color: #fff;
}

.form-check-input:checked {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
}

/* Application shell */
.card {
  --bs-card-bg: #fff;
}

.modal {
  --bs-modal-bg: #fff;
}

.list-group {
  --bs-list-group-bg: #fff;
}

.dashboard-nav {
  width: 320px;
  height: 100dvh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  background-color: #18392b;
}

.dashboard-nav .brand-logo img,
.dashboard-sidebar .brand-logo img {
  width: 104px;
  height: auto;
}

.dashboard-nav .nav,
.dashboard-sidebar .nav {
  gap: 0.25rem;
}

.dashboard-nav .nav-link,
.dashboard-sidebar .nav-link {
  display: flex;
  align-items: center;
  padding: 0.65rem 0.85rem;
  border-radius: var(--bs-border-radius);
  color: #e4ede7;
  transition: background-color 0.15s ease;
}

.dashboard-nav .nav-link > .bi,
.dashboard-sidebar .nav-link > .bi {
  flex-shrink: 0;
}

.dashboard-nav .nav-link:hover,
.dashboard-sidebar .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

.dashboard-nav .nav-link.active,
.dashboard-sidebar .nav-link.active {
  background-color: #d1e7dd;
  color: #0a3622;
  font-weight: 600;
}

.dashboard-nav .nav-section,
.dashboard-sidebar .nav-section {
  padding: 1.25rem 0.85rem 0.35rem;
  color: #b9cec1;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dashboard-sidebar {
  --bs-offcanvas-width: 320px;
  background-color: #18392b;
}

.dashboard-app {
  min-width: 0;
}

.dashboard-identity {
  min-width: 0;
  overflow-wrap: anywhere;
}

.dashboard-account-email {
  max-width: 18rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-toolbar {
  min-height: 68px;
  border-bottom: 1px solid var(--bs-border-color);
}

.dashboard-content {
  padding: 1.5rem;
}

.dashboard-content > .container-fluid {
  max-width: 1600px;
  margin-inline: auto;
}

.dashboard-content .card {
  --bs-card-bg: #fff;
  --bs-card-border-color: var(--bs-border-color);
  --bs-card-cap-bg: #fff;
  --bs-card-border-radius: 0.75rem;
}

.dashboard-content .card-header {
  padding: 1rem 1.25rem;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.dashboard-content .card-header h5 {
  font-size: 1.125rem;
  font-weight: 600;
}

.page-heading h1 {
  font-size: clamp(1.5rem, 2vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  flex-shrink: 0;
}

.btn-icon:focus-visible {
  outline: 3px solid var(--action-color, var(--bs-primary));
  outline-offset: 2px;
}

.dashboard-content label:not(.form-check-label) {
  display: inline-block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.table {
  --bs-table-bg: #fff;
  --bs-table-border-color: #edf0ee;
  --bs-table-hover-bg: #f3f8f5;
}

.dashboard-content .table > :not(caption) > * > * {
  padding: 0.85rem 0.75rem;
}

.table thead th {
  color: #495057;
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
}

.table .badge {
  font-weight: 500;
}

.table td:last-child {
  white-space: nowrap;
}

.sftp-help .table {
  width: 100%;
  table-layout: fixed;
}

.sftp-help .table th,
.sftp-help .table td {
  white-space: normal;
  overflow-wrap: anywhere;
}

.sftp-help-columns th:first-child {
  width: 34%;
}

.empty-state {
  padding: 2.5rem 1rem;
  text-align: center;
}

.empty-state > .bi {
  color: var(--bs-secondary-color);
  font-size: 2rem;
}

.dashboard-stat {
  transition: border-color 0.15s ease;
}

.dashboard-stat:hover {
  border-color: var(--bs-primary-border-subtle);
}

.dashboard-stat .stat-value {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.expedient-section {
  scroll-margin-top: 1rem;
}

.auth-card {
  width: 100%;
  max-width: 440px;
}

/* The public entry point prioritizes the two everyday workspaces. */
.access-page {
  position: relative;
  isolation: isolate;
  padding: 0 1rem;
  background: #dce8df;
}

.access-page::before {
  content: "";
  position: fixed;
  inset: -16px;
  z-index: -1;
  background: linear-gradient(rgba(222, 235, 224, 0.28), rgba(222, 235, 224, 0.45)),
    var(--access-background, url("/assets/access-forest-bde3a5d9.webp")) center / cover no-repeat;
  filter: blur(7px);
  pointer-events: none;
}

.access-page::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(
    circle 240px at var(--forest-glow-x, 50%) var(--forest-glow-y, 50%),
    rgba(235, 255, 224, 0.3),
    rgba(235, 255, 224, 0.1) 45%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.access-forest-shade {
  position: fixed;
  inset: -16px;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(rgba(222, 235, 224, 0.28), rgba(222, 235, 224, 0.45)),
    url("/assets/access-forest-mist-705c58a7.webp") center / cover no-repeat;
  filter: blur(7px);
  opacity: 0;
  animation: access-forest-light 26s ease-in-out infinite;
}

@keyframes access-forest-light {
  0%, 100% {
    opacity: 0;
  }

  50% {
    opacity: 1;
  }
}

.access-forest-haze {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.access-forest-haze::before,
.access-forest-haze::after {
  content: "";
  position: absolute;
  top: -30px;
  bottom: -30px;
  width: min(30vw, 420px);
  filter: blur(18px);
  opacity: 0;
  animation: access-forest-haze 29s ease-in-out -8s infinite;
}

.access-forest-haze::before {
  left: -30px;
  background:
    radial-gradient(ellipse at 0% 35%, rgba(242, 250, 239, 0.55), transparent 75%),
    radial-gradient(ellipse at 10% 80%, rgba(242, 250, 239, 0.35), transparent 65%);
}

.access-forest-haze::after {
  right: -30px;
  background:
    radial-gradient(ellipse at 100% 60%, rgba(242, 250, 239, 0.5), transparent 75%),
    radial-gradient(ellipse at 90% 15%, rgba(242, 250, 239, 0.3), transparent 65%);
  animation-duration: 37s;
  animation-delay: -19s;
}

@keyframes access-forest-haze {
  0%, 100% {
    opacity: 0.08;
  }

  50% {
    opacity: 0.55;
  }
}

.access-page.access-glow-active::after {
  opacity: 1;
}

.access-container {
  max-width: 960px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 28px;
  box-shadow: 0 20px 80px rgba(24, 57, 43, 0.15);
}

.auth-container {
  max-width: 520px;
}

.auth-page .auth-logo {
  width: 200px;
}

.auth-portal {
  color: #496453;
}

.auth-title {
  font-size: clamp(1.5rem, 3vw, 1.75rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.auth-container .form-control {
  padding: 0.625rem 0.75rem;
}

.auth-links a {
  color: #27754d;
  text-decoration: none;
}

.auth-links a:hover {
  text-decoration: underline;
}

.access-logo {
  display: block;
  width: 240px;
  max-width: 100%;
  height: auto;
}

.access-brand {
  margin-bottom: 1.25rem;
}

.access-intro {
  max-width: 640px;
  color: #18392b;
}

.access-headline {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.access-description {
  color: #496453;
  line-height: 1.65;
}

.access-tagline {
  padding: 0.375rem 0.75rem;
  border-radius: 999px;
  background: #edf5ef;
}

.access-language .language-switch > .btn {
  background: transparent;
  color: var(--bs-secondary-color);
}

.access-language .language-switch > .btn:hover,
.access-language .language-switch > .btn:focus-visible {
  background: #edf5ef;
  color: #18392b;
}

@media (max-width: 767.98px) {
  .access-page {
    padding: 0 0.75rem;
  }

  .access-logo {
    width: 200px;
  }

  .access-brand {
    margin-bottom: 1.5rem;
  }
}

.access-title {
  font-size: clamp(1.375rem, 2.5vw, 1.5rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.access-icon {
  width: 52px;
  height: 52px;
}

.access-option {
  background: #f8fbf9;
  border-color: #dce8df !important;
  transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.access-option .bi-arrow-right {
  transition: transform 0.25s ease;
}

.access-option:focus-visible {
  border-color: var(--bs-primary) !important;
  background-color: #edf5ef;
  box-shadow: 0 6px 20px rgba(24, 57, 43, 0.08);
  outline: 3px solid var(--bs-primary);
  outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
  .access-option:hover {
    border-color: var(--bs-primary) !important;
    background-color: #edf5ef;
    box-shadow: 0 6px 20px rgba(24, 57, 43, 0.08);
  }

  .access-option:hover .bi-arrow-right {
    transform: translateX(4px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .access-forest-shade {
    animation: none;
  }

  .access-forest-haze::before,
  .access-forest-haze::after {
    animation: none;
  }

  .access-page::after {
    display: none;
  }

  .access-option,
  .access-option .bi-arrow-right {
    transition: none;
  }

  .access-option:hover .bi-arrow-right {
    transform: none;
  }
}

.auth-card .card-body {
  padding: 2rem;
}

.hover-card {
  transition: box-shadow 0.2s ease;
}

.hover-card:hover {
  box-shadow: 0 0.25rem 0.75rem rgba(33, 37, 41, 0.08);
}

/* Match enhanced selects to Bootstrap form controls. */
.choices {
  margin-bottom: 0;
}

.choices__inner {
  min-height: 38px;
  padding: 0.375rem 0.75rem;
  background: #fff;
  border-color: var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  font-size: 1rem;
}

.choices__input {
  background: #fff;
}

.choices__list--single {
  padding: 0;
}

.choices[data-type*="select-one"] .choices__inner {
  padding-bottom: 0.375rem;
}

.is-focused .choices__inner,
.is-open .choices__inner {
  border-color: #86b7a0;
}

.choices__list--dropdown,
.choices__list[aria-expanded] {
  border-color: var(--bs-border-color);
}

.choices__list--multiple .choices__item {
  background-color: #d1e7dd;
  border-color: #a3cfbb;
  color: #0a3622;
}

.choices__list--multiple .choices__item .choices__button {
  border-left-color: #a3cfbb;
  filter: brightness(0.4);
}

@media (max-width: 991.98px) {
  .dashboard-content {
    padding: 1rem;
  }

  .dashboard-toolbar {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hover-card,
  .dashboard-nav .nav-link,
  .dashboard-sidebar .nav-link,
  .closure-checklist__chevron {
    transition: none;
  }
}

/* HS-Code tree picker (admin catalog authoring + consultancy product selection) */
.hs-code-tree {
  max-height: 320px;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  padding: 0.25rem 0;
  background: #fff;
}

.hs-code-tree-list {
  list-style: none;
  margin: 0;
  padding-left: 1.25rem;
}

.hs-code-tree > .hs-code-tree-list {
  padding-left: 0.25rem;
}

.hs-code-tree-item {
  min-width: 0;
}

.hs-code-tree-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  min-width: 0;
  padding: 0.3rem 0.5rem;
  border: none;
  background: none;
  text-align: left;
  font-size: 0.875rem;
  border-radius: 0.25rem;
}

.hs-code-tree-row:hover {
  background: #f1f3f5;
}

button.hs-code-tree-row--selectable {
  cursor: pointer;
}

.hs-code-tree-row--retired {
  opacity: 0.6;
}

.hs-code-tree-row--active {
  background: #e7f5ec;
}

.hs-code-tree-caret,
.hs-code-tree-caret-spacer {
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6c757d;
}

.hs-code-tree-code {
  flex: none;
  border: 1px solid var(--bs-primary-border-subtle);
  color: var(--bs-primary);
  border-radius: 0.25rem;
  padding: 0.05rem 0.4rem;
  font-family: var(--bs-font-monospace, monospace);
  font-size: 0.8rem;
  white-space: nowrap;
}

.hs-code-tree-label {
  flex: 1 1 auto;
  min-width: 0;
  white-space: normal;
  word-break: break-word;
  color: #212529;
}

.hs-code-tree-check {
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #adb5bd;
  border-radius: 0.2rem;
  color: transparent;
}

.hs-code-tree-row--active .hs-code-tree-check {
  background: var(--eudr-green);
  border-color: var(--eudr-green);
  color: #fff;
}

.hs-code-tree-children {
  border-left: 1px solid #e9ecef;
  margin-left: 0.55rem;
}

/* Supply Chain styles → supply_chain.css */
