:root {
  --app-bg: #f3f5ef;
  --app-bg-accent: #e9efe4;
  --app-surface: rgba(255, 255, 255, 0.84);
  --app-surface-strong: #ffffff;
  --app-border: rgba(31, 41, 55, 0.1);
  --app-border-strong: rgba(31, 41, 55, 0.16);
  --app-text: #182230;
  --app-muted: #667085;
  --app-primary: #225c4d;
  --app-primary-soft: rgba(34, 92, 77, 0.12);
  --app-primary-strong: #173f35;
  --app-info: #2a6f97;
  --app-success: #2f7d59;
  --app-warning: #c48222;
  --app-danger: #c64545;
  --app-shadow: 0 20px 45px rgba(24, 34, 48, 0.08);
  --app-radius-xl: 1.25rem;
  --app-radius-lg: 1rem;
  --app-radius-md: 0.8rem;
}

html,
body {
  min-height: 100%;
}

body.app-shell {
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--app-text);
  background:
    radial-gradient(circle at top left, rgba(34, 92, 77, 0.08), transparent 28%),
    radial-gradient(circle at top right, rgba(42, 111, 151, 0.08), transparent 24%),
    linear-gradient(180deg, #f8faf6 0%, var(--app-bg) 100%);
}

a {
  color: var(--app-primary);
}

a:hover {
  color: var(--app-primary-strong);
}

.form-control,
.form-select,
.btn,
.card,
.dropdown-menu,
.alert,
.offcanvas,
.table {
  border-radius: var(--app-radius-md);
}

.form-control,
.form-select {
  min-height: 3rem;
  border: 1px solid var(--app-border);
  box-shadow: none;
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(34, 92, 77, 0.4);
  box-shadow: 0 0 0 0.24rem rgba(34, 92, 77, 0.12);
}

.btn {
  font-weight: 700;
  letter-spacing: 0.01em;
  border-width: 1px;
  padding: 0.72rem 1.05rem;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary,
.btn-action-main {
  background: linear-gradient(135deg, var(--app-primary) 0%, #2f7d59 100%);
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(34, 92, 77, 0.18);
}

.btn-primary:hover,
.btn-action-main:hover {
  background: linear-gradient(135deg, var(--app-primary-strong) 0%, var(--app-primary) 100%);
  border-color: transparent;
}

.btn-outline-primary {
  color: var(--app-primary);
  border-color: rgba(34, 92, 77, 0.22);
  background: rgba(255, 255, 255, 0.7);
}

.btn-outline-primary:hover {
  color: #fff;
  background: var(--app-primary);
  border-color: var(--app-primary);
}

.btn-outline-secondary {
  color: #475467;
  border-color: rgba(71, 84, 103, 0.16);
  background: rgba(255, 255, 255, 0.74);
}

.btn-outline-secondary:hover {
  color: var(--app-text);
  background: #eef2ec;
  border-color: rgba(71, 84, 103, 0.24);
}

.btn-outline-success {
  color: var(--app-success);
  border-color: rgba(47, 125, 89, 0.22);
}

.btn-outline-success:hover {
  color: #fff;
  background: var(--app-success);
  border-color: var(--app-success);
}

.btn-outline-danger {
  color: var(--app-danger);
  border-color: rgba(198, 69, 69, 0.22);
}

.btn-outline-danger:hover {
  color: #fff;
  background: var(--app-danger);
  border-color: var(--app-danger);
}

.btn-sm {
  padding: 0.52rem 0.8rem;
  border-radius: 0.75rem;
}

.btn-action-soft {
  background: rgba(255, 255, 255, 0.82);
}

#app-wrapper {
  margin-top: 72px;
  min-height: calc(100vh - 72px);
}

#main-content {
  overflow-y: auto;
  max-height: calc(100vh - 72px);
}

.app-footer {
  margin-top: 3rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(24, 34, 48, 0.08);
  color: var(--app-muted);
  font-size: 0.88rem;
}

