/* Global design harmonization for all templates extending layout.html */
:root {
  /* Core Palette - Premium Emerald & Slate */
  --ds-bg: #f4f7f6;
  --ds-surface: #ffffff;
  --ds-surface-soft: #f8fafb;
  --ds-ink: #1e293b;
  --ds-muted: #64748b;
  --ds-line: #e2e8f0;
  
  --ds-brand: #0d9488;
  --ds-brand-strong: #0f766e;
  --ds-brand-light: #ccfbf1;
  
  --ds-accent: #f59e0b;
  --ds-danger: #e11d48;
  --ds-success: #10b981;
  --ds-warning: #f59e0b;
  --ds-info: #0ea5e9;
  
  /* Legacy mapping for style.css */
  --primary-color: var(--ds-brand);
  --primary-dark: var(--ds-brand-strong);
  --accent-1: #8b5cf6;
  --accent-2: #3b82f6;
  --accent-3: #ec4899;
  --secondary-color: var(--ds-muted);
  --success-color: var(--ds-success);
  --warning-color: var(--ds-warning);
  --info-color: var(--ds-info);
  --light-bg: var(--ds-bg);
  --white: var(--ds-surface);
  --text-dark: var(--ds-ink);
  --text-muted: var(--ds-muted);

  --ds-radius-sm: 8px;
  --ds-radius-md: 12px;
  --ds-radius-lg: 16px;
  --ds-shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --ds-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  
  --bs-primary: var(--ds-brand);
  --bs-secondary: var(--ds-muted);
  --bs-success: var(--ds-success);
  --bs-warning: var(--ds-warning);
  --bs-danger: var(--ds-danger);
  --bs-info: var(--ds-info);
  --bs-border-radius: var(--ds-radius-md);
}