.app-footer strong {
  color: #475467;
}

.app-navbar {
  min-height: 72px;
  padding: 0.6rem 0.35rem;
  background: rgba(248, 250, 246, 0.88);
  border-bottom: 1px solid rgba(24, 34, 48, 0.08);
  backdrop-filter: blur(14px);
}

.app-navbar .navbar-brand {
  color: var(--app-text);
}

.app-navbar .brand-mark {
  width: 2.7rem;
  height: 2.7rem;
  border-radius: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, var(--app-primary) 0%, #2f7d59 100%);
  box-shadow: 0 12px 24px rgba(34, 92, 77, 0.2);
}

.app-navbar .brand-mark i {
  font-size: 1.2rem;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-title {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--app-text);
}

.brand-subtitle {
  font-size: 0.77rem;
  color: var(--app-muted);
}

.topbar-pill {
  background: rgba(255, 255, 255, 0.78);
}

#sidebar-collapse-toggle {
  width: 2.35rem;
  height: 2.35rem;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.app-sidebar {
  width: 220px;
  min-height: calc(100vh - 72px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78) 0%, rgba(248, 250, 246, 0.92) 100%);
  border-right: 1px solid rgba(24, 34, 48, 0.08);
  backdrop-filter: blur(12px);
  transition: width 0.22s ease, box-shadow 0.22s ease;
}

.app-sidebar-offcanvas {
  background: linear-gradient(180deg, #f7faf5 0%, #edf3ea 100%);
}

.sidebar-inner {
  padding: 0.8rem 0.65rem 1rem;
  transition: padding 0.22s ease;
}

.sidebar-section-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--app-muted);
}

.sidebar-nav {
  gap: 0.18rem;
}

#sidebar-desktop .nav-link {
  display: flex;
  align-items: center;
  color: #344054;
  border-radius: 0.95rem;
  font-size: 0.92rem;
  font-weight: 650;
  padding: 0.72rem 0.85rem;
  transition: background-color 0.16s ease, color 0.16s ease, padding 0.22s ease;
}

#sidebar-desktop .nav-link .nav-link-label,
#sidebar-desktop .nav-link .sidebar-link-label {
  white-space: nowrap;
}

#sidebar-desktop .nav-link .bi {
  font-size: 1.05rem;
  flex: 0 0 auto;
}

#sidebar-desktop .nav-link:hover,
.app-sidebar-offcanvas .nav-link:hover {
  background: rgba(34, 92, 77, 0.08);
  color: var(--app-primary-strong);
}