body {
  font-family: 'IBM Plex Sans', 'Segoe UI', Tahoma, sans-serif;
  color: var(--ds-ink);
  background:
    radial-gradient(1100px 420px at -10% -10%, #dce9e7 0%, rgba(220, 233, 231, 0) 60%),
    radial-gradient(900px 360px at 120% -15%, #ece2d4 0%, rgba(236, 226, 212, 0) 58%),
    var(--ds-bg);
}

h1,
h2,
h3,
h4,
h5,
h6,
.navbar-brand,
.card-title,
.btn,
.badge {
  font-family: 'Sora', 'Trebuchet MS', sans-serif;
}

.page-shell {
  padding: clamp(0.6rem, 1.2vw, 1rem);
}

.page-shell .container,
.page-shell .container-fluid {
  max-width: 1320px;
}

.page-section {
  margin-top: 0.2rem;
}

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

.page-title {
  margin: 0;
  font-size: clamp(1rem, 1.5vw, 1.4rem);
  color: #143446;
}

.page-subtitle {
  margin-top: 0.22rem;
  color: #67808d;
  font-size: 0.8rem;
}

.page-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.surface-card {
  border-radius: var(--ds-radius-md);
  border: 1px solid var(--ds-line);
  background: var(--ds-surface);
  box-shadow: var(--ds-shadow-soft);
}

.table-shell {
  border-radius: var(--ds-radius-md);
  padding: 0.2rem;
  background: linear-gradient(180deg, #ffffff 0%, #f9fcfc 100%);
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
}

/* Compact buttons for table action rows */
.btn-compact {
  --bs-btn-padding-y: 0.25rem;
  --bs-btn-padding-x: 0.4rem;
  --bs-btn-font-size: 0.75rem;
  min-height: 44px;
}

/* Annexe/download toolbar buttons */
.btn-annexe {
  padding: 0.2rem 0.35rem;
  font-size: 0.9rem;
  border-radius: 6px;
  background: #fbfcfd;
  min-height: 44px;
}

/* Force 44×44px minimum touch target on any element */
.touch-target {
  min-width: 44px;
  min-height: 44px;
}

/* Login/auth card */
.login-card {
  width: 100%;
  max-width: 480px;
}

/* Avatar sizing */
.avatar-xs {
  width: 24px;
  height: 24px;
  font-size: 0.7rem;
}
.avatar-sm {
  width: 32px;
  height: 32px;
}

/* Progress bar defaults for stat cards */
.progress-stat {
  height: 8px;
}
.progress-stat-sm {
  height: 6px;
}
.progress-stat-xs {
  height: 6px;
  border-radius: 3px;
}

/* Action page — dropdown positioning and hover */
.actions-page .table-responsive { overflow-y: visible !important; }
.actions-page .action-row { position: relative; transition: all 0.2s; }
.actions-page .action-row:hover { background-color: var(--ds-bg) !important; }
.actions-page .action-row .dropdown { position: relative; z-index: 100; }
.actions-page .action-row .dropdown-menu {
  z-index: 1050 !important;
  position: absolute;
  top: 100%;
  right: 0;
}

/* Billing page — row status colors */
.billing-row-warning { background: #fff7e6; }
.billing-row-danger { background: #fdeaea; }
.payment-pill { font-weight: 600; }
.billing-table-wrap { overflow: visible !important; }
.billing-table-wrap .dropdown-menu {
  z-index: 1050 !important;
}

@keyframes fade-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Topbar */
.topbar {
  backdrop-filter: blur(8px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 252, 251, 0.96)) !important;
  border-bottom: 1px solid var(--ds-line);
}

.topbar .container-fluid {
  min-height: var(--topbar-height, 60px);
  align-items: center;
  gap: 0.4rem;
}

.topbar .navbar-brand {
  color: var(--ds-ink) !important;
  letter-spacing: 0.02em;
}

.topbar .navbar-brand i {
  filter: drop-shadow(0 3px 8px rgba(15, 139, 117, 0.25));
}

.topbar-menu-btn,
.topbar-icon-link,
.topbar-user-trigger {
  border-radius: 12px !important;
  transition: all 0.2s ease;
}

.topbar-menu-btn,
.topbar-icon-link {
  width: 38px;
  height: 38px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  color: #254253 !important;
  background: #f1f6f6;
  border: 1px solid #d4e0e5 !important;
}

.topbar-menu-btn:hover,
.topbar-menu-btn:focus,
.topbar-icon-link:hover,
.topbar-icon-link:focus {
  background: #e8f2f1;
  border-color: #bcd3d8 !important;
  color: #123247 !important;
  transform: translateY(-1px);
}

.topbar-user-trigger {
  padding: 0.35rem 0.55rem !important;
  border: 1px solid transparent;
}

.topbar-user-trigger:hover,
.topbar-user-trigger:focus {
  background: #eef5f5;
  border-color: #d2e0e4;
}

.topbar-search-form {
  margin: 0;
}

.topbar-search-form .input-group {
  height: 38px;
  border: 1px solid #d6e2e7;
  border-radius: 999px;
  overflow: hidden;
  background: #f8fbfb;
}

.topbar-search-input {
  background: transparent !important;
  font-size: 0.8rem;
  color: #274250;
}

.topbar-search-input::placeholder {
  color: #6e828f;
}

/* Sidebar */
.sidebar {
  width: 258px;
  padding: 0.5rem 0.45rem;
  background:
    radial-gradient(320px 180px at 6% -8%, rgba(31, 157, 103, 0.28) 0%, rgba(31, 157, 103, 0) 65%),
    linear-gradient(180deg, #123247 0%, #0f2d41 52%, #0d2637 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 14px 28px rgba(9, 25, 36, 0.22);
}

.sidebar > .p-3 {
  padding: 0.35rem !important;
}

.sidebar .nav.flex-column {
  gap: 0.2rem;
}

.sidebar .nav-link {
  min-height: 44px;
  margin: 0;
  padding: 0.52rem 0.68rem;
  border-radius: 12px;
  color: #d9e8ef;
  border: 1px solid transparent;
  background: transparent;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.sidebar .nav-link i {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #e6f2f6;
  background: rgba(255, 255, 255, 0.08);
  transition: background 0.2s ease, color 0.2s ease;
}

.sidebar .sidebar-sublink {
  min-height: 34px;
  margin-left: 0.45rem;
  margin-right: 0.2rem;
  padding: 0.35rem 0.55rem;
  font-size: 0.77rem;
  color: #b8ccd7;
  border: 1px solid transparent;
  border-radius: 10px;
}

.sidebar .sidebar-sublink i {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.16);
  background: linear-gradient(135deg, rgba(15, 139, 117, 0.36), rgba(11, 108, 91, 0.34));
  box-shadow: 0 8px 16px rgba(6, 23, 34, 0.25), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  transform: translateX(2px);
}

.sidebar .nav-link:hover i,
.sidebar .nav-link.active i {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.sidebar .collapse .nav-link:hover,
.sidebar .collapse .nav-link.active {
  transform: none;
}

.sidebar h6 {
  color: #a5bdca !important;
  font-size: 0.7rem;
  letter-spacing: 0.11em;
  margin: 1.05rem 0 0.4rem !important;
}

.sidebar .fa-chevron-down {
  font-size: 0.66rem;
  color: #9eb6c4;
}

.sidebar .nav-link[aria-expanded='true'] .fa-chevron-down {
  transform: rotate(180deg);
  transition: transform 0.2s ease;
}

.sidebar-overlay {
  background: rgba(7, 17, 24, 0.22);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  z-index: 1050;
}

body.no-scroll {
  overflow: hidden;
}

/* Generic surfaces */
.card,
.dropdown-menu,
.modal-content,
.alert,
.list-group-item {
  border-radius: var(--ds-radius-md);
  border: 1px solid var(--ds-line);
  box-shadow: var(--ds-shadow-soft);
}

.modal-content {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--ds-shadow);
}

.card {
  background: var(--ds-surface);
}

.dropdown-menu {
  padding: 0.45rem;
  min-width: 240px;
  border: 1px solid #d6e1e6;
  backdrop-filter: blur(6px);
}

.dropdown-menu.show {
  animation: dropdown-rise 0.16s ease;
}

@keyframes dropdown-rise {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.topbar-user-menu {
  min-width: 270px;
}

.dropdown-section-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7f8c;
  font-weight: 700;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
}

.dropdown-item .dropdown-icon {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #edf4f6;
  color: #2f5264;
  flex: 0 0 1.6rem;
}

.dropdown-item:hover .dropdown-icon,
.dropdown-item:focus .dropdown-icon,
.dropdown-item.active .dropdown-icon {
  background: #dcecef;
  color: #173848;
}

.dropdown-divider {
  margin: 0.45rem 0;
  border-color: #dde7eb;
}

.dropdown-item-danger {
  color: #b13f4c !important;
}

.dropdown-item-danger .dropdown-icon {
  background: #fbecef;
  color: #b64553;
}

.dropdown-item-danger:hover,
.dropdown-item-danger:focus {
  background: #fef4f5;
}

.dropdown-item-danger:hover .dropdown-icon,
.dropdown-item-danger:focus .dropdown-icon {
  background: #f8dfe3;
}

.card-header {
  background: linear-gradient(180deg, #f9fbfb 0%, #f1f6f6 100%);
  border-bottom: 1px solid var(--ds-line);
}

.card .card-body {
  padding: clamp(0.95rem, 1.4vw, 1.2rem);
}

.card .card-header {
  padding: 0.85rem 1rem;
}

.alert {
  border-left: 4px solid rgba(18, 50, 71, 0.2);
}

/* Buttons */
.btn {
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.btn-primary {
  border: none;
  background: linear-gradient(135deg, var(--ds-brand) 0%, var(--ds-brand-strong) 100%);
  box-shadow: 0 8px 20px rgba(15, 139, 117, 0.26);
}

.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(135deg, #0c7967 0%, #09584b 100%);
  box-shadow: 0 10px 24px rgba(15, 139, 117, 0.3);
}

.btn-outline-primary {
  border-color: var(--ds-brand);
  color: var(--ds-brand);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background-color: var(--ds-brand);
  border-color: var(--ds-brand);
  color: #fff;
}

.btn-warning,
.btn-outline-warning {
  color: #4f3a00;
}

/* Forms */
.form-control,
.form-select,
.form-check-input,
.input-group-text,
textarea {
  border-radius: var(--ds-radius-sm) !important;
  border-color: #ccd9df;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: var(--ds-brand);
  box-shadow: 0 0 0 0.18rem rgba(15, 139, 117, 0.18);
}

.form-label {
  color: #2b3b48;
  font-weight: 600;
}

.form-control,
.form-select,
textarea {
  background-color: #fbfdfd;
}

.form-control::placeholder,
textarea::placeholder {
  color: #748894;
}

.nav-pills .nav-link {
  border-radius: 999px;
  border: 1px solid #d5e2e7;
  color: #2f5264;
  font-weight: 600;
}

.nav-pills .nav-link:hover {
  background: #eef5f6;
}

.nav-pills .nav-link.active {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, #0f8b75 0%, #0b6c5b 100%);
}

/* Tables */
.table {
  --bs-table-bg: transparent;
  --bs-table-striped-bg: #f6fbfa;
  --bs-table-hover-bg: #eef7f5;
  border-collapse: separate;
  border-spacing: 0;
}

.table thead th {
  border-bottom: 1px solid var(--ds-line);
  color: #324555;
  font-weight: 700;
  background: #f4f8f8;
}

.table td,
.table th {
  vertical-align: middle;
  border-color: #e5edf0;
}

.table > :not(caption) > * > * {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.table-responsive {
  border: 1px solid var(--ds-line);
  border-radius: var(--ds-radius-md);
  background: #fff;
}

/* Badges */
.badge {
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  padding: 0.45em 0.65em;
  border-radius: 999px;
}

.bg-primary {
  background: linear-gradient(135deg, #257893 0%, #1a5c73 100%) !important;
}

.bg-success {
  background: linear-gradient(135deg, #2a9b67 0%, #1f7f53 100%) !important;
}

.bg-danger {
  background: linear-gradient(135deg, #cf5656 0%, #b74242 100%) !important;
}

.bg-warning {
  background: linear-gradient(135deg, #efbd52 0%, #d99f2b 100%) !important;
}

/* Breadcrumbs and small text */
.breadcrumb,
.text-muted,
small,
.form-text {
  color: var(--ds-muted) !important;
}

/* Landing pages still inherit baseline visual language */
.landing-header,
.landing-content {
  background-color: transparent;
}

/* Mobile tuning (source of truth for sidebar mobile behavior) */
@media (max-width: 992px) {
  .topbar {
    border-bottom-width: 1px;
  }

  .app-layout {
    position: relative;
  }

  .sidebar {
    display: none;
    position: fixed;
    z-index: 1060;
    width: min(84vw, 320px);
    left: 0;
    top: calc(var(--topbar-height) + 6px);
    height: calc(100vh - var(--topbar-height) - 12px);
    min-height: calc(100vh - var(--topbar-height) - 12px);
    border-radius: 0 16px 16px 0;
    border-right-color: rgba(255, 255, 255, 0.16);
    box-shadow: 0 18px 38px rgba(3, 13, 20, 0.38);
  }

  .sidebar .nav-link {
    min-height: 46px;
    font-size: 0.85rem;
  }

  .sidebar .sidebar-text {
    white-space: normal;
    line-height: 1.18;
  }

  .sidebar.show {
    display: block;
    left: 0;
  }

  .topbar .navbar-brand {
    font-size: 0.93rem;
  }

  .topbar-user-trigger {
    padding: 0.2rem !important;
  }

  .content {
    padding: 12px;
  }

  .card {
    border-radius: var(--ds-radius-md);
  }
}

@media (max-width: 576px) {
  .sidebar {
    display: none;
    position: fixed;
    width: min(92vw, 330px);
    left: 0;
    top: calc(var(--topbar-height) + 4px);
    height: calc(100vh - var(--topbar-height) - 8px);
    min-height: calc(100vh - var(--topbar-height) - 8px);
    border-radius: 0 14px 14px 0;
    padding: 0.45rem 0.35rem;
  }

  .sidebar.show {
    display: block;
    left: 0;
  }

  .sidebar .nav-link {
    min-height: 44px;
    padding: 0.5rem 0.6rem;
  }

  .sidebar .nav-link i {
    width: 1.75rem;
    height: 1.75rem;
  }

  .btn {
    border-radius: 12px;
  }

  .page-header {
    margin-bottom: 0.85rem;
  }

  .page-subtitle {
    font-size: 0.78rem;
  }

  .topbar-user-menu {
    min-width: 240px;
  }

  .dropdown-item {
    padding: 0.52rem 0.62rem;
  }

  .table-responsive {
    border-radius: 12px;
  }
}


/* Auth pages harmonization */
body.auth-page {
  background:
    radial-gradient(900px 320px at 15% 0%, rgba(15, 139, 117, 0.18), rgba(15, 139, 117, 0) 60%),
    radial-gradient(700px 260px at 100% 100%, rgba(224, 155, 45, 0.14), rgba(224, 155, 45, 0) 60%),
    #edf3f3;
}

.auth-bg {
  background: transparent;
}

.auth-left {
  background: linear-gradient(140deg, #14384d 0%, #0f2d3f 55%, #0f8b75 100%);
}

.frost-card {
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 20px 36px rgba(8, 25, 37, 0.26);
}

.login-card {
  color: var(--ds-ink) !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 251, 251, 0.94));
  border: 1px solid #d9e4e8;
  box-shadow: var(--ds-shadow);
}

.login-card p,
.login-card label,
.login-card .text-muted,
.login-card .small {
  color: var(--ds-muted) !important;
}

.login-card .form-control {
  background: #ffffff;
  border-color: #cad8df;
}

/* TagSelect Component - Modern Multi-select */

.tag-select-wrapper {
  position: relative;
  width: 100%;
  margin-bottom: 0.5rem;
}

.tag-select-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
  min-height: 20px;
}

.tag-badge {
  display: inline-flex;
  align-items: center;
  background: #f0f7f6;
  color: var(--ds-brand-strong);
  border: 1px solid rgba(15, 139, 117, 0.2);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  animation: tag-pop 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes tag-pop {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.tag-close {
  background: none;
  border: none;
  padding: 0;
  margin-left: 0.4rem;
  color: var(--ds-brand);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  opacity: 0.6;
  transition: opacity 0.2s, transform 0.2s;
}

.tag-close:hover {
  opacity: 1;
  transform: scale(1.1);
  color: var(--ds-danger);
}

.tag-select-input {
  display: flex;
  align-items: center;
  position: relative;
  background: #fff;
  border: 1px solid #ccd9df;
  border-radius: var(--ds-radius-sm);
  padding: 0.45rem 0.75rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  cursor: text;
}

.tag-select-input:focus-within {
  border-color: var(--ds-brand);
  box-shadow: 0 0 0 0.18rem rgba(15, 139, 117, 0.15);
}

.tag-select-search {
  border: none;
  background: transparent;
  outline: none;
  flex-grow: 1;
  font-size: 0.88rem;
  color: var(--ds-ink);
  min-width: 120px;
}

.tag-select-icon {
  margin-left: 0.5rem;
  color: #8da2af;
  font-size: 0.75rem;
  transition: transform 0.3s;
}

.tag-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #fff;
  border: 1px solid #d6e1e6;
  border-radius: var(--ds-radius-sm);
  margin-top: 4px;
  box-shadow: var(--ds-shadow);
  max-height: 280px;
  overflow-y: auto;
  display: none;
  animation: dropdown-slide 0.2s ease-out;
}

@keyframes dropdown-slide {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.tag-select-dropdown.show {
  display: block;
}

.tag-select-options {
  padding: 0.3rem;
}

.tag-select-option {
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 0.88rem;
  color: #34495e;
  display: flex;
  align-items: center;
}

.tag-select-option:hover {
  background: #f1f6f6;
}

.tag-select-option.selected {
  background: #edf7f5;
  color: var(--ds-brand-strong);
  font-weight: 500;
}

.tag-select-option-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  cursor: pointer;
  margin: 0;
}

.tag-select-option-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--ds-brand);
  cursor: pointer;
}

.login-card .form-control:focus {
  border-color: var(--ds-brand);
  box-shadow: 0 0 0 0.18rem rgba(15, 139, 117, 0.2);
  transform: none;
}

.login-card a {
  color: #1b6f8a;
}

.login-card a:hover {
  color: #14586d;
}

.social-btn {
  border-color: #cfdce2;
}

/* Dashboard indicators */
.dashboard-page {
  max-width: 1480px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.dashboard-toolbar {
  flex-wrap: wrap;
}

.metric-card {
  color: #fff;
  border: none;
  box-shadow: 0 10px 24px rgba(11, 35, 54, 0.16);
}

.metric-card .card-body {
  padding: 1rem;
}

.metric-card-primary {
  background: linear-gradient(130deg, #237995 0%, #1d6378 100%);
}

.metric-card-success {
  background: linear-gradient(130deg, #2f9d6f 0%, #247e58 100%);
}

.metric-card-info {
  background: linear-gradient(130deg, #2f88a5 0%, #256b82 100%);
}

.metric-card-dark {
  background: linear-gradient(130deg, #1c3142 0%, #132634 100%);
}

.metric-label {
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  opacity: 0.92;
}

.metric-value {
  font-size: clamp(1.2rem, 1.8vw, 1.8rem);
  font-weight: 700;
  line-height: 1.1;
}

.metric-meta {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  opacity: 0.9;
}

.indicator-card {
  border: 1px solid #d6e2e7;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbfb 100%);
}

.indicator-title {
  font-size: 0.82rem;
  color: #4e6474;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.indicator-main {
  font-size: clamp(1.3rem, 2vw, 1.8rem);
  font-weight: 700;
  color: #123247;
  line-height: 1.15;
  margin-top: 0.35rem;
}

.indicator-sub {
  margin-top: 0.35rem;
  font-size: 0.86rem;
  color: #5f7280;
}

.mini-progress {
  height: 8px;
  border-radius: 999px;
  background: #e5eef1;
  overflow: hidden;
}

.mini-progress span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0f8b75 0%, #1a6e92 100%);
}

body.dashboard-compact .metric-card .card-body {
  padding: 0.75rem 0.8rem;
}

body.dashboard-compact .indicator-main {
  font-size: 1.5rem;
}

/* Landing impact indicators */
.impact-section {
  background:
    radial-gradient(800px 220px at 0% 0%, rgba(15, 139, 117, 0.08), rgba(15, 139, 117, 0) 65%),
    radial-gradient(700px 260px at 100% 100%, rgba(42, 136, 165, 0.07), rgba(42, 136, 165, 0) 60%),
    #f5faf9;
}

.impact-card {
  background: #fff;
  border: 1px solid #d9e5e9;
  border-radius: 16px;
  box-shadow: 0 10px 22px rgba(15, 49, 71, 0.09);
  padding: 1rem;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.impact-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 28px rgba(15, 49, 71, 0.14);
}

.impact-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.7rem;
  color: #ffffff;
  background: linear-gradient(140deg, #0f8b75 0%, #1f7196 100%);
}

.impact-value {
  font-size: clamp(1.3rem, 2.2vw, 1.95rem);
  font-weight: 700;
  color: #133145;
  line-height: 1.1;
}

.impact-label {
  margin-top: 0.45rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: #203746;
}

.impact-meta {
  margin-top: 0.2rem;
  font-size: 0.8rem;
  color: #62808e;
}

@media (max-width: 992px) {
  .dashboard-page {
    padding-top: 0.55rem !important;
  }

  .dashboard-header {
    margin-bottom: 0.9rem !important;
  }

  .dashboard-toolbar {
    width: 100%;
  }

  .dashboard-toolbar .btn-group,
  .dashboard-toolbar .form-check {
    width: 100%;
  }

  .dashboard-toolbar .btn-group label {
    flex: 1;
  }
}

@media (max-width: 576px) {
  .dashboard-header {
    text-align: center;
    align-items: center !important;
  }

  .dashboard-header .dashboard-toolbar {
    justify-content: center;
  }

  .metric-label {
    font-size: 0.8rem;
  }

  .metric-meta {
    font-size: 0.73rem;
  }

  .indicator-sub {
    font-size: 0.8rem;
  }

  .impact-card {
    padding: 0.9rem;
  }
}

/* Landing page harmonization */
body.landing-page {
  background:
    radial-gradient(1000px 320px at -10% -5%, rgba(15, 139, 117, 0.14), rgba(15, 139, 117, 0) 62%),
    radial-gradient(920px 280px at 110% -10%, rgba(224, 155, 45, 0.12), rgba(224, 155, 45, 0) 60%),
    #edf3f3;
}

.landing-header {
  position: sticky;
  top: 0;
  z-index: 1025;
  backdrop-filter: blur(8px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 252, 251, 0.94));
  border-bottom: 1px solid #d6e2e7;
}

.landing-content section {
  padding-block: clamp(3.2rem, 6vw, 5.8rem);
}

.landing-content .section-title {
  font-size: clamp(1.65rem, 3.3vw, 2.45rem);
  line-height: 1.2;
  color: #123247;
  margin-bottom: 0.75rem;
}

.landing-content .section-subtitle {
  max-width: 780px;
  margin: 0 auto;
  font-size: clamp(0.96rem, 1.6vw, 1.1rem);
  color: #5d7382;
}

.landing-content .hero-section {
  background:
    radial-gradient(700px 260px at 100% 0%, rgba(31, 113, 150, 0.1), rgba(31, 113, 150, 0) 60%),
    linear-gradient(180deg, #f6fbfb 0%, #edf5f5 100%);
}

.landing-content .hero-title {
  font-size: clamp(2.05rem, 4.4vw, 3.15rem);
  color: #102d3f;
}

.landing-content .hero-subtitle {
  color: #4f6574;
  max-width: 640px;
}

.landing-content .hero-stats {
  border: 1px solid #d7e4e9;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  padding: 0.9rem 0.5rem;
}

.landing-content .feature-card,
.landing-content .testimonial-card,
.landing-content .pricing-card,
.landing-content .cta-form-card,
.landing-content .accordion-item {
  border: 1px solid #d7e3e8;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(12, 40, 58, 0.08);
}

.landing-content .feature-card,
.landing-content .testimonial-card,
.landing-content .pricing-card,
.landing-content .cta-form-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fcfc 100%);
}

.landing-content .feature-card:hover,
.landing-content .testimonial-card:hover,
.landing-content .pricing-card:hover,
.landing-content .impact-card:hover,
.landing-content .image-frame:hover {
  transform: translateY(-6px);
}

.landing-content .pricing-card {
  overflow: hidden;
}

.landing-content .pricing-title {
  color: #143547;
  font-size: 1.3rem;
}

.landing-content .pricing-price .display-4 {
  font-size: clamp(1.8rem, 3vw, 2.25rem);
  font-weight: 700;
  color: #0f8b75;
}

.landing-content .pricing-features li {
  color: #294656;
}

.landing-content .faq-section .accordion-button {
  background: linear-gradient(180deg, #ffffff 0%, #f6fbfb 100%);
  color: #163a4d;
  font-weight: 600;
  border-radius: 14px !important;
}

.landing-content .faq-section .accordion-button:not(.collapsed) {
  background: linear-gradient(180deg, #ebf5f3 0%, #e4f0ee 100%);
  color: #0f3a4f;
  box-shadow: inset 0 -1px 0 rgba(15, 139, 117, 0.08);
}

.landing-content .faq-section .accordion-body {
  color: #4d6574;
}

.landing-content .cta-section {
  background:
    radial-gradient(720px 260px at 0% 50%, rgba(15, 139, 117, 0.08), rgba(15, 139, 117, 0) 60%),
    linear-gradient(180deg, #f4faf9 0%, #ffffff 100%);
}

.landing-content .final-cta-section {
  background: linear-gradient(140deg, #123247 0%, #0f6c5d 100%);
}

.landing-content .btn {
  border-radius: 999px;
  font-weight: 600;
}

.landing-content .demo-message-textarea {
  min-height: 100px;
  height: 100px;
  padding-top: 2.2rem !important;
}
.landing-content .demo-message-textarea:focus,
.landing-content .demo-message-textarea:not(:placeholder-shown) {
  padding-top: 2.2rem !important;
}
.landing-content .form-floating > .form-control {
  padding-top: 1.8rem !important;
}

@media (max-width: 992px) {
  .landing-content section {
    padding-block: 3.4rem;
  }

  .landing-content .hero-title,
  .landing-content .hero-subtitle {
    text-align: center;
  }

  .landing-content .hero-cta {
    justify-content: center;
  }

  .landing-content .hero-stats {
    margin-inline: auto;
    max-width: 460px;
  }
}

@media (max-width: 768px) {
  .landing-header {
    padding-block: 0.65rem !important;
  }

  .landing-content .hero-cta {
    flex-direction: column;
  }

  .landing-content .hero-cta .btn,
  .landing-content .final-cta-buttons .btn {
    width: 100%;
  }

  .landing-content .cta-form-card {
    padding: 1.15rem;
  }
}

/* Landing: refinements for a more professional & friendly look */
.landing-content .page-shell {
  padding: 0;
}
.landing-content .hero-section {
  padding-block: 0;
}

.landing-content .hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: linear-gradient(90deg, rgba(15,139,117,0.12), rgba(15,139,117,0.04));
  color: #0f6c5d;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.landing-content .hero-title {
  font-weight: 800;
  letter-spacing: -0.015em;
  color: #0b3640;
}

.landing-content .hero-subtitle {
  font-size: clamp(1rem, 1.45vw, 1.15rem);
  color: #4b6370;
}

.landing-content .hero-cta .btn {
  min-width: 180px;
}

.btn-gradient {
  background: linear-gradient(90deg, #0f8b75 0%, #1a91b8 100%);
  color: #fff;
  border: none;
  box-shadow: 0 12px 30px rgba(15, 139, 117, 0.16);
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.btn-gradient:hover,
.btn-gradient:focus {
  transform: translateY(-4px);
  box-shadow: 0 18px 42px rgba(14, 113, 95, 0.18);
}

.landing-content .hero-visual {
  border-radius: 18px;
  padding: 1rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.85), rgba(248,252,252,0.7));
  box-shadow: 0 20px 40px rgba(9, 33, 40, 0.08);
}

.landing-content .dashboard-mockup {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(20, 50, 60, 0.06);
  background: linear-gradient(180deg, #ffffff 0%, #f6fbfb 100%);
}

.landing-content .floating-card {
  border-radius: 14px;
  padding: 0.6rem 0.8rem;
  box-shadow: 0 8px 20px rgba(10, 40, 50, 0.08);
  background: #fff;
}

.landing-content .benefit-item {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
}

.landing-content .benefit-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, #0f8b75 0%, #1a91b8 100%);
  box-shadow: 0 8px 18px rgba(16, 100, 84, 0.12);
}

.landing-content .testimonial-card {
  padding: 1.25rem;
}

.landing-content .testimonial-author .author-avatar img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 999px;
  border: 2px solid rgba(15,139,117,0.12);
}

.landing-content .testimonial-card blockquote {
  font-style: normal;
  color: #27414a;
  margin-bottom: 0.9rem;
}

.landing-content .cta-form-card {
  padding: 1.35rem;
  border-radius: 14px;
}

.landing-content .form-footer-text {
  font-size: 0.82rem;
  color: #6b8b8a;
}

.landing-content .trust-logos img {
  max-height: 44px;
  opacity: 0.86;
  filter: grayscale(0.02) saturate(0.9);
  margin: 0 0.85rem;
  transition: transform 180ms ease, opacity 180ms ease;
}

.landing-content .trust-logos img:hover {
  transform: translateY(-4px);
  opacity: 1;
}

/* small animation helpers */
.fade-up { transform: translateY(12px); opacity: 0; transition: transform 420ms ease, opacity 420ms ease; }
.fade-up.in-view { transform: translateY(0); opacity: 1; }

/* How it works section landing */
.landing-content .how-it-works-section {
  background: linear-gradient(180deg, #ffffff 0%, #f6fbfb 100%);
}

.landing-content .how-it-works-section .step-card {
  background: #fff;
  border: 1px solid #d9e5e9;
  box-shadow: 0 10px 22px rgba(15, 49, 71, 0.06);
}

.landing-content .how-it-works-section .step-card:hover {
  border-color: rgba(15,139,117,0.2);
}

.landing-content .how-it-works-section .step-subtitle {
  color: #4b6370;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Stats counter section landing */
.landing-content .stats-counter-section {
  background:
    radial-gradient(800px 220px at 50% 0%, rgba(15, 139, 117, 0.06), rgba(15, 139, 117, 0) 65%),
    #ffffff;
  border-top: 1px solid rgba(0,0,0,0.04);
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

.landing-content .stats-counter-section .stat-counter-item {
  border-right: 1px solid rgba(0,0,0,0.06);
}

.landing-content .stats-counter-section .stat-counter-item:last-child {
  border-right: none;
}

@media (max-width: 767.98px) {
  .landing-content .stats-counter-section .stat-counter-item {
    border-right: none;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    padding: 1.2rem 0;
  }
  .landing-content .stats-counter-section .stat-counter-item:last-child {
    border-bottom: none;
  }
}

/* Screenshots blocks */
.landing-content .screenshots-section .screenshot-block {
  background: linear-gradient(180deg, #ffffff 0%, #f8fcfc 100%);
}

/* Feature tags inline */
.landing-content .features-section .feature-tags .tag {
  background: rgba(15,139,117,0.08);
  color: #0f6c5d;
  border: 1px solid rgba(15,139,117,0.1);
}

/* CTA benefits check styling */
.landing-content .cta-section .benefit-check {
  font-size: 0.95rem;
}

.landing-content .cta-section .benefit-check i {
  font-size: 1.1rem;
}

/* Hero stats enhanced */
.landing-content .hero-section .display-stat .stat-value {
  font-size: 2rem;
}

/* Remove duplicate background from landing hero */
.landing-content .hero-section::before {
  display: none;
}

/* Final CTA text opacity refinement */
.landing-content .final-cta-section .lead {
  opacity: 0.8 !important;
}

/* Pricing card recommended badge */
.landing-content .pricing-section .badge.bg-success {
  background: rgba(15,139,117,0.1) !important;
  color: #0f6c5d !important;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 999px;
}

/* Pricing card price monthly hint */
.landing-content .pricing-section .pricing-price + div small {
  font-size: 0.82rem;
}

/* Text type badges */
.type-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 500;
  font-size: 0.8rem;
}

/* Conformity evaluation page */
.eval-page-header {
  background: linear-gradient(150deg, #ffffff 0%, #f3f9f9 100%);
  border: 1px solid #d8e5ea;
}
.eval-kpi-card {
  border: 1px solid #dce7ec;
  box-shadow: 0 10px 24px rgba(15, 49, 71, 0.08);
  height: 100%;
}
.eval-kpi-card .kpi-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #58707f;
  font-weight: 700;
}
.eval-kpi-card .kpi-value {
  font-size: clamp(1.4rem, 2.2vw, 2rem);
  line-height: 1.1;
  font-weight: 700;
  color: #173447;
}
.eval-kpi-card .kpi-meta {
  font-size: 0.8rem;
  color: #5d7381;
}
.eval-rate-track {
  height: 9px;
  border-radius: 999px;
  background: #e6eff3;
  overflow: hidden;
}
.eval-rate-track span {
  display: block;
  height: 100%;
  border-radius: 999px;
}
.eval-rate-track .bar-coverage {
  background: linear-gradient(90deg, #2b88a7 0%, #1e6f88 100%);
}
.eval-rate-track .bar-conformity {
  background: linear-gradient(90deg, #2e9d70 0%, #257b5a 100%);
}
.eval-rate-track .bar-risk {
  background: linear-gradient(90deg, #d45454 0%, #b74343 100%);
}
.eval-toolbar {
  border: 1px solid #dce7ec;
  background: #ffffff;
}
.eval-table-wrap {
  border-radius: 14px;
}
.eval-table {
  min-width: 980px;
}
.eval-content-preview {
  max-height: 132px;
  overflow: auto;
  font-size: 0.9rem;
  line-height: 1.35;
  color: #32495a;
}
.eval-content-preview p:last-child {
  margin-bottom: 0;
}
.eval-highlight-risk {
  outline: 1px solid rgba(198, 69, 69, 0.32);
  background: linear-gradient(180deg, rgba(198, 69, 69, 0.08), rgba(198, 69, 69, 0.03));
}
.table-danger-light {
  background-color: rgba(220, 53, 69, 0.05) !important;
}
.eval-table tr:hover {
  background-color: rgba(43, 136, 167, 0.03) !important;
}
.eval-pagination .page-link {
  color: #2b88a7;
  border: 1px solid #dee2e6;
  padding: 0.4rem 0.75rem;
}
.eval-pagination .page-item.active .page-link {
  background-color: #2b88a7;
  border-color: #2b88a7;
  color: white;
}
.eval-sticky-toolbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #dee2e6;
}

.eval-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  justify-content: center;
}
.eval-radio-group-compact {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  justify-content: center;
}
.eval-radio-group-compact .radio-label {
  width: 34px;
  height: 34px;
  padding: 6px;
  border-width: 1.5px;
}
.eval-radio-group-compact .radio-label i {
  font-size: 14px;
  width: 100%;
  height: 100%;
  line-height: 1;
}
.eval-radio-wrapper {
  position: relative;
}
.eval-radio {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}
.eval-radio-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: 2px solid #e9ecef;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  font-size: 0.85rem;
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  position: relative;
  white-space: nowrap;
}
.eval-radio-label:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: #ccd9df;
}
.eval-radio-label i {
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.eval-radio:checked + .eval-radio-label {
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}
.eval-radio.applicable:checked + .eval-radio-label.applicable {
  background-color: #e8f5e9;
  border-color: #28a745;
  color: #28a745;
}
.eval-radio.applicable[value="NON_APPLICABLE"]:checked + .eval-radio-label.applicable {
  background-color: #ffeaea;
  border-color: #dc3545;
  color: #dc3545;
}
.eval-radio.applicable[value="A_CONFIRMER"]:checked + .eval-radio-label.applicable {
  background-color: #e3f2fd;
  border-color: #17a2b8;
  color: #17a2b8;
}
.eval-radio.applicable[value="INFORMATION"]:checked + .eval-radio-label.applicable {
  background-color: #f1f3f5;
  border-color: #6c757d;
  color: #495057;
}
.eval-radio.conforme:checked + .eval-radio-label.conforme {
  background-color: #e8f5e9;
  border-color: #28a745;
  color: #28a745;
}
.eval-radio.conforme[value="NON_CONFORME"]:checked + .eval-radio-label.conforme {
  background-color: #ffeaea;
  border-color: #dc3545;
  color: #dc3545;
}
.eval-radio.conforme[value="EN_COURS"]:checked + .eval-radio-label.conforme {
  background-color: #fff3cd;
  border-color: #ffc107;
  color: #856404;
}
.eval-radio:disabled + .eval-radio-label {
  background-color: #f8f9fa !important;
  border-color: #dee2e6 !important;
  color: #6c757d !important;
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  transform: none !important;
  box-shadow: none !important;
}

@media (max-width: 992px) {
  .eval-table { min-width: 860px; }
  .eval-kpi-card .kpi-meta { font-size: 0.74rem; }
}
@media (max-width: 576px) {
  .eval-radio-label {
    padding: 6px 12px;
    font-size: 0.78rem;
    gap: 4px;
  }
  .eval-radio-label i {
    font-size: 14px;
  }
  .eval-kpi-card .kpi-value { font-size: 1.25rem; }
}


/* touch */