#sidebar-desktop .nav-link.active,
.app-sidebar-offcanvas .nav-link.active {
  background: linear-gradient(135deg, var(--app-primary) 0%, #2f7d59 100%);
  color: #fff;
  box-shadow: 0 14px 30px rgba(34, 92, 77, 0.16);
}

body.sidebar-collapsed .app-sidebar,
.app-sidebar.is-collapsed {
  width: 72px;
}

body.sidebar-collapsed .sidebar-inner,
.app-sidebar.is-collapsed .sidebar-inner {
  padding-left: 0.45rem;
  padding-right: 0.45rem;
}

body.sidebar-collapsed .brand-subtitle,
body.sidebar-collapsed .sidebar-section-label,
.app-sidebar.is-collapsed .brand-subtitle,
.app-sidebar.is-collapsed .sidebar-section-label {
  opacity: 0;
  pointer-events: none;
}

body.sidebar-collapsed #sidebar-desktop .nav-link,
.app-sidebar.is-collapsed .nav-link {
  justify-content: center;
  padding-left: 0.65rem;
  padding-right: 0.65rem;
}

body.sidebar-collapsed #sidebar-desktop .nav-link .sidebar-link-label,
.app-sidebar.is-collapsed .nav-link .sidebar-link-label {
  display: none;
}

body.sidebar-collapsed #sidebar-desktop .nav-link .bi,
.app-sidebar.is-collapsed .nav-link .bi {
  margin-right: 0 !important;
}

body.sidebar-collapsed #sidebar-desktop .sidebar-section,
.app-sidebar.is-collapsed .sidebar-section {
  margin-top: 0.2rem !important;
  min-height: 0.2rem;
}

body.sidebar-collapsed #sidebar-desktop .sidebar-nav,
.app-sidebar.is-collapsed .sidebar-nav {
  align-items: stretch;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-kicker {
  margin-bottom: 0.35rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--app-muted);
}

.page-title {
  margin: 0;
  font-size: clamp(1.8rem, 2vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.page-subtitle {
  max-width: 52rem;
  margin: 0.55rem 0 0;
  color: var(--app-muted);
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.panel-card {
  border: 1px solid rgba(24, 34, 48, 0.08);
  background: var(--app-surface);
  backdrop-filter: blur(12px);
  box-shadow: var(--app-shadow);
}

.panel-card-header {
  border-bottom: 1px solid rgba(24, 34, 48, 0.08);
}

.filter-panel .card-body {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(247, 249, 244, 0.82) 100%);
}

.context-banner {
  border: 1px solid rgba(42, 111, 151, 0.14);
  background: rgba(42, 111, 151, 0.08);
}

.stat-card {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 46px rgba(24, 34, 48, 0.12);
}

.metric-card .card-body {
  padding: 1.35rem 1.45rem;
}

.metric-icon {
  width: 3.35rem;
  height: 3.35rem;
  border-radius: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.metric-icon-primary {
  background: rgba(34, 92, 77, 0.12);
  color: var(--app-primary);
}

.metric-icon-success {
  background: rgba(47, 125, 89, 0.12);
  color: var(--app-success);
}

.metric-icon-info {
  background: rgba(42, 111, 151, 0.12);
  color: var(--app-info);
}

.message-stack .alert {
  border: 1px solid rgba(24, 34, 48, 0.08);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 24px rgba(24, 34, 48, 0.06);
}

.breadcrumb {
  background: transparent;
  padding: 0;
  margin-bottom: 1rem;
}

.data-table {
  --bs-table-bg: transparent;
  margin-bottom: 0;
}

.data-table thead th {
  border-bottom-width: 1px;
  border-color: rgba(24, 34, 48, 0.08);
  background: rgba(239, 243, 236, 0.8);
  color: #344054;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table tbody td {
  padding-top: 1rem;
  padding-bottom: 1rem;
  border-color: rgba(24, 34, 48, 0.06);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  --bs-table-accent-bg: rgba(34, 92, 77, 0.03);
}

.table-action-group {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.bulk-select-col {
  width: 3rem;
  min-width: 3rem;
}

.bulk-select-col .form-check {
  display: flex;
  justify-content: center;
  margin-bottom: 0;
}

.bulk-select-toolbar {
  background: linear-gradient(135deg, rgba(34, 92, 77, 0.1) 0%, rgba(42, 111, 151, 0.08) 100%);
}

.bulk-select-hint {
  background: rgba(248, 249, 250, 0.72);
}

.pagination-toolbar {
  border-top: 1px solid rgba(24, 34, 48, 0.08);
  padding-top: 1rem;
}

.pagination-size-form .form-select {
  min-height: 2.35rem;
  width: auto;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: clamp(1.5rem, 5vw, 5rem);
  background:
    linear-gradient(90deg, rgba(248, 251, 255, 0.84) 0%, rgba(248, 251, 255, 0.68) 24%, rgba(248, 251, 255, 0.18) 52%, rgba(248, 251, 255, 0) 100%),
    url("../img/login-hero-certified-products-blue-concrete.png") center / cover no-repeat,
    linear-gradient(135deg, #f7fbff 0%, #dcecff 100%);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
}

.auth-card .card {
  --bs-card-bg: transparent;
  background: rgba(255, 255, 255, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.52) !important;
  backdrop-filter: blur(18px) saturate(125%);
  -webkit-backdrop-filter: blur(18px) saturate(125%);
  box-shadow:
    0 24px 60px rgba(15, 45, 74, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.58) !important;
}

.auth-disclaimer {
  border: 1px solid rgba(42, 111, 151, 0.16);
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.32);
  padding: 0.85rem 1rem;
}

.auth-disclaimer > p:first-child {
  color: var(--app-text);
  font-weight: 700;
}

.auth-disclaimer .form-check-label {
  font-size: 0.92rem;
}

.variant-form .form-label {
  margin-bottom: 0.4rem;
  font-weight: 700;
}

.variant-form .form-text {
  min-height: 2.3rem;
}

.variant-form .choice-panel {
  border: 1px solid var(--app-border);
  border-radius: 0.95rem;
  background: rgba(255, 255, 255, 0.84);
  padding: 0.9rem 1rem;
  max-height: 26rem;
  overflow-y: auto;
}

.variant-form .choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 0.65rem 1rem;
}

.variant-form .choice-grid .form-check {
  margin-bottom: 0;
}

.variant-form .choice-grid .form-check-label {
  margin-left: 0.25rem;
}

.variant-form .section-card {
  border: 1px solid var(--app-border);
  border-radius: 1rem;
  padding: 1.1rem;
  background: rgba(248, 249, 250, 0.65);
}

.variant-form .override-card {
  height: 100%;
  border: 1px solid rgba(34, 92, 77, 0.14);
  border-radius: 0.9rem;
  padding: 0.95rem;
  background: rgba(255, 255, 255, 0.82);
}

.variant-form .override-master {
  min-width: 18rem;
}

.variant-form .override-master .form-check {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  padding-left: 0;
}

.variant-form .override-master .form-check-input {
  margin-left: 0;
  float: none;
}

.variant-form [data-override-input].is-auto {
  color: #6c757d;
  border-style: dashed;
  box-shadow: none;
}

.variant-form .override-auto {
  min-height: 1.25rem;
}

.export-scope-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.9rem;
}

.export-scope-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid var(--app-border);
  border-radius: 1rem;
  padding: 1rem 1.1rem;
  background: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.export-scope-card:hover {
  border-color: rgba(34, 92, 77, 0.26);
  transform: translateY(-1px);
}

.export-scope-card input[type="radio"] {
  margin: 0;
}

.export-scope-card:has(input:checked) {
  border-color: rgba(34, 92, 77, 0.45);
  box-shadow: 0 0 0 0.18rem rgba(34, 92, 77, 0.12);
  background: rgba(237, 243, 234, 0.92);
}

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

.export-checkbox-list {
  max-height: 20rem;
  overflow-y: auto;
  border: 1px solid var(--app-border);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.86);
  padding: 0.7rem 0.9rem;
}

.export-checkbox-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 0.55rem;
}

.export-checkbox-item:last-child {
  margin-bottom: 0;
}

.export-checkbox-item .form-check-input {
  margin-top: 0.25rem;
}

.export-checkbox-item .form-check-label {
  flex: 1;
}

@media (max-width: 991.98px) {
  #app-wrapper {
    margin-top: 72px;
  }

  #main-content {
    max-height: none;
  }
}

@media (max-width: 767.98px) {
  .auth-wrapper {
    justify-content: center;
    padding: 1rem;
    background:
      linear-gradient(180deg, rgba(248, 251, 255, 0.88) 0%, rgba(248, 251, 255, 0.78) 52%, rgba(248, 251, 255, 0.62) 100%),
      url("../img/login-hero-certified-products-blue-concrete.png") center right / cover no-repeat,
      linear-gradient(135deg, #f7fbff 0%, #dcecff 100%);
  }

  .page-header {
    align-items: stretch;
  }

  .page-actions {
    width: 100%;
  }

  .page-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .variant-form .choice-panel {
    max-height: none;
  }
}
