:root {
  --bg: #ecf4ef;
  --bg-soft: #f8fbf9;
  --card: rgba(255, 255, 255, 0.84);
  --card-border: rgba(11, 36, 30, 0.09);
  --text: #10221a;
  --muted: #5b6b62;
  --primary: #0f7a5f;
  --primary-strong: #065b45;
  --accent: #1a88d9;
  --danger: #b84545;
  --surface-1: rgba(255, 255, 255, 0.84);
  --surface-2: rgba(255, 255, 255, 0.76);
  --surface-3: rgba(247, 251, 249, 0.86);
  --surface-elevated: rgba(255, 255, 255, 0.92);
  --surface-soft: rgba(255, 255, 255, 0.72);
  --surface-overlay: rgba(8, 34, 27, 0.44);
  --border-soft: rgba(16, 34, 26, 0.1);
  --border-strong: rgba(14, 43, 34, 0.18);
  --input-bg: rgba(255, 255, 255, 0.94);
  --input-border: rgba(14, 43, 34, 0.2);
  --placeholder: rgba(14, 43, 34, 0.24);
  --separator: rgba(16, 34, 26, 0.1);
  --link: #0d557e;
  --focus-ring: rgba(26, 136, 217, 0.4);
  --status-in-progress-accent: #e4a11a;
  --status-in-progress-text: #9a6200;
  --status-in-progress-bg: rgba(228, 161, 26, 0.16);
  --status-in-progress-bg-soft: rgba(228, 161, 26, 0.1);
  --status-in-progress-bg-faint: rgba(228, 161, 26, 0.07);
  --status-in-progress-border: rgba(228, 161, 26, 0.18);
  --status-in-progress-border-soft: rgba(228, 161, 26, 0.12);
  --hero-border: rgba(16, 34, 26, 0.1);
  --hero-bg:
    radial-gradient(circle at 100% 0%, rgba(26, 136, 217, 0.16), transparent 34%),
    radial-gradient(circle at 0% 100%, rgba(15, 122, 95, 0.12), transparent 38%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.68), rgba(243, 249, 246, 0.74));
  --hero-rule: linear-gradient(90deg, rgba(15, 122, 95, 0), rgba(15, 122, 95, 0.24), rgba(26, 136, 217, 0));
  --panel-bg: linear-gradient(155deg, rgba(255, 255, 255, 0.9), rgba(246, 252, 249, 0.92));
  --panel-inner: rgba(255, 255, 255, 0.82);
  --panel-inner-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.78);
  --panel-heading: #395147;
  --panel-title: #0a372b;
  --day-btn-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 248, 244, 0.96));
  --day-btn-outside: rgba(245, 248, 246, 0.72);
  --day-btn-border: rgba(16, 34, 26, 0.13);
  --secondary-bg: rgba(15, 122, 95, 0.1);
  --secondary-border: rgba(15, 122, 95, 0.24);
  --secondary-text: #0a2d23;
  --ghost-bg: rgba(255, 255, 255, 0.7);
  --ghost-border: rgba(14, 43, 34, 0.18);
  --ghost-text: #21453a;
  --danger-bg: rgba(184, 69, 69, 0.12);
  --danger-border: rgba(184, 69, 69, 0.28);
  --danger-text: #7a2121;
  --popup-bg:
    radial-gradient(circle at 100% 0%, rgba(161, 239, 220, 0.18), transparent 48%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 251, 247, 0.96));
  --popup-border: rgba(13, 92, 71, 0.24);
  --popup-shadow:
    0 28px 52px rgba(5, 33, 26, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.62) inset;
  --weather-popup-bg:
    radial-gradient(circle at 95% 0%, rgba(255, 223, 181, 0.2), transparent 45%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 251, 247, 0.96));
  --weather-popup-shadow:
    0 26px 48px rgba(6, 33, 26, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  --radius-xl: 24px;
  --radius-lg: 16px;
  --shadow-soft: 0 18px 45px rgba(10, 32, 24, 0.09);
}

html {
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

html[data-theme="dark"] {
  --bg: #07110e;
  --bg-soft: #0c1814;
  --card: rgba(12, 23, 20, 0.88);
  --card-border: rgba(129, 160, 148, 0.18);
  --text: #edf7f1;
  --muted: #9fb5ab;
  --surface-1: rgba(12, 23, 20, 0.88);
  --surface-2: rgba(14, 28, 24, 0.9);
  --surface-3: rgba(17, 31, 27, 0.94);
  --surface-elevated: rgba(18, 34, 29, 0.96);
  --surface-soft: rgba(20, 36, 31, 0.8);
  --surface-overlay: rgba(2, 10, 8, 0.7);
  --border-soft: rgba(129, 160, 148, 0.16);
  --border-strong: rgba(148, 181, 169, 0.22);
  --input-bg: rgba(11, 22, 19, 0.94);
  --input-border: rgba(126, 159, 147, 0.2);
  --placeholder: rgba(201, 219, 211, 0.34);
  --separator: rgba(129, 160, 148, 0.16);
  --link: #71bdf3;
  --focus-ring: rgba(73, 169, 232, 0.48);
  --status-in-progress-accent: #f0b548;
  --status-in-progress-text: #ffd27d;
  --status-in-progress-bg: rgba(228, 161, 26, 0.18);
  --status-in-progress-bg-soft: rgba(240, 181, 72, 0.11);
  --status-in-progress-bg-faint: rgba(240, 181, 72, 0.07);
  --status-in-progress-border: rgba(240, 181, 72, 0.22);
  --status-in-progress-border-soft: rgba(240, 181, 72, 0.14);
  --hero-border: rgba(129, 160, 148, 0.14);
  --hero-bg:
    radial-gradient(circle at 100% 0%, rgba(52, 128, 194, 0.26), transparent 34%),
    radial-gradient(circle at 0% 100%, rgba(25, 120, 93, 0.22), transparent 40%),
    linear-gradient(135deg, rgba(11, 23, 20, 0.94), rgba(18, 33, 29, 0.94));
  --hero-rule: linear-gradient(90deg, rgba(26, 136, 217, 0), rgba(26, 136, 217, 0.32), rgba(15, 122, 95, 0));
  --panel-bg: linear-gradient(155deg, rgba(10, 21, 18, 0.96), rgba(17, 31, 27, 0.96));
  --panel-inner: rgba(11, 22, 19, 0.88);
  --panel-inner-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  --panel-heading: #b4c9c0;
  --panel-title: #f1fbf6;
  --day-btn-bg: linear-gradient(180deg, rgba(14, 28, 24, 0.98), rgba(17, 32, 28, 0.96));
  --day-btn-outside: rgba(15, 26, 23, 0.82);
  --day-btn-border: rgba(129, 160, 148, 0.18);
  --secondary-bg: rgba(15, 122, 95, 0.18);
  --secondary-border: rgba(59, 156, 127, 0.32);
  --secondary-text: #dff8ee;
  --ghost-bg: rgba(255, 255, 255, 0.04);
  --ghost-border: rgba(148, 181, 169, 0.18);
  --ghost-text: #d5e7df;
  --danger-bg: rgba(184, 69, 69, 0.18);
  --danger-border: rgba(214, 101, 101, 0.28);
  --danger-text: #ffd7d7;
  --popup-bg:
    radial-gradient(circle at 100% 0%, rgba(18, 126, 95, 0.22), transparent 48%),
    linear-gradient(180deg, rgba(11, 22, 19, 0.98), rgba(17, 31, 27, 0.98));
  --popup-border: rgba(80, 156, 131, 0.26);
  --popup-shadow:
    0 28px 52px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  --weather-popup-bg:
    radial-gradient(circle at 95% 0%, rgba(176, 103, 24, 0.16), transparent 45%),
    linear-gradient(180deg, rgba(11, 22, 19, 0.98), rgba(17, 31, 27, 0.98));
  --weather-popup-shadow:
    0 26px 48px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  --shadow-soft: 0 24px 56px rgba(0, 0, 0, 0.34);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 5%, #d5efe4 0%, transparent 38%),
    radial-gradient(circle at 92% 12%, #d5e7ff 0%, transparent 35%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
}

.hidden {
  display: none !important;
}

.bg-orb {
  position: fixed;
  pointer-events: none;
  filter: blur(10px);
  z-index: 0;
}

.bg-orb-a {
  width: 280px;
  height: 280px;
  right: -90px;
  top: 10%;
  background: radial-gradient(circle, rgba(20, 139, 202, 0.25), rgba(20, 139, 202, 0));
}

.bg-orb-b {
  width: 340px;
  height: 340px;
  left: -120px;
  bottom: 5%;
  background: radial-gradient(circle, rgba(8, 135, 96, 0.2), rgba(8, 135, 96, 0));
}

.auth-gate {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 28px 20px 40px;
}

.auth-card {
  width: min(740px, 100%);
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  padding: 22px;
}

.auth-form {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.field > .password-input-wrap {
  position: relative;
  display: block;
  margin-bottom: 0;
  font-size: inherit;
  font-weight: inherit;
}

.password-input-wrap > input {
  width: 100%;
  padding-right: 48px;
}

.password-visibility-btn {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.password-visibility-btn:hover {
  background: var(--secondary-bg);
  color: var(--text);
}

.password-visibility-btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

.password-eye-icon {
  grid-area: 1 / 1;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.password-eye-hidden,
.password-visibility-btn[aria-pressed="true"] .password-eye-visible {
  display: none;
}

.password-visibility-btn[aria-pressed="true"] .password-eye-hidden {
  display: block;
}

.auth-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.auth-switch label {
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  min-width: 0;
  color: var(--muted);
  font-weight: 600;
}

.auth-switch input[type="radio"] {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  accent-color: #1a88d9;
}

.auth-message {
  min-height: 1.2em;
  margin: 0;
  font-weight: 600;
  color: #064f78;
}

.auth-registration-notice {
  margin: -4px 0 0;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(15, 122, 95, 0.12);
  background: rgba(241, 248, 244, 0.92);
  color: #4b655c;
  font-size: 0.9rem;
}

.auth-trial-note {
  margin: -2px 0 0;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(15, 122, 95, 0.14);
  background: linear-gradient(180deg, rgba(241, 249, 245, 0.96), rgba(232, 245, 239, 0.92));
  color: #2d5447;
  font-size: 0.9rem;
  line-height: 1.45;
}

.auth-admin-note {
  margin: -6px 0 0;
  color: #5b7168;
  font-size: 0.84rem;
  line-height: 1.4;
}

.auth-aux {
  margin-top: 10px;
}

.link-btn {
  border: 0;
  background: transparent;
  padding: 0;
  color: #0d557e;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.forgot-form {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(16, 34, 26, 0.1);
  display: grid;
  gap: 10px;
}

.forgot-message {
  min-height: 1.2em;
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: #064f78;
}

.forgot-message.success {
  color: #05543f;
}

.forgot-message.warning {
  color: #7b4c00;
}

.forgot-message.danger {
  color: #7a2121;
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1160px;
  margin: 0 auto;
  padding: 28px 18px 44px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  align-items: stretch;
  gap: 16px;
  margin-bottom: 28px;
}

.topbar-hero {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 790px;
  min-height: 156px;
  padding: clamp(14px, 1.8vw, 18px);
  border: 1px solid rgba(16, 34, 26, 0.1);
  border-radius: 30px;
  background:
    radial-gradient(circle at 100% 0%, rgba(26, 136, 217, 0.16), transparent 34%),
    radial-gradient(circle at 0% 100%, rgba(15, 122, 95, 0.12), transparent 38%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.68), rgba(243, 249, 246, 0.74));
  box-shadow: var(--shadow-soft);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 310px);
  gap: clamp(12px, 1.6vw, 18px);
  align-items: center;
}

.topbar-hero::after {
  content: "";
  position: absolute;
  inset: auto 22px 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(15, 122, 95, 0), rgba(15, 122, 95, 0.24), rgba(26, 136, 217, 0));
}

.topbar-actions {
  display: grid;
  align-content: center;
  justify-items: stretch;
  gap: 10px;
}

.topbar-actions > .btn {
  width: 100%;
}

.topbar-theme-toggle {
  position: fixed;
  top: max(14px, calc(env(safe-area-inset-top, 0px) + 14px));
  right: max(14px, calc(env(safe-area-inset-right, 0px) + 14px));
  z-index: 80;
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(16, 34, 26, 0.1);
  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0%, rgba(26, 136, 217, 0.14), transparent 50%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(244, 250, 247, 0.82));
  color: #24483c;
  box-shadow:
    0 14px 28px rgba(9, 35, 28, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.74);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

.topbar-theme-toggle::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 60%);
  pointer-events: none;
}

.topbar-theme-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 122, 95, 0.22);
  box-shadow:
    0 16px 30px rgba(9, 35, 28, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.topbar-theme-toggle:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.topbar-theme-toggle-icon {
  position: absolute;
  width: 16px;
  height: 16px;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.topbar-theme-toggle-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.topbar-theme-toggle-icon-sun {
  opacity: 0;
  transform: translateY(6px) scale(0.78);
}

.topbar-theme-toggle-icon-auto {
  opacity: 0;
  transform: translateY(0) scale(1);
}

.topbar-theme-toggle-icon-moon {
  opacity: 0;
  transform: translateY(6px) scale(0.78);
}

#accountMenuBtn {
  order: 1;
}

#btnPlanning {
  order: 2;
}

#adminStatisticsBtn {
  order: 3;
}

.topbar-brand {
  display: grid;
  align-content: center;
  gap: 12px;
  max-width: 620px;
  min-width: 0;
}

.account-panel-shell {
  margin-bottom: 18px;
}

.account-panel-card {
  padding: 20px;
}

.account-panel-head h2 {
  margin: 0;
  font-size: clamp(1.45rem, 2.9vw, 2rem);
  line-height: 1.05;
}

.account-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.account-quick-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.account-style {
  margin-top: 12px;
  border-top: 1px solid rgba(16, 34, 26, 0.1);
  padding-top: 12px;
}

.account-style .card-head {
  margin-bottom: 10px;
}

.account-style .card-head h3 {
  margin: 0;
  font-size: 1rem;
}

.account-settings-launch {
  margin-top: 14px;
  border-top: 1px solid rgba(16, 34, 26, 0.1);
  padding-top: 12px;
}

.account-settings {
  margin-top: 12px;
  border: 1px solid rgba(16, 34, 26, 0.1);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.76);
  padding: 12px;
}

.account-settings .card-head {
  margin-bottom: 10px;
}

.account-settings .card-head h3 {
  margin: 0;
  font-size: 1rem;
}

.account-settings .account-quick-actions {
  margin-bottom: 10px;
}

.appearance-settings {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: var(--surface-3);
}

.appearance-settings-head h4 {
  margin: 0;
  font-size: 0.98rem;
}

.appearance-settings-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.appearance-theme-field {
  margin-top: 10px;
}

.appearance-theme-hint {
  margin: 8px 0 0;
}

.account-legal {
  border: 1px dashed rgba(16, 34, 26, 0.2);
  border-radius: 12px;
  background: rgba(247, 251, 249, 0.86);
  padding: 10px;
  display: grid;
  gap: 12px;
}

.account-legal + .account-legal {
  margin-top: 12px;
}

.account-legal-title {
  margin: 0 0 6px;
  font-weight: 800;
}

.account-legal p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.account-legal p + p {
  margin-top: 6px;
}

.account-legal-section h4 {
  margin: 0 0 6px;
  font-size: 0.96rem;
}

.account-legal-list {
  margin: 6px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.9rem;
}

.account-legal-list li + li {
  margin-top: 6px;
}

.account-security-block {
  margin-top: 12px;
  border: 1px solid rgba(16, 34, 26, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  padding: 10px;
}

.account-security {
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
}

.account-security .card-head {
  margin-bottom: 10px;
}

.account-security .card-head h3 {
  margin: 0;
  font-size: 1rem;
}

.security-form .actions {
  margin-top: 12px;
}

.account-danger-zone {
  margin-top: 12px;
  border: 1px solid rgba(184, 69, 69, 0.24);
  border-radius: 12px;
  background: rgba(184, 69, 69, 0.08);
  padding: 10px;
}

.account-danger-title {
  margin: 0 0 4px;
  font-weight: 800;
  color: #7a2121;
}

.account-danger-zone p {
  margin: 0;
  color: #6a2c2c;
  font-size: 0.9rem;
}

.account-retention-notice {
  line-height: 1.55;
}

.account-retention-notice.warning {
  color: #8a4a00;
  font-weight: 700;
}

.account-danger-zone .btn {
  margin-top: 10px;
}

.account-feedback {
  min-height: 1.2em;
  margin: 10px 0 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--muted);
}

.account-feedback.success {
  color: #05543f;
}

.account-feedback.warning {
  color: #7b4c00;
}

.account-feedback.danger {
  color: #7a2121;
}

.admin-statistics-panel {
  margin-bottom: 18px;
}

.admin-statistics-card {
  padding: 20px;
}

.admin-statistics-head h2 {
  margin: 2px 0 6px;
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
}

.admin-statistics-kicker {
  margin: 0;
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.admin-statistics-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.admin-statistics-filters {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background: var(--surface-3);
  display: grid;
  grid-template-columns: minmax(185px, 0.55fr) minmax(260px, 1fr);
  align-items: center;
  gap: 18px;
}

.admin-statistics-filter-summary {
  min-height: 56px;
  padding-right: 18px;
  border-right: 1px solid var(--border-soft);
  display: grid;
  align-content: center;
  gap: 3px;
}

.admin-statistics-filter-summary > span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.045em;
}

.admin-statistics-filter-summary > strong {
  color: var(--text);
  font-size: 1rem;
}

.admin-statistics-filter-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.admin-statistics-period-switch {
  padding: 4px;
  border-radius: 12px;
  background: rgba(15, 122, 95, 0.08);
  display: inline-flex;
  gap: 3px;
}

.admin-statistics-period-option {
  appearance: none;
  min-height: 42px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 8px 17px;
  cursor: pointer;
  transition:
    color 150ms ease,
    background 150ms ease,
    box-shadow 150ms ease;
}

.admin-statistics-period-option:hover {
  color: var(--text);
}

.admin-statistics-period-option.is-selected {
  background: var(--card);
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(15, 122, 95, 0.13);
}

.admin-statistics-filter-field {
  min-width: 175px;
  display: grid;
  gap: 5px;
}

.admin-statistics-filter-field span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.admin-statistics-filter-field input {
  min-height: 44px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  padding: 7px 10px;
  font: inherit;
}

.admin-statistics-status {
  min-height: 1.1em;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.admin-statistics-status.danger {
  color: #7a2121;
}

.admin-statistics-content {
  margin-top: 14px;
  display: grid;
  gap: 16px;
}

.admin-statistics-section {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background: var(--surface-3);
  padding: 14px;
}

.admin-statistics-section h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.admin-statistics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.admin-statistics-metric {
  position: relative;
  min-height: 86px;
  border: 1px solid rgba(15, 122, 95, 0.14);
  border-radius: 14px;
  background: var(--card);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.admin-statistics-metric:hover,
.admin-statistics-metric:focus-within {
  border-color: rgba(15, 122, 95, 0.38);
  box-shadow: 0 10px 22px rgba(15, 122, 95, 0.1);
  transform: translateY(-1px);
}

.admin-statistics-metric-main {
  appearance: none;
  width: 100%;
  min-height: 84px;
  color: inherit;
  font: inherit;
  text-align: left;
  border: 0;
  border-radius: inherit;
  background: transparent;
  padding: 11px 42px 11px 11px;
  display: grid;
  align-content: space-between;
  gap: 7px;
  cursor: pointer;
}

.admin-statistics-metric-main:focus-visible,
.admin-statistics-help-btn:focus-visible {
  outline: 2px solid rgba(15, 122, 95, 0.5);
  outline-offset: 1px;
}

.admin-statistics-metric strong {
  color: var(--text);
  font-size: clamp(1.3rem, 2vw, 1.7rem);
  line-height: 1;
}

.admin-statistics-metric span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.3;
}

.admin-statistics-help-btn {
  appearance: none;
  position: absolute;
  top: 9px;
  right: 9px;
  width: 25px;
  height: 25px;
  border: 1px solid rgba(15, 122, 95, 0.24);
  border-radius: 999px;
  background: rgba(15, 122, 95, 0.06);
  color: var(--primary);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.admin-statistics-help-btn:hover {
  background: rgba(15, 122, 95, 0.14);
  border-color: rgba(15, 122, 95, 0.42);
}

.admin-statistics-feature-list,
.admin-statistics-month-list {
  display: grid;
  gap: 8px;
}

.admin-statistics-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(16, 34, 26, 0.08);
  border-radius: 12px;
  background: var(--card);
  padding: 10px 12px;
  font-size: 0.9rem;
}

.admin-statistics-row.is-clickable {
  appearance: none;
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.admin-statistics-row.is-clickable:hover,
.admin-statistics-row.is-clickable:focus-visible {
  border-color: rgba(15, 122, 95, 0.32);
  background: rgba(15, 122, 95, 0.06);
}

.admin-statistics-row strong {
  color: var(--text);
}

.admin-statistics-row span {
  color: var(--muted);
}

.admin-statistics-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.admin-statistic-detail-card {
  width: min(940px, 100%);
  max-height: min(88vh, 920px);
}

.admin-statistic-detail-head {
  flex-shrink: 0;
}

.admin-statistic-detail-body {
  max-height: min(62vh, 640px);
  overflow-y: auto;
  display: grid;
  gap: 9px;
  padding-right: 3px;
}

.admin-statistic-detail-empty {
  margin: 0;
  color: var(--muted);
  padding: 16px 0;
}

.admin-statistic-help-card {
  width: min(550px, 100%);
}

.admin-statistic-help-text {
  margin: 0;
  color: var(--text);
  font-size: 0.96rem;
  line-height: 1.6;
}

.admin-statistic-account {
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: var(--surface-3);
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(210px, 1.35fr) repeat(3, minmax(110px, 0.72fr));
  align-items: center;
  gap: 12px;
}

.admin-statistic-account.has-action {
  grid-template-columns: minmax(210px, 1.35fr) repeat(3, minmax(110px, 0.72fr)) auto;
}

.admin-statistic-account-action {
  display: flex;
  justify-content: flex-end;
}

.admin-statistic-account-main strong {
  display: block;
  color: var(--text);
  font-size: 0.94rem;
}

.admin-statistic-account-main span,
.admin-statistic-account-data span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.79rem;
}

.admin-statistic-account-data strong {
  display: block;
  color: var(--text);
  font-size: 0.88rem;
}

.billing-badge {
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid rgba(10, 74, 116, 0.24);
  color: #0d557e;
  background: rgba(26, 136, 217, 0.12);
}

.billing-badge.success {
  color: #035843;
  background: rgba(15, 122, 95, 0.16);
  border-color: rgba(15, 122, 95, 0.3);
}

.billing-badge.warning {
  color: #7b4c00;
  background: rgba(228, 161, 26, 0.2);
  border-color: rgba(167, 118, 15, 0.3);
}

.billing-badge.danger {
  color: #7a2121;
  background: rgba(184, 69, 69, 0.16);
  border-color: rgba(184, 69, 69, 0.3);
}

@media (max-width: 760px) {
  .admin-statistics-filters {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .admin-statistics-filter-summary {
    padding-right: 0;
    padding-bottom: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--border-soft);
  }

  .admin-statistics-period-switch {
    width: 100%;
  }

  .admin-statistics-period-option {
    flex: 1;
  }

  .admin-statistics-filter-field {
    width: 100%;
  }

  .admin-statistics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-statistics-row {
    grid-template-columns: 1fr auto;
  }

  .admin-statistics-row span:last-child {
    grid-column: 1 / -1;
  }

  .admin-statistic-account {
    grid-template-columns: 1fr 1fr;
  }

  .admin-statistic-account-main {
    grid-column: 1 / -1;
  }

  .admin-statistic-account.has-action {
    grid-template-columns: 1fr 1fr;
  }

  .admin-statistic-account-action {
    grid-column: 1 / -1;
  }

  .admin-statistic-account-action .btn {
    width: 100%;
  }
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  color: var(--muted);
}

h1 {
  margin: 0;
  font-size: clamp(1.6rem, 3.6vw, 2.4rem);
  line-height: 1.1;
}

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

.brand-lockup {
  position: relative;
  display: block;
  overflow: hidden;
}

.logo-home-btn {
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
  padding: 0;
  margin: 0;
  text-align: center;
  cursor: pointer;
  width: 100%;
  border-radius: 0;
  box-shadow: none;
  transition:
    transform 160ms ease,
    opacity 160ms ease;
}

.logo-home-btn:hover {
  transform: translateY(-1px);
  opacity: 0.94;
}

.brand-lockup-auth {
  width: min(100%, 460px);
  aspect-ratio: 49 / 13;
  margin: -8px auto -2px;
}

.brand-lockup-topbar {
  width: min(100%, 330px);
  aspect-ratio: 49 / 13;
  margin: 0;
  justify-self: start;
  margin-left: -8px;
  overflow: visible;
}

.app-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.auth-logo {
  transform: none;
}

.topbar-logo {
  transform: scale(1.16);
  transform-origin: center;
  object-position: center;
}

.subtitle {
  margin: 8px 0 0;
  color: var(--muted);
}

.topbar-kicker {
  margin: 0;
  display: inline-block;
  width: fit-content;
  padding: 0.28rem 0.58rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.34);
  font-size: clamp(0.68rem, 0.65rem + 0.1vw, 0.78rem);
  letter-spacing: 0.1em;
  color: #718079;
  text-transform: uppercase;
  font-weight: 480;
}

.topbar-kicker::before {
  display: none;
  content: none;
}

.topbar-kicker span {
  color: #536b63;
  font-weight: 600;
  letter-spacing: 0.11em;
}

.topbar-welcome {
  margin: 0;
  font-size: clamp(1.42rem, 1.9vw, 1.8rem);
  line-height: 1.04;
  letter-spacing: -0.015em;
  color: #495b53;
  font-weight: 520;
  max-width: 18ch;
  text-wrap: balance;
}

.topbar-note {
  margin: 0;
  max-width: 44ch;
  color: #697972;
  font-size: clamp(0.8rem, 0.77rem + 0.08vw, 0.86rem);
  line-height: 1.5;
  letter-spacing: 0;
  text-wrap: pretty;
}

.topbar-note:empty {
  display: none;
}

.auth-subtitle {
  max-width: 92%;
  margin-top: 4px;
  margin-left: auto;
  margin-right: auto;
  font-size: clamp(0.88rem, 0.68rem + 0.4vw, 1rem);
  line-height: 1.6;
  letter-spacing: -0.01em;
  font-weight: 500;
  color: #5e6d65;
  text-align: center;
  text-wrap: pretty;
}

.auth-subtitle.auth-subtitle-register {
  margin-left: 0;
  margin-right: 0;
  text-align: left;
}

.landing-shell {
  width: min(1240px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.landing-login-btn {
  min-height: 48px;
  min-width: 168px;
  padding: 10px 18px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #ffffff;
  background:
    linear-gradient(135deg, #0f7a5f, #15956e 58%, #18a57d);
  border: 1px solid rgba(11, 101, 79, 0.2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 16px 28px rgba(8, 108, 82, 0.22);
}

.landing-login-btn:hover {
  border-color: rgba(11, 101, 79, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 20px 34px rgba(8, 108, 82, 0.28);
}

.landing-top {
  display: block;
}

.landing-hero {
  position: relative;
  overflow: hidden;
  min-height: 100%;
  padding: clamp(20px, 2.6vw, 30px);
  border: 1px solid var(--hero-border);
  border-radius: 30px;
  background: var(--hero-bg);
  box-shadow: var(--shadow-soft);
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(280px, 360px);
  gap: 22px;
  align-items: start;
}

.landing-hero::before {
  content: "";
  position: absolute;
  inset: auto 28px 0;
  height: 1px;
  background: var(--hero-rule);
}

.landing-brand-lockup {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  line-height: 0;
  margin: -38px auto 2px;
  width: min(100%, 640px);
  max-width: 640px;
  aspect-ratio: auto;
  overflow: visible;
}

.landing-brand-lockup .app-logo {
  width: 100%;
  height: auto;
  max-width: 640px;
  transform: none;
}

.landing-kicker {
  margin: 0 0 2px;
  align-self: center;
  text-align: center;
}

.landing-hero-main {
  grid-column: 1;
  justify-self: center;
  width: min(100%, 760px);
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: center;
  text-align: center;
  padding-top: clamp(10px, 1.3vw, 16px);
}

.landing-title {
  max-width: 15ch;
  margin-top: -10px;
  margin-inline: auto;
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1;
  letter-spacing: -0.045em;
  color: var(--panel-title);
  text-wrap: balance;
}

.landing-lead {
  max-width: 60ch;
  margin: 28px 0 0;
  margin-inline: auto;
  color: var(--panel-heading);
  font-size: clamp(0.96rem, 0.88rem + 0.2vw, 1.04rem);
  line-height: 1.62;
  text-wrap: pretty;
}

.landing-hero-side {
  grid-column: 2;
  justify-self: end;
  width: min(100%, 100%);
  min-width: 0;
  display: grid;
  align-self: start;
  gap: 14px;
  margin-top: -14px;
}

.landing-hero-login-wrap {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.landing-hero-side-card {
  align-self: start;
  padding: 18px;
  border: 1px solid rgba(14, 43, 34, 0.1);
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0%, rgba(26, 136, 217, 0.12), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(244, 250, 247, 0.82));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.74),
    0 10px 22px rgba(9, 35, 28, 0.05);
}

.landing-hero-side-kicker {
  margin: 0 0 10px;
  color: #0d7259;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.landing-hero-side-card h2 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.1;
  text-wrap: balance;
}

.landing-hero-side-list {
  margin: 14px 0 0;
  padding-left: 18px;
  color: #566961;
  line-height: 1.55;
}

.landing-hero-side-list li + li {
  margin-top: 8px;
}

.landing-hero-bridge {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(14, 43, 34, 0.08);
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0%, rgba(26, 136, 217, 0.1), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(244, 250, 247, 0.82));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.74),
    0 10px 22px rgba(9, 35, 28, 0.05);
}

.landing-hero-bridge-kicker {
  margin: 0;
  color: #0d7259;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.landing-hero-bridge-text {
  margin: 0;
  color: #566961;
  font-size: 1rem;
  line-height: 1.62;
  text-wrap: pretty;
}

.landing-hero-bridge-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.landing-hero-bridge-points span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(14, 43, 34, 0.1);
  background: rgba(255, 255, 255, 0.82);
  color: #24453a;
  font-size: 0.82rem;
  font-weight: 760;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.landing-trade-chip {
  padding: 9px 12px;
  border: 1px solid rgba(14, 43, 34, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: #355248;
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.landing-seo-section {
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid rgba(14, 43, 34, 0.1);
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0%, rgba(26, 136, 217, 0.1), transparent 40%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(244, 250, 247, 0.82));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.74),
    0 10px 22px rgba(9, 35, 28, 0.05);
}

.landing-seo-section-head h2 {
  margin: 0;
  max-width: 18ch;
  font-size: clamp(1.18rem, 1rem + 0.5vw, 1.58rem);
  line-height: 1.08;
  text-wrap: balance;
}

.landing-seo-section-head p {
  margin: 8px 0 0;
  max-width: 66ch;
  color: #576a62;
  line-height: 1.58;
}

.landing-seo-section-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.landing-seo-point {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid rgba(14, 43, 34, 0.1);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.landing-seo-point strong {
  color: #16392f;
  font-size: 1rem;
  line-height: 1.2;
}

.landing-seo-point p {
  margin: 0;
  color: #5a6d65;
  line-height: 1.5;
}

.landing-seo-links {
  display: grid;
  gap: 14px;
}

.landing-seo-link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.landing-seo-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(14, 43, 34, 0.12);
  background: rgba(255, 255, 255, 0.72);
  color: #23453b;
  font-weight: 600;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

.landing-seo-link:hover {
  border-color: rgba(15, 122, 95, 0.28);
  background: rgba(244, 250, 247, 0.9);
}

.landing-ai-panel {
  padding: 18px;
  border: 1px solid rgba(14, 43, 34, 0.1);
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0%, rgba(26, 136, 217, 0.12), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(243, 249, 246, 0.82));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.76),
    0 12px 24px rgba(9, 35, 28, 0.05);
  display: grid;
  grid-template-columns: minmax(340px, 1.12fr) minmax(0, 1.28fr);
  gap: 18px;
  align-items: start;
}

.landing-ai-head h2 {
  margin: 0;
  max-width: 24ch;
  font-size: clamp(1.18rem, 1rem + 0.5vw, 1.58rem);
  line-height: 1.08;
  text-wrap: balance;
}

.landing-ai-head p {
  margin: 8px 0 0;
  max-width: 64ch;
  color: #576a62;
  line-height: 1.58;
}

.landing-ai-kicker {
  margin: -2px 0 8px;
  color: #0d7259;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.landing-ai-head h2 {
  margin-top: 8px;
}

.landing-ai-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.landing-ai-item {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(14, 43, 34, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
}

.landing-ai-item-title {
  margin: 0;
  color: #0c5c97;
  font-size: 1rem;
  font-weight: 820;
  letter-spacing: -0.02em;
}

.landing-ai-item-text {
  margin: 8px 0 0;
  color: #5c6e66;
  font-size: 0.88rem;
  line-height: 1.52;
}

.landing-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
  scroll-margin-top: 84px;
}

.landing-feature-grid > .card,
.landing-feature-grid > .card + .card {
  margin-top: 0;
}

.landing-feature-card {
  height: 100%;
  padding: 20px;
  background:
    radial-gradient(circle at 100% 0%, rgba(26, 136, 217, 0.08), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(246, 252, 249, 0.92));
  display: flex;
  flex-direction: column;
}

.landing-feature-tag {
  margin: 0 0 10px;
  color: #0d7259;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.landing-feature-card:first-child .landing-feature-tag {
  margin-top: -2px;
}

.landing-feature-card:nth-child(2) .landing-feature-tag {
  margin-top: -2px;
}

.landing-feature-card:nth-child(3) .landing-feature-tag {
  margin-top: -2px;
}

.landing-feature-card:first-child h2 {
  margin-top: 8px;
}

.landing-feature-card:nth-child(2) h2 {
  margin-top: 8px;
}

.landing-feature-card:nth-child(3) h2 {
  margin-top: 8px;
}

.landing-feature-card h2 {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.2;
  text-wrap: balance;
}

.landing-feature-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.58;
}

.landing-feature-list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.landing-feature-list li + li {
  margin-top: 7px;
}

.landing-trade-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.landing-faq {
  scroll-margin-top: 84px;
}

.landing-faq-list {
  display: grid;
  gap: 10px;
}

.landing-faq-item {
  border: 1px solid rgba(14, 43, 34, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  padding: 14px 16px;
}

.landing-faq-item summary {
  cursor: pointer;
  list-style: none;
  font-weight: 600;
}

.landing-faq-item summary::-webkit-details-marker {
  display: none;
}

.landing-faq-item p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.58;
}

html[data-theme="dark"] .landing-hero {
  border-color: var(--hero-border);
  background: var(--hero-bg);
}

.auth-modal-card {
  width: min(720px, 100%);
  border-radius: 24px;
}

.auth-modal-intro {
  display: grid;
  justify-items: center;
  gap: 10px;
}

.auth-modal-brand {
  margin: -8px auto 0;
  width: min(100%, 380px);
}

.auth-modal-intro .auth-subtitle,
.auth-modal-card .auth-subtitle {
  max-width: 100%;
  margin-top: 2px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

html[data-theme="dark"] .landing-hero-side-card {
  border-color: rgba(129, 160, 148, 0.16);
  background:
    radial-gradient(circle at 100% 0%, rgba(61, 136, 202, 0.14), transparent 42%),
    linear-gradient(180deg, rgba(14, 27, 23, 0.9), rgba(17, 31, 27, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 14px 26px rgba(0, 0, 0, 0.18);
}

html[data-theme="dark"] .landing-hero-side-kicker {
  color: #7ce0b8;
}

html[data-theme="dark"] .landing-login-btn {
  color: #f7fffb;
  background: linear-gradient(135deg, #116f57, #15956e 58%, #17a67d);
  border-color: rgba(129, 160, 148, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 18px 32px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] .landing-hero-bridge {
  border-color: rgba(129, 160, 148, 0.16);
  background:
    radial-gradient(circle at 100% 0%, rgba(61, 136, 202, 0.14), transparent 42%),
    linear-gradient(180deg, rgba(14, 27, 23, 0.9), rgba(17, 31, 27, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 14px 26px rgba(0, 0, 0, 0.18);
}

html[data-theme="dark"] .landing-hero-bridge-kicker {
  color: #7ce0b8;
}

html[data-theme="dark"] .landing-hero-bridge-text {
  color: #bdd3ca;
}

html[data-theme="dark"] .landing-hero-bridge-points span {
  border-color: rgba(129, 160, 148, 0.16);
  background: rgba(13, 24, 21, 0.78);
  color: #d8ece4;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

html[data-theme="dark"] .landing-hero-side-list {
  color: #a9c0b6;
}

html[data-theme="dark"] .landing-trade-chip,
html[data-theme="dark"] .landing-faq-item {
  border-color: rgba(129, 160, 148, 0.16);
  background: rgba(13, 24, 21, 0.72);
  color: #d9ece4;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

html[data-theme="dark"] .landing-seo-section {
  border-color: rgba(129, 160, 148, 0.16);
  background:
    radial-gradient(circle at 100% 0%, rgba(61, 136, 202, 0.14), transparent 42%),
    linear-gradient(180deg, rgba(14, 27, 23, 0.9), rgba(17, 31, 27, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 14px 26px rgba(0, 0, 0, 0.18);
}

html[data-theme="dark"] .landing-seo-section-head p,
html[data-theme="dark"] .landing-seo-point p {
  color: #a9c0b6;
}

html[data-theme="dark"] .landing-seo-point,
html[data-theme="dark"] .landing-seo-link {
  border-color: rgba(129, 160, 148, 0.16);
  background: rgba(13, 24, 21, 0.78);
  color: #d9ece4;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

html[data-theme="dark"] .landing-seo-link:hover {
  background: rgba(17, 31, 27, 0.92);
}

html[data-theme="dark"] .landing-ai-panel {
  border-color: rgba(129, 160, 148, 0.16);
  background:
    radial-gradient(circle at 100% 0%, rgba(61, 136, 202, 0.14), transparent 42%),
    linear-gradient(180deg, rgba(14, 27, 23, 0.9), rgba(17, 31, 27, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 14px 26px rgba(0, 0, 0, 0.18);
}

html[data-theme="dark"] .landing-ai-head p,
html[data-theme="dark"] .landing-ai-item-text,
html[data-theme="dark"] .landing-feature-card p,
html[data-theme="dark"] .landing-feature-list,
html[data-theme="dark"] .landing-faq-item p {
  color: #a9c0b6;
}

html[data-theme="dark"] .landing-ai-kicker {
  color: #7ce0b8;
}

html[data-theme="dark"] .landing-ai-item {
  border-color: rgba(129, 160, 148, 0.16);
  background: rgba(13, 24, 21, 0.8);
}

html[data-theme="dark"] .landing-ai-item-title {
  color: #90cbff;
}

html[data-theme="dark"] .landing-feature-card {
  background:
    radial-gradient(circle at 100% 0%, rgba(61, 136, 202, 0.14), transparent 38%),
    linear-gradient(180deg, rgba(15, 27, 24, 0.92), rgba(17, 31, 27, 0.94));
}

html[data-theme="dark"] .landing-feature-tag {
  color: #7ce0b8;
}

@media (max-width: 1020px) {
  .landing-hero,
  .landing-ai-panel {
    grid-template-columns: 1fr;
  }

  .landing-hero-main,
  .landing-hero-side {
    grid-column: auto;
  }

  .landing-hero-main,
  .landing-hero-side {
    justify-self: stretch;
  }

  .landing-hero-main {
    width: 100%;
    padding-top: 0;
  }

  .landing-hero-side {
    margin-top: 0;
  }

  .landing-hero-login-wrap {
    justify-content: stretch;
  }

  .landing-title {
    max-width: 14ch;
  }

  .landing-seo-section-grid {
    grid-template-columns: 1fr;
  }

  .landing-ai-grid,
  .landing-feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .auth-gate {
    padding: 18px 14px 28px;
  }

  .auth-modal {
    place-items: end center;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
  }

  .auth-modal-card {
    width: min(100%, 430px);
    max-height: min(84dvh, 760px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 0px));
    gap: 6px;
    border-radius: 24px 24px 18px 18px;
  }

  .auth-modal-head {
    align-items: flex-start;
    gap: 8px;
  }

  .auth-modal-head > div {
    min-width: 0;
  }

  .auth-modal-head h2 {
    margin-top: 0;
    font-size: clamp(1.06rem, 5.1vw, 1.38rem);
    line-height: 1.02;
  }

  .auth-modal-head .send-confirm-popup-kicker {
    margin-bottom: 4px;
    font-size: 0.66rem;
    letter-spacing: 0.08em;
  }

  #closeAuthModalBtn {
    padding: 5px 9px;
    font-size: 0.78rem;
    border-radius: 12px;
  }

  .auth-modal-brand {
    width: min(84%, 315px);
    margin: 4px auto 12px;
  }

  .auth-modal-intro {
    gap: 12px;
  }

  .auth-modal-intro .auth-subtitle,
  .auth-modal-card .auth-subtitle {
    max-width: 38ch;
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.4;
  }

  .auth-modal-intro .auth-subtitle br,
  .auth-modal-card .auth-subtitle br {
    display: none;
  }

  .auth-form {
    margin-top: 4px;
    gap: 7px;
  }

  .auth-switch {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .auth-switch label {
    min-height: 38px;
    padding: 6px 8px;
    font-size: 0.82rem;
    gap: 5px;
  }

  .auth-registration-notice {
    margin-top: 0;
    padding: 8px 10px;
    font-size: 0.82rem;
    line-height: 1.36;
  }

  .field > span {
    margin-bottom: 4px;
    font-size: 0.82rem;
  }

  .auth-modal-card input:not([type="radio"]):not([type="checkbox"]),
  .auth-modal-card select,
  .auth-modal-card textarea {
    padding: 7px 10px;
    font-size: 0.9rem;
    border-radius: 13px;
  }

  #authSubmitBtn {
    min-height: 42px;
    margin-top: 1px;
    font-size: 0.94rem;
  }

  .auth-message {
    min-height: 0;
    font-size: 0.82rem;
    line-height: 1.3;
  }

  .auth-message:empty {
    display: none;
  }

  .auth-aux {
    margin-top: 6px;
  }

  .forgot-form {
    margin-top: 6px;
    padding-top: 8px;
    gap: 8px;
  }

  .link-btn {
    font-size: 0.92rem;
  }

  .landing-hero {
    border-radius: 24px;
  }

  .landing-hero {
    gap: 18px;
  }

  .landing-kicker {
    display: block;
    width: max-content;
    max-width: 100%;
    margin-top: 0;
    margin-bottom: 10px;
    margin-inline: auto;
    text-align: center;
  }

  .landing-brand-lockup {
    width: min(100%, 352px);
    max-width: 92vw;
    margin: 4px auto 14px;
  }

  .landing-brand-lockup .app-logo {
    max-width: 100%;
    transform: translateY(-30px);
  }

  .landing-title {
    max-width: none;
    font-size: clamp(1.6rem, 8vw, 2.3rem);
    line-height: 1.02;
  }

  .landing-hero-bridge {
    padding: 16px;
    gap: 12px;
  }

  .landing-seo-section {
    padding: 16px;
    gap: 12px;
  }

  .landing-hero-bridge-text {
    font-size: 0.98rem;
    line-height: 1.64;
  }

  .landing-hero-bridge-points {
    flex-wrap: wrap;
    gap: 8px;
  }

  .landing-hero-side-card {
    padding: 16px;
  }

  .landing-login-btn {
    width: 100%;
    min-height: 48px;
    padding-inline: 16px;
  }

  .landing-ai-grid,
  .landing-feature-grid {
    grid-template-columns: 1fr;
  }

  .landing-seo-link-list {
    flex-direction: column;
  }

  .landing-seo-link {
    justify-content: center;
  }

  .landing-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .landing-brand-lockup {
    width: min(100%, 320px);
    max-width: 90vw;
  }
}

.stepper {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.step-btn {
  border: 1px solid var(--card-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 600;
  transition: all 200ms ease;
}

.step-btn.active {
  color: #ffffff;
  background: linear-gradient(120deg, var(--primary), var(--accent));
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(7, 96, 145, 0.24);
}

.panel {
  display: none;
  animation: fade 220ms ease;
}

.panel.active {
  display: block;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  padding: 18px;
}

.card + .card {
  margin-top: 14px;
}

.card-head {
  margin-bottom: 14px;
}

.card-head h2 {
  margin: 0;
  font-size: 1.12rem;
}

.card-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.planning-panel {
  margin-bottom: 18px;
}

.planning-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border-color: rgba(10, 42, 33, 0.14);
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.9), rgba(246, 252, 249, 0.92));
}

.planning-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 6px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
}

.planning-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(16, 34, 26, 0.08);
}

.planning-head h2 {
  margin: 0;
  font-size: clamp(1.45rem, 2.9vw, 2rem);
  line-height: 1.05;
}

.planning-head p {
  margin: 8px 0 0;
  max-width: 54ch;
  color: #395147;
}

.planning-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 14px;
}

.planning-calendar-wrap,
.planning-day-wrap {
  border: 1px solid rgba(16, 34, 26, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  padding: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.planning-month-nav {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.planning-month-nav .btn {
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 0.82rem;
}

.planning-month-label {
  margin: 0;
  text-align: center;
  font-size: 1.08rem;
  font-weight: 780;
  color: #0a372b;
}

.planning-weekdays,
.planning-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
}

.planning-weekdays {
  margin-bottom: 8px;
}

.planning-weekdays span {
  text-align: center;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}

.planning-day-btn {
  position: relative;
  min-height: 60px;
  border: 1px solid rgba(16, 34, 26, 0.13);
  border-radius: 13px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 248, 244, 0.96));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8px;
  cursor: pointer;
  transition: transform 170ms ease, box-shadow 170ms ease, border-color 170ms ease, background 170ms ease;
}

.planning-day-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 122, 95, 0.36);
  box-shadow: 0 6px 14px rgba(11, 52, 40, 0.1);
}

.planning-day-number {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1d3029;
}

.planning-day-btn.outside-month {
  opacity: 0.5;
  background: rgba(245, 248, 246, 0.72);
}

.planning-day-btn.today {
  border-color: rgba(26, 136, 217, 0.45);
  box-shadow: 0 0 0 1px rgba(26, 136, 217, 0.2);
}

.planning-day-btn.selected {
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), #0b8d63 58%, #188bc8);
  box-shadow: 0 10px 20px rgba(6, 88, 67, 0.28);
}

.planning-day-btn.selected .planning-day-number {
  color: #ffffff;
}

.planning-day-count {
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(15, 122, 95, 0.18);
  color: #0a4635;
  font-size: 0.73rem;
  font-weight: 800;
}

.planning-day-btn.selected .planning-day-count {
  background: rgba(255, 255, 255, 0.24);
  color: #ffffff;
}

.planning-selected-date {
  margin: 0;
  font-size: 1.24rem;
  line-height: 1.2;
}

.planning-day-filters {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.planning-day-filter {
  border: 1px solid rgba(16, 34, 26, 0.16);
  border-radius: 999px;
  background: rgba(244, 250, 247, 0.95);
  color: #355348;
  font-size: 0.78rem;
  font-weight: 760;
  letter-spacing: 0.02em;
  padding: 5px 12px;
  cursor: pointer;
  transition: border-color 170ms ease, background 170ms ease, color 170ms ease, transform 170ms ease;
}

.planning-day-filter:hover {
  border-color: rgba(15, 122, 95, 0.45);
  color: #0d6f55;
  transform: translateY(-1px);
}

.planning-day-filter.is-active {
  border-color: rgba(9, 98, 74, 0.68);
  background: linear-gradient(135deg, rgba(14, 116, 89, 0.2), rgba(26, 136, 217, 0.14));
  color: #094c39;
  box-shadow: 0 6px 14px rgba(8, 78, 59, 0.14);
}

.planning-day-events {
  margin-top: 12px;
  display: grid;
  gap: 8px;
  max-height: 250px;
  overflow: auto;
  padding-right: 2px;
}

.planning-empty {
  border: 1px dashed rgba(16, 34, 26, 0.16);
  background: rgba(246, 250, 248, 0.8);
}

.planning-event-item {
  border: 1px solid rgba(16, 34, 26, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  padding: 10px 10px 10px 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.planning-event-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.planning-event-time {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 780;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #0e6f55;
}

.planning-event-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 760;
  color: #132c23;
}

.planning-event-system-badge {
  width: fit-content;
  margin-top: 2px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: 1px solid rgba(7, 93, 69, 0.28);
  background: rgba(12, 123, 93, 0.13);
  color: #0a5e46;
}

.planning-event-notes {
  margin: 2px 0 0;
  font-size: 0.85rem;
  color: #53655d;
  white-space: pre-wrap;
}

.planning-event-client {
  margin-top: 4px;
  display: grid;
  gap: 3px;
}

.planning-event-client-link {
  width: fit-content;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 760;
  color: var(--primary-strong);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.planning-event-client-link:hover {
  color: #0e8d69;
}

.planning-event-contact,
.planning-event-sync {
  margin: 0;
  font-size: 0.79rem;
  color: #5b6c64;
}

.planning-event-sync {
  color: #0d6f55;
  font-weight: 700;
}

.planning-event-actions {
  display: grid;
  gap: 8px;
}

.planning-event-edit,
.planning-event-delete {
  width: 34px;
  min-width: 34px;
  height: 34px;
  border-radius: 999px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  line-height: 1;
  box-shadow: none;
}

.planning-event-edit {
  font-size: 0.98rem;
}

.planning-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(16, 34, 26, 0.1);
}

.planning-form-block-title {
  margin: 12px 0 8px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}

.planning-form .field-grid {
  gap: 10px;
}

.planning-client-grid {
  padding: 10px;
  border: 1px dashed rgba(16, 34, 26, 0.16);
  border-radius: 12px;
  background: rgba(247, 251, 249, 0.8);
}

.planning-form .actions {
  margin-top: 12px;
}

.planning-feedback {
  min-height: 1.2em;
  margin: 10px 0 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--muted);
}

.planning-feedback.success {
  color: #05543f;
}

.planning-feedback.warning {
  color: #7b4c00;
}

.planning-feedback.danger {
  color: #7a2121;
}

.kpi-grid-shell {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  gap: 10px;
  align-items: center;
}

.kpi-grid-stack {
  min-width: 0;
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.kpi-scope-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px;
}

.kpi-scope-toolbar-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.kpi-year-control {
  position: relative;
  flex: 0 0 auto;
}

.kpi-year-control::after {
  content: "⌄";
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-48%);
  font-size: 0.78rem;
  color: #5d7067;
  pointer-events: none;
}

.kpi-year-control select {
  width: 82px;
  min-width: 82px;
  max-width: 82px;
  padding: 8px 24px 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15, 122, 95, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 250, 247, 0.96));
  box-shadow:
    0 8px 18px rgba(10, 32, 24, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.66);
  color: #143428;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  text-align-last: center;
  appearance: none;
  cursor: pointer;
}

.kpi-scope-kicker {
  margin: 0;
  color: #6a7b73;
  font-size: 0.72rem;
  font-weight: 780;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kpi-scope-label {
  margin: 0;
  color: #16352b;
  font-size: 1rem;
  font-weight: 820;
  line-height: 1.08;
}

.kpi-scope-nav {
  align-self: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(16, 34, 26, 0.12);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 247, 243, 0.96));
  color: #0e6f55;
  display: inline-grid;
  place-items: center;
  font-size: 1.15rem;
  font-weight: 820;
  cursor: pointer;
  box-shadow:
    0 8px 16px rgba(10, 32, 24, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    opacity 180ms ease;
}

.kpi-scope-nav:hover:not(:disabled) {
  transform: translateY(-1px) scale(1.02);
  border-color: rgba(15, 122, 95, 0.32);
  box-shadow:
    0 12px 22px rgba(10, 32, 24, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.kpi-scope-nav:disabled {
  opacity: 0.42;
  cursor: default;
  color: #8ea099;
  box-shadow: none;
}

.kpi-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: stretch;
  grid-auto-rows: 1fr;
}

.kpi-grid .card + .card {
  margin-top: 0;
}

.kpi-card {
  --kpi-accent: rgba(15, 122, 95, 0.92);
  --kpi-accent-soft: rgba(15, 122, 95, 0.12);
  position: relative;
  overflow: hidden;
  min-height: 204px;
  height: 100%;
  padding: 16px 18px 15px;
  border-color: rgba(12, 54, 43, 0.12);
  background: #ffffff;
  box-shadow:
    0 8px 16px rgba(10, 32, 24, 0.045),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
  gap: 12px;
}

.kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 16px;
  width: 48px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--kpi-accent), rgba(26, 136, 217, 0.72));
}

.kpi-card-rates {
  --kpi-accent: var(--status-in-progress-accent);
  --kpi-accent-soft: var(--status-in-progress-bg-soft);
}

.kpi-card-amounts {
  --kpi-accent: rgba(47, 127, 185, 0.92);
  --kpi-accent-soft: rgba(47, 127, 185, 0.13);
}

.kpi-card-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.kpi-card .label {
  position: relative;
  margin: 0;
  width: fit-content;
  max-width: 100%;
  padding: 5px 9px;
  border: 1px solid rgba(16, 34, 26, 0.07);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: #5c6f67;
  font-size: 0.72rem;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.kpi-head-note {
  margin: 0;
  color: #7a8b83;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.kpi-card .meta {
  margin: auto 0 0;
  max-width: none;
  color: #5f7068;
  font-size: 0.8rem;
  line-height: 1.32;
}

.kpi-date-meta {
  margin: 0;
}

.kpi-stage-footnote {
  margin-top: auto;
}

.kpi-stage {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-content: stretch;
  gap: 12px;
  height: 100%;
  transform: translateX(0);
  opacity: 1;
  transition:
    transform 280ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 220ms ease;
  will-change: transform, opacity;
}

.kpi-stage.is-leaving.is-nav-next {
  transform: translateX(-34px);
  opacity: 0;
}

.kpi-stage.is-entering.is-nav-next {
  transform: translateX(34px);
  opacity: 0;
  animation: kpiStageSlideInNext 320ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.kpi-stage.is-leaving.is-nav-prev {
  transform: translateX(34px);
  opacity: 0;
}

.kpi-stage.is-entering.is-nav-prev {
  transform: translateX(-34px);
  opacity: 0;
  animation: kpiStageSlideInPrev 320ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes kpiStageSlideInNext {
  from {
    transform: translateX(34px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes kpiStageSlideInPrev {
  from {
    transform: translateX(-34px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kpi-stage {
    transition: none;
    animation: none;
  }
}

.kpi-circle-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.kpi-circle-row-single {
  grid-template-columns: 1fr;
  justify-items: start;
}

.kpi-circle-stat {
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
}

.kpi-circle-row-single .kpi-circle-stat {
  justify-items: start;
  text-align: left;
}

.kpi-circle {
  width: clamp(90px, 7.4vw, 102px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(16, 34, 26, 0.08);
  background:
    radial-gradient(circle at 30% 28%, rgba(247, 251, 255, 0.98), rgba(233, 243, 252, 0.94));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 10px 20px rgba(10, 32, 24, 0.05);
  display: grid;
  place-items: center;
  padding: 12px;
  text-align: center;
  color: #2f7fb9;
  font-size: clamp(1.04rem, 1.34vw, 1.38rem);
  line-height: 0.9;
  letter-spacing: -0.05em;
  font-weight: 820;
}

.kpi-circle-warm {
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 252, 245, 0.96), rgba(252, 246, 232, 0.94));
  color: var(--status-in-progress-text);
}

.kpi-circle-cool {
  background:
    radial-gradient(circle at 30% 28%, rgba(243, 250, 246, 0.96), rgba(232, 244, 238, 0.92));
  color: #0f7a5f;
}

.kpi-circle-caption {
  margin: 0;
  max-width: 15ch;
  color: #61726a;
  font-size: 0.78rem;
  line-height: 1.28;
  font-weight: 700;
}

.kpi-card-rates .meta {
  max-width: 34ch;
}

.kpi-amount-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.kpi-amount-item {
  min-width: 0;
  padding: 2px 0 0;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 10px;
  text-align: center;
}

.kpi-amount-circle {
  margin: 0;
  width: clamp(94px, 7.6vw, 108px);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  padding: 14px;
  border: 1px solid rgba(16, 34, 26, 0.08);
  background:
    radial-gradient(circle at 30% 28%, rgba(247, 251, 255, 0.98), rgba(233, 243, 252, 0.94));
  color: #2f7fb9;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 10px 20px rgba(10, 32, 24, 0.05);
  font-size: clamp(0.98rem, 1.12vw, 1.12rem);
  line-height: 1.04;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-align: center;
  overflow-wrap: anywhere;
}

.kpi-amount-circle-warm {
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 252, 245, 0.96), rgba(252, 246, 232, 0.94));
  color: var(--status-in-progress-text);
}

.kpi-amount-circle-cool {
  background:
    radial-gradient(circle at 30% 28%, rgba(243, 250, 246, 0.96), rgba(232, 244, 238, 0.92));
  color: #0f7a5f;
}

.kpi-amount-circle-paid {
  background:
    radial-gradient(circle at 30% 28%, rgba(249, 255, 231, 0.98), rgba(237, 246, 201, 0.94));
  color: #6d8616;
}

.kpi-amount-circle-tva {
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 244, 233, 0.98), rgba(245, 218, 189, 0.94));
  color: #b55612;
}

.kpi-amount-circle-purchases {
  background:
    radial-gradient(circle at 30% 28%, rgba(237, 252, 246, 0.98), rgba(214, 241, 229, 0.94));
  color: #0f7a5f;
}

.kpi-amount-label {
  margin: 0;
  color: #61726a;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.proactive-card {
  margin-top: 14px;
  position: relative;
  overflow: hidden;
  border-color: rgba(12, 54, 43, 0.12);
  background: rgba(255, 255, 255, 0.95);
  box-shadow:
    0 18px 30px rgba(10, 32, 24, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.proactive-card::before {
  display: none;
}

.proactive-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 4px 0;
  background: #ffffff;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.proactive-head-main {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.proactive-kicker,
.purchase-module-kicker {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #517769;
  font-weight: 760;
}

.purchase-module-head .purchase-module-kicker {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #517769;
  font-weight: 760;
}

.proactive-head h2 {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.1;
  letter-spacing: 0;
}

.proactive-head-side {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

.proactive-head-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(12, 84, 65, 0.12);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
  color: #2d5f50;
  font-size: 0.78rem;
  font-weight: 720;
}

.proactive-summary {
  margin: 0;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 34px;
  padding: 8px 14px;
  border-radius: 14px;
  border: 1px solid rgba(12, 84, 65, 0.1);
  background: rgba(255, 255, 255, 0.72);
  color: #254f42;
  font-size: 0.9rem;
  font-weight: 620;
  line-height: 1.35;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.proactive-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
}

.proactive-block {
  border: 1px solid rgba(12, 57, 45, 0.1);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(247, 251, 249, 0.82));
  padding: 16px;
  display: grid;
  gap: 12px;
  align-content: start;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 10px 24px rgba(10, 34, 27, 0.05);
}

.proactive-block-head {
  display: grid;
  gap: 4px;
  align-content: start;
}

.proactive-block-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.proactive-block-kicker {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 740;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: #719084;
}

.proactive-block h3 {
  margin: 0;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}

.proactive-block-summary {
  margin: 0;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(12, 84, 65, 0.12);
  background: rgba(255, 255, 255, 0.82);
  color: #295646;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.2;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.proactive-followup-title-row {
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.proactive-followup-tabs {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-left: auto;
}

.proactive-followup-tab {
  min-height: 38px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid rgba(15, 122, 95, 0.18);
  background: rgba(255, 255, 255, 0.84);
  color: #56786c;
  font-size: 0.82rem;
  font-weight: 760;
  letter-spacing: 0.01em;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 6px 14px rgba(10, 34, 27, 0.04);
  transition:
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.proactive-followup-tab:hover {
  border-color: rgba(15, 122, 95, 0.28);
  color: #2f5e50;
}

.proactive-followup-tab.is-active {
  border-color: rgba(15, 122, 95, 0.3);
  background: linear-gradient(180deg, rgba(15, 122, 95, 0.14), rgba(236, 247, 242, 0.96));
  color: #0f7a5f;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 10px 18px rgba(15, 122, 95, 0.12);
}

.proactive-followup-tab:focus-visible {
  outline: 2px solid rgba(15, 122, 95, 0.3);
  outline-offset: 2px;
}

.proactive-list {
  display: grid;
  gap: 10px;
}

.proactive-list.is-carousel {
  gap: 12px;
}

.proactive-list-tools {
  display: flex;
  justify-content: flex-end;
}

.proactive-list-tools-notice {
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.proactive-inline-note {
  margin: 0;
  color: #486b5e;
  font-size: 0.8rem;
  font-weight: 620;
  line-height: 1.32;
}

.proactive-scroll-hint {
  font-size: 0.76rem;
  color: #5d7b70;
}

.proactive-carousel-shell {
  display: grid;
  gap: 10px;
}

.proactive-carousel-track {
  display: grid;
  gap: 10px;
  max-height: clamp(210px, 28vh, 260px);
  overflow-y: auto;
  padding-right: 6px;
  padding-bottom: 4px;
  scroll-behavior: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  scrollbar-width: auto;
  border-right: 1px solid rgba(15, 122, 95, 0.08);
}

.proactive-carousel-track::-webkit-scrollbar {
  width: 7px;
}

.proactive-carousel-track::-webkit-scrollbar-track {
  background: rgba(16, 34, 26, 0.08);
  border-radius: 999px;
}

.proactive-carousel-track::-webkit-scrollbar-thumb {
  background: rgba(15, 122, 95, 0.34);
  border-radius: 999px;
}

.proactive-empty {
  margin: 0;
  border: 1px dashed rgba(16, 34, 26, 0.14);
  border-radius: 16px;
  background: rgba(251, 253, 252, 0.92);
  color: #577165;
  font-size: 0.86rem;
  line-height: 1.45;
  padding: 14px;
}

.proactive-item {
  position: relative;
  border: 1px solid rgba(16, 34, 26, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  padding: 14px;
  display: grid;
  gap: 10px;
  box-shadow:
    0 12px 24px rgba(8, 30, 24, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.proactive-item.is-completing,
.history-item.is-completing {
  pointer-events: none;
  overflow: hidden;
  isolation: isolate;
  position: relative;
  transform-origin: center top;
  will-change: transform, opacity, filter;
  animation: proactiveFollowupDustOut 3200ms cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}

.proactive-item.is-completing::before,
.history-item.is-completing::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(214, 226, 221, 0.2) 46%, rgba(182, 199, 192, 0.08)),
    radial-gradient(circle at 50% 22%, rgba(232, 239, 236, 0.44) 0, transparent 58%);
  opacity: 0;
  animation: proactiveFollowupDustVeil 3200ms ease-out forwards;
}

.proactive-item.is-completing::after,
.history-item.is-completing::after {
  content: "";
  position: absolute;
  inset: -12px;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 18%, rgba(186, 203, 196, 0.96) 0 4px, transparent 5px),
    radial-gradient(circle at 20% 40%, rgba(164, 184, 176, 0.88) 0 5px, transparent 6px),
    radial-gradient(circle at 28% 68%, rgba(188, 208, 200, 0.84) 0 4px, transparent 5px),
    radial-gradient(circle at 38% 16%, rgba(202, 216, 210, 0.9) 0 4px, transparent 5px),
    radial-gradient(circle at 46% 44%, rgba(170, 193, 184, 0.82) 0 6px, transparent 7px),
    radial-gradient(circle at 56% 24%, rgba(208, 221, 215, 0.88) 0 4px, transparent 5px),
    radial-gradient(circle at 64% 52%, rgba(159, 181, 171, 0.84) 0 5px, transparent 6px),
    radial-gradient(circle at 74% 18%, rgba(214, 225, 220, 0.86) 0 4px, transparent 5px),
    radial-gradient(circle at 82% 40%, rgba(173, 193, 185, 0.82) 0 5px, transparent 6px),
    radial-gradient(circle at 70% 76%, rgba(185, 204, 197, 0.8) 0 4px, transparent 5px),
    radial-gradient(circle at 44% 82%, rgba(197, 212, 206, 0.76) 0 4px, transparent 5px),
    radial-gradient(circle at 18% 84%, rgba(177, 196, 188, 0.74) 0 4px, transparent 5px);
  opacity: 0;
  mix-blend-mode: normal;
  filter: blur(0.2px) saturate(1.05);
  animation: proactiveFollowupDustParticles 3200ms ease-out forwards;
}

@keyframes proactiveFollowupDustOut {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
    box-shadow:
      0 12px 24px rgba(8, 30, 24, 0.05),
      inset 0 1px 0 rgba(255, 255, 255, 0.82);
  }
  32% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
    box-shadow:
      0 12px 24px rgba(8, 30, 24, 0.05),
      inset 0 1px 0 rgba(255, 255, 255, 0.82);
  }
  62% {
    opacity: 0.98;
    transform: translateY(6px) scale(0.992);
    filter: blur(0.35px);
    box-shadow:
      0 18px 30px rgba(8, 30, 24, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.72);
  }
  100% {
    opacity: 0;
    transform: translateY(74px) scale(0.9);
    filter: blur(14px);
    box-shadow:
      0 24px 36px rgba(8, 30, 24, 0),
      inset 0 1px 0 rgba(255, 255, 255, 0);
  }
}

@keyframes proactiveFollowupDustVeil {
  0% {
    opacity: 0;
    transform: translateY(-6px) scaleY(0.92);
  }
  24% {
    opacity: 0;
    transform: translateY(-4px) scaleY(0.95);
  }
  48% {
    opacity: 0.72;
  }
  100% {
    opacity: 0;
    transform: translateY(94px) scaleY(1.24);
  }
}

@keyframes proactiveFollowupDustParticles {
  0% {
    opacity: 0;
    transform: translate3d(0, -6px, 0) scale(0.92);
  }
  24% {
    opacity: 0;
    transform: translate3d(0, -4px, 0) scale(0.94);
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(-10px, 112px, 0) scale(1.32);
  }
}

@media (prefers-reduced-motion: reduce) {
  .proactive-item.is-completing,
  .history-item.is-completing,
  .proactive-item.is-completing::before,
  .history-item.is-completing::before,
  .proactive-item.is-completing::after,
  .history-item.is-completing::after {
    animation: none;
  }

  .proactive-item.is-completing,
  .history-item.is-completing {
    opacity: 0;
  }
}

.proactive-item.weather.orange {
  border-color: rgba(199, 120, 8, 0.28);
  background: linear-gradient(155deg, rgba(255, 247, 236, 0.96), rgba(255, 255, 255, 0.9));
}

.proactive-item.weather.red {
  border-color: rgba(173, 44, 44, 0.32);
  background: linear-gradient(155deg, rgba(255, 240, 240, 0.95), rgba(255, 255, 255, 0.9));
}

.proactive-item.followup.due {
  border-color: rgba(184, 69, 69, 0.28);
}

.proactive-item.followup.soon {
  border-color: rgba(199, 120, 8, 0.28);
}

.proactive-item.followup.planned {
  border-color: rgba(15, 122, 95, 0.26);
}

.proactive-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.proactive-item-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 760;
  line-height: 1.22;
  letter-spacing: -0.01em;
}

.proactive-item-risk {
  margin-left: 5px;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #4f6c61;
  font-weight: 780;
}

.proactive-item-meta-grid {
  display: grid;
  gap: 7px;
}

.proactive-item-body {
  display: grid;
  gap: 12px;
}

.proactive-item-body-rdv {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.42fr);
  align-items: start;
}

.proactive-item-main-content {
  min-width: 0;
}

.proactive-item-side {
  min-width: 0;
}

.proactive-item-side-contact {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid rgba(16, 34, 26, 0.08);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(247, 251, 249, 0.98), rgba(240, 247, 244, 0.94));
  align-self: stretch;
}

.proactive-item-side-title {
  margin: 0;
  color: #718c81;
  font-size: 0.68rem;
  font-weight: 740;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.proactive-item-side-line {
  margin: 0;
  color: #37584d;
  font-size: 0.8rem;
  line-height: 1.4;
  word-break: break-word;
}

.proactive-item-meta {
  margin: 0;
  display: grid;
  gap: 3px;
  color: #37584d;
  font-size: 0.84rem;
  line-height: 1.35;
}

.proactive-item-meta-label {
  display: block;
  color: #718c81;
  font-size: 0.68rem;
  font-weight: 740;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.proactive-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 2px;
}

.proactive-item-actions .btn {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 0.76rem;
  font-weight: 760;
  letter-spacing: 0.01em;
}

.proactive-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.74rem;
  font-weight: 760;
  letter-spacing: 0.01em;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.proactive-tag.neutral {
  color: #33584c;
  border-color: rgba(15, 122, 95, 0.22);
  background: rgba(226, 242, 236, 0.88);
}

.proactive-tag.info {
  color: #0d557e;
  border-color: rgba(26, 136, 217, 0.3);
  background: rgba(223, 239, 255, 0.88);
}

.proactive-tag.warning {
  color: #8a4e00;
  border-color: rgba(199, 120, 8, 0.3);
  background: rgba(255, 237, 205, 0.92);
}

.proactive-tag.danger {
  color: #8f2f2f;
  border-color: rgba(184, 69, 69, 0.32);
  background: rgba(255, 225, 225, 0.9);
}

.proactive-tag.success {
  color: #05543f;
  border-color: rgba(15, 122, 95, 0.28);
  background: rgba(220, 241, 232, 0.92);
}

.chart-card {
  margin-top: 14px;
  border-color: rgba(12, 54, 43, 0.12);
  background: rgba(255, 255, 255, 0.95);
  box-shadow:
    0 18px 30px rgba(10, 32, 24, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.chart-card .card-head h2 {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #517769;
  font-weight: 760;
}

.chart-card .card-head p {
  max-width: 48ch;
  color: #607169;
}

@media (min-width: 980px) {
  #monthlyChartSubtitle {
    max-width: none;
    white-space: nowrap;
  }
}

.chart-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.chart-card-head-copy {
  min-width: 0;
}

.chart-year-control {
  position: relative;
  flex: 0 0 auto;
}

.chart-year-control::after {
  content: "⌄";
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-48%);
  font-size: 0.78rem;
  color: #5d7067;
  pointer-events: none;
}

.chart-year-control select {
  width: 82px;
  min-width: 82px;
  max-width: 82px;
  padding: 8px 24px 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15, 122, 95, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 250, 247, 0.96));
  box-shadow:
    0 8px 18px rgba(10, 32, 24, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.66);
  color: #143428;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  text-align-last: center;
  appearance: none;
  cursor: pointer;
}

.chart-carousel-shell {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.chart-pan-shell {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  touch-action: pan-y;
  cursor: grab;
}

.chart-pan-shell.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.chart-slide-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.chart-slide-range {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 700;
  color: #143428;
}

.chart-slide-hint {
  margin: 0;
  font-size: 0.75rem;
  color: #6b7a72;
  text-align: right;
}

.chart-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 4px;
}

.chart-summary-item {
  border: 1px solid rgba(16, 34, 26, 0.08);
  border-radius: 15px;
  padding: 6px 9px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
  display: grid;
  gap: 2px;
}

.chart-summary-item.quotes-summary {
  border-color: rgba(47, 127, 185, 0.12);
  background: linear-gradient(
    180deg,
    rgba(47, 127, 185, 0.07),
    rgba(255, 255, 255, 0.94)
  );
}

.chart-summary-item.in-progress-summary {
  border-color: var(--status-in-progress-border-soft);
  background: linear-gradient(
    180deg,
    var(--status-in-progress-bg-faint),
    rgba(255, 255, 255, 0.94)
  );
}

.chart-summary-item.invoices-summary {
  border-color: rgba(15, 122, 95, 0.12);
  background: linear-gradient(
    180deg,
    rgba(15, 122, 95, 0.07),
    rgba(255, 255, 255, 0.94)
  );
}

.chart-summary-item.paid-summary {
  border-color: rgba(148, 183, 45, 0.16);
  background: linear-gradient(
    180deg,
    rgba(183, 216, 63, 0.14),
    rgba(255, 255, 255, 0.94)
  );
}

.chart-summary-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  color: #607169;
  font-weight: 700;
}

.chart-summary-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.chart-summary-dot.quotes {
  background: #2f7fb9;
}

.chart-summary-dot.in-progress {
  background: var(--status-in-progress-text);
}

.chart-summary-dot.invoices {
  background: #0f7a5f;
}

.chart-summary-dot.paid {
  background: #94b72d;
}

.chart-summary-value {
  margin: 0;
  font-size: clamp(1.02rem, 1.35vw, 1.26rem);
  line-height: 1;
  letter-spacing: -0.04em;
  color: #10221a;
  font-weight: 800;
}

.chart-summary-meta {
  margin: 0;
  font-size: 0.67rem;
  color: #6a7a72;
}

.monthly-chart-canvas {
  display: block;
  width: 100%;
  height: 252px;
}

.purchase-module-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(12, 54, 43, 0.12);
  background:
    radial-gradient(circle at 100% 0%, rgba(26, 136, 217, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 250, 247, 0.96));
  box-shadow:
    0 18px 30px rgba(10, 32, 24, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.purchase-module-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.purchase-module-head-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.purchase-module-head-copy h2 {
  margin-top: 10px;
}

.purchase-module-toggle {
  display: none;
  flex: 0 0 auto;
}

.purchase-module-toggle-icon {
  display: block;
}

.purchase-module-preview-kicker {
  margin: 0 0 6px;
  color: #4f7d6f;
  font-size: 0.76rem;
  font-weight: 780;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.purchase-module-period-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  align-self: start;
}

.purchase-module-summary-item,
.purchase-module-total-item {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(16, 34, 26, 0.09);
  border-radius: 24px;
  padding: 16px 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 248, 0.94));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.68),
    0 10px 24px rgba(10, 32, 24, 0.04);
  display: grid;
  align-content: center;
  justify-items: start;
  text-align: left;
  gap: 6px;
  min-height: 92px;
}

.purchase-module-summary-item::before,
.purchase-module-total-item::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  border-radius: 24px 0 0 24px;
  background: linear-gradient(180deg, rgba(15, 122, 95, 0.7), rgba(26, 136, 217, 0.35));
}

.purchase-module-summary-item strong,
.purchase-module-total-item strong {
  font-size: 1.2rem;
  line-height: 1.05;
  color: #10221a;
  letter-spacing: -0.03em;
}

.purchase-module-summary-item span,
.purchase-module-total-item span {
  color: #62746b;
  font-size: 0.76rem;
  font-weight: 700;
}

.purchase-module-stat-kicker {
  color: #5e7a6d;
  font-size: 0.67rem;
  font-weight: 780;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.purchase-module-stat-note {
  color: #6a7c74;
  font-size: 0.8rem;
  font-weight: 720;
}

.purchase-module-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 16px;
  align-items: stretch;
}

.purchase-module-upload {
  grid-column: 1;
  grid-row: 1;
}

.purchase-module-analysis {
  grid-column: 1;
  grid-row: 2;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  min-height: 540px;
}

.purchase-module-preview {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: stretch;
}

.purchase-module-history {
  grid-column: 1 / -1;
}

.purchase-module-block,
.purchase-module-preview {
  border: 1px solid rgba(16, 34, 26, 0.1);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 10px 24px rgba(10, 32, 24, 0.04);
}

.purchase-module-block {
  padding: 14px;
}

.purchase-module-block-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.purchase-module-block-head h3,
.purchase-module-preview-head h3 {
  margin: 0;
  font-size: 1rem;
}

.purchase-module-history-head h3 {
  font-size: 1.12rem;
  line-height: 1.1;
}

.purchase-module-block-head p {
  margin: 5px 0 0;
  color: #607169;
  font-size: 0.84rem;
}

.purchase-module-upload-status {
  margin: 5px 0 0;
  color: #44695c;
  font-size: 0.86rem;
  line-height: 1.4;
}

.purchase-module-upload-status.info {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(195, 147, 33, 0.24);
  background: linear-gradient(180deg, rgba(255, 249, 232, 0.95), rgba(248, 239, 208, 0.92));
  color: #7b5f18;
}

.purchase-module-upload-status.info::before,
.purchase-module-upload-status.success::before {
  content: "";
  width: 15px;
  height: 15px;
  border-radius: 999px;
  border: 2px solid rgba(123, 95, 24, 0.18);
  border-top-color: #c39321;
  animation: quote-photo-status-spin 0.8s linear infinite;
  flex: 0 0 auto;
}

.purchase-module-upload-status.success::before {
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 0;
  background: none;
  animation: none;
  clip-path: polygon(14% 52%, 0 66%, 39% 100%, 100% 18%, 84% 4%, 37% 63%);
  background-color: #c39321;
}

.purchase-module-upload-status.success {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(195, 147, 33, 0.24);
  background: linear-gradient(180deg, rgba(255, 249, 232, 0.95), rgba(248, 239, 208, 0.92));
  color: #7b5f18;
}

.purchase-module-upload-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 156px));
  justify-content: start;
  gap: 8px;
}

.purchase-module-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 14px;
  font-weight: 760;
  font-size: 0.82rem;
  line-height: 1.1;
  letter-spacing: -0.01em;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 8px 18px rgba(13, 54, 43, 0.05);
}

.purchase-module-action-btn span {
  display: block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.purchase-module-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 28px;
  padding: 0 8px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(26, 136, 217, 0.14), rgba(15, 122, 95, 0.12));
  color: #124030;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.purchase-module-pipeline {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.purchase-module-pipeline span,
.purchase-module-filter-chip,
.purchase-module-tag,
.purchase-module-history-type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(15, 122, 95, 0.18);
  background: rgba(226, 242, 236, 0.9);
  color: #2f5448;
  font-size: 0.74rem;
  font-weight: 740;
}

.purchase-module-analysis-shell {
  display: grid;
  gap: 10px;
  flex: 1 1 auto;
}

.purchase-module-analysis-card {
  border: 1px solid rgba(16, 34, 26, 0.08);
  border-radius: 18px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.94);
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 100%;
}

.purchase-module-analysis-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.purchase-module-analysis-type {
  margin: 0;
  color: #4d6d61;
  font-size: 0.76rem;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.purchase-module-analysis-title {
  margin: 2px 0 0;
  font-size: 1.2rem;
  font-weight: 810;
  color: #11362b;
}

.purchase-module-analysis-title-empty {
  font-size: 1rem;
  font-weight: 760;
}

.purchase-module-confidence {
  min-width: 138px;
  border-radius: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(26, 136, 217, 0.18);
  background: rgba(223, 239, 255, 0.84);
  text-align: right;
}

.purchase-module-confidence strong {
  display: block;
  color: #11476a;
  font-size: 1.34rem;
}

.purchase-module-confidence span {
  color: #41677c;
  font-size: 0.76rem;
  font-weight: 760;
}

.purchase-module-analysis-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
}

.purchase-module-analysis-field {
  border-bottom: 1px solid rgba(16, 34, 26, 0.08);
  padding-bottom: 12px;
}

.purchase-module-analysis-field span {
  display: block;
  color: #73887f;
  font-size: 0.7rem;
  font-weight: 740;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.purchase-module-analysis-field strong {
  display: block;
  margin-top: 5px;
  color: #18392f;
  font-size: 1.08rem;
}

.purchase-module-tag-row,
.purchase-module-flag-list,
.purchase-module-filter-row,
.purchase-module-history-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.purchase-module-history-head {
  display: grid;
  gap: 14px;
}

.purchase-module-history-tools {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(520px, 1.08fr);
  gap: 18px;
  align-items: stretch;
}

.purchase-module-history-stats {
  display: grid;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-self: stretch;
  align-content: center;
}

.purchase-module-history-totals,
.purchase-module-period-summary {
  height: 100%;
  align-content: stretch;
}

.purchase-module-summary-item.stat-count {
  background:
    radial-gradient(circle at 100% 0%, rgba(26, 136, 217, 0.14), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 251, 0.95));
}

.purchase-module-summary-item.stat-period {
  background:
    radial-gradient(circle at 100% 0%, rgba(15, 122, 95, 0.12), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 250, 246, 0.95));
}

.purchase-module-total-item.stat-ht {
  background:
    radial-gradient(circle at 100% 0%, rgba(26, 136, 217, 0.12), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 251, 0.95));
}

.purchase-module-total-item.stat-vat {
  background:
    radial-gradient(circle at 100% 0%, rgba(233, 179, 61, 0.16), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(252, 248, 238, 0.95));
}

.purchase-module-total-item.stat-ttc {
  background:
    radial-gradient(circle at 100% 0%, rgba(15, 122, 95, 0.16), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 249, 245, 0.95));
}

.purchase-module-filter-row {
  width: 100%;
}

.purchase-module-filter-toolbar {
  width: 100%;
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(15, 122, 95, 0.1);
  border-radius: 22px;
  background:
    radial-gradient(circle at 100% 0%, rgba(26, 136, 217, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(248, 252, 250, 0.98), rgba(240, 248, 245, 0.94));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 12px 24px rgba(10, 32, 24, 0.04);
}

.purchase-module-filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.purchase-module-filter-header-copy {
  display: grid;
  gap: 4px;
}

.purchase-module-filter-kicker {
  color: #5f7c70;
  font-size: 0.68rem;
  font-weight: 780;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.purchase-module-filter-header-copy strong {
  color: #173126;
  font-size: 1.08rem;
  line-height: 1.1;
}

.purchase-module-filter-scope {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: fit-content;
  padding: 4px;
  border: 1px solid rgba(15, 122, 95, 0.08);
  border-radius: 999px;
  background: rgba(227, 241, 236, 0.8);
}

.purchase-module-filter-toggle {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: #426257;
  font-size: 0.84rem;
  font-weight: 760;
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.purchase-module-filter-toggle.active {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(244, 250, 247, 0.96));
  border-color: rgba(15, 122, 95, 0.16);
  color: #0e3529;
  box-shadow: 0 8px 18px rgba(10, 32, 24, 0.06);
}

.purchase-module-filter-panel {
  display: grid;
  gap: 10px;
  width: 100%;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(16, 34, 26, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.64);
}

.purchase-module-filter-panel-label {
  color: #698278;
  font-size: 0.7rem;
  font-weight: 780;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.purchase-module-filter-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
  width: 100%;
  min-width: 0;
}

.purchase-module-filter-field {
  display: grid;
  gap: 6px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.purchase-module-filter-control {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.purchase-module-filter-control.is-month-control {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(16, 34, 26, 0.12);
  border-radius: 14px;
  background: rgba(249, 251, 250, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.purchase-module-filter-control.is-date-control {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(16, 34, 26, 0.12);
  border-radius: 14px;
  background: rgba(249, 251, 250, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.purchase-module-filter-field input,
.purchase-module-filter-field select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: block;
  box-sizing: border-box;
  min-height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(16, 34, 26, 0.12);
  background: rgba(249, 251, 250, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.purchase-module-filter-field input[type="month"] {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  inline-size: 100% !important;
  min-inline-size: 0 !important;
  -webkit-min-logical-width: 0;
  -webkit-appearance: none;
  appearance: none;
  border: 0;
  border-radius: inherit;
  background: transparent;
  box-shadow: none;
  margin-inline: 0;
  justify-self: stretch;
  padding-left: 14px;
  padding-inline-start: 14px;
  padding-right: 34px;
  padding-inline-end: 34px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-module-filter-field input[type="date"] {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  inline-size: 100% !important;
  min-inline-size: 0 !important;
  -webkit-min-logical-width: 0;
  -webkit-appearance: none;
  appearance: none;
  border: 0;
  border-radius: inherit;
  background: transparent;
  box-shadow: none;
  margin-inline: 0;
  justify-self: stretch;
  padding-left: 14px;
  padding-inline-start: 14px;
  padding-right: 34px;
  padding-inline-end: 34px;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 900px) {
  .purchase-module-filter-control.is-month-control {
    width: 100%;
    margin-inline: 0;
  }
}

.purchase-module-filter-field input[type="month"]::-webkit-datetime-edit,
.purchase-module-filter-field input[type="month"]::-webkit-datetime-edit-fields-wrapper,
.purchase-module-filter-field input[type="month"]::-webkit-date-and-time-value {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-module-filter-field span,
.purchase-module-filter-summary {
  color: #60756c;
  font-size: 0.76rem;
  font-weight: 720;
}

.purchase-module-filter-summary {
  margin: 0;
  line-height: 1.45;
}

.purchase-module-filter-reset {
  min-height: 40px;
  padding-inline: 16px;
  white-space: nowrap;
}

.purchase-module-tag.category {
  background: rgba(223, 239, 255, 0.9);
  border-color: rgba(26, 136, 217, 0.24);
  color: #0d557e;
}

.purchase-module-tag.project {
  background: rgba(220, 241, 232, 0.92);
  border-color: rgba(15, 122, 95, 0.22);
  color: #05543f;
}

.purchase-module-tag.flag,
.purchase-module-history-type {
  background: rgba(233, 241, 249, 0.88);
  border-color: rgba(47, 127, 185, 0.24);
  color: #21597f;
}

.purchase-module-tag.flag.warning {
  background: rgba(255, 237, 205, 0.92);
  border-color: rgba(199, 120, 8, 0.24);
  color: #8a4e00;
}

.purchase-module-tag.flag.danger {
  background: rgba(255, 225, 225, 0.9);
  border-color: rgba(184, 69, 69, 0.28);
  color: #8f2f2f;
}

.purchase-module-analysis-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 20px;
}

.purchase-module-analysis-actions [data-purchase-action="validate-document"] {
  min-width: 144px;
}

.purchase-module-edit-form {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(16, 34, 26, 0.08);
  border-radius: 18px;
  background: rgba(242, 248, 245, 0.88);
}

.purchase-module-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.purchase-module-edit-field {
  display: grid;
  gap: 6px;
}

.purchase-module-edit-field span {
  color: #6d8278;
  font-size: 0.72rem;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.purchase-module-edit-note {
  margin: 0;
  color: #567165;
  font-size: 0.82rem;
  line-height: 1.45;
}

.purchase-camera-popup-card {
  width: min(720px, 100%);
}

.purchase-archive-modal-card {
  width: min(920px, 100%);
  max-height: min(92vh, 980px);
  max-height: min(92svh, 980px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.purchase-archive-modal-head {
  align-items: flex-start;
}

.purchase-archive-modal-body {
  display: grid;
  align-items: start;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding-right: 4px;
}

#purchaseArchiveModal {
  overflow: hidden;
}

.purchase-archive-modal-sheet {
  height: auto;
  min-height: 0;
}

.purchase-camera-popup-stage {
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(13, 92, 71, 0.14);
  background:
    linear-gradient(180deg, rgba(245, 250, 247, 0.98), rgba(233, 243, 239, 0.94));
}

.purchase-camera-popup-video {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #d9e6df;
}

.purchase-camera-popup-actions {
  justify-content: space-between;
}

.purchase-module-preview {
  display: flex;
  flex-direction: column;
  padding: 16px;
  min-height: 100%;
}

.purchase-module-preview-head {
  margin-bottom: 14px;
}

.purchase-module-preview-sheet {
  flex: 1 1 auto;
  border-radius: 20px;
  border: 1px solid rgba(16, 34, 26, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 251, 253, 0.98));
  padding: 16px;
  box-shadow:
    0 12px 24px rgba(10, 32, 24, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.74);
  display: grid;
  gap: 12px;
  min-height: min(68vh, 700px);
}

.purchase-document-sheet-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  border: 1px solid rgba(16, 34, 26, 0.08);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 251, 0.98));
  color: #1f4f7a;
  font-size: 1.12rem;
  font-weight: 900;
  letter-spacing: 0.015em;
}

.purchase-document-sheet-meta p,
.purchase-document-sheet-totals p,
.purchase-document-sheet-footer p {
  margin: 0;
}

.purchase-document-sheet-meta {
  display: grid;
  gap: 5px;
  color: #355247;
  font-size: 0.9rem;
}

.purchase-document-sheet-meta strong,
.purchase-document-sheet-totals strong {
  color: #10221a;
}

.purchase-document-sheet-lines {
  border-top: 1px solid rgba(16, 34, 26, 0.08);
  border-bottom: 1px solid rgba(16, 34, 26, 0.08);
  padding: 10px 0;
  display: grid;
  gap: 10px;
}

.purchase-document-sheet-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.purchase-document-sheet-line strong {
  color: #143428;
  font-size: 0.88rem;
}

.purchase-document-sheet-line span {
  display: block;
  margin-top: 2px;
  color: #70817a;
  font-size: 0.74rem;
}

.purchase-document-sheet-line-ref {
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.purchase-document-sheet-line-vat {
  color: #5f736b;
}

.purchase-document-sheet-line-total {
  color: #173c30;
  font-size: 0.88rem;
  font-weight: 760;
}

.purchase-document-sheet-totals {
  display: grid;
  gap: 7px;
  padding-top: 2px;
}

.purchase-document-sheet-totals p {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #365549;
  font-size: 0.9rem;
}

.purchase-document-sheet-totals p.total {
  font-size: 1.06rem;
  font-weight: 820;
}

.purchase-document-sheet-footer {
  display: grid;
  gap: 8px;
}

.purchase-module-filter-chip.active {
  background: linear-gradient(135deg, rgba(15, 122, 95, 0.18), rgba(26, 136, 217, 0.16));
  border-color: rgba(15, 122, 95, 0.26);
  color: #0e3529;
}

.purchase-module-history-list {
  display: grid;
  gap: 10px;
}

.purchase-module-history-carousel {
  display: grid;
  gap: 12px;
}

.purchase-module-history-carousel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.purchase-module-history-carousel-caption {
  margin: 0;
  color: #60756c;
  font-size: 0.78rem;
  font-weight: 760;
}

.purchase-module-history-carousel-hint {
  color: #5d7b70;
  font-size: 0.76rem;
  font-weight: 700;
}

.purchase-module-history-carousel-shell {
  display: grid;
  gap: 10px;
}

.purchase-module-history-carousel-track {
  display: grid;
  gap: 10px;
  max-height: clamp(260px, 38vh, 360px);
  overflow-y: auto;
  padding-right: 6px;
  padding-bottom: 4px;
  scroll-behavior: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  scrollbar-width: auto;
  border-right: 1px solid rgba(15, 122, 95, 0.08);
}

.purchase-module-history-carousel-track::-webkit-scrollbar {
  width: 7px;
}

.purchase-module-history-carousel-track::-webkit-scrollbar-track {
  background: rgba(16, 34, 26, 0.08);
  border-radius: 999px;
}

.purchase-module-history-carousel-track::-webkit-scrollbar-thumb {
  background: rgba(15, 122, 95, 0.34);
  border-radius: 999px;
}

.purchase-module-history-item {
  border: 1px solid rgba(16, 34, 26, 0.08);
  border-radius: 16px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.94);
  display: grid;
  gap: 6px;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.purchase-module-history-item:hover,
.purchase-module-history-item:focus-visible {
  border-color: rgba(26, 136, 217, 0.24);
  box-shadow: 0 10px 24px rgba(10, 32, 24, 0.06);
  transform: translateY(-1px);
}

.purchase-module-history-item.is-active {
  border-color: rgba(15, 122, 95, 0.3);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(237, 247, 243, 0.98));
  box-shadow:
    0 14px 28px rgba(10, 32, 24, 0.08),
    inset 0 0 0 1px rgba(15, 122, 95, 0.08);
}

.purchase-module-history-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.purchase-module-history-main {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.purchase-module-history-copy {
  display: grid;
  gap: 2px;
}

.purchase-module-history-top h4 {
  margin: 0;
  color: #18392f;
  font-size: 0.98rem;
}

.purchase-module-history-subline {
  margin: 0;
  color: #5f746a;
  font-size: 0.8rem;
}

.purchase-module-history-top p,
.purchase-module-history-meta {
  margin: 3px 0 0;
  color: #5f746a;
  font-size: 0.8rem;
}

.purchase-module-history-side {
  display: grid;
  justify-items: end;
  gap: 8px;
  flex-shrink: 0;
}

.purchase-module-history-amount {
  color: #18392f;
  font-size: 0.98rem;
  font-weight: 820;
  white-space: nowrap;
}

.purchase-module-history-delete {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(16, 34, 26, 0.08);
  border-radius: 999px;
  background: rgba(247, 251, 249, 0.98);
  color: #5d756a;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.purchase-module-history-delete:hover,
.purchase-module-history-delete:focus-visible {
  border-color: rgba(189, 87, 87, 0.32);
  background: rgba(255, 234, 234, 0.96);
  color: #9b3434;
  transform: translateY(-1px);
}

.purchase-module-footer {
  display: grid;
  justify-content: flex-start;
  gap: 10px;
  margin-top: 16px;
  padding-top: 2px;
}

.purchase-module-footer-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  flex: 1 1 auto;
}

.purchase-module-footer-actions {
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  flex: 0 0 auto;
  flex-wrap: wrap;
}

.purchase-module-footer-status {
  margin: 0;
  min-height: 20px;
  color: #8a4e00;
  font-size: 0.84rem;
  font-weight: 650;
}

.purchase-module-footer-status.info {
  color: #0d557e;
}

.purchase-module-footer-status.success {
  color: #05543f;
}

.purchase-module-footer-status.error {
  color: #9b3434;
}

.purchase-module-footer-actions .btn.is-loading {
  opacity: 0.78;
  cursor: wait;
}

@media (max-width: 980px) {
  .purchase-module-layout {
    grid-template-columns: 1fr;
  }

  .purchase-module-upload,
  .purchase-module-analysis,
  .purchase-module-preview,
  .purchase-module-history {
    grid-column: 1;
    grid-row: auto;
  }

  .purchase-module-history-tools {
    grid-template-columns: 1fr;
  }

  .purchase-module-history-stats {
    grid-template-rows: none;
  }
}

@media (max-width: 760px) {
  .purchase-module-card {
    padding: 14px 12px 12px;
  }

  .purchase-module-head {
    margin-bottom: 14px;
    align-items: center;
  }

  .purchase-module-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid rgba(15, 122, 95, 0.18);
    border-radius: 12px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(240, 248, 244, 0.94));
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.84),
      0 8px 18px rgba(13, 54, 43, 0.05);
    cursor: pointer;
  }

  .purchase-module-toggle-icon {
    width: 12px;
    height: 12px;
    border-right: 2px solid #12382d;
    border-bottom: 2px solid #12382d;
    transform: translateY(-2px) rotate(45deg);
    transition: transform 180ms ease;
  }

  .purchase-module-card.is-collapsed-mobile .purchase-module-toggle-icon {
    transform: translateY(1px) rotate(-135deg);
  }

  .purchase-module-card.is-collapsed-mobile .purchase-module-body {
    display: none;
  }

  .purchase-module-period-summary,
  .purchase-module-footer-totals {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .purchase-module-period-summary {
    gap: 8px;
  }

  .purchase-module-summary-item,
  .purchase-module-total-item {
    min-height: 78px;
    padding: 12px 14px;
    border-radius: 20px;
    gap: 4px;
  }

  .purchase-module-summary-item::before,
  .purchase-module-total-item::before {
    width: 5px;
    border-radius: 20px 0 0 20px;
  }

  .purchase-module-summary-item strong,
  .purchase-module-total-item strong {
    font-size: 0.98rem;
    line-height: 1.08;
  }

  .purchase-module-summary-item span,
  .purchase-module-total-item span {
    font-size: 0.7rem;
  }

  .purchase-module-stat-kicker {
    font-size: 0.62rem;
  }

  .purchase-module-stat-note {
    font-size: 0.72rem;
    line-height: 1.3;
  }

  .purchase-module-analysis-grid,
  .purchase-module-edit-grid,
  .purchase-module-filter-controls {
    grid-template-columns: 1fr;
  }

  .purchase-module-filter-field input[type="month"] {
    font-size: 0.96rem;
  }

  .purchase-module-upload-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .purchase-module-upload-actions .purchase-module-action-btn:last-child {
    grid-column: 1 / -1;
  }

  .purchase-module-action-btn {
    min-height: 38px;
    padding: 0 10px;
    border-radius: 12px;
    font-size: 0.8rem;
  }

  .purchase-module-analysis {
    min-height: auto;
  }

  .purchase-module-analysis-card {
    padding: 16px;
    border-radius: 16px;
    gap: 12px;
  }

  .purchase-module-analysis-top {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .purchase-module-analysis-title {
    font-size: 1.04rem;
    line-height: 1.15;
  }

  .purchase-module-analysis-title-empty {
    font-size: 0.94rem;
  }

  .purchase-module-confidence {
    display: inline-grid;
    justify-items: start;
    align-self: flex-start;
    min-width: 0;
    padding: 10px 12px;
    border-radius: 12px;
    text-align: left;
  }

  .purchase-module-confidence strong {
    font-size: 1.08rem;
    line-height: 1;
  }

  .purchase-module-confidence span {
    font-size: 0.7rem;
    line-height: 1.25;
  }

  .purchase-module-analysis-field {
    padding-bottom: 10px;
  }

  .purchase-module-analysis-field span {
    font-size: 0.66rem;
  }

  .purchase-module-analysis-field strong {
    margin-top: 4px;
    font-size: 0.98rem;
    line-height: 1.2;
  }

  .purchase-module-tag-row,
  .purchase-module-flag-list {
    gap: 6px;
  }

  .purchase-module-analysis-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding-top: 12px;
  }

  .purchase-module-analysis-actions .btn {
    min-height: 38px;
    padding: 0 10px;
    border-radius: 12px;
    font-size: 0.8rem;
  }

  .purchase-module-analysis-actions [data-purchase-action="validate-document"] {
    min-width: 0;
  }

  .purchase-module-analysis-actions [data-purchase-action="reset-document"],
  .purchase-module-analysis-actions [data-purchase-action="cancel-edit-document"] {
    grid-column: 1 / -1;
    justify-self: start;
    min-width: 88px;
  }

  .purchase-module-filter-reset {
    min-height: 36px;
    padding-inline: 12px;
    border-radius: 12px;
    font-size: 0.78rem;
  }

  .purchase-module-filter-header {
    flex-direction: column;
    align-items: stretch;
  }

  .purchase-module-history-head {
    gap: 10px;
  }

  .purchase-module-history-tools {
    gap: 12px;
  }

  .purchase-module-history-stats {
    gap: 8px;
  }

  .purchase-module-filter-toolbar {
    padding: 14px;
    border-radius: 18px;
    gap: 12px;
  }

  .purchase-module-filter-panel {
    padding: 10px;
    border-radius: 16px;
  }

  .purchase-module-history-carousel-head {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .purchase-module-history-carousel-caption,
  .purchase-module-history-carousel-hint {
    font-size: 0.74rem;
  }

  .purchase-module-history-carousel-track {
    max-height: min(280px, 42vh);
    gap: 8px;
    padding-right: 0;
    border-right: 0;
    scrollbar-gutter: auto;
  }

  .purchase-module-history-item {
    padding: 8px 9px;
    border-radius: 14px;
    gap: 3px;
  }

  .purchase-module-history-top {
    flex-direction: column;
    align-items: stretch;
    gap: 3px;
  }

  .purchase-module-history-main,
  .purchase-module-history-copy {
    gap: 2px;
  }

  .purchase-module-history-top h4 {
    font-size: 0.9rem;
    line-height: 1.14;
  }

  .purchase-module-history-subline,
  .purchase-module-history-top p,
  .purchase-module-history-meta {
    font-size: 0.74rem;
    line-height: 1.28;
  }

  .purchase-module-history-tags,
  .purchase-module-tag-row {
    gap: 5px;
  }

  .purchase-module-history-type,
  .purchase-module-tag {
    min-height: 26px;
    padding: 0 10px;
    font-size: 0.7rem;
  }

  .purchase-module-history-side {
    width: 100%;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 4px;
    margin-top: -1px;
  }

  .purchase-module-history-amount {
    font-size: 0.88rem;
  }

  .purchase-module-history-delete {
    width: 24px;
    height: 24px;
    font-size: 0.82rem;
  }

  .purchase-module-footer {
    justify-items: stretch;
  }

  .purchase-module-footer-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .purchase-module-footer-actions .btn {
    width: 100%;
    min-height: 38px;
    padding: 0 10px;
    border-radius: 12px;
    font-size: 0.8rem;
  }

  #purchaseModuleExportEmailBtn {
    grid-column: 1 / -1;
  }
}

@media (max-width: 480px) {
  .purchase-module-toggle {
    width: 34px;
    height: 34px;
    border-radius: 11px;
  }

  .purchase-module-toggle-icon {
    width: 10px;
    height: 10px;
  }

  .purchase-module-period-summary {
    gap: 7px;
  }

  .purchase-module-summary-item,
  .purchase-module-total-item {
    min-height: 72px;
    padding: 11px 12px;
    border-radius: 18px;
  }

  .purchase-module-summary-item strong,
  .purchase-module-total-item strong {
    font-size: 0.92rem;
  }

  .purchase-module-summary-item span,
  .purchase-module-total-item span,
  .purchase-module-stat-note {
    font-size: 0.68rem;
  }

  .purchase-module-upload-actions {
    grid-template-columns: 1fr;
  }

  .purchase-module-upload-actions .purchase-module-action-btn:last-child {
    grid-column: auto;
  }

  .purchase-module-action-btn {
    min-height: 36px;
    padding: 0 9px;
    border-radius: 11px;
    font-size: 0.78rem;
  }

  .purchase-module-analysis-card {
    padding: 14px;
    gap: 10px;
  }

  .purchase-module-analysis-title {
    font-size: 0.98rem;
  }

  .purchase-module-confidence {
    width: 100%;
    justify-items: center;
    text-align: center;
  }

  .purchase-module-analysis-grid {
    gap: 10px;
  }

  .purchase-module-analysis-actions {
    grid-template-columns: 1fr;
  }

  .purchase-module-analysis-actions [data-purchase-action="reset-document"],
  .purchase-module-analysis-actions [data-purchase-action="cancel-edit-document"] {
    justify-self: stretch;
    min-width: 0;
  }

  .purchase-module-analysis-actions .btn,
  .purchase-module-footer-actions .btn,
  .purchase-module-filter-reset {
    min-height: 36px;
    padding: 0 9px;
    border-radius: 11px;
    font-size: 0.78rem;
  }

  .purchase-module-filter-field input[type="month"] {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    display: block;
    box-sizing: border-box;
    -webkit-min-logical-width: 0;
    min-height: 40px;
    font-size: 0.88rem;
    padding-right: 30px;
    padding-inline-end: 30px;
  }

  .purchase-module-filter-field input[type="month"]::-webkit-datetime-edit,
  .purchase-module-filter-field input[type="month"]::-webkit-datetime-edit-fields-wrapper,
  .purchase-module-filter-field input[type="month"]::-webkit-date-and-time-value {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .purchase-module-filter-control.is-month-control {
    width: 100%;
    margin-inline: 0;
  }

  .purchase-module-history-carousel-track {
    max-height: min(248px, 40vh);
  }

  .purchase-module-history-item {
    padding: 8px;
  }

  .purchase-module-history-side {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .purchase-module-history-delete {
    justify-self: end;
  }

  .purchase-module-footer-actions {
    grid-template-columns: 1fr;
  }

  #purchaseModuleExportEmailBtn {
    grid-column: auto;
  }
}

@media (max-width: 760px) {
  .purchase-module-footer {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    justify-items: stretch;
  }

  .purchase-module-footer-actions {
    width: 100%;
    min-width: 0;
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 8px;
    justify-items: center;
    justify-self: stretch;
  }

  .purchase-module-footer-actions .btn {
    width: min(100%, calc(100% - 24px));
    justify-self: center;
  }

  .purchase-module-footer-status {
    width: 100%;
  }

  #purchaseModuleExportEmailBtn {
    grid-column: auto;
  }
}

@media (min-width: 761px) and (max-width: 980px) {
  .purchase-module-footer {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    justify-items: stretch;
  }

  .purchase-module-footer-actions {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 220px));
    gap: 4px;
    justify-content: start;
    justify-self: stretch;
    align-items: stretch;
  }

  .purchase-module-footer-actions .btn {
    width: 100%;
    justify-self: stretch;
  }

  #purchaseModuleExportEmailBtn {
    grid-column: auto;
  }
}

html[data-theme="dark"] .purchase-module-card,
html[data-theme="dark"] .purchase-module-block,
html[data-theme="dark"] .purchase-module-preview,
html[data-theme="dark"] .purchase-module-summary-item,
html[data-theme="dark"] .purchase-module-total-item,
html[data-theme="dark"] .purchase-module-analysis-card,
html[data-theme="dark"] .purchase-module-history-item,
html[data-theme="dark"] .purchase-module-preview-sheet,
html[data-theme="dark"] .purchase-module-edit-form {
  border-color: var(--border-soft);
  background: var(--surface-2);
  box-shadow: none;
}

html[data-theme="dark"] .purchase-module-history-item:hover,
html[data-theme="dark"] .purchase-module-history-item:focus-visible,
html[data-theme="dark"] .purchase-module-history-item.is-active {
  border-color: rgba(113, 197, 173, 0.34);
  background: rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] .purchase-module-card {
  background:
    radial-gradient(circle at 100% 0%, rgba(36, 105, 168, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(10, 21, 18, 0.98), rgba(17, 31, 27, 0.96));
}

html[data-theme="dark"] .purchase-module-kicker,
html[data-theme="dark"] .purchase-module-preview-kicker,
html[data-theme="dark"] .purchase-module-block-head p,
html[data-theme="dark"] .purchase-module-upload-status,
html[data-theme="dark"] .purchase-module-summary-item span,
html[data-theme="dark"] .purchase-module-total-item span,
html[data-theme="dark"] .purchase-module-analysis-field span,
html[data-theme="dark"] .purchase-module-edit-field span,
html[data-theme="dark"] .purchase-module-edit-note,
html[data-theme="dark"] .purchase-document-sheet-meta,
html[data-theme="dark"] .purchase-document-sheet-line span,
html[data-theme="dark"] .purchase-document-sheet-totals p,
html[data-theme="dark"] .purchase-module-history-top p,
html[data-theme="dark"] .purchase-module-history-meta {
  color: var(--muted);
}

html[data-theme="dark"] .purchase-module-upload-status.success {
  color: #5b6f64;
}

html[data-theme="dark"] .purchase-module-analysis-title,
html[data-theme="dark"] .purchase-module-summary-item strong,
html[data-theme="dark"] .purchase-module-total-item strong,
html[data-theme="dark"] .purchase-module-analysis-field strong,
html[data-theme="dark"] .purchase-module-history-top h4,
html[data-theme="dark"] .purchase-module-history-amount,
html[data-theme="dark"] .purchase-document-sheet-meta strong,
html[data-theme="dark"] .purchase-document-sheet-totals strong,
html[data-theme="dark"] .purchase-document-sheet-line strong {
  color: var(--text);
}

html[data-theme="dark"] .purchase-module-history-delete {
  border-color: rgba(148, 181, 169, 0.18);
  background: rgba(255, 255, 255, 0.05);
  color: #c8dad3;
}

html[data-theme="dark"] .purchase-module-history-carousel-track {
  border-right-color: rgba(148, 181, 169, 0.12);
}

html[data-theme="dark"] .purchase-module-history-carousel-track::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .purchase-module-history-carousel-track::-webkit-scrollbar-thumb {
  background: rgba(113, 197, 173, 0.34);
}

html[data-theme="dark"] .purchase-archive-modal-sheet {
  background: var(--surface-2);
  box-shadow: none;
}

html[data-theme="dark"] .purchase-module-history-delete:hover,
html[data-theme="dark"] .purchase-module-history-delete:focus-visible {
  border-color: rgba(235, 117, 117, 0.34);
  background: rgba(141, 52, 52, 0.2);
  color: #ffc4c4;
}

html[data-theme="dark"] .purchase-module-filter-toggle {
  border-color: transparent;
  background: transparent;
  color: #d8e6e0;
}

html[data-theme="dark"] .purchase-module-filter-toggle.active {
  border-color: rgba(113, 197, 173, 0.34);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

html[data-theme="dark"] .purchase-module-filter-toolbar,
html[data-theme="dark"] .purchase-module-filter-panel {
  border-color: var(--border-soft);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: none;
}

html[data-theme="dark"] .purchase-module-filter-scope {
  border-color: rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
}

html[data-theme="dark"] .purchase-module-filter-header-copy strong,
html[data-theme="dark"] .purchase-module-filter-panel-label,
html[data-theme="dark"] .purchase-module-filter-kicker {
  color: var(--text);
}

html[data-theme="dark"] .purchase-module-action-icon,
html[data-theme="dark"] .purchase-module-pipeline span,
html[data-theme="dark"] .purchase-module-filter-chip,
html[data-theme="dark"] .purchase-module-tag,
html[data-theme="dark"] .purchase-module-history-type {
  border-color: rgba(148, 181, 169, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #d8e6e0;
}

html[data-theme="dark"] .purchase-camera-popup-stage {
  border-color: rgba(148, 181, 169, 0.18);
  background:
    linear-gradient(180deg, rgba(11, 23, 19, 0.96), rgba(18, 31, 27, 0.94));
}

html[data-theme="dark"] .purchase-camera-popup-video {
  background: #0d1814;
}

html[data-theme="dark"] .purchase-module-confidence {
  border-color: rgba(73, 169, 232, 0.24);
  background: rgba(44, 92, 125, 0.22);
}

html[data-theme="dark"] .purchase-module-confidence strong {
  color: #9fd7ff;
}

html[data-theme="dark"] .purchase-document-sheet-brand {
  border-color: rgba(148, 181, 169, 0.16);
  background: linear-gradient(180deg, rgba(18, 34, 29, 0.98), rgba(15, 28, 24, 0.96));
  color: #90cbff;
}

html[data-theme="dark"] .purchase-document-sheet-lines {
  border-color: rgba(148, 181, 169, 0.12);
}

.weather-alert-popup {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  padding: clamp(14px, 2.6vw, 26px);
  background: rgba(8, 34, 27, 0.42);
  backdrop-filter: blur(4px);
}

.weather-alert-popup-card {
  width: min(760px, 100%);
  border-radius: 18px;
  border: 1px solid rgba(13, 92, 71, 0.24);
  background:
    radial-gradient(circle at 95% 0%, rgba(255, 223, 181, 0.2), transparent 45%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 251, 247, 0.96));
  box-shadow:
    0 26px 48px rgba(6, 33, 26, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  padding: clamp(16px, 2.2vw, 22px);
  display: grid;
  gap: 12px;
}

.weather-alert-popup-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.weather-alert-popup-head h2 {
  margin: 2px 0 0;
  font-size: clamp(1.14rem, 1.9vw, 1.36rem);
}

.weather-alert-popup-kicker {
  margin: 0;
  color: #5f7e73;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 760;
}

.weather-alert-popup-meta {
  margin: 0;
  color: #4f6f63;
  font-size: 0.9rem;
}

.weather-alert-popup-list {
  display: grid;
  gap: 10px;
}

.weather-alert-popup-item {
  border: 1px solid rgba(16, 34, 26, 0.12);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.weather-alert-popup-item.red {
  border-color: rgba(173, 44, 44, 0.36);
  background:
    linear-gradient(160deg, rgba(255, 240, 240, 0.96), rgba(255, 231, 231, 0.9));
}

.weather-alert-popup-item.orange {
  border-color: rgba(199, 120, 8, 0.3);
  background:
    linear-gradient(160deg, rgba(255, 247, 236, 0.95), rgba(255, 243, 225, 0.88));
}

.weather-alert-popup-item-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.weather-alert-popup-item-title {
  margin: 0;
  font-size: 1.04rem;
  font-weight: 810;
  color: #12382c;
}

.weather-alert-popup-item-risk {
  margin-left: 6px;
  font-size: 0.84rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #4a6459;
  font-weight: 780;
}

.weather-alert-popup-item-meta {
  margin: 0;
  color: #3d5a50;
  font-size: 0.84rem;
  font-weight: 700;
}

.weather-alert-popup-item-message {
  margin: 0;
  color: #26483c;
  font-size: 0.92rem;
  line-height: 1.34;
}

.weather-alert-popup-level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.78rem;
  font-weight: 860;
  letter-spacing: 0.05em;
}

.weather-alert-popup-level-badge.orange {
  color: #8a4e00;
  border-color: rgba(199, 120, 8, 0.32);
  background: rgba(255, 229, 182, 0.65);
}

.weather-alert-popup-level-badge.red {
  color: #872727;
  border-color: rgba(173, 44, 44, 0.36);
  background: rgba(255, 202, 202, 0.64);
}

.send-confirm-popup {
  position: fixed;
  inset: 0;
  z-index: 46;
  display: grid;
  place-items: center;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(14px, 2.6vw, 26px);
  background: rgba(8, 34, 27, 0.44);
  backdrop-filter: blur(4px);
}

.send-confirm-popup-card {
  width: min(560px, 100%);
  border-radius: 18px;
  border: 1px solid rgba(13, 92, 71, 0.24);
  background:
    radial-gradient(circle at 100% 0%, rgba(161, 239, 220, 0.18), transparent 48%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 251, 247, 0.96));
  box-shadow:
    0 28px 52px rgba(5, 33, 26, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.62) inset;
  padding: clamp(16px, 2.2vw, 24px);
  display: grid;
  gap: 12px;
}

.send-confirm-popup-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.send-confirm-popup-head h2 {
  margin: 2px 0 0;
  font-size: clamp(1.12rem, 1.85vw, 1.32rem);
}

.send-confirm-popup-kicker {
  margin: 0;
  color: #5f7e73;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 760;
}

.send-confirm-popup-message {
  margin: 0;
  color: #25483c;
  font-size: 0.96rem;
  line-height: 1.4;
}

.send-confirm-popup-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.invoice-deposit-popup-card {
  width: min(620px, 100%);
}

.invoice-deposit-form {
  display: grid;
  gap: 14px;
}

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

.invoice-deposit-feedback {
  min-height: 1.2em;
  color: #2f5d4b;
  font-size: 0.92rem;
}

.invoice-deposit-feedback.is-danger {
  color: #8b2e2e;
}

.invoice-deposit-popup-actions {
  gap: 10px;
}

.pdf-preview-popup {
  z-index: 48;
}

.pdf-preview-popup-card {
  width: min(1120px, 100%);
  max-height: min(92vh, 980px);
}

.pdf-preview-popup-head {
  align-items: center;
}

.pdf-preview-shell {
  position: relative;
  min-height: min(72vh, 760px);
  border-radius: 16px;
  border: 1px solid rgba(16, 34, 26, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(243, 249, 246, 0.94));
  overflow: hidden;
}

.pdf-preview-loading {
  margin: 0;
  min-height: min(72vh, 760px);
  display: grid;
  place-items: center;
  padding: 24px;
  color: #33584b;
  font-size: 0.96rem;
  font-weight: 650;
  text-align: center;
}

.pdf-preview-frame {
  width: 100%;
  min-height: min(72vh, 760px);
  border: 0;
  background: #f3f5f7;
}

.pdf-preview-popup-actions {
  gap: 10px;
}

.style-card {
  margin-top: 14px;
}

.style-summary {
  border: 1px dashed rgba(16, 34, 26, 0.2);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.7);
  padding: 12px;
  display: grid;
  gap: 4px;
}

.style-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.style-summary .main {
  color: var(--text);
  font-weight: 700;
}

.style-summary .warning {
  color: #7b4c00;
  font-weight: 700;
}

.style-summary .success {
  color: #05543f;
  font-weight: 700;
}

.style-actions {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.business-preferences {
  margin-top: 12px;
  border: 1px solid rgba(16, 34, 26, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  padding: 12px;
}

.business-preferences-head {
  margin-bottom: 10px;
}

.business-preferences-head h3 {
  margin: 0;
  font-size: 1rem;
}

.business-preferences-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.business-trade-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.business-trade-chip {
  border: 1px solid rgba(16, 34, 26, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  color: #27453a;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.business-trade-chip:hover {
  border-color: rgba(15, 122, 95, 0.28);
  background: rgba(15, 122, 95, 0.08);
  transform: translateY(-1px);
}

.business-trade-chip.active {
  border-color: rgba(15, 122, 95, 0.42);
  background: linear-gradient(135deg, rgba(15, 122, 95, 0.18), rgba(26, 136, 217, 0.16));
  color: #0e3529;
  box-shadow: 0 10px 18px rgba(10, 76, 57, 0.12);
}

.business-trade-chip .emoji {
  font-size: 1.08rem;
  line-height: 1;
}

.business-trade-chip .label {
  min-width: 0;
}

.business-trade-empty {
  margin: 4px 0 0;
  color: #5f766c;
  font-size: 0.9rem;
}

.business-trade-selection-summary {
  margin: 10px 0 0;
  color: #3d5f53;
  font-size: 0.86rem;
  font-weight: 650;
}

.business-dictionary {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(16, 34, 26, 0.14);
}

.business-dictionary-head h4 {
  margin: 0;
  font-size: 0.95rem;
}

.business-dictionary-head p {
  margin: 4px 0 0;
  color: #49685d;
  font-size: 0.84rem;
}

.business-dictionary-input-row {
  margin-top: 10px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.business-dictionary-field {
  flex: 1 1 auto;
}

.business-dictionary-add-btn {
  min-width: 108px;
}

.business-dictionary-list {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.business-dictionary-empty {
  margin: 0;
  color: #5f766c;
  font-size: 0.86rem;
}

.business-dictionary-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid rgba(15, 122, 95, 0.28);
  background: rgba(15, 122, 95, 0.08);
  color: #1c493b;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 5px 8px 5px 10px;
}

.business-dictionary-chip-label {
  max-width: 220px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.business-dictionary-chip-remove {
  appearance: none;
  border: none;
  background: rgba(120, 25, 25, 0.1);
  color: #7a2323;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.business-dictionary-chip-remove:hover {
  background: rgba(120, 25, 25, 0.18);
}

.business-dictionary-summary {
  margin: 8px 0 0;
  color: #3d5f53;
  font-size: 0.82rem;
  font-weight: 650;
}

.style-form {
  margin-top: 14px;
  border-top: 1px solid rgba(16, 34, 26, 0.1);
  padding-top: 14px;
}

.company-payment-methods {
  margin-top: 12px;
  border: 1px solid rgba(16, 34, 26, 0.1);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.7);
  padding: 12px;
}

.company-quote-conditions {
  margin-top: 12px;
  border: 1px solid rgba(16, 34, 26, 0.1);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.7);
  padding: 12px;
}

.company-quote-conditions .quote-conditions-input {
  margin-top: 10px;
  min-height: 132px;
  background: rgba(255, 255, 255, 0.92);
}

.company-payment-methods-head h4 {
  margin: 0;
  font-size: 0.95rem;
}

.company-payment-methods-head p {
  margin: 4px 0 0;
  color: #49685d;
  font-size: 0.84rem;
}

.company-payment-methods-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.company-payment-method {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(16, 34, 26, 0.14);
  background: rgba(255, 255, 255, 0.9);
  color: #27453a;
  font-size: 0.86rem;
  font-weight: 650;
}

.company-payment-method input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: #0f7a5f;
}

.company-payment-method span {
  line-height: 1.2;
}

@media (max-width: 760px) {
  .company-payment-methods-grid {
    grid-template-columns: 1fr;
  }
}

.style-preview-actions {
  margin-top: 12px;
}

.logo-editor {
  margin-top: 12px;
  border: 1px solid rgba(16, 34, 26, 0.1);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.7);
  padding: 12px;
}

.logo-preview-wrap {
  min-height: 92px;
  display: flex;
  align-items: center;
}

.company-logo-preview {
  max-width: 220px;
  max-height: 82px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid rgba(16, 34, 26, 0.12);
  background: #ffffff;
}

.logo-empty {
  margin: 0;
  color: var(--muted);
}

.logo-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.file-btn {
  display: inline-flex;
  align-items: center;
}

#companyLogoInput {
  display: none;
}

.company-style-preview {
  margin-top: 12px;
}

.style-doc-sheet {
  border: 1px solid rgba(16, 34, 26, 0.14);
  border-radius: var(--radius-lg);
  background: #ffffff;
  padding: 14px;
}

.style-doc-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 38%);
  gap: 16px;
  align-items: start;
}

.style-doc-company {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-width: 0;
}

.style-doc-logo {
  width: 98px;
  height: 62px;
  object-fit: contain;
  border: 1px solid rgba(16, 34, 26, 0.12);
  border-radius: 8px;
  background: #ffffff;
}

.style-doc-company-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}

.style-doc-company-body {
  display: grid;
  gap: 2px;
}

.style-doc-client {
  margin-top: 120px;
  border: 1px solid rgba(16, 34, 26, 0.12);
  border-radius: 10px;
  background: rgba(236, 244, 239, 0.4);
  padding: 10px;
  min-width: 230px;
  width: 100%;
  max-width: 320px;
  justify-self: end;
}

.style-doc-block-title {
  margin: 0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.style-doc-client-name {
  margin: 6px 0 2px;
  font-weight: 700;
}

.style-doc-meta {
  margin: 0;
  font-size: 0.85rem;
  color: #3d544b;
}

.style-doc-title-row {
  margin-top: 86px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.style-doc-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}

.style-doc-date {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.style-doc-table {
  margin-top: 10px;
  width: 100%;
  border-collapse: collapse;
}

.style-doc-table th,
.style-doc-table td {
  border-bottom: 1px solid rgba(16, 34, 26, 0.08);
  padding: 8px 6px;
  text-align: left;
}

.style-doc-table th {
  background: rgba(16, 34, 26, 0.04);
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.style-doc-table td:last-child,
.style-doc-table th:last-child {
  text-align: right;
}

.style-doc-totals {
  margin-top: 12px;
  margin-left: auto;
  max-width: 300px;
  display: grid;
  gap: 6px;
}

.style-doc-totals p {
  margin: 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.style-doc-totals p.strong {
  font-size: 1.03rem;
  font-weight: 800;
}

.style-doc-totals p.discount {
  color: #0f6d53;
  font-weight: 700;
}

.style-doc-totals p.discount-reason {
  display: block;
  margin-top: -2px;
  color: #5b7066;
  font-size: 0.8rem;
  line-height: 1.4;
}

.style-doc-footer {
  margin-top: 40px;
  display: grid;
  gap: 10px;
}

.style-doc-conditions-box,
.style-doc-payment-box {
  border: 1px solid rgba(16, 34, 26, 0.12);
  border-radius: 12px;
  background: rgba(248, 252, 250, 0.88);
  padding: 10px;
}

.style-doc-conditions-lines {
  margin-top: 7px;
  display: grid;
  gap: 4px;
}

.style-doc-conditions-line {
  margin: 0;
  font-size: 0.84rem;
  color: #304d43;
  line-height: 1.4;
}

.style-doc-payment-label {
  margin: 7px 0 0;
  font-size: 0.8rem;
  color: #3b5a4f;
  font-weight: 650;
}

.style-doc-payment-modes {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.style-doc-payment-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid rgba(15, 122, 95, 0.25);
  background: rgba(232, 246, 239, 0.9);
  color: #184236;
  font-size: 0.74rem;
  font-weight: 720;
}

.style-doc-signatures {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.style-doc-signature-card {
  border: 1px dashed rgba(16, 34, 26, 0.24);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  padding: 8px;
  display: grid;
  gap: 10px;
}

.style-doc-signature-card p {
  margin: 0;
  font-size: 0.78rem;
  color: #3d5a50;
  font-weight: 650;
}

.style-doc-signature-line {
  display: block;
  height: 38px;
  border-bottom: 1px solid rgba(16, 34, 26, 0.4);
}

#monthlyChart {
  width: 100%;
  height: 260px;
  display: block;
}

.history-card {
  margin-top: 14px;
}

.history-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.history-card-head-copy {
  flex: 1 1 220px;
  min-width: 0;
}

.history-card .card-head h2 {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #517769;
  font-weight: 760;
}

.history-year-control {
  position: relative;
  flex: 0 0 auto;
  margin-left: auto;
}

.history-year-control::after {
  content: "⌄";
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-48%);
  font-size: 0.78rem;
  color: #5d7067;
  pointer-events: none;
}

.history-year-control select {
  width: 82px;
  min-width: 82px;
  max-width: 82px;
  padding: 8px 24px 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15, 122, 95, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 250, 247, 0.96));
  box-shadow:
    0 8px 18px rgba(10, 32, 24, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.66);
  color: #143428;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  text-align-last: center;
  appearance: none;
  cursor: pointer;
}

.history-filters {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) auto;
  gap: 10px;
  margin-bottom: 12px;
  align-items: end;
}

.history-search-field {
  margin: 0;
}

.history-type-filters {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 8px;
}

.history-filter-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.history-filter-chip input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.history-filter-chip span {
  display: inline-grid;
  grid-auto-flow: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 32px;
  min-width: 88px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 740;
  letter-spacing: 0.01em;
  color: #1b3e32;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid rgba(16, 34, 26, 0.2);
  transition:
    transform 160ms ease,
    color 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 180ms ease;
}

.history-filter-chip span::before {
  content: "";
  width: 12px;
  height: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  line-height: 1;
  font-weight: 900;
  border-radius: 999px;
  border: 2px solid rgba(83, 103, 95, 0.65);
  background: transparent;
  color: #ffffff;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    opacity 160ms ease;
}

.history-filter-chip span::after {
  display: none;
}

.history-filter-chip input:not(:checked) + span:hover {
  border-color: rgba(16, 34, 26, 0.34);
  background: rgba(244, 250, 248, 0.95);
}

.history-filter-chip input:checked + span {
  color: #ffffff;
  border-color: transparent;
  background: linear-gradient(130deg, #0f7a5f, #1a87d0);
  box-shadow:
    0 8px 16px rgba(15, 122, 95, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.32);
  transform: translateY(-1px);
}

.history-filter-chip input:checked + span::before {
  content: "✓";
  background: #ffffff;
  border-color: #ffffff;
  color: #0d7259;
  opacity: 0.95;
}

.history-filter-chip input:checked + span::after {
  display: none;
}

.history-filter-chip input:focus-visible + span {
  outline: 2px solid rgba(26, 136, 217, 0.45);
  outline-offset: 1px;
}

.history-list {
  display: grid;
  gap: 10px;
}

.history-more-wrap {
  display: flex;
  justify-content: center;
  padding-top: 4px;
}

.history-more-btn {
  min-width: 152px;
  min-height: 38px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(15, 122, 95, 0.12);
  background: rgba(255, 255, 255, 0.78);
  color: #183a2f;
  font-weight: 760;
  letter-spacing: 0.01em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.history-more-btn:hover {
  border-color: rgba(15, 122, 95, 0.22);
  background: rgba(238, 246, 242, 0.9);
  color: #0f2f25;
}

.history-item {
  border: 1px solid rgba(16, 34, 26, 0.09);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.9);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.history-main {
  min-width: 0;
  flex: 1 1 auto;
}

.history-paid-badge-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 124px;
}

.history-title {
  margin: 0;
  font-weight: 700;
}

.history-client-contact {
  margin: 2px 0 0;
  color: #4f675d;
  font-size: 0.78rem;
  font-weight: 620;
}

.history-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.history-meta {
  margin: 4px 0 0;
  color: #3f6255;
  font-size: 0.84rem;
}

.history-badge-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  align-items: center;
}

.history-deposit-flag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(190, 145, 55, 0.28);
  background: rgba(233, 194, 116, 0.18);
  color: #7a560d;
  font-size: 0.8rem;
  font-weight: 720;
}

.history-quote-outcome-flag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(170, 66, 66, 0.28);
  background: rgba(184, 69, 69, 0.12);
  color: #8b2f2f;
  font-size: 0.8rem;
  font-weight: 760;
}

.history-quote-outcome-flag::before {
  content: "!";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: rgba(184, 69, 69, 0.16);
  color: #8b2f2f;
  font-size: 0.72rem;
  line-height: 1;
  font-weight: 800;
}

.history-comment {
  margin: 4px 0 0;
  color: #1f4c3d;
  font-size: 0.83rem;
  font-weight: 650;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.history-followup-flag {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(19, 128, 184, 0.33);
  background: linear-gradient(135deg, rgba(15, 122, 95, 0.14), rgba(34, 136, 197, 0.15));
  color: #0f5970;
  font-size: 0.79rem;
  font-weight: 760;
  letter-spacing: 0.02em;
  font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
  white-space: nowrap;
}

.history-followup-flag::before {
  content: "↻";
  font-size: 0.82rem;
  line-height: 1;
  color: #11768f;
}

.history-followup-flag.invoice {
  gap: 6px;
  border-color: rgba(190, 102, 126, 0.3);
  background: linear-gradient(135deg, rgba(232, 170, 187, 0.24), rgba(250, 234, 239, 0.84));
  color: #8a3d54;
}

.history-followup-flag.invoice::before {
  content: "↻";
  color: #a64f69;
}

.history-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.history-status-badges {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.history-action-menu {
  position: relative;
}

.history-action-menu > summary {
  list-style: none;
}

.history-action-menu > summary::-webkit-details-marker {
  display: none;
}

.history-action-menu .history-action-trigger {
  min-width: 88px;
  min-height: 32px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid rgba(8, 92, 70, 0.42);
  background: linear-gradient(135deg, #0f7a5f, #167eb7);
  color: #ffffff;
  font-size: 0.77rem;
  font-weight: 740;
  box-shadow:
    0 10px 22px rgba(10, 87, 66, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.history-action-menu .history-action-trigger::after {
  content: "▾";
  font-size: 0.72rem;
  line-height: 1;
  opacity: 0.96;
  transition: transform 160ms ease, opacity 160ms ease;
}

.history-action-menu[open] .history-action-trigger::after {
  transform: rotate(180deg);
}

.history-action-menu[open] .history-action-trigger {
  border-color: rgba(8, 92, 70, 0.52);
  background: linear-gradient(135deg, #0e6f56, #126f9f);
  box-shadow:
    0 12px 24px rgba(10, 87, 66, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.history-action-popover {
  position: absolute;
  left: 50%;
  right: auto;
  top: calc(100% + 12px);
  transform: translateX(-50%);
  z-index: 30;
  min-width: 248px;
  max-width: min(360px, calc(100vw - 32px));
  display: grid;
  gap: 5px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(16, 34, 26, 0.16);
  background: rgba(255, 255, 255, 0.97);
  box-shadow:
    0 18px 36px rgba(12, 38, 30, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
}

.history-action-popover::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -6px;
  width: 12px;
  height: 12px;
  background: rgba(255, 255, 255, 0.97);
  border-left: 1px solid rgba(16, 34, 26, 0.14);
  border-top: 1px solid rgba(16, 34, 26, 0.14);
  transform: translateX(-50%) rotate(45deg);
}

.history-action-item {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #133427;
  padding: 8px 10px;
  text-align: left;
  font-size: 0.88rem;
  font-weight: 680;
  cursor: pointer;
}

.history-action-item:hover {
  background: rgba(15, 122, 95, 0.12);
}

.history-action-item.history-action-item-convert {
  border-color: rgba(9, 110, 84, 0.32);
  background: rgba(13, 126, 97, 0.12);
}

.history-action-item.history-action-item-convert:hover {
  background: rgba(13, 126, 97, 0.2);
}

.history-action-item.history-action-item-secondary {
  color: #315247;
}

.history-action-item.history-action-item-wide {
  white-space: nowrap;
}

.history-action-item:focus-visible {
  outline: 2px solid rgba(26, 136, 217, 0.4);
  outline-offset: 1px;
}

.history-action-item.danger {
  color: #7a2121;
}

.history-action-item.danger:hover {
  background: rgba(184, 69, 69, 0.14);
}

.history-action-item.history-action-item-acompte {
  border-color: rgba(198, 145, 66, 0.28);
  background: rgba(214, 163, 89, 0.12);
  color: #6f4600;
}

.history-action-item.history-action-item-acompte:hover {
  background: rgba(214, 163, 89, 0.2);
}

.history-action-item.history-action-item-paid {
  border-color: rgba(29, 137, 113, 0.22);
  background:
    radial-gradient(circle at top right, rgba(132, 239, 203, 0.32), transparent 42%),
    linear-gradient(135deg, rgba(11, 102, 84, 0.14), rgba(72, 177, 146, 0.16));
  color: #0a5947;
}

.history-action-item.history-action-item-paid:hover {
  background:
    radial-gradient(circle at top right, rgba(132, 239, 203, 0.4), transparent 46%),
    linear-gradient(135deg, rgba(11, 102, 84, 0.18), rgba(72, 177, 146, 0.22));
}

.badge {
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}

.badge.quote {
  background: rgba(26, 136, 217, 0.14);
  color: #0c5c97;
}

.badge.saved {
  background: rgba(76, 112, 137, 0.14);
  color: #345268;
}

.badge.in-progress {
  background: var(--status-in-progress-bg);
  color: var(--status-in-progress-text);
}

.badge.invoice {
  background: rgba(15, 122, 95, 0.14);
  color: #05543f;
}

.badge.invoice-electronic {
  border: 1px solid rgba(15, 122, 95, 0.22);
  background:
    radial-gradient(circle at top right, rgba(132, 239, 203, 0.28), transparent 42%),
    rgba(15, 122, 95, 0.14);
  white-space: nowrap;
}

.badge.badge-paid {
  position: relative;
  padding: 8px 16px 8px 34px;
  border: 1px solid rgba(118, 153, 41, 0.3);
  background:
    radial-gradient(circle at top right, rgba(232, 255, 162, 0.72), transparent 34%),
    linear-gradient(135deg, rgba(131, 165, 36, 0.14), rgba(189, 224, 92, 0.32));
  color: #4d6309;
  font-weight: 800;
  text-transform: uppercase;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 8px 18px rgba(114, 142, 30, 0.18);
  letter-spacing: 0.08em;
}

.badge.badge-paid::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 35%, #ffffff 0 18%, transparent 19%),
    linear-gradient(135deg, #86b125, #d0ec6a);
  box-shadow: 0 0 0 3px rgba(186, 224, 91, 0.22);
  transform: translateY(-50%);
}

.empty {
  margin: 0;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.75);
  color: var(--muted);
  text-align: center;
}

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

.field {
  display: block;
}

.field-checkbox {
  display: grid;
  align-content: start;
}

.field-full {
  grid-column: 1 / -1;
}

.field > span {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 0.9rem;
}

.toggle-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 48px;
  padding: 11px 12px;
  border: 1px solid rgba(14, 43, 34, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  cursor: pointer;
}

.toggle-field input[type="checkbox"] {
  margin-top: 2px;
}

.toggle-field span {
  display: block;
  font-size: 0.84rem;
  line-height: 1.4;
  font-weight: 560;
}

.client-card .card-head p {
  max-width: 48ch;
}

.client-card {
  background: #ffffff;
}

input:not([type="radio"]):not([type="checkbox"]),
select,
textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid rgba(14, 43, 34, 0.2);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.96rem;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
}

input:not([type="radio"]):not([type="checkbox"])::placeholder,
textarea::placeholder {
  color: rgba(14, 43, 34, 0.24);
  opacity: 1;
  font-weight: 400;
  font-style: italic;
}

input:not([type="radio"]):not([type="checkbox"]):focus::placeholder,
textarea:focus::placeholder {
  color: rgba(14, 43, 34, 0.18);
}

textarea {
  min-height: 92px;
  resize: vertical;
  font: inherit;
}

input:not([type="radio"]):not([type="checkbox"]):focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 2px solid rgba(26, 136, 217, 0.4);
  outline-offset: 1px;
}

.hint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.create-ai-head {
  margin-bottom: 12px;
}

.create-ai-kicker {
  margin: 0 0 4px;
  color: #5d7068;
  font-size: 0.76rem;
  font-weight: 760;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.create-ai-head h2 {
  font-size: 1.08rem;
}

.create-ai-head p:last-child {
  max-width: 48ch;
}

.quote-entry-modes {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.entry-mode-btn {
  min-height: 40px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 750;
}

.entry-mode-btn.active {
  box-shadow:
    0 10px 20px rgba(12, 95, 72, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.quick-line-section {
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(16, 34, 26, 0.14);
  background:
    radial-gradient(circle at 20% -20%, rgba(26, 136, 217, 0.14), transparent 44%),
    radial-gradient(circle at 100% 0%, rgba(15, 122, 95, 0.12), transparent 44%),
    rgba(250, 254, 252, 0.92);
}

.quote-capture-head {
  margin-bottom: 10px;
}

.quote-capture-head h3 {
  margin: 0;
  font-size: 1.45rem;
}

.quote-capture-head p {
  margin: 6px 0 0;
  color: #4f6d62;
}

.quote-capture-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.quote-capture-card {
  border: 1px solid rgba(16, 34, 26, 0.13);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
  padding: 12px;
  display: grid;
  gap: 8px;
}

.quote-capture-title {
  margin: 0;
  font-size: 1.14rem;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: #112d23;
}

.quote-capture-subtitle {
  margin: 0;
  color: #5a766a;
  line-height: 1.45;
}

.quote-capture-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lya-assistant-field {
  margin: 0;
}

.lya-assistant-input {
  min-height: 108px;
  resize: vertical;
}

.lya-assistant-actions > .btn {
  flex: 1 1 170px;
}

.quote-capture-photo-actions > .btn {
  flex: 1 1 170px;
}

.quote-capture-status {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 650;
  color: #3f6053;
}

.quote-capture-status.loading {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(195, 147, 33, 0.24);
  background: linear-gradient(180deg, rgba(255, 249, 232, 0.95), rgba(248, 239, 208, 0.92));
  color: #7b5f18;
}

.quote-capture-status.loading::before {
  content: "";
  width: 15px;
  height: 15px;
  border-radius: 999px;
  border: 2px solid rgba(123, 95, 24, 0.18);
  border-top-color: #c39321;
  animation: quote-photo-status-spin 0.8s linear infinite;
  flex: 0 0 auto;
}

.quote-capture-status.success {
  color: #0f6e54;
}

.quote-capture-status.warning {
  color: #7b5f18;
}

.quote-capture-status.danger {
  color: #8c2f2f;
}

@keyframes quote-photo-status-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.lya-assistant-response {
  margin-top: 12px;
}

.quote-ai-review {
  margin-top: 12px;
}

.quote-ai-review-card {
  border: 1px solid rgba(11, 89, 69, 0.16);
  border-radius: 18px;
  background: linear-gradient(
    180deg,
    rgba(248, 252, 250, 0.96),
    rgba(239, 247, 243, 0.94)
  );
  padding: 14px;
  display: grid;
  gap: 12px;
  box-shadow: 0 10px 24px rgba(8, 39, 30, 0.06);
}

.quote-ai-review-head {
  display: grid;
  gap: 4px;
}

.quote-ai-review-kicker {
  margin: 0;
  font-size: 0.74rem;
  font-weight: 680;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6a857a;
}

.quote-ai-review-summary {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 600;
  color: #1f4337;
  line-height: 1.35;
}

.quote-ai-review-block {
  display: grid;
  gap: 6px;
}

.quote-ai-review-block h4 {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: #47675b;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.quote-ai-review-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  color: #314f44;
  font-size: 0.9rem;
  line-height: 1.45;
}

.quote-ai-review-list.is-grouped {
  padding-left: 0;
  list-style: none;
  gap: 8px;
}

.quote-ai-review-alert-item {
  border: 1px solid rgba(11, 89, 69, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
  padding: 10px 12px;
  display: grid;
  gap: 4px;
}

.quote-ai-review-item-label {
  color: #173f32;
  font-weight: 600;
}

.quote-ai-review-item-text {
  color: #355448;
}

.final-review-popup-card {
  max-width: 560px;
}

.final-review-popup-list {
  display: grid;
  gap: 8px;
}

.final-review-popup-actions {
  justify-content: flex-end;
}

.lya-chat-card {
  border: 1px solid rgba(15, 79, 62, 0.16);
  border-radius: 18px;
  background: #f6fbf8;
  padding: 14px;
  display: grid;
  gap: 12px;
  box-shadow: 0 10px 28px rgba(8, 39, 30, 0.08);
}

.lya-chat-thread {
  display: grid;
  gap: 12px;
}

.lya-chat-turn {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.lya-chat-turn.user {
  justify-content: flex-end;
  flex-direction: row-reverse;
}

.lya-chat-avatar {
  width: 32px;
  min-width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(12, 63, 49, 0.22);
  background: #ffffff;
  color: #164537;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.64rem;
  letter-spacing: 0.04em;
  font-weight: 800;
}

.lya-chat-turn.user .lya-chat-avatar {
  background: #0f7a5f;
  color: #ffffff;
  border-color: #0f7a5f;
}

.lya-chat-bubble {
  width: min(100%, 880px);
  border: 1px solid rgba(15, 72, 56, 0.15);
  border-radius: 14px;
  padding: 10px 12px;
  display: grid;
  gap: 8px;
}

.lya-chat-bubble.assistant {
  background: #ffffff;
}

.lya-chat-bubble.user {
  background: linear-gradient(180deg, rgba(15, 122, 95, 0.15), rgba(15, 122, 95, 0.09));
  border-color: rgba(15, 122, 95, 0.28);
}

.lya-chat-turn.user .lya-chat-bubble {
  width: min(100%, 700px);
  padding: 8px 10px;
  gap: 6px;
}

.lya-chat-turn.user .lya-chat-text {
  font-size: 0.94rem;
  line-height: 1.38;
}

.lya-chat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lya-chat-role {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 780;
  color: #2c5b4b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.lya-chat-intent {
  margin: 0;
  padding: 4px 10px;
  border: 1px solid rgba(15, 122, 95, 0.3);
  border-radius: 999px;
  background: rgba(15, 122, 95, 0.12);
  color: #0e5f49;
  font-size: 0.73rem;
  font-weight: 700;
}

.lya-chat-text {
  margin: 0;
  font-size: 0.99rem;
  line-height: 1.48;
  color: #173d31;
}

.lya-chat-context {
  margin: 0;
  font-size: 0.8rem;
  color: #4b6e62;
}

.lya-chat-section {
  border-top: 1px solid rgba(15, 72, 56, 0.1);
  padding-top: 9px;
  display: grid;
  gap: 7px;
}

.lya-chat-section-title {
  margin: 0;
  color: #2d5d4e;
  font-size: 0.8rem;
  font-weight: 720;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.lya-chat-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 5px;
}

.lya-chat-list li {
  color: #1d4336;
  font-size: 0.93rem;
}

.lya-chat-warning-list {
  display: grid;
  gap: 7px;
}

.lya-chat-warning-chip {
  margin: 0;
  border: 1px solid rgba(199, 120, 8, 0.28);
  border-radius: 10px;
  background: rgba(255, 244, 220, 0.7);
  color: #6f4c10;
  padding: 7px 10px;
  font-size: 0.88rem;
  font-weight: 650;
}

.lya-chat-proposal-list {
  display: grid;
  gap: 6px;
}

.lya-chat-proposal-item {
  margin: 0;
  border: 1px solid rgba(15, 72, 56, 0.13);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.lya-chat-proposal-item.actionable {
  border-color: rgba(15, 122, 95, 0.26);
  background: linear-gradient(180deg, rgba(239, 251, 246, 0.88), rgba(255, 255, 255, 0.92));
}

.lya-chat-proposal-line {
  margin: 0;
  color: #1b4134;
  font-size: 0.9rem;
  line-height: 1.35;
  flex: 1 1 auto;
  min-width: 0;
}

.lya-chat-proposal-actions {
  display: flex;
  justify-content: flex-start;
  flex: 0 0 auto;
}

.lya-proposal-apply-btn {
  border-radius: 999px;
  padding: 0 12px;
  min-height: 30px;
  font-size: 0.75rem;
  font-weight: 760;
  white-space: nowrap;
}

.lya-proposal-apply-btn.is-added {
  background: rgba(15, 122, 95, 0.16);
  border-color: rgba(15, 122, 95, 0.3);
  color: #0f5f48;
}

.lya-chat-question-block {
  display: grid;
  gap: 7px;
}

.lya-chat-thinking {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lya-chat-thinking span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(15, 122, 95, 0.75);
  animation: lya-typing 1.1s infinite ease-in-out;
}

.lya-chat-thinking span:nth-child(2) {
  animation-delay: 0.14s;
}

.lya-chat-thinking span:nth-child(3) {
  animation-delay: 0.28s;
}

.lya-chat-thinking-label {
  margin: 0;
  font-size: 0.88rem;
  color: #4b6e62;
}

@media (max-width: 640px) {
  .lya-chat-proposal-item {
    display: grid;
    justify-content: stretch;
  }

  .lya-chat-proposal-actions {
    justify-content: flex-start;
  }

  .lya-proposal-apply-btn {
    min-height: 32px;
  }
}

@keyframes lya-typing {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

.lya-response-card {
  border: 1px solid rgba(13, 92, 71, 0.22);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(245, 251, 248, 0.92));
  padding: 14px;
  display: grid;
  gap: 12px;
  box-shadow: 0 12px 24px rgba(11, 49, 38, 0.08);
}

.lya-response-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.lya-response-head-main {
  display: grid;
  gap: 4px;
  min-width: 0;
  flex: 1 1 360px;
}

.lya-response-head-tags {
  display: grid;
  gap: 6px;
  justify-items: end;
}

.lya-response-quick-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.lya-response-title {
  margin: 0;
  font-size: 1.04rem;
  font-weight: 780;
  color: #083629;
}

.lya-response-intent {
  margin: 0;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15, 122, 95, 0.28);
  background: rgba(15, 122, 95, 0.12);
  color: #0d5a45;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: none;
  font-weight: 740;
}

.lya-response-summary {
  margin: 0;
  color: #183d30;
  font-weight: 620;
  font-size: 0.96rem;
}

.lya-metric-chip {
  border: 1px solid rgba(14, 79, 62, 0.2);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.74rem;
  font-weight: 700;
  color: #215042;
  background: rgba(255, 255, 255, 0.85);
}

.lya-metric-chip.warning {
  color: #8a6112;
  border-color: rgba(184, 126, 33, 0.32);
  background: rgba(245, 232, 199, 0.42);
}

.lya-metric-chip.success {
  color: #0c6148;
  border-color: rgba(15, 122, 95, 0.3);
  background: rgba(205, 239, 227, 0.6);
}

.lya-response-section {
  border-top: 1px solid rgba(16, 34, 26, 0.1);
  padding-top: 11px;
  display: grid;
  gap: 8px;
}

.lya-response-section h4 {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #47675b;
  display: flex;
  align-items: center;
  gap: 7px;
}

.lya-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  border: 1px solid rgba(15, 122, 95, 0.28);
  background: rgba(15, 122, 95, 0.12);
  color: #0f5c46;
  font-size: 0.72rem;
  font-weight: 780;
}

.lya-response-section ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 5px;
}

.lya-response-section li {
  color: #1c3d31;
  font-size: 0.9rem;
}

.lya-warning-list,
.lya-question-list,
.lya-proposal-list {
  display: grid;
  gap: 7px;
}

.lya-warning-item,
.lya-question-item,
.lya-proposal-item {
  border: 1px solid rgba(16, 34, 26, 0.12);
  border-radius: 12px;
  background: rgba(248, 253, 250, 0.95);
  padding: 10px 11px;
  display: grid;
  gap: 6px;
}

.lya-warning-code {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 740;
  letter-spacing: 0.02em;
  text-transform: none;
  color: #8a6112;
}

.lya-warning-message,
.lya-question-text,
.lya-proposal-line {
  margin: 0;
  color: #1c4033;
  font-size: 0.95rem;
}

.lya-question-choices,
.lya-question-required,
.lya-proposal-notes,
.lya-proposal-justification,
.lya-proposal-confidence {
  margin: 0;
  color: #4e6c60;
  font-size: 0.82rem;
}

.lya-question-choice-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lya-question-choice-btn {
  border: 1px solid rgba(15, 122, 95, 0.28);
  background: rgba(255, 255, 255, 0.9);
  color: #1f4e3f;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 650;
  cursor: pointer;
}

.lya-question-choice-btn:hover,
.lya-question-choice-btn:focus-visible,
.lya-question-choice-btn.is-active {
  border-color: rgba(15, 122, 95, 0.48);
  background: rgba(15, 122, 95, 0.12);
  outline: none;
}

.lya-question-answer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.lya-question-answer-input {
  min-height: 40px;
  font-size: 0.88rem;
  padding: 0 12px;
}

.lya-question-send-btn {
  min-height: 40px;
  padding: 0 12px;
  white-space: nowrap;
}

.lya-proposal-type {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 760;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #0e5d47;
  padding: 4px 8px;
  border: 1px solid rgba(15, 122, 95, 0.22);
  border-radius: 999px;
  background: rgba(15, 122, 95, 0.1);
}

.lya-proposal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.lya-proposal-title {
  margin: 0;
  color: #123e31;
  font-size: 0.97rem;
  font-weight: 720;
}

.lya-proposal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lya-proposal-chip {
  border: 1px solid rgba(14, 79, 62, 0.2);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.75rem;
  color: #275246;
  background: rgba(255, 255, 255, 0.9);
  font-weight: 650;
}

.lya-proposal-chip.muted {
  color: #4a6a5f;
  border-color: rgba(16, 34, 26, 0.16);
}

.lya-validation-note {
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px dashed rgba(15, 122, 95, 0.28);
  background: rgba(15, 122, 95, 0.08);
  color: #12513f;
  font-size: 0.82rem;
  font-weight: 650;
}

.lya-validation-note.success {
  border-style: solid;
  border-color: rgba(15, 122, 95, 0.28);
  background: rgba(15, 122, 95, 0.12);
}

.quote-capture-feed {
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px dashed rgba(15, 122, 95, 0.25);
  background: rgba(255, 255, 255, 0.7);
  display: grid;
  gap: 8px;
}

.quote-capture-empty {
  margin: 0;
  text-align: center;
  color: #638175;
}

.quote-capture-item {
  border: 1px solid rgba(16, 34, 26, 0.12);
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.9);
}

.quote-capture-item.success {
  border-color: rgba(15, 122, 95, 0.24);
}

.quote-capture-item.warning {
  border-color: rgba(184, 126, 33, 0.3);
}

.quote-capture-item.danger {
  border-color: rgba(184, 69, 69, 0.3);
}

.quote-capture-item-source {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #5a776c;
  font-weight: 760;
}

.quote-capture-item-message {
  margin: 4px 0 0;
  font-size: 0.92rem;
  color: #15362a;
}

.quote-capture-item-detail {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: #4a655b;
}

.quick-line-field {
  margin: 12px 0 0;
}

.quick-line-input-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: stretch;
}

.quick-line-add-btn {
  min-width: 112px;
}

.quick-line-preview {
  margin: 10px 0 0;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px dashed rgba(16, 34, 26, 0.16);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  color: #1a3e31;
  font-size: 0.86rem;
}

.quick-line-preview.success {
  border-style: solid;
  border-color: rgba(15, 122, 95, 0.28);
  background: rgba(15, 122, 95, 0.08);
}

.quick-line-preview.warning {
  border-style: solid;
  border-color: rgba(184, 126, 33, 0.28);
  background: rgba(255, 179, 0, 0.08);
}

.quick-line-preview.muted {
  color: #5c6d66;
  background: rgba(255, 255, 255, 0.75);
}

.quick-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(16, 34, 26, 0.11);
}

.quick-chip strong {
  font-size: 0.72rem;
  letter-spacing: 0.03em;
}

.quick-chip.strong {
  font-weight: 760;
}

.quick-line-suggestions {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

.quick-line-suggestion {
  width: 100%;
  border: 1px solid rgba(16, 34, 26, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  padding: 8px 10px;
  text-align: left;
  display: grid;
  gap: 2px;
  cursor: pointer;
}

.quick-line-suggestion-main {
  font-size: 0.9rem;
  font-weight: 720;
  color: #0f3126;
}

.quick-line-suggestion-meta {
  font-size: 0.77rem;
  color: #4d6159;
}

.quick-line-suggestion:hover,
.quick-line-suggestion.active {
  border-color: rgba(15, 122, 95, 0.32);
  background: rgba(15, 122, 95, 0.1);
}

.quick-line-hint {
  margin: 8px 2px 0;
  font-size: 0.8rem;
  color: #4e6159;
}

.table-entry-section {
  margin-top: 12px;
}

.table-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 0;
}

.table-toolbar-copy {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.table-toolbar-kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #547066;
}

.table-toolbar-title {
  margin: 0;
  font-size: 1.14rem;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: #112d23;
}

.table-toolbar-description {
  margin: 0;
  max-width: 640px;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #567066;
}

.table-toolbar-meta {
  margin: 0;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(15, 122, 95, 0.16);
  border-radius: 999px;
  background:
    radial-gradient(circle at 0% 50%, rgba(15, 122, 95, 0.12), transparent 42%),
    rgba(255, 255, 255, 0.82);
  color: #104537;
  font-size: 0.84rem;
  font-weight: 760;
  white-space: nowrap;
}

.table-toolbar-meta:empty {
  display: none;
}

.table-wrap {
  margin-top: 14px;
  overflow: visible;
  border: 1px solid rgba(9, 67, 52, 0.2);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 251, 248, 0.92));
  box-shadow:
    0 20px 40px rgba(8, 57, 44, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.line-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 900px;
  table-layout: fixed;
}

.line-table th,
.line-table td {
  padding: 10px 10px;
  border-bottom: 1px solid rgba(16, 34, 26, 0.08);
  text-align: left;
  vertical-align: middle;
}

.line-table th {
  background: linear-gradient(135deg, #0f7a5f, #0b694f);
  font-size: 0.81rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(220, 255, 239, 0.96);
  font-weight: 760;
  border-bottom-color: rgba(5, 45, 35, 0.22);
}

.line-table th:not(:last-child) {
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.08);
}

.line-table th:first-child {
  width: 46px;
  text-align: center;
}

.line-table th:last-child {
  width: 126px;
  text-align: center;
}

.line-table th:nth-child(2) {
  min-width: 280px;
}

.line-table th:nth-child(3) {
  width: 116px;
  text-align: center;
}

.line-table th:nth-child(4) {
  width: 140px;
  text-align: center;
}

.line-table th:nth-child(5) {
  min-width: 190px;
  text-align: right;
}

.line-table th:nth-child(6) {
  width: 140px;
  text-align: right;
}

.line-table tbody td {
  background: rgba(255, 255, 255, 0.92);
  vertical-align: top;
}

.line-table tbody tr:nth-child(2n) td {
  background: rgba(249, 252, 251, 0.92);
}

.line-table tbody tr:hover td {
  background: rgba(240, 248, 245, 0.96);
}

.line-table tr:last-child td {
  border-bottom: 0;
}

.line-table .line-index {
  text-align: center;
  color: #6f8f82;
  font-weight: 700;
  font-size: 0.82rem;
}

.line-table td input,
.line-table td select {
  min-height: 44px;
  border-radius: 12px;
}

.line-table-unit-select-wrap {
  width: 100%;
}

.line-table-unit-select-wrap > select[name="quality"] {
  width: 100%;
}

.line-table td input[name="quantity"] {
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 760;
}

.line-table td:nth-child(3),
.line-table td:nth-child(4) {
  text-align: center;
}

.line-table td:nth-child(5),
.line-table td:nth-child(6) {
  text-align: right;
}

.line-table td input[name="unitPrice"] {
  font-variant-numeric: tabular-nums;
  font-weight: 740;
}

.line-material-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.line-material-input-wrap {
  position: relative;
  border-radius: 12px;
  background: var(--input-bg);
}

.line-material-input-wrap > input[name="material"] {
  position: relative;
  z-index: 2;
  background: transparent;
}

.line-material-ghost {
  position: absolute;
  left: 14px;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  pointer-events: none;
  white-space: pre;
  overflow: hidden;
  font-size: 0.96rem;
  line-height: 1.2;
  font-weight: 500;
}

.line-material-ghost-prefix {
  color: transparent;
}

.line-material-ghost-tail {
  color: rgba(7, 88, 68, 0.62);
  font-style: italic;
  font-weight: 700;
}

.line-material-autocomplete {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 26;
  max-height: 236px;
  overflow-y: auto;
  display: grid;
  gap: 4px;
  padding: 6px;
  border: 1px solid rgba(16, 34, 26, 0.2);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(245, 251, 248, 0.98));
  box-shadow:
    0 16px 28px rgba(9, 48, 37, 0.2),
    0 3px 8px rgba(9, 48, 37, 0.1);
}

.line-material-option {
  width: 100%;
  border: 1px solid rgba(16, 34, 26, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.95);
  padding: 8px 10px;
  text-align: left;
  display: grid;
  gap: 2px;
  cursor: pointer;
  transition:
    border-color 140ms ease,
    background-color 140ms ease,
    transform 140ms ease;
}

.line-material-option:hover {
  border-color: rgba(16, 34, 26, 0.12);
  background: rgba(255, 255, 255, 0.95);
  transform: none;
}

.line-material-option.active {
  border-color: rgba(15, 122, 95, 0.36);
  background: rgba(226, 244, 237, 0.95);
  transform: translateY(-1px);
}

.line-material-option-main {
  font-size: 0.89rem;
  font-weight: 740;
  color: #12382c;
}

.line-material-option-meta {
  font-size: 0.76rem;
  color: #4a6359;
}

.line-table tr.material-autocomplete-open td {
  background: rgba(250, 254, 252, 0.95);
}

.line-anomaly {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: #9b6110;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.line-anomaly-text {
  min-width: 0;
  flex: 1 1 auto;
}

.line-anomaly-ack {
  flex: 0 0 auto;
  border: 1px solid rgba(155, 97, 16, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: #8a5711;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  padding: 7px 10px;
  cursor: pointer;
}

.line-anomaly-ack:hover {
  background: rgba(255, 255, 255, 0.9);
}

.line-anomaly-ack:focus-visible {
  outline: 2px solid rgba(15, 122, 95, 0.28);
  outline-offset: 2px;
}

.line-has-anomaly td {
  background: rgba(255, 250, 240, 0.86);
}

.line-table tr.line-has-anomaly {
  box-shadow: inset 0 0 0 1px rgba(219, 156, 44, 0.32);
}

.line-total {
  font-weight: 700;
  white-space: nowrap;
  text-align: right;
  font-size: 1rem;
  color: #123d30;
  font-variant-numeric: tabular-nums;
}

.icon-btn {
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(184, 69, 69, 0.3);
  background: rgba(184, 69, 69, 0.12);
  color: #7a2121;
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    transform 140ms ease,
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease;
}

.line-action-stack {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.icon-btn-neutral {
  border-color: rgba(15, 122, 95, 0.3);
  background: rgba(15, 122, 95, 0.11);
  color: #115845;
  font-size: 1.28rem;
}

.icon-btn.icon-btn-neutral:hover {
  background: rgba(15, 122, 95, 0.18);
  border-color: rgba(15, 122, 95, 0.42);
}

.icon-btn.icon-btn-neutral:focus-visible {
  outline: 2px solid rgba(15, 122, 95, 0.34);
}

.icon-btn:hover {
  background: rgba(184, 69, 69, 0.18);
  border-color: rgba(184, 69, 69, 0.42);
}

.icon-btn:focus-visible {
  outline: 2px solid rgba(184, 69, 69, 0.3);
  outline-offset: 1px;
}

.line-table td[data-label="Action"] {
  text-align: center;
}

.line-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 16px;
  border-top: 1px solid rgba(16, 34, 26, 0.08);
  background:
    linear-gradient(180deg, rgba(247, 251, 249, 0.8), rgba(240, 246, 243, 0.92));
}

.line-footer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.line-add-manual-btn {
  position: relative;
  border-style: solid;
  border-width: 1px;
  border-color: rgba(15, 122, 95, 0.22);
  background:
    radial-gradient(circle at 0% 50%, rgba(15, 122, 95, 0.12), transparent 36%),
    linear-gradient(180deg, rgba(248, 253, 250, 0.99), rgba(230, 245, 238, 0.97));
  color: #18483a;
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: -0.01em;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 10px 22px rgba(8, 74, 57, 0.08);
}

.line-add-manual-btn:hover {
  border-color: rgba(15, 122, 95, 0.42);
  background:
    radial-gradient(circle at 0% 50%, rgba(15, 122, 95, 0.16), transparent 38%),
    linear-gradient(180deg, rgba(242, 251, 246, 0.99), rgba(218, 239, 229, 0.98));
  transform: translateY(-1px);
}

@media (max-width: 1179px) {
  .line-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 10px;
    margin: 0;
  }

  .line-table thead {
    display: none;
  }

  .line-table tbody {
    display: grid;
    gap: 12px;
    margin: 0;
  }

  .line-table tr[data-index] {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "material material"
      "quantity unit"
      "price price"
      "total actions";
    gap: 8px;
    border: 1px solid rgba(16, 34, 26, 0.1);
    border-radius: 18px;
    background:
      radial-gradient(circle at 100% 0%, rgba(15, 122, 95, 0.08), transparent 34%),
      linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(243, 249, 246, 0.93));
    padding: 12px;
    overflow: hidden;
    box-shadow:
      0 10px 24px rgba(8, 57, 44, 0.06),
      inset 0 1px 0 rgba(255, 255, 255, 0.84);
  }

  .line-table td {
    display: block;
    border: 0;
    padding: 0;
    background: transparent;
  }

  .line-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 5px;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #5c7268;
  }

  .line-table td input,
  .line-table td select {
    min-height: 42px;
    padding: 9px 11px;
    font-size: 0.9rem;
    border-radius: 12px;
  }

  .line-table td[data-label="Matériel / description"] {
    grid-area: material;
    display: grid;
    align-content: start;
    gap: 6px;
    padding: 10px;
    border: 1px solid rgba(16, 34, 26, 0.08);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.74);
  }

  .line-table td[data-label="Qte"] {
    grid-area: quantity;
  }

  .line-table td[data-label="Unité"] {
    grid-area: unit;
  }

  .line-table td[data-label="Prix unitaire HT"] {
    grid-area: price;
  }

  .line-table td[data-label="Qte"],
  .line-table td[data-label="Unité"],
  .line-table td[data-label="Prix unitaire HT"],
  .line-table td.line-total {
    display: grid;
    align-items: start;
    padding: 10px;
    border: 1px solid rgba(16, 34, 26, 0.08);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.74);
  }

  .line-table td.line-total {
    grid-area: total;
    white-space: normal;
    font-size: 1rem;
    display: grid;
    align-content: center;
    justify-items: start;
    gap: 4px;
    color: #0f3b2e;
    font-weight: 820;
    min-height: 100%;
  }

  .line-table td[data-label="#"] {
    display: none;
  }

  .line-table td[data-label="Action"] {
    grid-area: actions;
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    padding: 0;
    background: transparent !important;
    border: 0;
    box-shadow: none;
  }

  .line-table td[data-label="Action"]::before {
    display: none;
  }

  .line-table td[data-label="Action"] .icon-btn {
    width: 40px;
    min-width: 40px;
    height: 40px;
    font-size: 1.08rem;
  }

  .line-table td[data-label="Action"] .line-action-stack {
    width: auto;
    justify-content: flex-end;
    gap: 8px;
  }

  html[data-theme="dark"] .line-table tbody td,
  html[data-theme="dark"] .line-table tbody tr:nth-child(2n) td,
  html[data-theme="dark"] .line-table tbody tr:hover td,
  html[data-theme="dark"] .line-table tr.material-autocomplete-open td,
  html[data-theme="dark"] .line-table tr.line-has-anomaly td {
    background: transparent;
  }
}

@media (min-width: 1180px) {
  .table-wrap {
    padding-bottom: 10px;
  }

  .line-table {
    min-width: 0;
    margin-top: 14px;
    border-collapse: separate;
    border-spacing: 0 14px;
  }

  .line-table thead {
    display: none;
  }

  .line-table tbody {
    display: grid;
    gap: 14px;
    padding: 0 16px;
  }

  .line-table tr[data-index] {
    display: grid;
    grid-template-columns:
      34px
      minmax(0, 2.55fr)
      minmax(72px, 0.48fr)
      minmax(88px, 0.58fr)
      minmax(124px, 0.82fr)
      minmax(118px, 0.72fr)
      44px;
    gap: 10px;
    align-items: start;
    padding: 12px;
    border: 1px solid rgba(16, 34, 26, 0.1);
    border-radius: 20px;
    background:
      radial-gradient(circle at 100% 0%, rgba(15, 122, 95, 0.08), transparent 38%),
      linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 250, 247, 0.95));
    box-shadow:
      0 14px 30px rgba(8, 57, 44, 0.06),
      inset 0 1px 0 rgba(255, 255, 255, 0.88);
    transition:
      border-color 140ms ease,
      box-shadow 140ms ease;
  }

  .line-table tbody tr:hover td,
  .line-table tr.material-autocomplete-open td,
  .line-table tr.line-has-anomaly td {
    background: transparent;
  }

  .line-table tr[data-index]:hover {
    border-color: rgba(16, 34, 26, 0.1);
    box-shadow:
      0 14px 30px rgba(8, 57, 44, 0.06),
      inset 0 1px 0 rgba(255, 255, 255, 0.88);
  }

  .line-table tr.material-autocomplete-open,
  .line-table tr.material-autocomplete-open:hover {
    border-color: rgba(16, 34, 26, 0.1);
    box-shadow:
      0 14px 30px rgba(8, 57, 44, 0.06),
      inset 0 1px 0 rgba(255, 255, 255, 0.88);
  }

  .line-table tr.line-has-anomaly {
    border-color: rgba(214, 159, 63, 0.3);
    background:
      radial-gradient(circle at 100% 0%, rgba(214, 159, 63, 0.12), transparent 38%),
      linear-gradient(180deg, rgba(255, 252, 245, 0.98), rgba(252, 247, 236, 0.95));
  }

  .line-table td {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .line-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 6px;
    font-size: 0.63rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #5c7268;
  }

  .line-table td[data-label="#"] {
    display: flex;
    justify-content: center;
    padding-top: 18px;
  }

  .line-table td[data-label="#"]::before {
    display: none;
  }

  .line-table .line-index {
    width: 30px;
    min-width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: rgba(15, 122, 95, 0.1);
    color: #0d5b46;
    font-size: 0.8rem;
  }

  .line-table td[data-label="Matériel / description"] {
    display: grid;
    align-content: start;
    gap: 6px;
    min-width: 0;
    min-height: 100%;
    padding: 8px 10px;
    border: 1px solid rgba(16, 34, 26, 0.08);
    border-radius: 14px;
    background: rgba(250, 252, 251, 0.9);
  }

  .line-table td[data-label="Matériel / description"]::before {
    margin-bottom: 6px;
  }

  .line-table td[data-label="Qte"],
  .line-table td[data-label="Unité"],
  .line-table td[data-label="Prix unitaire HT"],
  .line-table td.line-total {
    display: grid;
    align-content: start;
    gap: 0;
    min-height: 100%;
    padding: 8px 10px;
    border: 1px solid rgba(16, 34, 26, 0.08);
    border-radius: 14px;
    background: rgba(250, 252, 251, 0.9);
  }

  .line-table td[data-label="Qte"]::before,
  .line-table td[data-label="Unité"]::before,
  .line-table td[data-label="Prix unitaire HT"]::before,
  .line-table td.line-total::before {
    margin-bottom: 6px;
  }

  .line-table td.line-total {
    white-space: normal;
    align-content: center;
    font-size: 1.04rem;
    font-weight: 820;
  }

  .line-table td input,
  .line-table td select {
    min-height: 40px;
  }

  .line-table td input:hover,
  .line-table td select:hover,
  .line-material-input-wrap:hover,
  .line-table td[data-label="Matériel / description"]:hover,
  .line-table td[data-label="Qte"]:hover,
  .line-table td[data-label="Unité"]:hover,
  .line-table td[data-label="Prix unitaire HT"]:hover,
  .line-table td.line-total:hover {
    border-color: rgba(16, 34, 26, 0.08);
    background: rgba(250, 252, 251, 0.9);
    box-shadow: none;
  }

  .line-table .icon-btn:hover,
  .line-table .icon-btn.icon-btn-neutral:hover {
    transform: none;
  }

  .line-table td input[name="unitPrice"] {
    text-align: right;
  }

  .line-material-cell {
    min-width: 0;
    gap: 6px;
  }

  .line-material-input-wrap {
    min-width: 0;
  }

  .line-material-input-wrap:focus-within {
    border-radius: 12px;
    box-shadow: 0 0 0 2px rgba(26, 136, 217, 0.24);
  }

  .line-table td input[name="material"]:focus {
    outline: none;
  }

  .line-anomaly {
    padding: 6px 8px;
    border: 1px solid rgba(214, 159, 63, 0.24);
    border-radius: 10px;
    background: rgba(214, 159, 63, 0.08);
    line-height: 1.35;
  }

  .line-table td[data-label="Action"] {
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    min-height: 100%;
    padding-top: 18px;
    background: transparent !important;
  }

  .line-table td[data-label="Action"]::before {
    display: none;
  }

  .line-table td.line-total,
  .line-table tr[data-index]:hover td.line-total,
  .line-table td.line-total:hover {
    background: rgba(250, 252, 251, 0.9);
    border-color: rgba(16, 34, 26, 0.08);
    box-shadow: none;
  }

  .line-table td[data-label="Action"],
  .line-table td[data-label="Action"]:hover,
  .line-table tr[data-index]:hover td[data-label="Action"] {
    background: transparent !important;
    border-color: transparent;
    box-shadow: none;
  }

  .line-action-stack {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .icon-btn {
    width: 40px;
    min-width: 40px;
    height: 40px;
  }

  .line-table .icon-btn,
  .line-table .icon-btn:hover,
  .line-table .icon-btn.icon-btn-neutral,
  .line-table .icon-btn.icon-btn-neutral:hover {
    transform: none;
    box-shadow: none;
  }

  .line-table .icon-btn:hover {
    background: rgba(184, 69, 69, 0.12);
    border-color: rgba(184, 69, 69, 0.3);
    color: #7a2121;
  }

  .line-table .icon-btn.icon-btn-neutral:hover {
    background: rgba(15, 122, 95, 0.11);
    border-color: rgba(15, 122, 95, 0.3);
    color: #115845;
  }

  .line-table-footer {
    margin-top: 2px;
    padding: 16px 20px 12px;
    background: transparent;
  }

  .line-footer-actions {
    width: 100%;
    justify-content: space-between;
    gap: 12px;
  }

  .market-catalog-update-hint {
    margin-left: auto;
  }
}

.business-catalog-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.business-catalog-trigger.btn-secondary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 13px;
  border: 1px solid rgba(15, 122, 95, 0.24);
  background:
    radial-gradient(circle at 100% 50%, rgba(26, 136, 217, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(241, 249, 246, 0.98), rgba(224, 241, 235, 0.94));
  color: #0e3a2d;
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: -0.01em;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 10px 22px rgba(8, 74, 57, 0.08);
}

.business-catalog-trigger.btn-secondary::after {
  content: "";
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  opacity: 0.82;
  transition: transform 160ms ease, opacity 160ms ease;
}

.business-catalog-trigger::-webkit-details-marker {
  display: none;
}

.business-catalog-menu > summary {
  cursor: pointer;
}

.business-catalog-trigger.btn-secondary:hover {
  border-color: rgba(15, 122, 95, 0.42);
  background:
    radial-gradient(circle at 100% 50%, rgba(26, 136, 217, 0.16), transparent 36%),
    linear-gradient(180deg, rgba(232, 246, 240, 0.99), rgba(213, 236, 227, 0.97));
  transform: translateY(-1px);
}

.business-catalog-menu[open] .business-catalog-trigger {
  border-color: rgba(15, 122, 95, 0.42);
  background:
    radial-gradient(circle at 100% 50%, rgba(26, 136, 217, 0.16), transparent 38%),
    linear-gradient(180deg, rgba(220, 242, 234, 0.99), rgba(199, 231, 220, 0.99));
}

.business-catalog-menu[open] .business-catalog-trigger::after {
  transform: rotate(-135deg) translateY(-1px);
  opacity: 1;
}

.business-catalog-popover {
  position: absolute;
  left: calc(100% + 12px);
  top: -18px;
  z-index: 30;
  width: min(560px, calc(100vw - 84px));
  padding: 12px;
  border: 1px solid rgba(16, 34, 26, 0.14);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(247, 252, 249, 0.98));
  box-shadow:
    0 20px 40px rgba(9, 48, 37, 0.18),
    0 4px 10px rgba(9, 48, 37, 0.08);
}

.business-catalog-popover::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 22px;
  width: 12px;
  height: 12px;
  border-left: 1px solid rgba(16, 34, 26, 0.14);
  border-bottom: 1px solid rgba(16, 34, 26, 0.14);
  background: rgba(255, 255, 255, 0.99);
  transform: rotate(45deg);
}

@media (max-width: 1460px) {
  .business-catalog-popover {
    left: 0;
    top: calc(100% + 10px);
    width: min(560px, calc(100vw - 40px));
  }

  .business-catalog-popover::before {
    top: -6px;
    left: 20px;
    border-left: 1px solid rgba(16, 34, 26, 0.14);
    border-bottom: 0;
    border-top: 1px solid rgba(16, 34, 26, 0.14);
  }
}

.business-catalog-search-field {
  margin-bottom: 10px;
}

.business-catalog-search-field span {
  font-size: 0.79rem;
  color: #587065;
}

.business-catalog-count {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #36584c;
}

.business-catalog-category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.business-catalog-category-chip {
  border: 1px solid rgba(15, 122, 95, 0.24);
  border-radius: 999px;
  background: rgba(236, 247, 243, 0.9);
  color: #1f4f3f;
  font-size: 0.73rem;
  font-weight: 700;
  line-height: 1;
  padding: 6px 10px;
  cursor: pointer;
  transition:
    border-color 130ms ease,
    background-color 130ms ease,
    color 130ms ease,
    transform 130ms ease;
}

.business-catalog-category-chip:hover {
  border-color: rgba(15, 122, 95, 0.36);
  background: rgba(224, 241, 235, 0.96);
  transform: translateY(-1px);
}

.business-catalog-category-chip.active {
  border-color: rgba(7, 88, 68, 0.62);
  background: linear-gradient(125deg, rgba(15, 122, 95, 0.94), rgba(7, 88, 68, 0.96));
  color: #e9fff5;
}

.business-catalog-list {
  max-height: 320px;
  overflow: auto;
  display: grid;
  gap: 8px;
  padding-right: 4px;
}

.business-catalog-empty {
  margin: 0;
  color: #5f766c;
  font-size: 0.88rem;
}

.business-catalog-item {
  width: 100%;
  border: 1px solid rgba(16, 34, 26, 0.14);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(246, 251, 248, 0.96), rgba(240, 248, 244, 0.96));
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 3px;
  transition: border-color 140ms ease, transform 140ms ease, background-color 140ms ease;
}

.business-catalog-item:hover {
  border-color: rgba(15, 122, 95, 0.34);
  background:
    linear-gradient(180deg, rgba(232, 246, 240, 0.98), rgba(222, 241, 233, 0.98));
  transform: translateY(-1px);
}

.business-catalog-item-title {
  margin: 0;
  color: #12382c;
  font-weight: 740;
}

.business-catalog-item-meta {
  margin: 0;
  color: #4c665c;
  font-size: 0.8rem;
}

.market-catalog-update-hint {
  margin: 0 0 0 auto;
  flex: 0 0 auto;
  display: inline-grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 7px;
  row-gap: 1px;
  max-width: min(250px, 100%);
  padding: 6px 9px;
  border-radius: 11px;
  border: 1px solid rgba(20, 48, 39, 0.1);
  background: linear-gradient(180deg, rgba(252, 253, 252, 0.98), rgba(246, 249, 247, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 4px 10px rgba(12, 52, 41, 0.028);
  color: #274c40;
  line-height: 1.25;
}

.market-catalog-update-hint::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex: 0 0 6px;
  background: #70877d;
  box-shadow: 0 0 0 4px rgba(112, 135, 125, 0.055);
  grid-row: 1 / span 2;
  align-self: center;
}

.market-catalog-update-hint-title {
  display: block;
  font-size: 0.53rem;
  font-weight: 800;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  color: rgba(39, 76, 64, 0.76);
}

.market-catalog-update-hint-meta {
  display: block;
  font-size: 0.64rem;
  font-weight: 590;
  color: #698479;
}

.market-catalog-update-hint.is-fresh {
  border-color: rgba(15, 122, 95, 0.16);
  background: linear-gradient(180deg, rgba(242, 250, 246, 0.98), rgba(236, 246, 241, 0.96));
  color: #1d634e;
}

.market-catalog-update-hint.is-fresh::before {
  background: #12906f;
  box-shadow: 0 0 0 4px rgba(18, 144, 111, 0.075);
}

.market-catalog-update-hint.is-warning {
  border-color: rgba(177, 129, 51, 0.16);
  background: linear-gradient(180deg, rgba(255, 250, 242, 0.98), rgba(250, 244, 234, 0.96));
  color: #7b5e29;
}

.market-catalog-update-hint.is-warning::before {
  background: #c08b34;
  box-shadow: 0 0 0 4px rgba(192, 139, 52, 0.075);
}

.market-catalog-update-hint.is-muted {
  border-color: rgba(95, 122, 111, 0.12);
  background: linear-gradient(180deg, rgba(249, 251, 250, 0.98), rgba(244, 248, 246, 0.96));
  color: #4f6c62;
}

.market-catalog-update-hint.is-muted::before {
  background: #6f867c;
  box-shadow: 0 0 0 4px rgba(111, 134, 124, 0.055);
}

.quote-bottom-panels {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: 16px;
  align-items: stretch;
}

.quote-bottom-left-stack {
  display: grid;
  align-content: start;
  gap: 16px;
}

.quote-bottom-right-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 100%;
}

.quote-bottom-right-stack .quote-conditions-panel {
  margin-top: auto;
}

@media (max-width: 1180px) {
  .quote-bottom-panels {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .quote-bottom-left-stack,
  .quote-bottom-right-stack {
    display: contents;
  }

  .quote-total-panel {
    order: 1;
  }

  .quote-profitability-panel {
    order: 2;
  }

  .quote-comment-panel {
    order: 3;
  }

  .quote-general-conditions-panel {
    order: 4;
  }

  .quote-panel-header,
  .quote-panel-header-total {
    align-items: flex-start;
    gap: 12px;
  }

  .quote-total-header-spacer {
    display: none;
  }
}

.quote-panel {
  border: 1px solid rgba(16, 34, 26, 0.12);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 251, 248, 0.92));
  padding: 15px;
  box-shadow:
    0 20px 44px rgba(12, 48, 37, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.quote-panel-title {
  margin: 0;
  font-size: 1.14rem;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: #112d23;
}

.quote-panel-disclosure {
  display: grid;
  gap: 12px;
}

.quote-panel-disclosure-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  list-style: none;
  cursor: default;
  pointer-events: none;
}

.quote-panel-disclosure-summary::-webkit-details-marker {
  display: none;
}

.quote-panel-disclosure-summary::marker {
  display: none;
}

.quote-panel-disclosure-content {
  min-width: 0;
}

.quote-panel-disclosure-indicator {
  display: none;
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  color: #60776d;
  transition: transform 160ms ease;
}

.quote-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.quote-panel-kicker {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.68rem;
  font-weight: 800;
  color: #60776d;
}

.quote-panel-description {
  margin: 6px 0 0;
  max-width: 50ch;
  color: #587064;
  font-size: 0.82rem;
  line-height: 1.38;
}

.quote-status-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(16, 34, 26, 0.14);
  background: rgba(240, 245, 242, 0.9);
  color: #385448;
  font-size: 0.74rem;
  font-weight: 760;
  white-space: nowrap;
}

.quote-status-badge.is-positive {
  color: #0f7a5f;
  border-color: rgba(15, 122, 95, 0.28);
  background: rgba(231, 247, 240, 0.94);
}

.quote-status-badge.is-warning {
  color: #885d17;
  border-color: rgba(183, 126, 48, 0.34);
  background: rgba(255, 245, 225, 0.94);
}

.quote-status-badge.is-danger {
  color: #9e2b2f;
  border-color: rgba(173, 64, 64, 0.34);
  background: rgba(255, 238, 238, 0.94);
}

.quote-conditions-input {
  min-height: 146px;
  resize: vertical;
  border-radius: 16px;
  border: 1px solid rgba(16, 34, 26, 0.14);
  background: rgba(255, 255, 255, 0.97);
  color: #1c3f33;
}

.quote-summary-panel {
  display: grid;
  align-content: start;
}

.quote-profitability-inputs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.quote-inline-field,
.quote-total-card {
  display: grid;
  gap: 6px;
  padding: 11px;
  border-radius: 16px;
  border: 1px solid rgba(16, 34, 26, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(243, 249, 246, 0.92));
  min-width: 0;
}

.quote-inline-field-label,
.quote-total-card-label {
  color: #5c7268;
  font-size: 0.74rem;
  font-weight: 720;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.quote-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(16, 34, 26, 0.08);
}

.quote-summary-row:first-child {
  padding-top: 2px;
}

.quote-summary-control {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 42px;
  border-radius: 13px;
  border: 1px solid rgba(13, 67, 52, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(244, 250, 247, 0.97));
  color: #12392c;
  font-size: 0.92rem;
  font-weight: 760;
  padding: 8px 12px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 10px 20px rgba(13, 68, 53, 0.07);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

.quote-summary-control-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.quote-summary-control-wrap .quote-summary-control,
.quote-summary-control-wrap input.quote-summary-control {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  flex: 1 1 auto !important;
}

.quote-summary-margin {
  padding-right: 34px;
  padding-inline-end: 34px;
}

.quote-summary-control-suffix {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  font-weight: 720;
  color: #44675a;
  pointer-events: none;
}

.quote-summary-select-wrap {
  position: relative;
}

.quote-summary-date-wrap {
  position: relative;
}

.quote-summary-select-indicator {
  position: absolute;
  right: 14px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-right: 2px solid #187f63;
  border-bottom: 2px solid #187f63;
  transform: translateY(-62%) rotate(45deg);
  pointer-events: none;
  opacity: 0.9;
}

.quote-summary-date-indicator {
  position: absolute;
  right: 14px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  pointer-events: none;
  opacity: 0.85;
}

.quote-summary-date-indicator::before,
.quote-summary-date-indicator::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  box-sizing: border-box;
}

.quote-summary-date-indicator::before {
  top: 3px;
  width: 14px;
  height: 11px;
  border: 2px solid rgba(24, 71, 57, 0.72);
  border-radius: 4px;
}

.quote-summary-date-indicator::after {
  top: 0;
  width: 10px;
  height: 4px;
  border-top: 2px solid rgba(24, 71, 57, 0.72);
  border-left: 2px solid rgba(24, 71, 57, 0.72);
  border-right: 2px solid rgba(24, 71, 57, 0.72);
  border-radius: 3px 3px 0 0;
}

.quote-profitability-panel {
  position: relative;
  overflow: hidden;
  border-color: rgba(12, 72, 56, 0.2);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 251, 248, 0.92));
}

.quote-profitability-panel::before {
  display: none;
}

.quote-profitability-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(220px, 0.85fr);
  gap: 10px;
  margin-bottom: 12px;
}

.quote-profitability-focus {
  display: grid;
  gap: 6px;
  padding: 13px;
  border-radius: 18px;
  border: 1px solid rgba(16, 34, 26, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(240, 248, 244, 0.95));
}

.quote-profitability-focus-main {
  background:
    radial-gradient(circle at 100% 0%, rgba(15, 122, 95, 0.08), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(239, 248, 243, 0.95));
}

.quote-profitability-focus-label {
  color: #5d756a;
  font-size: 0.73rem;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.quote-profitability-focus-value {
  font-size: clamp(1.55rem, 2.8vw, 2.2rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.quote-profitability-focus-secondary .quote-profitability-focus-value {
  font-size: clamp(1.35rem, 2.4vw, 1.9rem);
}

.quote-profitability-focus-meta {
  margin: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: #587064;
  font-size: 0.8rem;
}

.quote-profitability-meta-value {
  font-size: 0.94rem;
}

.quote-profitability-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 2px;
  margin-bottom: 8px;
}

.quote-profitability-metric {
  display: grid;
  gap: 6px;
  padding: 11px;
  border-radius: 16px;
  border: 1px solid rgba(16, 34, 26, 0.1);
  background: rgba(255, 255, 255, 0.72);
}

.quote-profitability-metric-highlight {
  background:
    linear-gradient(180deg, rgba(247, 253, 249, 0.98), rgba(232, 246, 239, 0.96));
  border-color: rgba(15, 122, 95, 0.22);
}

.quote-profitability-metric span {
  color: #5b7368;
  font-size: 0.72rem;
  font-weight: 720;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.quote-profitability-value {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  color: #112f24;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.quote-profitability-metric .quote-profitability-value {
  font-size: 1rem;
  letter-spacing: -0.03em;
}

.quote-profitability-value.is-positive {
  color: #0f7a5f;
}

.quote-profitability-value.is-warning {
  color: #7f540f;
}

.quote-profitability-value.is-danger {
  color: #9e2b2f;
}

.profitability-hint {
  display: block;
  margin-top: 12px;
  min-height: 0;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(80, 112, 101, 0.18);
  background: rgba(245, 249, 247, 0.94);
  color: #4f695f;
  line-height: 1.34;
  font-size: 0.78rem;
}

.profitability-hint.is-positive {
  color: #0f7a5f;
  border-color: rgba(15, 122, 95, 0.22);
  background: linear-gradient(180deg, rgba(241, 252, 247, 0.96), rgba(229, 247, 239, 0.92));
}

.profitability-hint.is-warning {
  color: #7a5a1a;
  border-color: rgba(183, 126, 48, 0.24);
  background: linear-gradient(180deg, rgba(255, 250, 241, 0.96), rgba(255, 243, 220, 0.92));
}

.profitability-hint.is-danger {
  color: #9e2b2f;
  border-color: rgba(173, 64, 64, 0.22);
  background: linear-gradient(180deg, rgba(255, 244, 244, 0.96), rgba(250, 230, 230, 0.92));
}

.profitability-apply-btn {
  margin-top: 12px;
  width: 100%;
  min-height: 44px;
  justify-content: center;
  border-color: rgba(15, 122, 95, 0.22);
  background: linear-gradient(180deg, rgba(249, 253, 251, 0.99), rgba(229, 246, 238, 0.97));
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 20px rgba(10, 74, 57, 0.08);
}

.profitability-apply-btn:hover {
  border-color: rgba(15, 122, 95, 0.42);
  background: linear-gradient(180deg, rgba(245, 252, 248, 0.99), rgba(219, 241, 231, 0.98));
}

.profitability-apply-btn:disabled {
  opacity: 0.7;
  box-shadow: none;
}

.quote-summary-control:hover {
  border-color: rgba(13, 102, 77, 0.36);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(236, 246, 241, 0.97));
}

.quote-summary-control:focus,
.quote-summary-control:focus-visible {
  outline: none;
  border-color: rgba(20, 122, 94, 0.52);
  box-shadow:
    0 0 0 3px rgba(26, 136, 217, 0.18),
    0 10px 20px rgba(12, 90, 68, 0.14);
}

.quote-summary-date {
  text-align: left;
  padding-right: 8px;
}

.quote-summary-tva {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  text-align: left;
  padding-right: 42px;
  background-image: none;
}

.quote-summary-tva::-ms-expand {
  display: none;
}

.quote-summary-date::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.72;
  filter: saturate(1.2);
}

.quote-summary-date::-webkit-calendar-picker-indicator:hover {
  opacity: 0.95;
}

.quote-summary-row:last-child {
  border-bottom: 0;
}

.quote-summary-hint {
  margin: 0;
  font-size: 0.8rem;
  color: #597166;
  line-height: 1.4;
}

.quote-total-panel {
  gap: 0;
}

.quote-panel-header-total {
  margin-bottom: 12px;
}

.quote-total-header-spacer {
  flex: 0 0 200px;
  min-height: 1px;
}

.quote-total-focus {
  display: grid;
  gap: 4px;
  min-width: 200px;
  padding: 13px 15px;
  border-radius: 18px;
  border: 1px solid rgba(15, 122, 95, 0.18);
  background:
    radial-gradient(circle at 100% 0%, rgba(15, 122, 95, 0.14), transparent 45%),
    linear-gradient(180deg, rgba(244, 252, 248, 0.99), rgba(229, 247, 239, 0.97));
}

.quote-total-focus-label {
  color: #557166;
  font-size: 0.72rem;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.quote-total-focus strong {
  font-size: clamp(1.55rem, 2.8vw, 2.35rem);
  line-height: 0.98;
  color: #0f7a5f;
  font-weight: 850;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}

.quote-total-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.quote-total-card {
  min-height: 104px;
  align-content: start;
}

.quote-total-card strong {
  color: #112f24;
  font-size: 1.14rem;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.quote-total-card-input .quote-summary-control,
.quote-total-card-input .quote-summary-control-wrap {
  width: 100%;
}

.quote-total-card-input:not(.quote-total-card-wide) .quote-summary-control,
.quote-total-card-input:not(.quote-total-card-wide) .quote-summary-control-wrap {
  margin-top: auto;
}

.quote-total-card-wide {
  grid-column: 1 / -1;
}

.quote-total-card-wide .quote-summary-hint {
  margin-top: 2px;
}

.quote-total-card-discount {
  gap: 8px;
}

.quote-facturx-fields {
  gap: 12px;
  border-style: dashed;
  border-color: rgba(15, 122, 95, 0.22);
  background:
    radial-gradient(circle at 100% 0%, rgba(15, 122, 95, 0.08), transparent 44%),
    linear-gradient(180deg, rgba(248, 253, 250, 0.98), rgba(240, 249, 245, 0.95));
}

.quote-facturx-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.quote-facturx-head p {
  margin: 4px 0 0;
  color: #5b7066;
  font-size: 0.84rem;
  line-height: 1.35;
}

.quote-facturx-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.quote-facturx-grid .quote-total-card {
  min-height: 94px;
}

.quote-facturx-card {
  position: relative;
  overflow: visible !important;
}

.quote-facturx-field-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.quote-facturx-field-head .quote-total-card-label {
  min-width: 0;
  padding-right: 2px;
}

.quote-facturx-help {
  position: relative;
  flex: 0 0 auto;
  z-index: 2;
}

.quote-facturx-help summary {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(15, 122, 95, 0.24);
  background: rgba(255, 255, 255, 0.9);
  color: #0e6e56;
  font-size: 0.8rem;
  font-weight: 850;
  line-height: 1;
  cursor: pointer;
  list-style: none;
  box-shadow: 0 6px 14px rgba(7, 54, 42, 0.08);
}

.quote-facturx-help summary::-webkit-details-marker {
  display: none;
}

.quote-facturx-help summary:hover,
.quote-facturx-help summary:focus-visible {
  border-color: rgba(15, 122, 95, 0.42);
  background: rgba(224, 246, 238, 0.98);
  outline: none;
}

.quote-facturx-help[open] summary {
  color: #ffffff;
  background: #0f7a5f;
  border-color: rgba(15, 122, 95, 0.58);
}

.quote-facturx-help p {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(240px, 72vw);
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(15, 122, 95, 0.2);
  background: rgba(255, 255, 255, 0.98);
  color: #25483c;
  font-size: 0.78rem;
  font-weight: 620;
  line-height: 1.35;
  text-transform: none;
  letter-spacing: 0;
  box-shadow: 0 18px 34px rgba(5, 33, 26, 0.16);
}

.quote-total-discount-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 180px);
  gap: 10px;
  align-items: stretch;
}

.quote-summary-discount {
  text-align: right;
}

.quote-summary-discount-reason {
  text-align: left;
  font-weight: 620;
}

.quote-total-discount-impact {
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 13px;
  border: 1px solid rgba(15, 122, 95, 0.18);
  background: rgba(235, 247, 241, 0.94);
  color: #0f6d53;
  font-size: 0.8rem;
  font-weight: 760;
  white-space: nowrap;
}

.quote-total-card-hero {
  gap: 4px;
  min-height: auto;
  padding: 13px 15px;
  border-radius: 18px;
  border-color: rgba(15, 122, 95, 0.18);
  background:
    radial-gradient(circle at 100% 0%, rgba(15, 122, 95, 0.14), transparent 45%),
    linear-gradient(180deg, rgba(244, 252, 248, 0.99), rgba(229, 247, 239, 0.97));
}

.quote-total-card-hero strong {
  font-size: clamp(1.55rem, 2.8vw, 2.35rem);
  line-height: 0.98;
  color: #0f7a5f;
  font-weight: 850;
  letter-spacing: -0.05em;
}

.preview {
  display: grid;
  gap: 14px;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.preview-company {
  border: 1px solid rgba(16, 34, 26, 0.12);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.86);
  padding: 10px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.preview-company-logo {
  width: 92px;
  height: 58px;
  border-radius: 8px;
  border: 1px solid rgba(16, 34, 26, 0.12);
  object-fit: contain;
  background: #ffffff;
  flex: 0 0 auto;
}

.preview-company-title {
  margin: 0;
  font-weight: 800;
}

.preview-company-meta {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.preview-paid-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(214, 45, 58, 0.18);
  background:
    linear-gradient(135deg, rgba(255, 244, 245, 0.98), rgba(255, 232, 235, 0.92));
  box-shadow: 0 16px 34px rgba(214, 45, 58, 0.12);
}

.preview-paid-banner-kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(166, 30, 41, 0.88);
}

.preview-paid-banner-title {
  margin: 4px 0 0;
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #d62d3a;
}

.preview-paid-banner-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(214, 45, 58, 0.14);
  color: #a61e29;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.preview-title {
  margin: 0;
  font-size: 1.15rem;
}

.preview-muted {
  margin: 4px 0 0;
  color: var(--muted);
}

.preview-client {
  margin: 0;
}

.preview-b2b-compliance {
  border: 1px solid rgba(15, 122, 95, 0.24);
  border-radius: 12px;
  background: rgba(240, 250, 246, 0.92);
  padding: 14px 16px;
}

.preview-b2b-compliance.is-warning {
  border-color: rgba(180, 83, 9, 0.28);
  background: rgba(255, 251, 235, 0.94);
}

.preview-b2b-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.preview-b2b-kicker {
  margin: 0 0 3px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0f6d53;
}

.preview-b2b-head h3 {
  margin: 0;
  font-size: 1rem;
  color: #10221a;
}

.preview-b2b-status {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px 10px;
  background: #d9f99d;
  color: #28430d;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.preview-b2b-compliance.is-warning .preview-b2b-status {
  background: #fde68a;
  color: #78350f;
}

.preview-b2b-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 14px;
  margin: 0;
}

.preview-b2b-grid div {
  min-width: 0;
}

.preview-b2b-grid dt {
  margin: 0 0 2px;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
}

.preview-b2b-grid dd {
  margin: 0;
  color: #10221a;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.preview-b2b-warning,
.preview-b2b-note {
  margin: 12px 0 0;
  font-size: 0.88rem;
  font-weight: 700;
}

.preview-b2b-warning {
  color: #92400e;
}

.preview-b2b-note {
  color: #0f6d53;
}

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

.preview-table th,
.preview-table td {
  padding: 8px 6px;
  border-bottom: 1px solid rgba(16, 34, 26, 0.09);
}

.preview-table th {
  text-align: left;
  font-size: 0.82rem;
  text-transform: uppercase;
  color: var(--muted);
}

.preview-table td:last-child,
.preview-table th:last-child {
  text-align: right;
}

.preview-conditions {
  border: 1px dashed rgba(16, 34, 26, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.74);
  padding: 10px;
}

.preview-conditions-title {
  margin: 0 0 6px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
}

.preview-conditions p {
  margin: 0;
  color: #334a3f;
  font-size: 0.9rem;
  line-height: 1.4;
}

.preview-totals {
  justify-self: end;
  min-width: 220px;
  display: grid;
  gap: 6px;
}

.preview-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.preview-row.discount {
  color: #0f6d53;
  font-weight: 700;
}

.preview-row.discount-reason {
  display: block;
  color: #5b7066;
  font-size: 0.82rem;
  line-height: 1.4;
}

.preview-row.strong {
  font-weight: 700;
  font-size: 1.05rem;
}

.preview-row.deposit {
  color: #0e7358;
  font-weight: 700;
}

.preview-row.balance-due {
  padding-top: 6px;
  border-top: 1px solid rgba(13, 92, 71, 0.14);
}

.preview-payment-note {
  margin: 6px 0 0;
  color: #5b7066;
  font-size: 0.82rem;
  line-height: 1.45;
}

.share-invoice-btn {
  position: relative;
  overflow: hidden;
}

.share-invoice-btn.is-converted {
  color: #28431b;
  border: 1px solid rgba(169, 202, 54, 0.34);
  background:
    radial-gradient(circle at 0% 50%, rgba(210, 235, 94, 0.38), transparent 40%),
    linear-gradient(135deg, rgba(246, 254, 217, 0.98), rgba(221, 245, 152, 0.96));
  box-shadow:
    0 12px 24px rgba(182, 206, 75, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.share-invoice-btn.is-converted:hover {
  background:
    radial-gradient(circle at 0% 50%, rgba(210, 235, 94, 0.42), transparent 42%),
    linear-gradient(135deg, rgba(248, 255, 224, 1), rgba(226, 247, 160, 0.98));
}

.share-status {
  min-height: 1.2em;
  margin: 8px 0 0;
  color: var(--primary-strong);
  font-weight: 600;
}

.share-invoice-notice {
  margin: 10px 0 0;
  padding: 9px 12px;
  border-radius: 14px;
  border: 1px solid rgba(154, 193, 48, 0.3);
  background:
    linear-gradient(135deg, rgba(248, 253, 229, 0.96), rgba(235, 247, 187, 0.92));
  color: #536a1b;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
}

.share-attachment-input {
  display: none;
}

.share-attachment-panel {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(15, 122, 95, 0.16);
  border-radius: 18px;
  background: linear-gradient(
    180deg,
    rgba(248, 252, 250, 0.98),
    rgba(238, 247, 243, 0.94)
  );
  display: grid;
  gap: 10px;
}

.share-attachment-title,
.share-attachment-meta {
  margin: 0;
}

.share-attachment-title {
  color: #173f32;
  font-size: 0.88rem;
  font-weight: 760;
}

.share-attachment-meta {
  color: #5c776d;
  font-size: 0.76rem;
  line-height: 1.4;
}

.share-attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.share-attachment-chip {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 9px 10px 9px 12px;
  border-radius: 14px;
  border: 1px solid rgba(15, 122, 95, 0.16);
  background: rgba(255, 255, 255, 0.88);
}

.share-attachment-chip-text {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.share-attachment-chip-name,
.share-attachment-chip-size {
  margin: 0;
}

.share-attachment-chip-name {
  color: #173f32;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.25;
  word-break: break-word;
}

.share-attachment-chip-size {
  color: #69857a;
  font-size: 0.72rem;
  font-weight: 620;
}

.share-attachment-remove {
  width: 28px;
  min-width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: rgba(187, 70, 70, 0.1);
  color: #8c3434;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
}

.share-attachment-remove:hover,
.share-attachment-remove:focus-visible {
  background: rgba(187, 70, 70, 0.16);
}

.share-progress-toast {
  position: fixed;
  left: 50%;
  bottom: max(18px, calc(env(safe-area-inset-bottom, 0px) + 18px));
  transform: translateX(-50%);
  z-index: 120;
  min-width: min(360px, calc(100vw - 32px));
  max-width: min(520px, calc(100vw - 32px));
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(15, 122, 95, 0.2);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  color: #153b2e;
  box-shadow:
    0 18px 36px rgba(8, 35, 28, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
}

.share-progress-toast-spinner {
  width: 16px;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(15, 122, 95, 0.2);
  border-top-color: rgba(15, 122, 95, 0.9);
  animation: share-progress-spin 0.8s linear infinite;
}

.share-progress-toast-message {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.35;
}

.share-progress-toast.success {
  border-color: rgba(15, 122, 95, 0.22);
  background: rgba(239, 250, 245, 0.96);
  color: #0b5d47;
}

.share-progress-toast.success .share-progress-toast-spinner {
  border-color: rgba(15, 122, 95, 0.18);
  border-top-color: rgba(15, 122, 95, 0.78);
}

.share-progress-toast.danger {
  border-color: rgba(184, 69, 69, 0.24);
  background: rgba(255, 245, 245, 0.96);
  color: #8a2d2d;
}

.share-progress-toast.danger .share-progress-toast-spinner {
  border-color: rgba(184, 69, 69, 0.2);
  border-top-color: rgba(184, 69, 69, 0.86);
}

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

.share-actions,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.create-actions .btn {
  flex: 1 1 200px;
}

.delivery-card {
  margin-top: 18px;
  border-top: 1px solid rgba(16, 34, 26, 0.09);
  padding-top: 14px;
}

.delivery-card h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.delivery-list {
  display: grid;
  gap: 8px;
}

.delivery-item {
  border: 1px solid rgba(16, 34, 26, 0.1);
  border-radius: 12px;
  background: #ffffff;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.delivery-main {
  min-width: 0;
}

.delivery-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.delivery-title {
  margin: 0;
  font-weight: 700;
}

.delivery-meta {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

#step-share .card {
  background: #ffffff;
}

.delivery-status {
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.76rem;
  font-weight: 700;
}

.delivery-status.success {
  color: #05543f;
  background: rgba(15, 122, 95, 0.15);
}

.delivery-status.warning {
  color: #7b4c00;
  background: rgba(228, 161, 26, 0.22);
}

.delivery-status.danger {
  color: #7a2121;
  background: rgba(184, 69, 69, 0.18);
}

.delivery-delete-btn {
  width: 36px;
  min-width: 36px;
  height: 36px;
  font-size: 1.18rem;
}

.delivery-delete-btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.btn-compact {
  padding: 7px 11px;
  font-size: 0.84rem;
  border-radius: 10px;
}

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

.btn:active {
  transform: translateY(0);
}

.btn:disabled,
.icon-btn:disabled,
.history-action-item:disabled,
.business-catalog-item:disabled,
.quick-line-suggestion:disabled,
.line-material-option:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  color: #ffffff;
  background: linear-gradient(120deg, var(--primary), var(--primary-strong));
  box-shadow: 0 10px 20px rgba(8, 108, 82, 0.25);
}

.btn-secondary {
  color: #0a2d23;
  background: rgba(15, 122, 95, 0.1);
  border: 1px solid rgba(15, 122, 95, 0.24);
}

.btn-ghost {
  color: #21453a;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(14, 43, 34, 0.18);
}

.btn-danger {
  color: #7a2121;
  background: rgba(184, 69, 69, 0.12);
  border: 1px solid rgba(184, 69, 69, 0.28);
}

.history-delete-btn {
  width: 42px;
  height: 42px;
  min-width: 42px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  line-height: 1;
  font-weight: 800;
  text-transform: uppercase;
}

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

@media (max-width: 1280px) {
  .history-card-head {
    align-items: stretch;
  }

  .history-filters {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .history-type-filters {
    width: 100%;
    justify-self: stretch;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .history-filter-chip {
    width: 100%;
  }

  .history-filter-chip span {
    width: 100%;
    min-width: 0;
    white-space: nowrap;
  }
}

@media (max-width: 1700px) {
  .history-type-filters {
    width: 100%;
    justify-self: stretch;
    display: grid !important;
    grid-auto-flow: row !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 8px;
  }

  .history-filter-chip {
    width: 100%;
    min-width: 0;
  }

  .history-filter-chip span {
    width: 100%;
    min-width: 0;
    display: inline-flex;
    white-space: nowrap;
  }
}

@media (max-width: 1040px) {
  .kpi-grid-shell {
    grid-template-columns: 32px minmax(0, 1fr) 32px;
    gap: 8px;
  }

  .kpi-scope-toolbar {
    padding: 0;
  }

  .kpi-year-control select {
    width: 72px;
    min-width: 72px;
    max-width: 72px;
    padding: 7px 22px 7px 8px;
    font-size: 0.68rem;
  }

  .kpi-year-control::after {
    right: 10px;
    font-size: 0.68rem;
  }

  .kpi-scope-nav {
    width: 32px;
    height: 32px;
    font-size: 1.02rem;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .kpi-card {
    min-height: 174px;
  }

  .kpi-circle-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .kpi-amount-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .planning-layout {
    grid-template-columns: 1fr;
  }

  .history-filters {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .history-type-filters {
    width: 100%;
    justify-self: stretch;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .history-filter-chip {
    width: 100%;
  }

  .history-filter-chip span {
    width: 100%;
    min-width: 0;
    white-space: nowrap;
  }

  .proactive-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .proactive-carousel-track {
    height: min(44vh, 260px);
    padding-right: 2px;
    mask-image: none;
  }

  .weather-alert-popup {
    align-items: end;
    padding: 10px;
  }

  .weather-alert-popup-card {
    max-height: min(78vh, 640px);
    overflow: auto;
  }

  .weather-alert-popup-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .weather-alert-popup-level-badge {
    align-self: flex-start;
    min-width: 64px;
    height: 30px;
  }

  .send-confirm-popup {
    align-items: center;
    padding: 10px;
  }

  .send-confirm-popup-card {
    width: 100%;
  }

  .purchase-archive-modal-card {
    max-height: calc(100vh - 20px);
    max-height: calc(100svh - 20px);
  }

  .purchase-archive-modal-body {
    padding-right: 0;
  }

  .pdf-preview-popup-card {
    max-height: min(94vh, 980px);
  }

  .pdf-preview-shell,
  .pdf-preview-loading,
  .pdf-preview-frame {
    min-height: min(68vh, 640px);
  }

  .send-confirm-popup-actions {
    justify-content: stretch;
  }

  .send-confirm-popup-actions .btn {
    width: 100%;
  }

  .invoice-deposit-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 701px) and (max-width: 1040px) {
  #purchaseArchiveModal {
    padding-inline: clamp(40px, 7vw, 96px);
  }

  .purchase-archive-modal-card {
    width: min(620px, 100%);
    max-height: calc(100vh - 32px);
    max-height: calc(100svh - 32px);
  }
}

@media (max-width: 940px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: stretch;
  }

  .topbar-actions > .btn {
    width: 100%;
  }

  .history-type-filters {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .history-filter-chip {
    width: 100%;
  }

  .history-filter-chip span {
    width: 100%;
    min-width: 0;
    white-space: nowrap;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .field-full {
    grid-column: auto;
  }

  #step-create .field {
    min-width: 0;
  }

  #step-create .card,
  #step-create .field-grid {
    min-width: 0;
  }

  #step-create input[type="date"],
  #step-create input[type="time"],
  #step-create select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    display: block;
    box-sizing: border-box;
  }

  #planningForm .field,
  #planningForm .field-grid {
    min-width: 0;
  }

  #planningDateInput,
  #planningTimeInput {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    display: block;
    box-sizing: border-box;
    -webkit-min-logical-width: 0;
    padding-right: 12px;
    padding-inline-end: 12px;
  }

  #planningDateInput::-webkit-datetime-edit,
  #planningDateInput::-webkit-datetime-edit-fields-wrapper,
  #planningDateInput::-webkit-date-and-time-value,
  #planningTimeInput::-webkit-datetime-edit,
  #planningTimeInput::-webkit-datetime-edit-fields-wrapper,
  #planningTimeInput::-webkit-date-and-time-value {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #quoteDate {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    -webkit-min-logical-width: 0;
    padding-right: 12px;
    padding-inline-end: 12px;
    text-align: left;
  }

  #quoteDate::-webkit-date-and-time-value {
    text-align: left;
  }

  #step-create .quote-summary-row #quoteDate,
  #step-create .quote-summary-row #tvaRate {
    width: 168px;
    min-width: 168px;
    max-width: 168px;
    flex: 0 0 168px;
  }

  #step-create .quote-summary-control-wrap {
    width: 168px;
    min-width: 168px;
    max-width: 168px;
    flex: 0 0 168px;
  }

  .brand-lockup-topbar {
    width: min(100%, 336px);
  }

  .planning-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .account-head-actions {
    justify-content: flex-start;
  }

  .line-table-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 8px 0 0;
    border-top: 0;
    background: transparent;
  }

  .line-footer-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: start;
  }

  .line-add-manual-btn {
    width: 100%;
  }

  .business-catalog-menu,
  .business-catalog-menu > summary {
    width: 100%;
  }

  .business-catalog-menu {
    position: relative;
  }

  .business-catalog-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    width: min(560px, calc(100vw - 32px));
    margin-top: 0;
  }

  .business-catalog-popover::before {
    display: block;
    top: -6px;
    right: 24px;
    left: auto;
    border-top: 1px solid rgba(16, 34, 26, 0.14);
    border-left: 1px solid rgba(16, 34, 26, 0.14);
    border-bottom: 0;
  }

  .market-catalog-update-hint {
    grid-column: 1 / -1;
    width: 100%;
    font-size: 0.72rem;
  }

  .quote-panel {
    padding: 13px;
    border-radius: 18px;
  }

  .quote-profitability-inputs,
  .quote-facturx-grid,
  .quote-total-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quote-profitability-inputs .quote-inline-field:last-child,
  .quote-total-card-wide,
  .quote-total-card-hero {
    grid-column: 1 / -1;
  }

  .quote-profitability-hero,
  .quote-profitability-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quote-profitability-metrics .quote-profitability-metric:last-child {
    grid-column: 1 / -1;
  }

}

@media (max-width: 700px) {
  body.catalog-modal-open {
    overflow: hidden;
  }

  body.purchase-archive-modal-open {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    overflow: hidden;
  }

  #purchaseArchiveModal {
    align-items: center;
    padding:
      calc(env(safe-area-inset-top, 0px) + 8px)
      14px
      calc(env(safe-area-inset-bottom, 0px) + 14px);
  }

  .purchase-archive-modal-card {
    width: min(390px, calc(100vw - 28px));
    max-height: min(84vh, 760px);
    max-height: min(84svh, 760px);
    margin: 0 auto;
    border-radius: 22px;
    padding: 14px;
    gap: 10px;
  }

  .purchase-archive-modal-head {
    gap: 8px;
  }

  .purchase-archive-modal-head h2 {
    font-size: 1.18rem;
  }

  .purchase-archive-modal-head .send-confirm-popup-message {
    font-size: 0.88rem;
  }

  .purchase-module-preview-sheet {
    min-height: 0;
    padding: 12px;
    gap: 10px;
  }

  .purchase-document-sheet-brand {
    min-height: 48px;
    font-size: 1rem;
  }

  .purchase-document-sheet-meta {
    gap: 4px;
    font-size: 0.86rem;
  }

  .purchase-document-sheet-lines {
    padding: 8px 0;
    gap: 8px;
  }

  .purchase-document-sheet-line strong {
    font-size: 0.84rem;
  }

  .app-shell {
    padding: 4px 18px 44px;
  }

  .chart-card,
  .purchase-module-card,
  .history-card {
    border-color: rgba(12, 54, 43, 0.12);
    background:
      radial-gradient(circle at 100% 0%, rgba(26, 136, 217, 0.08), transparent 34%),
      linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 248, 0.96));
    box-shadow:
      0 18px 30px rgba(10, 32, 24, 0.055),
      inset 0 1px 0 rgba(255, 255, 255, 0.72);
  }

  .topbar {
    gap: 3px;
    margin-bottom: 16px;
  }

  .chart-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    margin-bottom: 3px;
  }

  .chart-slide-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .chart-card-head {
    gap: 8px;
  }

  .chart-year-control select {
    width: 72px;
    min-width: 72px;
    max-width: 72px;
    padding: 7px 22px 7px 8px;
    font-size: 0.66rem;
  }

  .chart-year-control::after {
    right: 10px;
    font-size: 0.68rem;
  }

  .chart-slide-range {
    font-size: 0.78rem;
  }

  .chart-slide-hint {
    font-size: 0.7rem;
    text-align: left;
  }

  .chart-summary-item {
    border-radius: 10px;
    padding: 5px 6px 4px;
    gap: 1px;
    min-height: 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: none;
    position: relative;
  }

  .chart-summary-value {
    font-size: 0.96rem;
    margin-top: 1px;
    line-height: 0.95;
  }

  .chart-summary-label {
    gap: 4px;
    font-size: 0.54rem;
    line-height: 1;
    letter-spacing: 0.01em;
  }

  .chart-summary-dot {
    width: 6px;
    height: 6px;
  }

  .chart-summary-meta {
    display: block;
    font-size: 0.48rem;
    line-height: 1;
    color: #7b8a83;
  }

  .chart-card {
    padding: 14px 12px 12px;
  }

  .chart-card .card-head {
    margin-bottom: 10px;
  }

  .chart-card .card-head h2 {
    font-size: 0.82rem;
    letter-spacing: 0.07em;
  }

  .chart-card .card-head p {
    margin-top: 4px;
    font-size: 0.74rem;
    line-height: 1.32;
  }

  #monthlyChart {
    height: 190px;
  }

  .monthly-chart-canvas {
    height: 190px;
  }

  .client-card {
    padding: 14px 12px 12px;
  }

  .client-card .card-head {
    margin-bottom: 10px;
  }

  .client-card .card-head h2 {
    font-size: 0.98rem;
  }

  .client-card .card-head p {
    margin-top: 4px;
    font-size: 0.74rem;
    line-height: 1.34;
    max-width: 30ch;
  }

  .client-card > .field {
    margin-bottom: 8px;
  }

  .client-card .field-grid {
    gap: 8px;
  }

  .client-card .field > span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .client-card input:not([type="radio"]):not([type="checkbox"]),
  .client-card select {
    border-radius: 11px;
    padding: 9px 11px;
    font-size: 0.88rem;
    min-height: 42px;
  }

  .history-card {
    padding: 14px 12px 12px;
  }

  .history-card .card-head {
    margin-bottom: 10px;
  }

  .history-card-head {
    gap: 10px;
  }

  .history-card .card-head h2 {
    font-size: 0.82rem;
    letter-spacing: 0.07em;
    color: #517769;
  }

  .purchase-module-history-head h3 {
    font-size: 0.98rem;
    line-height: 1.1;
  }

  .history-card .card-head p {
    margin-top: 4px;
    font-size: 0.74rem;
    line-height: 1.34;
    max-width: 30ch;
    color: #607169;
  }

  .history-year-control {
    align-self: flex-start;
  }

  .history-year-control select {
    width: 78px;
    min-width: 78px;
    max-width: 78px;
    padding: 8px 22px 8px 10px;
    font-size: 0.72rem;
    border: 1px solid rgba(15, 122, 95, 0.16);
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 250, 247, 0.96));
    box-shadow:
      0 8px 18px rgba(10, 32, 24, 0.05),
      inset 0 1px 0 rgba(255, 255, 255, 0.66);
  }

  .history-year-control::after {
    right: 10px;
    font-size: 0.72rem;
  }

  .history-filters {
    gap: 8px;
    margin-bottom: 10px;
  }

  .history-search-field span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .history-search-field input {
    min-height: 42px;
    padding: 9px 11px;
    border-radius: 11px;
    font-size: 0.88rem;
    border-color: rgba(15, 122, 95, 0.14);
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 248, 0.96));
    box-shadow:
      0 8px 18px rgba(10, 32, 24, 0.035),
      inset 0 1px 0 rgba(255, 255, 255, 0.7);
  }

  .history-type-filters {
    width: 100%;
    display: grid;
    grid-auto-flow: row;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
  }

  .history-filter-chip {
    width: 100%;
    min-width: 0;
  }

  .history-filter-chip span {
    width: 100%;
    min-width: 0;
    min-height: 34px;
    padding: 0 6px;
    font-size: 0.66rem;
    gap: 3px;
    letter-spacing: -0.01em;
  }

  .history-filter-chip span::before {
    width: 9px;
    height: 9px;
    font-size: 0.56rem;
  }

  .history-list {
    gap: 8px;
  }

  .history-item {
    padding: 10px;
    border-radius: 16px;
    gap: 10px;
  }

  .history-title {
    font-size: 0.92rem;
    line-height: 1.28;
  }

  .history-client-contact {
    font-size: 0.74rem;
  }

  .history-sub,
  .history-meta,
  .history-comment {
    font-size: 0.78rem;
    line-height: 1.3;
  }

  .history-comment {
    -webkit-line-clamp: 3;
  }

  .history-actions {
    width: 100%;
    gap: 6px;
  }

  .history-paid-badge-slot {
    min-width: 0;
  }

  .history-actions .badge,
  .history-action-menu .history-action-trigger {
    min-height: 34px;
    font-size: 0.74rem;
  }

  #step-share .card {
    padding: 14px 12px 12px;
  }

  #step-share .card-head {
    margin-bottom: 10px;
  }

  #step-share .card-head h2 {
    font-size: 0.98rem;
  }

  #step-share .card-head p {
    margin-top: 4px;
    font-size: 0.74rem;
    line-height: 1.34;
    max-width: 31ch;
  }

  .preview {
    gap: 10px;
  }

  .preview-company {
    padding: 8px;
    gap: 10px;
    border-radius: 14px;
  }

  .preview-company-logo {
    width: 74px;
    height: 48px;
  }

  .preview-company-title {
    font-size: 0.88rem;
  }

  .preview-company-meta,
  .preview-muted,
  .preview-client {
    font-size: 0.76rem;
    line-height: 1.3;
  }

  .preview-title {
    font-size: 0.96rem;
  }

  .preview-conditions {
    padding: 8px;
  }

  .preview-conditions-title {
    margin-bottom: 4px;
    font-size: 0.68rem;
  }

  .preview-conditions p {
    font-size: 0.78rem;
    line-height: 1.32;
  }

  .preview-totals {
    min-width: 0;
    width: 100%;
    gap: 4px;
  }

  .preview-row,
  .preview-row.strong {
    font-size: 0.84rem;
  }

  .share-status {
    margin-top: 6px;
    font-size: 0.76rem;
  }

  .share-invoice-notice {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 12px;
    font-size: 0.74rem;
  }

  .share-attachment-panel {
    margin-top: 10px;
    padding: 10px 11px;
    border-radius: 16px;
    gap: 8px;
  }

  .share-attachment-title {
    font-size: 0.8rem;
  }

  .share-attachment-meta {
    font-size: 0.7rem;
  }

  .share-attachment-list {
    gap: 6px;
  }

  .share-attachment-chip {
    width: 100%;
    padding: 8px 9px 8px 10px;
    gap: 8px;
  }

  .share-attachment-chip-name {
    font-size: 0.76rem;
  }

  .share-attachment-chip-size {
    font-size: 0.68rem;
  }

  .share-progress-toast {
    min-width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    padding: 11px 12px;
    border-radius: 14px;
  }

  .share-progress-toast-message {
    font-size: 0.82rem;
  }

  .share-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
  }

  .share-actions .btn {
    min-height: 36px;
    padding: 0 9px;
    font-size: 0.72rem;
  }

  .delivery-card {
    margin-top: 14px;
    padding-top: 10px;
  }

  .delivery-card h3 {
    margin-bottom: 8px;
    font-size: 0.92rem;
  }

  .delivery-list {
    gap: 6px;
  }

  .delivery-item {
    padding: 8px 9px;
    border-radius: 12px;
    gap: 8px;
  }

  .actions {
    gap: 8px;
    margin-top: 10px;
  }

  #step-share .actions .btn {
    min-height: 40px;
    padding: 0 12px;
    font-size: 0.82rem;
  }

  .create-ai-card {
    padding: 14px 12px 12px;
  }

  .create-ai-head {
    margin-bottom: 10px;
  }

  .create-ai-kicker {
    margin-bottom: 3px;
    font-size: 0.64rem;
  }

  .create-ai-head h2 {
    font-size: 0.98rem;
  }

  .create-ai-head p:last-child {
    margin-top: 4px;
    font-size: 0.74rem;
    line-height: 1.34;
    max-width: 30ch;
  }

  .proactive-card {
    padding: 14px 12px 12px;
    border-radius: 22px;
  }

  .proactive-head {
    gap: 10px;
  }

  .proactive-kicker,
  .purchase-module-kicker {
    font-size: 0.72rem;
    letter-spacing: 0.07em;
  }

  .purchase-module-head .purchase-module-kicker {
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    color: #517769;
  }

  .purchase-module-head-copy h2 {
    margin-top: 6px;
    font-size: 1rem;
    line-height: 1.12;
    letter-spacing: -0.02em;
    color: #173126;
  }

  .proactive-head h2 {
    margin-top: 2px;
    font-size: 0.98rem;
    line-height: 1.1;
  }

  .proactive-head-side {
    display: none;
  }

  .proactive-summary {
    margin-top: 6px;
    font-size: 0.8rem;
    line-height: 1.34;
    min-height: 0;
    width: 100%;
    padding: 8px 10px;
    border-radius: 12px;
  }

  .proactive-grid {
    margin-top: 10px;
    gap: 8px;
  }

  .proactive-block {
    padding: 10px;
    border-radius: 16px;
    gap: 9px;
  }

  .proactive-block-kicker {
    font-size: 0.62rem;
  }

  .proactive-block h3 {
    font-size: 0.88rem;
  }

  .proactive-followup-title-row {
    gap: 8px;
  }

  .proactive-followup-tabs {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
    gap: 8px;
  }

  .proactive-followup-tab {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 12px;
    font-size: 0.74rem;
  }

  .proactive-block-summary {
    min-height: 22px;
    padding: 0 8px;
    font-size: 0.68rem;
  }

  .proactive-list,
  .proactive-list.is-carousel,
  .proactive-carousel-shell {
    gap: 7px;
  }

  .proactive-carousel-track {
    max-height: min(26vh, 220px);
    gap: 7px;
    padding-right: 2px;
  }

  .proactive-item {
    padding: 10px;
    border-radius: 14px;
    gap: 8px;
  }

  .proactive-item-body-rdv {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .proactive-item-side-contact {
    padding: 9px 10px;
    gap: 5px;
  }

  .proactive-item-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .proactive-item-title {
    font-size: 0.84rem;
    line-height: 1.26;
  }

  .proactive-item-risk {
    margin-left: 0;
    font-size: 0.68rem;
    letter-spacing: 0.04em;
  }

  .proactive-item-meta {
    font-size: 0.76rem;
    line-height: 1.3;
  }

  .proactive-item-side-line {
    font-size: 0.74rem;
  }

  .proactive-item-meta-label {
    font-size: 0.6rem;
  }

  .proactive-item-actions {
    gap: 6px;
  }

  .proactive-item-actions .btn {
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.7rem;
  }

  .proactive-tag {
    min-height: 24px;
    padding: 0 8px;
    font-size: 0.66rem;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .kpi-grid-shell {
    gap: 8px;
    grid-template-columns: 34px minmax(0, 1fr) 34px;
  }

  .kpi-grid-stack {
    margin-bottom: 14px;
  }

  .kpi-scope-toolbar {
    gap: 8px;
  }

  .kpi-scope-kicker {
    font-size: 0.6rem;
  }

  .kpi-scope-label {
    font-size: 0.82rem;
  }

  .kpi-scope-nav {
    width: 34px;
    height: 34px;
    font-size: 1.12rem;
  }

  .kpi-card {
    min-height: 0;
    padding: 12px 12px 10px;
    border-radius: 20px;
    gap: 8px;
  }

  .kpi-card::before {
    left: 14px;
    width: 40px;
  }

  .kpi-card-headline {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  .kpi-card .label {
    padding: 5px 8px;
    font-size: 0.66rem;
  }

  .kpi-head-note {
    font-size: 0.58rem;
    letter-spacing: 0.04em;
  }

  .kpi-circle-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .kpi-circle {
    width: min(100%, 68px);
    padding: 8px;
    font-size: clamp(0.72rem, 3.5vw, 0.88rem);
  }

  .kpi-circle-caption {
    max-width: 11ch;
    font-size: 0.64rem;
    line-height: 1.22;
  }

  .kpi-card .meta {
    max-width: none;
    font-size: 0.72rem;
    line-height: 1.28;
  }

  .kpi-date-meta {
    margin: 0;
  }

  .kpi-amount-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .kpi-amount-item {
    justify-items: center;
    text-align: center;
    align-items: start;
    gap: 7px;
    padding: 0;
  }

  .kpi-amount-circle {
    width: min(100%, 68px);
    padding: 8px;
    font-size: 0.62rem;
    line-height: 1.08;
  }

  .kpi-amount-label {
    text-align: center;
    font-size: 0.64rem;
    line-height: 1.16;
  }

  .stepper {
    grid-template-columns: 1fr;
  }

  .brand-lockup-auth {
    width: 100%;
    aspect-ratio: 49 / 13;
  }

  .auth-logo {
    transform: none;
  }

  .topbar .topbar-hero {
    max-width: none;
    min-height: 0;
    padding-top: 6px;
    padding-right: 48px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    grid-template-columns: 148px minmax(0, 1fr);
    grid-template-areas:
      "kicker welcome"
      "logo welcome";
    align-items: start;
    gap: 2px 12px;
  }

  .topbar .topbar-hero::after {
    display: none;
  }

  .topbar-brand {
    display: contents;
  }

  .topbar-kicker {
    grid-area: kicker;
    justify-self: start;
    padding: 0;
    background: transparent;
    font-size: 0.52rem;
    letter-spacing: 0.08em;
    align-self: end;
    white-space: nowrap;
  }

  .topbar-welcome {
    grid-area: welcome;
    justify-self: end;
    align-self: center;
    width: min(100%, 166px);
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font-size: clamp(0.96rem, 3.6vw, 1.12rem);
    line-height: 1.12;
    letter-spacing: -0.015em;
    text-align: center;
    white-space: pre-line;
    margin-right: 0;
    transform: translateX(8px);
  }

  .topbar-note {
    display: none;
  }

  .auth-subtitle {
    max-width: 100%;
    font-size: 0.9rem;
    line-height: 1.56;
  }

  .auth-modal-card {
    align-content: start;
  }

  .auth-modal-intro {
    gap: 14px;
  }

  .auth-modal-card .auth-modal-brand {
    width: min(98%, 360px);
    aspect-ratio: 49 / 13;
    margin: 0;
  }

  .auth-modal-intro .auth-subtitle,
  .auth-modal-card .auth-subtitle {
    max-width: 38ch;
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.4;
    text-align: center;
  }

  .auth-subtitle.auth-subtitle-register {
    margin-left: 0;
    margin-right: 0;
    text-align: left;
  }

  .brand-lockup-topbar {
    grid-area: logo;
    width: 154px;
    aspect-ratio: 49 / 13;
    justify-self: start;
    align-self: center;
    margin-top: -8px;
    margin-right: 0;
  }

  .topbar-logo {
    transform: scale(1.2);
  }

  .topbar-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: stretch;
  }

  .topbar {
    position: relative;
  }

  .topbar-theme-toggle {
    position: absolute;
    top: 4px;
    right: 0;
    width: 38px;
    min-width: 38px;
    height: 38px;
    border-radius: 16px;
  }

  .topbar-theme-toggle-icon {
    width: 15px;
    height: 15px;
  }

  .topbar-actions > .btn {
    width: 100%;
  }

  #accountMenuBtn {
    order: 2;
  }

  #btnPlanning {
    order: 1;
  }

  .quote-entry-modes {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .entry-mode-btn {
    width: 100%;
    min-height: 42px;
    padding: 0 10px;
    font-size: 0.82rem;
  }

  .quote-capture-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .quote-capture-card-photo {
    order: 1;
  }

  .quote-capture-card-assistant {
    order: 2;
  }

  .quick-line-section {
    margin-top: 10px;
    padding: 10px;
    border-radius: 16px;
  }

  .quote-capture-head {
    margin-bottom: 8px;
  }

  .quote-capture-head h3 {
    font-size: 1rem;
  }

  .quote-capture-head p {
    margin-top: 4px;
    font-size: 0.76rem;
    line-height: 1.34;
  }

  .quote-capture-card {
    padding: 10px;
    border-radius: 16px;
    gap: 7px;
  }

  .quote-capture-title {
    font-size: 1.02rem;
  }

  .quote-capture-subtitle {
    font-size: 0.78rem;
    line-height: 1.34;
  }

  .quote-capture-photo-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lya-assistant-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lya-assistant-field > span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .lya-assistant-input {
    min-height: 88px;
    padding: 10px 11px;
    font-size: 0.88rem;
  }

  .quote-capture-actions > .btn {
    min-height: 38px;
    padding: 0 9px;
    font-size: 0.76rem;
  }

  .quote-capture-status {
    font-size: 0.76rem;
  }

  .quick-line-field {
    margin-top: 10px;
  }

  .quick-line-field > span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .quick-line-input-wrap {
    grid-template-columns: 1fr auto;
    gap: 8px;
  }

  .quick-line-input-wrap input {
    min-height: 42px;
    padding: 9px 11px;
    font-size: 0.88rem;
  }

  .quick-line-add-btn {
    width: auto;
    min-width: 96px;
  }

  .quick-line-preview {
    margin-top: 8px;
    min-height: 34px;
    padding: 7px 9px;
    font-size: 0.76rem;
  }

  .quick-line-hint {
    margin-top: 6px;
    font-size: 0.68rem;
    line-height: 1.28;
  }

  .lya-chat-turn {
    gap: 7px;
  }

  .lya-chat-avatar {
    width: 28px;
    min-width: 28px;
    height: 28px;
    font-size: 0.58rem;
  }

  .lya-chat-bubble.user,
  .lya-chat-bubble.assistant {
    width: 100%;
  }

  .lya-response-head {
    flex-direction: column;
    align-items: stretch;
  }

  .lya-response-head-tags {
    justify-items: start;
  }

  .lya-response-quick-stats {
    justify-content: flex-start;
  }

  .lya-proposal-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .lya-question-answer-row {
    grid-template-columns: 1fr;
  }

  .lya-question-send-btn {
    width: 100%;
  }

  .quick-line-input-wrap {
    grid-template-columns: 1fr;
  }

  .quick-line-add-btn {
    width: 100%;
  }

  .history-type-filters {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .history-filter-chip {
    width: 100%;
  }

  .history-filter-chip span {
    width: 100%;
    min-width: 0;
    padding: 0 5px;
    font-size: 0.62rem;
    gap: 2px;
  }

  .history-more-btn {
    width: 100%;
  }

  .line-add-manual-btn {
    width: 100%;
  }

  input:not([type="radio"]):not([type="checkbox"]),
  select,
  textarea {
    font-size: 16px;
  }

  #step-create .field {
    min-width: 0;
  }

  #step-create .field-grid {
    width: 100%;
    min-width: 0;
  }

  #step-create input[type="date"],
  #step-create input[type="time"],
  #step-create select {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    display: block;
  }

  #quoteDate {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    -webkit-min-logical-width: 0;
    padding-right: 12px;
    padding-inline-end: 12px;
  }

  #quoteDate::-webkit-datetime-edit,
  #quoteDate::-webkit-datetime-edit-fields-wrapper,
  #quoteDate::-webkit-date-and-time-value {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #step-create input[type="date"] {
    text-align: left !important;
  }

  #step-create input[type="date"]::-webkit-date-and-time-value {
    text-align: left !important;
  }

  .table-wrap {
    border: 1px solid rgba(9, 67, 52, 0.16);
    border-radius: 20px;
    overflow: visible;
    margin-top: 10px;
    padding: 10px 10px 8px;
    background: #ffffff;
    box-shadow: none;
    position: relative;
    isolation: auto;
    transform: none;
    backface-visibility: visible;
    background-clip: padding-box;
  }

  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 0 0 4px;
  }

  .table-toolbar-copy {
    gap: 4px;
  }

  .table-toolbar-description {
    max-width: none;
    font-size: 0.82rem;
  }

  .table-toolbar-meta {
    align-self: flex-start;
    min-height: 36px;
    padding: 0 12px;
    font-size: 0.78rem;
    white-space: normal;
  }

  .line-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 10px;
    margin: 0;
  }

  .line-table thead {
    display: none;
  }

  .line-table tbody {
    display: grid;
    gap: 12px;
    margin: 0;
  }

  .line-table tr[data-index] {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "material material"
      "quantity unit"
      "price price"
      "total actions";
    gap: 8px;
    border: 1px solid rgba(16, 34, 26, 0.1);
    border-radius: 18px;
    background:
      radial-gradient(circle at 100% 0%, rgba(15, 122, 95, 0.08), transparent 34%),
      linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(243, 249, 246, 0.93));
    padding: 12px;
    overflow: hidden;
    box-shadow:
      0 10px 24px rgba(8, 57, 44, 0.06),
      inset 0 1px 0 rgba(255, 255, 255, 0.84);
  }

  .line-table td {
    display: block;
    border: 0;
    padding: 0;
    background: transparent;
  }

  .line-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 5px;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #5c7268;
  }

  .line-table td input,
  .line-table td select {
    min-height: 42px;
    padding: 9px 11px;
    font-size: 0.9rem;
    border-radius: 12px;
  }

  .line-table td[data-label="Matériel / description"] {
    grid-area: material;
    display: grid;
    align-content: start;
    gap: 3px;
    padding: 6px 9px;
    border: 1px solid rgba(16, 34, 26, 0.08);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.74);
  }

  .line-table td[data-label="Matériel / description"]::before {
    margin-bottom: 2px;
  }

  .line-table td[data-label="Matériel / description"] .line-material-cell {
    gap: 3px;
  }

  .line-table td[data-label="Matériel / description"] input[name="material"] {
    min-height: 34px;
    padding-top: 7px;
    padding-bottom: 7px;
    font-size: 0.85rem;
  }

  .line-table td[data-label="Qte"] {
    grid-area: quantity;
  }

  .line-table td[data-label="Unité"] {
    grid-area: unit;
  }

  .line-table td[data-label="Prix unitaire HT"] {
    grid-area: price;
  }

  .line-table td[data-label="Qte"],
  .line-table td[data-label="Unité"],
  .line-table td[data-label="Prix unitaire HT"],
  .line-table td.line-total {
    display: grid;
    align-items: start;
    padding: 10px;
    border: 1px solid rgba(16, 34, 26, 0.08);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.74);
  }

  .line-table td.line-total {
    grid-area: total;
    white-space: normal;
    font-size: 1rem;
    display: grid;
    align-content: center;
    justify-items: start;
    gap: 4px;
    color: #0f3b2e;
    font-weight: 820;
    min-height: 100%;
  }

  .line-table td[data-label="#"] {
    display: none;
  }

  .line-table td[data-label="Action"] {
    grid-area: actions;
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    padding: 0;
    background: transparent !important;
    border: 0;
    box-shadow: none;
  }

  .line-table td[data-label="Action"]::before {
    display: none;
  }

  .line-table td[data-label="Action"] .icon-btn {
    width: 40px;
    min-width: 40px;
    height: 40px;
    font-size: 1.08rem;
  }

  .line-table td[data-label="Action"] .line-action-stack {
    width: auto;
    justify-content: flex-end;
    gap: 8px;
  }

  .line-table tr.material-autocomplete-open {
    background: rgba(250, 254, 252, 0.95);
  }

  .line-table tr.line-has-anomaly {
    background: rgba(255, 250, 240, 0.86);
  }

  .line-table-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px 0 0;
    border-top: 0;
    background: transparent;
    position: relative;
  }

  .line-footer-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: start;
  }

  .line-add-manual-btn,
  .business-catalog-trigger.btn-secondary {
    min-height: 40px;
    padding: 0 12px;
    font-size: 0.8rem;
    border-radius: 12px;
  }

  .line-add-manual-btn {
    justify-content: center;
  }

  .market-catalog-update-hint {
    grid-column: 1 / -1;
    width: 100%;
    font-size: 0.7rem;
    line-height: 1.3;
  }

  .business-catalog-menu,
  .business-catalog-menu > summary {
    width: 100%;
  }

  .business-catalog-menu {
    position: static;
  }

  .business-catalog-menu[open] {
    position: fixed;
    inset: 0;
    z-index: 220;
    display: block;
  }

  .business-catalog-menu[open]::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(7, 24, 19, 0.28);
    backdrop-filter: blur(6px);
  }

  .business-catalog-popover {
    position: fixed;
    left: 12px;
    right: 12px;
    top: max(14px, calc(env(safe-area-inset-top, 0px) + 14px));
    bottom: max(14px, calc(env(safe-area-inset-bottom, 0px) + 14px));
    width: auto;
    transform: none;
    margin-top: 0;
    padding: 14px;
    border-radius: 22px;
    max-height: none;
    overflow: hidden;
    z-index: 221;
    display: grid;
    grid-template-rows: auto auto auto 1fr;
    align-content: start;
    box-shadow:
      0 24px 48px rgba(9, 48, 37, 0.22),
      0 4px 10px rgba(9, 48, 37, 0.08);
  }

  .business-catalog-popover::before {
    display: none;
  }

  .business-catalog-menu[open] > .business-catalog-trigger {
    position: fixed;
    top: max(22px, calc(env(safe-area-inset-top, 0px) + 22px));
    right: 22px;
    width: auto;
    min-height: 36px;
    padding: 0 12px;
    font-size: 0.78rem;
    z-index: 222;
    box-shadow: 0 10px 24px rgba(9, 48, 37, 0.18);
  }

  .business-catalog-count {
    margin-bottom: 6px;
    font-size: 0.68rem;
  }

  .business-catalog-category-filters {
    gap: 5px;
    margin-bottom: 8px;
    max-height: 104px;
    overflow: auto;
    padding-right: 2px;
  }

  .business-catalog-category-chip {
    font-size: 0.64rem;
    padding: 5px 8px;
  }

  .business-catalog-search-field {
    margin-bottom: 8px;
  }

  .business-catalog-search-field span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .business-catalog-search-field input {
    min-height: 42px;
    padding: 9px 11px;
    font-size: 0.86rem;
    border-radius: 11px;
  }

  .business-catalog-list {
    min-height: 0;
    max-height: none;
    overflow: auto;
    gap: 6px;
    padding-right: 2px;
  }

  .business-catalog-item {
    padding: 9px 10px;
    border-radius: 12px;
    gap: 2px;
  }

  .business-catalog-item-title {
    font-size: 0.84rem;
    line-height: 1.24;
  }

  .business-catalog-item-meta {
    font-size: 0.72rem;
    line-height: 1.28;
  }

  .quote-bottom-panels {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .quote-bottom-left-stack,
  .quote-bottom-right-stack {
    display: contents;
  }

  .quote-total-panel {
    order: 1;
  }

  .quote-profitability-panel {
    order: 2;
  }

  .quote-comment-panel {
    order: 3;
  }

  .quote-general-conditions-panel {
    order: 4;
  }

  .quote-panel {
    padding: 12px;
    border-radius: 16px;
  }

  .quote-comment-panel,
  .quote-general-conditions-panel {
    padding: 0;
    overflow: hidden;
  }

  .quote-comment-panel .quote-panel-disclosure,
  .quote-general-conditions-panel .quote-panel-disclosure {
    gap: 0;
  }

  .quote-comment-panel .quote-panel-disclosure-summary,
  .quote-general-conditions-panel .quote-panel-disclosure-summary {
    padding: 12px;
    cursor: pointer;
    pointer-events: auto;
  }

  .quote-comment-panel .quote-panel-disclosure-content,
  .quote-general-conditions-panel .quote-panel-disclosure-content {
    padding: 0 12px 12px;
  }

  .quote-comment-panel .quote-panel-disclosure-indicator,
  .quote-general-conditions-panel .quote-panel-disclosure-indicator {
    display: inline-flex;
  }

  .quote-comment-panel .quote-panel-disclosure[open] .quote-panel-disclosure-indicator,
  .quote-general-conditions-panel
    .quote-panel-disclosure[open]
    .quote-panel-disclosure-indicator {
    transform: rotate(225deg);
  }

  .quote-panel-header,
  .quote-panel-header-total {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 10px;
  }

  .quote-panel-title {
    font-size: 1.02rem;
  }

  .quote-panel-description {
    font-size: 0.77rem;
    line-height: 1.34;
  }

  .quote-status-badge {
    width: auto;
    min-width: 0;
    align-self: flex-start;
    min-height: 28px;
    padding: 0 11px;
    font-size: 0.72rem;
  }

  .quote-total-focus {
    width: 100%;
    min-width: 0;
  }

  .quote-total-header-spacer {
    display: none;
  }

  .quote-profitability-inputs,
  .quote-total-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quote-profitability-inputs {
    gap: 8px;
  }

  .quote-profitability-inputs .quote-inline-field:last-child {
    grid-column: 1 / -1;
  }

  .quote-profitability-inputs .quote-summary-control-wrap,
  .quote-profitability-inputs .quote-summary-control,
  .quote-profitability-inputs input.quote-summary-control,
  .quote-profitability-inputs .quote-summary-margin {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    flex: 1 1 auto !important;
  }

  .quote-profitability-hero {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .quote-profitability-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 6px;
  }

  .quote-profitability-metrics .quote-profitability-metric:last-child {
    grid-column: 1 / -1;
  }

  .quote-inline-field,
  .quote-total-card,
  .quote-facturx-grid .quote-total-card,
  .quote-profitability-focus,
  .quote-profitability-metric {
    padding: 10px;
    border-radius: 14px;
    min-height: 0;
  }

  .quote-summary-control {
    min-height: 40px;
    font-size: 0.9rem;
    padding: 8px 11px;
  }

  .quote-summary-control-suffix {
    right: 11px;
  }

  .quote-total-card,
  .quote-total-card-input,
  .quote-total-card-date,
  .quote-total-card-subtotal,
  .quote-total-card-tva,
  .quote-total-card-tva-amount,
  .quote-total-card-hero,
  .quote-facturx-fields,
  .quote-facturx-grid .quote-total-card {
    min-width: 0;
    width: 100%;
    overflow: hidden;
  }

  .quote-total-card-date,
  .quote-total-card-tva,
  .quote-total-card-subtotal,
  .quote-total-card-tva-amount {
    grid-column: auto;
  }

  .quote-total-card-hero {
    grid-column: 1 / -1;
  }

  .quote-total-discount-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .quote-total-discount-impact {
    min-height: 38px;
    font-size: 0.76rem;
  }

  .quote-total-card-date .quote-summary-control,
  .quote-total-card-date .quote-summary-date-wrap,
  .quote-total-card-date .quote-summary-control-wrap,
  .quote-total-card-tva .quote-summary-control,
  .quote-total-card-tva .quote-summary-control-wrap {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .quote-total-card-date #quoteDate {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    display: block;
    font-size: 0.8rem;
    padding-right: 34px;
    padding-inline-end: 34px;
    -webkit-appearance: none;
    appearance: none;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .quote-total-card-date #quoteDate::-webkit-calendar-picker-indicator {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
  }

  .quote-total-card-tva .quote-summary-hint {
    font-size: 0.72rem;
    line-height: 1.3;
  }

  .quote-total-focus strong,
  .quote-total-card-hero strong,
  .quote-profitability-focus-value {
    font-size: clamp(1.35rem, 8vw, 1.95rem);
  }

  .quote-profitability-focus-secondary .quote-profitability-focus-value {
    font-size: clamp(1.2rem, 7vw, 1.7rem);
  }

  .quote-total-card strong,
  .quote-profitability-metric .quote-profitability-value,
  .quote-profitability-meta-value {
    font-size: 0.98rem;
  }

  .quote-total-card-label,
  .quote-inline-field-label,
  .quote-profitability-focus-label,
  .quote-profitability-metric span,
  .quote-total-focus-label {
    font-size: 0.68rem;
  }

  .quote-profitability-focus-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    font-size: 0.72rem;
  }

  .profitability-hint {
    padding: 9px 11px;
    font-size: 0.75rem;
  }

  .profitability-apply-btn {
    min-height: 40px;
    font-size: 0.84rem;
  }

  .account-panel-shell {
    margin-bottom: 14px;
  }

  .account-panel-card {
    padding: 16px;
  }

  .business-trade-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .business-dictionary-input-row {
    flex-direction: column;
    align-items: stretch;
  }

  .business-dictionary-add-btn {
    width: 100%;
    min-width: 0;
  }

  .account-head-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .account-settings-launch .btn {
    width: 100%;
  }

  .account-settings .account-quick-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .account-settings .account-quick-actions .btn {
    width: 100%;
  }

  .planning-card {
    padding: 16px;
  }

  .planning-head {
    margin-bottom: 12px;
    padding-bottom: 10px;
  }

  .planning-head .btn {
    width: 100%;
  }

  .planning-calendar-wrap,
  .planning-day-wrap {
    border-radius: 14px;
    padding: 11px;
  }

  .planning-month-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .planning-month-label {
    grid-column: 1 / -1;
    order: -1;
  }

  .planning-month-nav .btn {
    width: 100%;
    font-size: 0.78rem;
    padding: 6px 8px;
  }

  .planning-weekdays,
  .planning-grid {
    gap: 5px;
  }

  .planning-weekdays span {
    font-size: 0.68rem;
  }

  .planning-day-btn {
    min-height: 50px;
    border-radius: 11px;
    padding: 6px;
  }

  .planning-day-number {
    font-size: 0.9rem;
  }

  .planning-day-count {
    min-width: 18px;
    height: 18px;
    font-size: 0.66rem;
    padding: 0 4px;
  }

  .planning-selected-date {
    font-size: 1.08rem;
  }

  .planning-day-events {
    max-height: none;
  }

  .history-item {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px 10px;
  }

  .history-main {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .history-paid-badge-slot {
    grid-column: 2;
    width: auto;
    min-width: 0;
    justify-content: flex-end;
    align-self: center;
  }

  .history-actions {
    grid-column: 1;
    width: auto;
    max-width: 100%;
    min-width: 0;
    align-items: center;
    justify-content: flex-start;
  }

  .history-status-badges {
    width: auto;
    max-width: 100%;
    min-width: 0;
    justify-content: flex-start;
  }

  .history-actions .badge,
  .history-paid-badge-slot .badge {
    min-height: 30px;
    padding: 5px 12px;
    font-size: 0.7rem;
    border-radius: 999px;
  }

  .history-paid-badge-slot .badge.badge-paid {
    padding: 6px 12px 6px 28px;
    letter-spacing: 0.05em;
  }

  .history-paid-badge-slot .badge.badge-paid::before {
    left: 10px;
    width: 12px;
    height: 12px;
    box-shadow: 0 0 0 2px rgba(186, 224, 91, 0.2);
  }

  .history-action-menu {
    width: auto;
    max-width: 100%;
    min-width: 0;
  }

  .history-title,
  .history-sub,
  .history-meta,
  .history-comment {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .history-action-menu .history-action-trigger {
    max-width: 100%;
  }

  .history-badge-rail {
    gap: 6px;
  }

  .history-deposit-flag,
  .history-quote-outcome-flag,
  .history-followup-flag {
    max-width: 100%;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .history-deposit-flag,
  .history-quote-outcome-flag {
    gap: 5px;
    padding: 4px 9px;
    font-size: 0.68rem;
    line-height: 1.2;
  }

  .history-quote-outcome-flag::before {
    width: 13px;
    height: 13px;
    font-size: 0.62rem;
  }

  .history-followup-flag {
    gap: 5px;
    font-size: 0.68rem;
    padding: 4px 9px;
    line-height: 1.2;
  }

  .history-followup-flag::before {
    font-size: 0.68rem;
  }

  .history-action-popover {
    min-width: 0;
    width: min(260px, calc(100vw - 56px));
  }

  .delivery-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .delivery-actions {
    width: 100%;
    justify-content: flex-end;
  }

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

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

  .preview-totals {
    justify-self: stretch;
    min-width: 0;
  }

  .style-doc-client {
    margin-top: 0;
    min-width: 0;
    width: 100%;
    max-width: none;
  }

  .style-doc-head {
    grid-template-columns: 1fr;
  }

  .style-doc-title-row {
    margin-top: 24px;
  }

  .style-doc-signatures {
    grid-template-columns: 1fr;
  }

  .create-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .create-actions .btn {
    width: 100%;
  }
}

@media (hover: none) and (pointer: coarse) {
  body.catalog-modal-open {
    overflow: hidden;
  }

  body.purchase-archive-modal-open {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    overflow: hidden;
  }

  .line-footer-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: start;
  }

  .line-add-manual-btn {
    width: 100%;
  }

  .business-catalog-menu,
  .business-catalog-menu > summary {
    width: 100%;
  }

  .business-catalog-menu {
    position: static;
  }

  .business-catalog-menu[open] {
    position: fixed;
    inset: 0;
    z-index: 220;
    display: block;
  }

  .business-catalog-menu[open]::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(7, 24, 19, 0.28);
    backdrop-filter: blur(6px);
  }

  .business-catalog-popover {
    position: fixed;
    left: 12px;
    right: 12px;
    top: auto;
    bottom: max(14px, calc(env(safe-area-inset-bottom, 0px) + 14px));
    width: auto;
    max-height: min(72vh, 620px);
    transform: none;
    margin-top: 0;
    padding: 14px;
    border-radius: 22px;
    overflow: hidden;
    z-index: 221;
    display: grid;
    grid-template-rows: auto auto auto 1fr;
    align-content: start;
  }

  .business-catalog-popover::before {
    display: none;
  }

  .business-catalog-menu[open] > .business-catalog-trigger {
    position: fixed;
    top: max(22px, calc(env(safe-area-inset-top, 0px) + 22px));
    right: 22px;
    width: auto;
    min-height: 36px;
    padding: 0 12px;
    font-size: 0.78rem;
    z-index: 222;
  }

  .business-catalog-list {
    min-height: 0;
    max-height: none;
    overflow: auto;
  }

  .market-catalog-update-hint {
    grid-column: 1 / -1;
  }
}

.auth-switch label,
.account-settings,
.style-summary,
.business-preferences,
.empty,
.step-btn,
.planning-calendar-wrap,
.planning-day-wrap,
.client-card,
input:not([type="radio"]):not([type="checkbox"]),
select,
textarea {
  border-color: var(--border-soft);
}

.auth-switch label,
.style-summary,
.business-preferences,
.empty,
.step-btn,
.client-card {
  background: var(--surface-soft);
}

.account-settings,
.planning-calendar-wrap,
.planning-day-wrap {
  background: var(--surface-2);
}

.account-legal,
.appearance-settings {
  border-color: var(--border-soft);
  background: var(--surface-3);
}

.link-btn {
  color: var(--link);
}

.forgot-form,
.account-style,
.account-settings-launch {
  border-color: var(--separator);
}

.topbar-hero {
  border-color: var(--hero-border);
  background: var(--hero-bg);
}

.topbar-hero::after {
  background: var(--hero-rule);
}

.planning-card {
  border-color: var(--border-soft);
  background: var(--panel-bg);
}

.planning-head {
  border-bottom-color: var(--separator);
}

.planning-head p {
  color: var(--panel-heading);
}

.planning-calendar-wrap,
.planning-day-wrap {
  box-shadow: var(--panel-inner-highlight);
}

.planning-month-label {
  color: var(--panel-title);
}

.planning-day-btn {
  border-color: var(--day-btn-border);
  background: var(--day-btn-bg);
}

.planning-day-number {
  color: var(--text);
}

.planning-day-btn.outside-month {
  background: var(--day-btn-outside);
}

.weather-alert-popup,
.send-confirm-popup {
  background: var(--surface-overlay);
}

.weather-alert-popup-card {
  border-color: var(--popup-border);
  background: var(--weather-popup-bg);
  box-shadow: var(--weather-popup-shadow);
}

.send-confirm-popup-card {
  border-color: var(--popup-border);
  background: var(--popup-bg);
  box-shadow: var(--popup-shadow);
}

.pdf-preview-shell {
  border-color: var(--border-soft);
  background: var(--surface-elevated);
}

html[data-theme="dark"] .pdf-preview-loading {
  color: var(--text);
}

html[data-theme="dark"] .pdf-preview-frame {
  background: #0f1717;
}

.weather-alert-popup-item,
.business-trade-chip {
  border-color: var(--border-soft);
  background: var(--surface-elevated);
  color: var(--text);
}

.btn-secondary {
  color: var(--secondary-text);
  background: var(--secondary-bg);
  border: 1px solid var(--secondary-border);
}

.btn-ghost {
  color: var(--ghost-text);
  background: var(--ghost-bg);
  border: 1px solid var(--ghost-border);
}

.btn-danger {
  color: var(--danger-text);
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
}

.btn.share-cancel-btn {
  color: #ffffff;
  border: 1px solid rgba(214, 118, 118, 0.4);
  background:
    radial-gradient(circle at 0% 50%, rgba(255, 226, 226, 0.34), transparent 40%),
    linear-gradient(135deg, #f3a2a2, #dd7373);
  box-shadow:
    0 12px 24px rgba(221, 115, 115, 0.16),
    inset 0 1px 0 rgba(255, 235, 235, 0.22);
}

.btn.share-cancel-btn:hover {
  background:
    radial-gradient(circle at 0% 50%, rgba(255, 236, 236, 0.38), transparent 42%),
    linear-gradient(135deg, #f6b1b1, #e38181);
}

input:not([type="radio"]):not([type="checkbox"]),
select,
textarea {
  background: var(--input-bg);
  border-color: var(--input-border);
  color: var(--text);
}

input:not([type="radio"]):not([type="checkbox"])::placeholder,
textarea::placeholder {
  color: var(--placeholder);
}

input:not([type="radio"]):not([type="checkbox"]):focus::placeholder,
textarea:focus::placeholder {
  color: var(--placeholder);
}

input:not([type="radio"]):not([type="checkbox"]):focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 2px solid var(--focus-ring);
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 8% 5%, rgba(10, 76, 57, 0.34) 0%, transparent 38%),
    radial-gradient(circle at 92% 12%, rgba(26, 136, 217, 0.22) 0%, transparent 35%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
}

html[data-theme="dark"] .bg-orb-a {
  background: radial-gradient(circle, rgba(26, 136, 217, 0.2), rgba(26, 136, 217, 0));
}

html[data-theme="dark"] .bg-orb-b {
  background: radial-gradient(circle, rgba(15, 122, 95, 0.24), rgba(15, 122, 95, 0));
}

html[data-theme="dark"] .auth-message,
html[data-theme="dark"] .forgot-message,
html[data-theme="dark"] .link-btn,
html[data-theme="dark"] .weather-alert-popup-item-title,
html[data-theme="dark"] .send-confirm-popup-head h2,
html[data-theme="dark"] .planning-month-label {
  color: #d9f0ff;
}

html[data-theme="dark"] .auth-registration-notice,
html[data-theme="dark"] .auth-trial-note,
html[data-theme="dark"] .billing-badge,
html[data-theme="dark"] .quote-capture-status,
html[data-theme="dark"] .quick-line-preview,
html[data-theme="dark"] .delivery-status,
html[data-theme="dark"] .profitability-hint,
html[data-theme="dark"] .proactive-tag,
html[data-theme="dark"] .badge {
  box-shadow: none;
}

html[data-theme="dark"] .auth-registration-notice,
html[data-theme="dark"] .auth-trial-note,
html[data-theme="dark"] .style-summary,
html[data-theme="dark"] .business-preferences,
html[data-theme="dark"] .account-settings,
html[data-theme="dark"] .appearance-settings,
html[data-theme="dark"] .account-legal,
html[data-theme="dark"] .planning-calendar-wrap,
html[data-theme="dark"] .planning-day-wrap,
html[data-theme="dark"] .empty,
html[data-theme="dark"] .step-btn,
html[data-theme="dark"] .client-card {
  box-shadow: none;
}

html[data-theme="dark"] .auth-registration-notice {
  border-color: rgba(72, 151, 123, 0.28);
  background: rgba(14, 41, 33, 0.94);
  color: #c0d8ce;
}

html[data-theme="dark"] .auth-trial-note {
  border-color: rgba(72, 151, 123, 0.3);
  background: linear-gradient(180deg, rgba(14, 41, 33, 0.96), rgba(14, 34, 29, 0.94));
  color: #d7eee5;
}

html[data-theme="dark"] .weather-alert-popup-kicker,
html[data-theme="dark"] .weather-alert-popup-meta,
html[data-theme="dark"] .weather-alert-popup-item-risk,
html[data-theme="dark"] .weather-alert-popup-item-meta,
html[data-theme="dark"] .weather-alert-popup-item-message,
html[data-theme="dark"] .send-confirm-popup-kicker,
html[data-theme="dark"] .send-confirm-popup-message,
html[data-theme="dark"] .planning-head p {
  color: var(--muted);
}

html[data-theme="dark"] .weather-alert-popup-item.red {
  border-color: rgba(214, 101, 101, 0.32);
  background: linear-gradient(160deg, rgba(70, 20, 20, 0.58), rgba(52, 16, 16, 0.42));
}

html[data-theme="dark"] .weather-alert-popup-item.orange {
  border-color: rgba(217, 147, 54, 0.28);
  background: linear-gradient(160deg, rgba(77, 46, 10, 0.48), rgba(64, 38, 9, 0.36));
}

html[data-theme="dark"] .weather-alert-popup-level-badge.orange {
  color: #ffd898;
  border-color: rgba(217, 147, 54, 0.32);
  background: rgba(121, 72, 13, 0.46);
}

html[data-theme="dark"] .weather-alert-popup-level-badge.red {
  color: #ffd3d3;
  border-color: rgba(214, 101, 101, 0.32);
  background: rgba(122, 35, 35, 0.42);
}

html[data-theme="dark"] .business-trade-chip:hover {
  border-color: rgba(64, 176, 143, 0.4);
  background: rgba(15, 122, 95, 0.14);
}

html[data-theme="dark"] .business-trade-chip.active {
  color: #effcf5;
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.22);
}

html[data-theme="dark"] .planning-day-btn:hover {
  border-color: rgba(64, 176, 143, 0.42);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

html[data-theme="dark"] .planning-day-btn.today {
  border-color: rgba(73, 169, 232, 0.54);
  box-shadow: 0 0 0 1px rgba(73, 169, 232, 0.26);
}

html[data-theme="dark"] .planning-day-btn.selected {
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .planning-selected-date {
  color: var(--text);
}

html[data-theme="dark"] .planning-day-filter {
  border-color: rgba(148, 181, 169, 0.2);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  box-shadow: none;
}

html[data-theme="dark"] .planning-day-filter:hover {
  border-color: rgba(63, 178, 138, 0.38);
  color: #eaf8f2;
  background: rgba(15, 122, 95, 0.12);
}

html[data-theme="dark"] .planning-day-filter.is-active {
  border-color: rgba(63, 178, 138, 0.44);
  background: linear-gradient(135deg, rgba(15, 122, 95, 0.22), rgba(26, 136, 217, 0.16));
  color: #effcf5;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
}

html[data-theme="dark"] .planning-empty {
  border-color: rgba(148, 181, 169, 0.18);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
}

html[data-theme="dark"] .planning-event-item {
  border-color: var(--border-soft);
  background: linear-gradient(180deg, rgba(12, 23, 20, 0.98), rgba(18, 33, 29, 0.96));
  box-shadow: none;
}

html[data-theme="dark"] .planning-event-time,
html[data-theme="dark"] .planning-event-sync,
html[data-theme="dark"] .planning-event-client-link {
  color: #8ce5be;
}

html[data-theme="dark"] .planning-event-title {
  color: var(--text);
}

html[data-theme="dark"] .planning-event-system-badge {
  border-color: rgba(63, 178, 138, 0.32);
  background: rgba(15, 122, 95, 0.18);
  color: #8ce5be;
}

html[data-theme="dark"] .planning-event-notes,
html[data-theme="dark"] .planning-event-contact {
  color: var(--muted);
}

html[data-theme="dark"] .planning-event-client-link:hover {
  color: #b7f1d8;
}

html[data-theme="dark"] .planning-form {
  border-top-color: var(--separator);
}

html[data-theme="dark"] .planning-client-grid {
  border-color: rgba(148, 181, 169, 0.2);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
}

html[data-theme="dark"] .topbar-kicker {
  background: rgba(255, 255, 255, 0.08);
  color: #b9cdc4;
}

html[data-theme="dark"] .topbar-kicker span {
  color: #e8f7ef;
}

html[data-theme="dark"] .topbar-welcome {
  color: #d5e3dc;
}

html[data-theme="dark"] .topbar-note {
  color: #b7cbc2;
}

html[data-theme="dark"] #btnPlanning {
  color: #c9d6d0;
}

html[data-theme="dark"] #accountMenuBtn {
  color: #c5d1cc;
}

html[data-theme="dark"] .topbar-theme-toggle {
  border-color: var(--border-soft);
  background:
    radial-gradient(circle at 100% 0%, rgba(26, 136, 217, 0.14), transparent 52%),
    linear-gradient(180deg, rgba(12, 23, 20, 0.92), rgba(17, 31, 27, 0.9));
  box-shadow:
    0 16px 26px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  color: #cbd8d2;
}

html[data-theme="dark"] .topbar-theme-toggle:hover {
  border-color: rgba(63, 178, 138, 0.28);
  box-shadow:
    0 18px 30px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.topbar-theme-toggle[data-theme-mode="light"] .topbar-theme-toggle-icon-sun,
.topbar-theme-toggle[data-theme-mode="dark"] .topbar-theme-toggle-icon-moon,
.topbar-theme-toggle[data-theme-mode="system"] .topbar-theme-toggle-icon-auto {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.topbar-theme-toggle[data-theme-mode="light"] .topbar-theme-toggle-icon-auto,
.topbar-theme-toggle[data-theme-mode="light"] .topbar-theme-toggle-icon-moon,
.topbar-theme-toggle[data-theme-mode="dark"] .topbar-theme-toggle-icon-auto,
.topbar-theme-toggle[data-theme-mode="dark"] .topbar-theme-toggle-icon-sun,
.topbar-theme-toggle[data-theme-mode="system"] .topbar-theme-toggle-icon-sun,
.topbar-theme-toggle[data-theme-mode="system"] .topbar-theme-toggle-icon-moon {
  opacity: 0;
  transform: translateY(6px) scale(0.78);
}

html[data-theme="dark"] .step-btn {
  border-color: rgba(148, 181, 169, 0.18);
  background: linear-gradient(180deg, rgba(20, 34, 30, 0.9), rgba(16, 29, 25, 0.88));
  color: #bfd0c8;
}

html[data-theme="dark"] .step-btn:hover {
  border-color: rgba(63, 178, 138, 0.28);
  background: linear-gradient(180deg, rgba(24, 41, 35, 0.94), rgba(18, 33, 29, 0.92));
  color: #d7e4de;
}

html[data-theme="dark"] .step-btn.active {
  color: #eaf6f0;
  border-color: rgba(63, 178, 138, 0.3);
  background: linear-gradient(135deg, rgba(15, 122, 95, 0.42), rgba(26, 136, 217, 0.24));
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .kpi-card .label {
  border-color: rgba(148, 181, 169, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #b9cdc4;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] .billing-badge {
  border-color: rgba(91, 184, 232, 0.26);
  color: #bfe6ff;
  background: rgba(26, 136, 217, 0.18);
}

html[data-theme="dark"] .planning-feedback.success,
html[data-theme="dark"] .account-feedback.success,
html[data-theme="dark"] .style-summary .success,
html[data-theme="dark"] .delivery-status.success,
html[data-theme="dark"] .quote-capture-status.success,
html[data-theme="dark"] .proactive-tag.success {
  color: #7fe0b6;
}

html[data-theme="dark"] .planning-feedback.warning,
html[data-theme="dark"] .account-feedback.warning,
html[data-theme="dark"] .style-summary .warning,
html[data-theme="dark"] .delivery-status.warning,
html[data-theme="dark"] .quote-capture-status.warning,
html[data-theme="dark"] .proactive-tag.warning {
  color: #ffd27d;
}

html[data-theme="dark"] .planning-feedback.danger,
html[data-theme="dark"] .account-feedback.danger,
html[data-theme="dark"] .delivery-status.danger,
html[data-theme="dark"] .quote-capture-status.danger,
html[data-theme="dark"] .proactive-tag.danger {
  color: #ffb7b7;
}

html[data-theme="dark"] .billing-badge.success,
html[data-theme="dark"] .delivery-status.success,
html[data-theme="dark"] .proactive-tag.success,
html[data-theme="dark"] .lya-metric-chip.success,
html[data-theme="dark"] .lya-validation-note.success {
  border-color: rgba(63, 178, 138, 0.34);
  background: rgba(15, 122, 95, 0.2);
}

html[data-theme="dark"] .billing-badge.warning,
html[data-theme="dark"] .delivery-status.warning,
html[data-theme="dark"] .proactive-tag.warning,
html[data-theme="dark"] .quote-capture-status.loading,
html[data-theme="dark"] .lya-metric-chip.warning,
html[data-theme="dark"] .lya-chat-warning-chip {
  border-color: rgba(214, 159, 63, 0.34);
  background: rgba(184, 126, 33, 0.18);
}

html[data-theme="dark"] .billing-badge.danger,
html[data-theme="dark"] .delivery-status.danger,
html[data-theme="dark"] .proactive-tag.danger {
  border-color: rgba(214, 101, 101, 0.34);
  background: rgba(184, 69, 69, 0.2);
}

html[data-theme="dark"] .kpi-card,
html[data-theme="dark"] .proactive-card,
html[data-theme="dark"] .chart-card,
html[data-theme="dark"] .history-card,
html[data-theme="dark"] .quote-ai-review-card,
html[data-theme="dark"] .lya-chat-card,
html[data-theme="dark"] .lya-response-card,
html[data-theme="dark"] .history-item,
html[data-theme="dark"] .history-action-popover,
html[data-theme="dark"] .business-catalog-popover,
html[data-theme="dark"] .business-catalog-item,
html[data-theme="dark"] .quote-panel,
html[data-theme="dark"] .delivery-item,
html[data-theme="dark"] .company-payment-methods,
html[data-theme="dark"] .company-quote-conditions,
html[data-theme="dark"] .logo-editor,
html[data-theme="dark"] .company-payment-method,
html[data-theme="dark"] .chart-summary-item,
html[data-theme="dark"] .proactive-block,
html[data-theme="dark"] .proactive-item,
html[data-theme="dark"] .proactive-empty,
html[data-theme="dark"] .quote-capture-card,
html[data-theme="dark"] .quote-capture-feed,
html[data-theme="dark"] .quote-capture-item,
html[data-theme="dark"] .lya-chat-bubble.assistant,
html[data-theme="dark"] .lya-chat-proposal-item,
html[data-theme="dark"] .lya-warning-item,
html[data-theme="dark"] .lya-question-item,
html[data-theme="dark"] .lya-proposal-item,
html[data-theme="dark"] .preview-company,
html[data-theme="dark"] .preview-conditions,
html[data-theme="dark"] .preview-b2b-compliance,
html[data-theme="dark"] .delivery-card,
html[data-theme="dark"] #step-share .card {
  border-color: var(--border-soft);
  background: var(--surface-2);
  box-shadow: none;
}

html[data-theme="dark"] .kpi-card {
  background: linear-gradient(180deg, rgba(12, 23, 20, 0.98), rgba(18, 33, 29, 0.96));
}

html[data-theme="dark"] .kpi-card .label,
html[data-theme="dark"] .chart-summary-item,
html[data-theme="dark"] .proactive-head-pill,
html[data-theme="dark"] .proactive-summary,
html[data-theme="dark"] .proactive-block-summary,
html[data-theme="dark"] .company-payment-method,
html[data-theme="dark"] .toggle-field,
html[data-theme="dark"] .quote-summary-control,
html[data-theme="dark"] .quote-profitability-panel .quote-summary-row .quote-profitability-value,
html[data-theme="dark"] .history-more-btn,
html[data-theme="dark"] .history-action-menu .history-action-trigger,
html[data-theme="dark"] .business-catalog-trigger.btn-secondary,
html[data-theme="dark"] .business-catalog-category-chip,
html[data-theme="dark"] .lya-metric-chip,
html[data-theme="dark"] .lya-proposal-chip,
html[data-theme="dark"] .lya-question-choice-btn {
  box-shadow: none;
}

html[data-theme="dark"] .kpi-head-note,
html[data-theme="dark"] .kpi-card .meta,
html[data-theme="dark"] .kpi-scope-kicker,
html[data-theme="dark"] .kpi-card .label,
html[data-theme="dark"] .kpi-circle-caption,
html[data-theme="dark"] .kpi-amount-label,
html[data-theme="dark"] .chart-card .card-head p,
html[data-theme="dark"] .chart-summary-label,
html[data-theme="dark"] .chart-summary-meta,
html[data-theme="dark"] .proactive-kicker,
html[data-theme="dark"] .chart-card .card-head h2,
html[data-theme="dark"] .history-card .card-head h2,
html[data-theme="dark"] .proactive-block-kicker,
html[data-theme="dark"] .proactive-item-risk,
html[data-theme="dark"] .proactive-item-meta,
html[data-theme="dark"] .proactive-item-meta-label,
html[data-theme="dark"] .company-payment-methods-head p,
html[data-theme="dark"] .logo-empty,
html[data-theme="dark"] .history-client-contact,
html[data-theme="dark"] .history-meta,
html[data-theme="dark"] .quote-capture-head p,
html[data-theme="dark"] .quote-capture-subtitle,
html[data-theme="dark"] .quote-ai-review-kicker,
html[data-theme="dark"] .quote-ai-review-block h4,
html[data-theme="dark"] .quote-ai-review-list,
html[data-theme="dark"] .quote-ai-review-item-text,
html[data-theme="dark"] .lya-chat-context,
html[data-theme="dark"] .lya-chat-thinking-label,
html[data-theme="dark"] .lya-response-section h4,
html[data-theme="dark"] .lya-question-choices,
html[data-theme="dark"] .lya-question-required,
html[data-theme="dark"] .lya-proposal-notes,
html[data-theme="dark"] .lya-proposal-justification,
html[data-theme="dark"] .lya-proposal-confidence,
html[data-theme="dark"] .quote-capture-empty,
html[data-theme="dark"] .quote-capture-item-source,
html[data-theme="dark"] .business-catalog-search-field span,
html[data-theme="dark"] .business-catalog-count,
html[data-theme="dark"] .market-catalog-update-hint-meta,
html[data-theme="dark"] .quote-panel-kicker,
html[data-theme="dark"] .quote-panel-description,
html[data-theme="dark"] .quote-inline-field-label,
html[data-theme="dark"] .quote-total-card-label,
html[data-theme="dark"] .quote-profitability-focus-label,
html[data-theme="dark"] .quote-profitability-focus-meta,
html[data-theme="dark"] .quote-profitability-metric span,
html[data-theme="dark"] .quote-total-focus-label,
html[data-theme="dark"] .quote-summary-hint,
html[data-theme="dark"] .preview-company-meta,
html[data-theme="dark"] .preview-muted,
html[data-theme="dark"] .preview-conditions-title,
html[data-theme="dark"] .delivery-meta {
  color: var(--muted);
}

html[data-theme="dark"] .chart-slide-range {
  color: #d8e6e0;
}

html[data-theme="dark"] .chart-slide-hint {
  color: var(--muted);
}

html[data-theme="dark"] .chart-year-control::after {
  color: #9fb5ab;
}

html[data-theme="dark"] .chart-year-control select {
  border-color: rgba(148, 181, 169, 0.18);
  background: linear-gradient(180deg, rgba(20, 34, 30, 0.96), rgba(15, 28, 24, 0.94));
  color: #d8e6e0;
  box-shadow: none;
}

html[data-theme="dark"] .history-year-control::after {
  color: #9fb5ab;
}

html[data-theme="dark"] .history-year-control select {
  border-color: rgba(148, 181, 169, 0.18);
  background: linear-gradient(180deg, rgba(20, 34, 30, 0.96), rgba(15, 28, 24, 0.94));
  color: #d8e6e0;
  box-shadow: none;
}

html[data-theme="dark"] .history-card {
  background:
    radial-gradient(circle at 100% 0%, rgba(26, 136, 217, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(12, 23, 20, 0.98), rgba(18, 33, 29, 0.96));
}

html[data-theme="dark"] .kpi-year-control::after {
  color: #9fb5ab;
}

html[data-theme="dark"] .kpi-year-control select {
  border-color: rgba(148, 181, 169, 0.18);
  background: linear-gradient(180deg, rgba(20, 34, 30, 0.96), rgba(15, 28, 24, 0.94));
  color: #d8e6e0;
  box-shadow: none;
}

html[data-theme="dark"] .kpi-circle,
html[data-theme="dark"] .kpi-circle-warm,
html[data-theme="dark"] .kpi-circle-cool,
html[data-theme="dark"] .kpi-amount-circle,
html[data-theme="dark"] .kpi-amount-circle-warm,
html[data-theme="dark"] .kpi-amount-circle-cool {
  border-color: var(--border-soft);
  color: var(--text);
  background: radial-gradient(circle at 30% 28%, rgba(24, 42, 36, 0.98), rgba(14, 27, 23, 0.96));
  box-shadow: none;
}

html[data-theme="dark"] .kpi-scope-label {
  color: #d8e6e0;
}

html[data-theme="dark"] .kpi-scope-nav {
  border-color: var(--border-soft);
  background: linear-gradient(180deg, rgba(20, 34, 30, 0.96), rgba(15, 28, 24, 0.94));
  color: #9ce8c3;
  box-shadow: none;
}

html[data-theme="dark"] .kpi-scope-nav:hover:not(:disabled) {
  border-color: rgba(63, 178, 138, 0.34);
  color: #dff7eb;
}

html[data-theme="dark"] .kpi-scope-nav:disabled {
  color: #6e837a;
}

html[data-theme="dark"] .kpi-amount-circle {
  color: #90cbff;
}

html[data-theme="dark"] .kpi-amount-circle-warm {
  color: var(--status-in-progress-text);
}

html[data-theme="dark"] .kpi-amount-circle-cool {
  color: #7ce0b8;
}

html[data-theme="dark"] .kpi-amount-circle-paid {
  color: #d7f18e;
}

html[data-theme="dark"] .kpi-amount-circle-purchases {
  color: #7ce0b8;
}

html[data-theme="dark"] .kpi-amount-circle-tva {
  color: #ffb27a;
}

html[data-theme="dark"] .kpi-circle {
  color: #90cbff;
}

html[data-theme="dark"] .kpi-circle-warm {
  color: var(--status-in-progress-text);
}

html[data-theme="dark"] .kpi-circle-cool {
  color: #7ce0b8;
}

html[data-theme="dark"] .chart-summary-item,
html[data-theme="dark"] .proactive-head-pill,
html[data-theme="dark"] .proactive-summary,
html[data-theme="dark"] .proactive-block-summary,
html[data-theme="dark"] .quote-capture-card,
html[data-theme="dark"] .quote-capture-feed,
html[data-theme="dark"] .quote-capture-item,
html[data-theme="dark"] .company-payment-method,
html[data-theme="dark"] .history-item,
html[data-theme="dark"] .delivery-item {
  background: var(--surface-elevated);
}

html[data-theme="dark"] .chart-summary-item.quotes-summary,
html[data-theme="dark"] .chart-summary-item.in-progress-summary,
html[data-theme="dark"] .chart-summary-item.invoices-summary,
html[data-theme="dark"] .chart-summary-item.paid-summary {
  background: var(--surface-2);
}

html[data-theme="dark"] .chart-summary-item.paid-summary {
  border-color: rgba(172, 210, 84, 0.24);
}

html[data-theme="dark"] .chart-summary-item.paid-summary .chart-summary-label,
html[data-theme="dark"] .chart-summary-item.paid-summary .chart-summary-meta {
  color: #d7e6c2;
}

html[data-theme="dark"] .chart-summary-item.paid-summary .chart-summary-value {
  color: #f1f8de;
}

html[data-theme="dark"] .proactive-card::before,
html[data-theme="dark"] .quote-profitability-panel::before {
  opacity: 0.9;
}

html[data-theme="dark"] .proactive-head,
html[data-theme="dark"] .proactive-card {
  background: linear-gradient(180deg, rgba(12, 23, 20, 0.98), rgba(18, 33, 29, 0.96));
}

html[data-theme="dark"] .proactive-block {
  background: linear-gradient(180deg, rgba(14, 26, 23, 0.98), rgba(17, 31, 27, 0.96));
}

html[data-theme="dark"] .proactive-empty {
  border-style: dashed;
}

html[data-theme="dark"] .proactive-item.weather.orange {
  border-color: rgba(214, 159, 63, 0.32);
  background: linear-gradient(155deg, rgba(77, 46, 10, 0.42), rgba(18, 28, 24, 0.94));
}

html[data-theme="dark"] .proactive-item.weather.red {
  border-color: rgba(214, 101, 101, 0.32);
  background: linear-gradient(155deg, rgba(70, 20, 20, 0.42), rgba(18, 28, 24, 0.94));
}

html[data-theme="dark"] .proactive-followup-tab {
  border-color: rgba(148, 181, 169, 0.2);
  background: linear-gradient(180deg, rgba(22, 37, 33, 0.96), rgba(16, 28, 24, 0.94));
  color: #a8c0b6;
  box-shadow: none;
}

html[data-theme="dark"] .proactive-followup-tab:hover {
  border-color: rgba(99, 201, 159, 0.3);
  color: #d6eee3;
}

html[data-theme="dark"] .proactive-followup-tab.is-active {
  border-color: rgba(63, 178, 138, 0.34);
  background: linear-gradient(180deg, rgba(15, 122, 95, 0.24), rgba(18, 35, 30, 0.96));
  color: #9ce8c3;
  box-shadow: none;
}

html[data-theme="dark"] .proactive-item.followup.planned {
  border-color: rgba(63, 178, 138, 0.32);
}

html[data-theme="dark"] .proactive-item-side-contact {
  border-color: rgba(148, 181, 169, 0.14);
  background: linear-gradient(180deg, rgba(26, 40, 35, 0.92), rgba(21, 31, 28, 0.96));
}

html[data-theme="dark"] .proactive-item-side-title {
  color: #8ea99d;
}

html[data-theme="dark"] .proactive-item-side-line {
  color: #d7ebe2;
}

html[data-theme="dark"] .proactive-tag.neutral,
html[data-theme="dark"] .lya-validation-note,
html[data-theme="dark"] .lya-chat-intent,
html[data-theme="dark"] .lya-response-intent,
html[data-theme="dark"] .lya-count-badge,
html[data-theme="dark"] .lya-proposal-type,
html[data-theme="dark"] .market-catalog-update-hint.is-fresh {
  color: #8ce5be;
  border-color: rgba(63, 178, 138, 0.32);
  background: rgba(15, 122, 95, 0.16);
}

html[data-theme="dark"] .proactive-tag.info {
  color: #90cbff;
  border-color: rgba(91, 184, 232, 0.3);
  background: rgba(26, 136, 217, 0.14);
}

html[data-theme="dark"] .chart-summary-value,
html[data-theme="dark"] .history-title,
html[data-theme="dark"] .quote-capture-title,
html[data-theme="dark"] .quote-ai-review-summary,
html[data-theme="dark"] .quote-ai-review-item-label,
html[data-theme="dark"] .lya-chat-role,
html[data-theme="dark"] .lya-chat-text,
html[data-theme="dark"] .lya-chat-section-title,
html[data-theme="dark"] .lya-chat-list li,
html[data-theme="dark"] .lya-chat-proposal-line,
html[data-theme="dark"] .lya-response-title,
html[data-theme="dark"] .lya-response-summary,
html[data-theme="dark"] .lya-response-section li,
html[data-theme="dark"] .lya-warning-message,
html[data-theme="dark"] .lya-question-text,
html[data-theme="dark"] .lya-proposal-line,
html[data-theme="dark"] .lya-proposal-title,
html[data-theme="dark"] .quote-capture-item-message,
html[data-theme="dark"] .business-catalog-item-title,
html[data-theme="dark"] .quote-summary-row strong,
html[data-theme="dark"] .preview-conditions p,
html[data-theme="dark"] .preview-b2b-grid dd,
html[data-theme="dark"] .preview-b2b-head h3,
html[data-theme="dark"] .delivery-title,
html[data-theme="dark"] .market-catalog-update-hint,
html[data-theme="dark"] .history-action-item,
html[data-theme="dark"] .history-action-item.history-action-item-secondary {
  color: var(--text);
}

html[data-theme="dark"] .proactive-head h2,
html[data-theme="dark"] .proactive-block h3,
html[data-theme="dark"] .proactive-item-title,
html[data-theme="dark"] .chart-summary-value,
html[data-theme="dark"] .history-title,
html[data-theme="dark"] .client-card .card-head h2,
html[data-theme="dark"] .create-ai-head h2,
html[data-theme="dark"] .quote-capture-head h3,
html[data-theme="dark"] .quote-capture-title,
html[data-theme="dark"] .quote-ai-review-summary,
html[data-theme="dark"] .quote-ai-review-item-label,
html[data-theme="dark"] .toggle-field span,
html[data-theme="dark"] #step-share .card-head h2,
html[data-theme="dark"] .preview-company-title,
html[data-theme="dark"] .preview-title,
html[data-theme="dark"] .lya-response-title,
html[data-theme="dark"] .delivery-card h3,
html[data-theme="dark"] .delivery-title {
  color: #c9d6d0;
}

html[data-theme="dark"] .share-attachment-panel {
  border-color: rgba(63, 178, 138, 0.16);
  background: linear-gradient(180deg, rgba(12, 24, 21, 0.98), rgba(17, 31, 27, 0.96));
}

html[data-theme="dark"] .share-attachment-title,
html[data-theme="dark"] .share-attachment-chip-name {
  color: #d8e6df;
}

html[data-theme="dark"] .share-attachment-meta,
html[data-theme="dark"] .share-attachment-chip-size {
  color: #8ea79d;
}

html[data-theme="dark"] .quote-ai-review-card,
html[data-theme="dark"] .lya-response-card {
  background: linear-gradient(180deg, rgba(12, 24, 21, 0.98), rgba(17, 31, 27, 0.96));
}

html[data-theme="dark"] .lya-chat-card {
  background: linear-gradient(180deg, rgba(11, 22, 19, 0.98), rgba(16, 30, 26, 0.96));
}

html[data-theme="dark"] .lya-chat-avatar {
  border-color: var(--border-soft);
  background: rgba(255, 255, 255, 0.06);
  color: #d8ebe3;
}

html[data-theme="dark"] .lya-chat-turn.user .lya-chat-avatar {
  border-color: rgba(15, 122, 95, 0.44);
}

html[data-theme="dark"] .lya-chat-bubble.assistant {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-soft);
}

html[data-theme="dark"] .lya-chat-bubble.user {
  border-color: rgba(63, 178, 138, 0.32);
  background: linear-gradient(180deg, rgba(15, 122, 95, 0.2), rgba(15, 122, 95, 0.12));
}

html[data-theme="dark"] .lya-chat-section,
html[data-theme="dark"] .lya-response-section {
  border-top-color: var(--separator);
}

html[data-theme="dark"] .lya-chat-proposal-item.actionable {
  border-color: rgba(63, 178, 138, 0.3);
  background: linear-gradient(180deg, rgba(15, 122, 95, 0.12), rgba(255, 255, 255, 0.03));
}

html[data-theme="dark"] .lya-proposal-apply-btn.is-added {
  color: #8ce5be;
  background: rgba(15, 122, 95, 0.18);
  border-color: rgba(63, 178, 138, 0.32);
}

html[data-theme="dark"] .lya-warning-item,
html[data-theme="dark"] .lya-question-item,
html[data-theme="dark"] .lya-proposal-item {
  background: rgba(255, 255, 255, 0.03);
}

html[data-theme="dark"] .quote-ai-review-alert-item {
  border-color: rgba(63, 178, 138, 0.16);
  background: rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .lya-warning-code {
  color: #ffd27d;
}

html[data-theme="dark"] .lya-question-choice-btn {
  border-color: rgba(63, 178, 138, 0.26);
  background: rgba(255, 255, 255, 0.04);
  color: #e4f3ec;
}

html[data-theme="dark"] .lya-question-choice-btn:hover,
html[data-theme="dark"] .lya-question-choice-btn:focus-visible,
html[data-theme="dark"] .lya-question-choice-btn.is-active {
  border-color: rgba(63, 178, 138, 0.44);
  background: rgba(15, 122, 95, 0.18);
}

html[data-theme="dark"] .quote-capture-status.loading::before {
  border-color: rgba(255, 210, 125, 0.18);
  border-top-color: #f0b548;
}

html[data-theme="dark"] .quote-ai-review-list,
html[data-theme="dark"] .quote-capture-item-detail,
html[data-theme="dark"] .business-catalog-item-meta {
  color: #c3d6ce;
}

html[data-theme="dark"] .history-filter-chip span,
html[data-theme="dark"] .history-more-btn {
  color: #dcece5;
  background: rgba(22, 36, 31, 0.78);
  border-color: rgba(148, 181, 169, 0.18);
}

html[data-theme="dark"] .history-filter-chip span::before {
  border-color: rgba(148, 181, 169, 0.52);
}

html[data-theme="dark"] .history-filter-chip input:not(:checked) + span:hover,
html[data-theme="dark"] .history-more-btn:hover {
  border-color: rgba(63, 178, 138, 0.34);
  background: rgba(25, 41, 35, 0.92);
  color: #f0fbf6;
}

html[data-theme="dark"] .history-filter-chip input:checked + span {
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] .history-filter-chip input:checked + span::before {
  background: #effcf5;
  border-color: #effcf5;
  color: #0d7259;
}

html[data-theme="dark"] .history-followup-flag {
  border-color: rgba(91, 184, 232, 0.32);
  background: linear-gradient(135deg, rgba(15, 122, 95, 0.16), rgba(26, 136, 217, 0.16));
  color: #9bd7ff;
}

html[data-theme="dark"] .history-followup-flag::before {
  color: #90cbff;
}

html[data-theme="dark"] .history-followup-flag.invoice {
  border-color: rgba(201, 118, 145, 0.34);
  background: linear-gradient(135deg, rgba(142, 58, 88, 0.34), rgba(55, 27, 38, 0.94));
  color: #ffc1d2;
}

html[data-theme="dark"] .history-followup-flag.invoice::before {
  color: #ffadc4;
}

html[data-theme="dark"] .history-quote-outcome-flag {
  border-color: rgba(214, 101, 101, 0.34);
  background: rgba(184, 69, 69, 0.18);
  color: #ffd2d2;
}

html[data-theme="dark"] .history-quote-outcome-flag::before {
  background: rgba(214, 101, 101, 0.2);
  color: #ffd2d2;
}

html[data-theme="dark"] .history-action-menu .history-action-trigger {
  border-color: rgba(63, 178, 138, 0.36);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
}

html[data-theme="dark"] .history-action-popover {
  backdrop-filter: blur(12px);
  background: rgba(11, 22, 19, 0.96);
}

html[data-theme="dark"] .history-action-popover::before {
  background: rgba(11, 22, 19, 0.96);
  border-left-color: var(--border-soft);
  border-bottom-color: var(--border-soft);
  border-top-color: var(--border-soft);
}

html[data-theme="dark"] .history-action-item:hover {
  background: rgba(15, 122, 95, 0.18);
}

html[data-theme="dark"] .history-action-item.history-action-item-convert {
  color: #8ce5be;
  border-color: rgba(63, 178, 138, 0.32);
  background: rgba(15, 122, 95, 0.16);
}

html[data-theme="dark"] .history-action-item.history-action-item-convert:hover {
  background: rgba(15, 122, 95, 0.24);
}

html[data-theme="dark"] .history-action-item.danger {
  color: #ffb7b7;
}

html[data-theme="dark"] .history-action-item.danger:hover {
  background: rgba(184, 69, 69, 0.2);
}

html[data-theme="dark"] .invoice-deposit-feedback {
  color: #b9d9cc;
}

html[data-theme="dark"] .invoice-deposit-feedback.is-danger {
  color: #ffadad;
}

html[data-theme="dark"] .history-deposit-flag {
  border-color: rgba(214, 163, 89, 0.28);
  background: rgba(214, 163, 89, 0.14);
  color: #ffd28d;
}

html[data-theme="dark"] .history-action-item.history-action-item-acompte {
  border-color: rgba(214, 163, 89, 0.34);
  background: rgba(214, 163, 89, 0.14);
  color: #ffd28d;
}

html[data-theme="dark"] .history-action-item.history-action-item-acompte:hover {
  background: rgba(214, 163, 89, 0.22);
}

html[data-theme="dark"] .history-action-item.history-action-item-paid {
  border-color: rgba(82, 201, 165, 0.28);
  background:
    radial-gradient(circle at top right, rgba(132, 239, 203, 0.18), transparent 42%),
    linear-gradient(135deg, rgba(13, 101, 83, 0.24), rgba(26, 78, 66, 0.8));
  color: #aaf0d8;
}

html[data-theme="dark"] .history-action-item.history-action-item-paid:hover {
  background:
    radial-gradient(circle at top right, rgba(132, 239, 203, 0.24), transparent 46%),
    linear-gradient(135deg, rgba(13, 101, 83, 0.3), rgba(28, 90, 74, 0.88));
}

html[data-theme="dark"] .business-catalog-trigger.btn-secondary {
  border-color: rgba(63, 178, 138, 0.3);
  background:
    radial-gradient(circle at 100% 50%, rgba(26, 136, 217, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(15, 122, 95, 0.14), rgba(10, 31, 25, 0.96));
  color: #eefcf6;
}

html[data-theme="dark"] .business-catalog-trigger.btn-secondary:hover {
  border-color: rgba(63, 178, 138, 0.42);
  background:
    radial-gradient(circle at 100% 50%, rgba(26, 136, 217, 0.22), transparent 36%),
    linear-gradient(180deg, rgba(15, 122, 95, 0.18), rgba(14, 35, 29, 0.98));
}

html[data-theme="dark"] .business-catalog-menu[open] .business-catalog-trigger {
  border-color: rgba(63, 178, 138, 0.48);
  background:
    radial-gradient(circle at 100% 50%, rgba(26, 136, 217, 0.22), transparent 38%),
    linear-gradient(180deg, rgba(15, 122, 95, 0.22), rgba(15, 39, 32, 0.98));
}

html[data-theme="dark"] .business-catalog-popover {
  background: linear-gradient(180deg, rgba(11, 22, 19, 0.98), rgba(17, 31, 27, 0.98));
  box-shadow: 0 24px 40px rgba(0, 0, 0, 0.34);
}

html[data-theme="dark"] .business-catalog-popover::before {
  background: rgba(11, 22, 19, 0.98);
  border-left-color: var(--border-soft);
  border-bottom-color: var(--border-soft);
  border-top-color: var(--border-soft);
}

html[data-theme="dark"] .business-catalog-category-chip {
  border-color: rgba(63, 178, 138, 0.24);
  background: rgba(255, 255, 255, 0.04);
  color: #dcece5;
}

html[data-theme="dark"] .business-catalog-category-chip:hover {
  border-color: rgba(63, 178, 138, 0.4);
  background: rgba(15, 122, 95, 0.14);
}

html[data-theme="dark"] .business-catalog-item {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
}

html[data-theme="dark"] .business-catalog-item:hover {
  border-color: rgba(63, 178, 138, 0.34);
  background: linear-gradient(180deg, rgba(15, 122, 95, 0.12), rgba(255, 255, 255, 0.03));
}

html[data-theme="dark"] .market-catalog-update-hint {
  border-color: var(--border-soft);
  background: rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .market-catalog-update-hint-title {
  color: rgba(199, 219, 210, 0.68);
}

html[data-theme="dark"] .market-catalog-update-hint-meta {
  color: rgba(214, 227, 220, 0.88);
}

html[data-theme="dark"] .market-catalog-update-hint.is-warning {
  color: #ffd27d;
  border-color: rgba(214, 159, 63, 0.3);
  background: rgba(184, 126, 33, 0.14);
}

html[data-theme="dark"] .market-catalog-update-hint.is-muted {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

html[data-theme="dark"] .quote-panel,
html[data-theme="dark"] .quote-profitability-panel {
  background: linear-gradient(180deg, rgba(11, 22, 19, 0.98), rgba(17, 31, 27, 0.96));
}

html[data-theme="dark"] .quote-panel-title,
html[data-theme="dark"] .quote-total-card strong,
html[data-theme="dark"] .quote-profitability-value {
  color: var(--text);
}

html[data-theme="dark"] .quote-status-badge,
html[data-theme="dark"] .quote-inline-field,
html[data-theme="dark"] .quote-total-card,
html[data-theme="dark"] .quote-profitability-focus,
html[data-theme="dark"] .quote-profitability-metric {
  border-color: rgba(148, 181, 169, 0.14);
  background: rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .quote-total-focus {
  border-color: rgba(63, 178, 138, 0.26);
  background:
    radial-gradient(circle at 100% 0%, rgba(15, 122, 95, 0.2), transparent 44%),
    rgba(15, 122, 95, 0.12);
}

html[data-theme="dark"] .quote-total-card-hero {
  border-color: rgba(63, 178, 138, 0.26);
  background:
    radial-gradient(circle at 100% 0%, rgba(15, 122, 95, 0.2), transparent 44%),
    rgba(15, 122, 95, 0.12);
}

html[data-theme="dark"] .quote-facturx-fields {
  border-color: rgba(63, 178, 138, 0.26);
  background:
    radial-gradient(circle at 100% 0%, rgba(15, 122, 95, 0.16), transparent 44%),
    rgba(255, 255, 255, 0.035);
}

html[data-theme="dark"] .quote-facturx-head p {
  color: var(--muted);
}

html[data-theme="dark"] .quote-facturx-help summary {
  border-color: rgba(140, 229, 190, 0.26);
  background: rgba(255, 255, 255, 0.06);
  color: #8ce5be;
  box-shadow: none;
}

html[data-theme="dark"] .quote-facturx-help summary:hover,
html[data-theme="dark"] .quote-facturx-help summary:focus-visible {
  border-color: rgba(140, 229, 190, 0.48);
  background: rgba(15, 122, 95, 0.18);
}

html[data-theme="dark"] .quote-facturx-help[open] summary {
  color: #051911;
  background: #8ce5be;
  border-color: rgba(140, 229, 190, 0.68);
}

html[data-theme="dark"] .quote-facturx-help p {
  border-color: rgba(140, 229, 190, 0.22);
  background: rgba(12, 24, 20, 0.98);
  color: var(--text);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.32);
}

html[data-theme="dark"] .quote-total-discount-impact {
  border-color: rgba(63, 178, 138, 0.24);
  background: rgba(15, 122, 95, 0.12);
  color: #8ce5be;
}

html[data-theme="dark"] .preview-row.discount {
  color: #8ce5be;
}

html[data-theme="dark"] .preview-row.discount-reason,
html[data-theme="dark"] .style-doc-totals p.discount-reason {
  color: #a8cbb9;
}

html[data-theme="dark"] .style-doc-totals p.discount {
  color: #8ce5be;
}

html[data-theme="dark"] .quote-status-badge.is-positive {
  background: rgba(15, 122, 95, 0.18);
}

html[data-theme="dark"] .quote-status-badge.is-warning {
  background: rgba(184, 126, 33, 0.16);
}

html[data-theme="dark"] .quote-status-badge.is-danger {
  background: rgba(184, 69, 69, 0.16);
}

html[data-theme="dark"] .quote-summary-control,
html[data-theme="dark"] .quote-conditions-input {
  border-color: rgba(148, 181, 169, 0.24);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

html[data-theme="dark"] .quote-summary-control-suffix {
  color: var(--muted);
}

html[data-theme="dark"] .quote-summary-control:hover {
  border-color: rgba(63, 178, 138, 0.32);
  background: rgba(15, 122, 95, 0.12);
}

html[data-theme="dark"] .quote-summary-control:focus,
html[data-theme="dark"] .quote-summary-control:focus-visible {
  box-shadow: 0 0 0 3px rgba(73, 169, 232, 0.16);
}

html[data-theme="dark"] .quote-summary-tva {
  background-image: none;
}

html[data-theme="dark"] .quote-summary-select-indicator {
  border-right-color: #7fe0b6;
  border-bottom-color: #7fe0b6;
}

html[data-theme="dark"] .quote-summary-date-indicator::before {
  border-color: rgba(140, 229, 190, 0.82);
}

html[data-theme="dark"] .quote-summary-date-indicator::after {
  border-top-color: rgba(140, 229, 190, 0.82);
  border-left-color: rgba(140, 229, 190, 0.82);
  border-right-color: rgba(140, 229, 190, 0.82);
}

html[data-theme="dark"] .quote-summary-date::-webkit-calendar-picker-indicator {
  filter: invert(0.92) saturate(0.4);
}

html[data-theme="dark"] .share-invoice-btn.is-converted {
  color: #e7f4b1;
  border-color: rgba(180, 214, 76, 0.32);
  background:
    radial-gradient(circle at 0% 50%, rgba(178, 214, 70, 0.22), transparent 40%),
    linear-gradient(135deg, rgba(44, 58, 20, 0.98), rgba(65, 94, 25, 0.95));
  box-shadow: none;
}

html[data-theme="dark"] .share-invoice-btn.is-converted:hover {
  background:
    radial-gradient(circle at 0% 50%, rgba(178, 214, 70, 0.28), transparent 42%),
    linear-gradient(135deg, rgba(48, 63, 22, 1), rgba(73, 104, 28, 0.98));
}

html[data-theme="dark"] .share-invoice-notice {
  border-color: rgba(180, 214, 76, 0.26);
  background: rgba(120, 156, 41, 0.14);
  color: #d9ef95;
}

html[data-theme="dark"] .profitability-apply-btn {
  border-color: rgba(63, 178, 138, 0.32);
  background: rgba(15, 122, 95, 0.14);
}

html[data-theme="dark"] .quote-profitability-value.is-positive,
html[data-theme="dark"] .profitability-hint.is-positive {
  color: #8ce5be;
  border-color: rgba(63, 178, 138, 0.34);
  background: rgba(15, 122, 95, 0.18);
}

html[data-theme="dark"] .quote-profitability-value.is-warning,
html[data-theme="dark"] .profitability-hint.is-warning {
  color: #ffd27d;
  border-color: rgba(214, 159, 63, 0.34);
  background: rgba(184, 126, 33, 0.18);
}

html[data-theme="dark"] .quote-profitability-value.is-danger,
html[data-theme="dark"] .profitability-hint.is-danger {
  color: #ffb7b7;
  border-color: rgba(214, 101, 101, 0.34);
  background: rgba(184, 69, 69, 0.18);
}

html[data-theme="dark"] .profitability-hint {
  border-color: var(--border-soft);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
}

html[data-theme="dark"] .profitability-apply-btn:hover {
  border-color: rgba(63, 178, 138, 0.42);
  background: rgba(15, 122, 95, 0.2);
}

html[data-theme="dark"] .preview-company,
html[data-theme="dark"] .preview-conditions,
html[data-theme="dark"] .preview-b2b-compliance {
  background: rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] .preview-b2b-compliance.is-warning {
  border-color: rgba(251, 191, 36, 0.32);
  background: rgba(120, 53, 15, 0.18);
}

html[data-theme="dark"] .preview-paid-banner {
  background:
    linear-gradient(135deg, rgba(84, 20, 26, 0.9), rgba(46, 12, 16, 0.92));
  border-color: rgba(255, 128, 140, 0.28);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .preview-paid-banner-kicker {
  color: rgba(255, 188, 194, 0.84);
}

html[data-theme="dark"] .preview-paid-banner-title {
  color: #ff808c;
}

html[data-theme="dark"] .preview-paid-banner-chip {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 128, 140, 0.28);
  color: #ffd7db;
}

html[data-theme="dark"] .preview-company-logo {
  background: rgba(255, 255, 255, 0.96);
}

html[data-theme="dark"] .company-logo-preview {
  background: rgba(255, 255, 255, 0.96);
}

html[data-theme="dark"] .delivery-item,
html[data-theme="dark"] #step-share .card {
  background: linear-gradient(180deg, rgba(12, 23, 20, 0.98), rgba(18, 33, 29, 0.96));
}

html[data-theme="dark"] .share-attachment-chip {
  border-color: rgba(63, 178, 138, 0.14);
  background: rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .delivery-card {
  border-top-color: var(--separator);
}

html[data-theme="dark"] .btn:disabled,
html[data-theme="dark"] .icon-btn:disabled,
html[data-theme="dark"] .history-action-item:disabled,
html[data-theme="dark"] .business-catalog-item:disabled,
html[data-theme="dark"] .quick-line-suggestion:disabled,
html[data-theme="dark"] .line-material-option:disabled {
  opacity: 0.5;
}

html[data-theme="dark"] .btn-primary {
  color: #dbe8e1;
  background: linear-gradient(120deg, #0b6b52, #084f3d);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] .btn.share-cancel-btn {
  color: #fff6f6;
  border: 1px solid rgba(255, 178, 178, 0.34);
  background:
    radial-gradient(circle at 0% 50%, rgba(255, 190, 190, 0.24), transparent 42%),
    linear-gradient(135deg, rgba(197, 97, 97, 0.96), rgba(151, 56, 56, 0.96));
  box-shadow:
    0 12px 24px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 224, 224, 0.08);
}

html[data-theme="dark"] .account-security-block {
  border-color: var(--border-soft);
  background: var(--surface-2);
}

html[data-theme="dark"] .account-danger-zone {
  border-color: rgba(214, 101, 101, 0.32);
  background: rgba(184, 69, 69, 0.12);
}

html[data-theme="dark"] .account-danger-title,
html[data-theme="dark"] .account-danger-zone p {
  color: #ffb7b7;
}

html[data-theme="dark"] .account-retention-notice.warning {
  color: #ffd08a;
}

html[data-theme="dark"] .badge.quote {
  color: #90cbff;
  background: rgba(26, 136, 217, 0.18);
}

html[data-theme="dark"] .badge.saved {
  color: #c8d8e5;
  background: rgba(124, 154, 179, 0.2);
}

html[data-theme="dark"] .badge.in-progress {
  color: var(--status-in-progress-text);
  background: var(--status-in-progress-bg);
}

html[data-theme="dark"] .badge.invoice {
  color: #8ce5be;
  background: rgba(15, 122, 95, 0.18);
}

html[data-theme="dark"] .badge.invoice-electronic {
  border-color: rgba(140, 229, 190, 0.22);
  background:
    radial-gradient(circle at top right, rgba(140, 229, 190, 0.18), transparent 42%),
    rgba(15, 122, 95, 0.2);
}

html[data-theme="dark"] .badge.badge-paid {
  border-color: rgba(172, 210, 84, 0.24);
  background:
    radial-gradient(circle at top right, rgba(218, 255, 134, 0.24), transparent 34%),
    linear-gradient(135deg, rgba(92, 120, 23, 0.38), rgba(42, 56, 18, 0.94));
  color: #ddf7a1;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 22px rgba(0, 0, 0, 0.22);
}

html[data-theme="dark"] .business-dictionary {
  border-top-color: rgba(148, 181, 169, 0.18);
}

html[data-theme="dark"] .business-dictionary-head p,
html[data-theme="dark"] .business-dictionary-empty,
html[data-theme="dark"] .business-dictionary-summary,
html[data-theme="dark"] .create-ai-kicker,
html[data-theme="dark"] .quick-line-hint,
html[data-theme="dark"] .quick-line-suggestion-meta,
html[data-theme="dark"] .line-table .line-index,
html[data-theme="dark"] .line-material-option-meta,
html[data-theme="dark"] .line-material-ghost-tail {
  color: var(--muted);
}

html[data-theme="dark"] .business-dictionary-chip,
html[data-theme="dark"] .quick-line-preview.success,
html[data-theme="dark"] .quick-line-preview.warning,
html[data-theme="dark"] .quick-chip.strong {
  box-shadow: none;
}

html[data-theme="dark"] .business-dictionary-chip {
  border-color: rgba(63, 178, 138, 0.3);
  background: rgba(15, 122, 95, 0.14);
  color: #dff5eb;
}

html[data-theme="dark"] .business-dictionary-chip-remove {
  background: rgba(184, 69, 69, 0.2);
  color: #ffd4d4;
}

html[data-theme="dark"] .business-dictionary-chip-remove:hover {
  background: rgba(184, 69, 69, 0.28);
}

html[data-theme="dark"] .quick-line-section,
html[data-theme="dark"] .table-wrap {
  border-color: var(--border-soft);
  background: linear-gradient(180deg, rgba(11, 22, 19, 0.98), rgba(17, 31, 27, 0.96));
  box-shadow: none;
}

html[data-theme="dark"] .quick-line-preview {
  border-color: rgba(148, 181, 169, 0.2);
  color: var(--text);
}

html[data-theme="dark"] .quick-line-preview.success {
  border-color: rgba(63, 178, 138, 0.34);
  background: rgba(15, 122, 95, 0.12);
}

html[data-theme="dark"] .quick-line-preview.warning {
  border-color: rgba(214, 159, 63, 0.34);
  background: rgba(184, 126, 33, 0.12);
}

html[data-theme="dark"] .quick-line-preview.muted,
html[data-theme="dark"] .quick-chip,
html[data-theme="dark"] .quick-line-suggestion {
  border-color: var(--border-soft);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

html[data-theme="dark"] .quick-line-suggestion-main {
  color: var(--text);
}

html[data-theme="dark"] .quick-line-suggestion:hover,
html[data-theme="dark"] .quick-line-suggestion.active {
  border-color: rgba(63, 178, 138, 0.34);
  background: rgba(15, 122, 95, 0.16);
}

html[data-theme="dark"] .line-table th {
  background: linear-gradient(135deg, #0a5f49, #084737);
  color: rgba(214, 233, 223, 0.88);
  border-bottom-color: rgba(4, 24, 19, 0.6);
}

html[data-theme="dark"] .table-toolbar-kicker {
  color: #8da89d;
}

html[data-theme="dark"] .table-toolbar-title {
  color: #edf7f1;
}

html[data-theme="dark"] .table-toolbar-description {
  color: #9fb5ab;
}

html[data-theme="dark"] .table-toolbar-meta {
  border-color: rgba(63, 178, 138, 0.22);
  background:
    radial-gradient(circle at 0% 50%, rgba(15, 122, 95, 0.18), transparent 42%),
    rgba(255, 255, 255, 0.05);
  color: #dff5eb;
}

html[data-theme="dark"] .line-table th:not(:last-child) {
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .line-table tbody td {
  background: rgba(255, 255, 255, 0.03);
}

html[data-theme="dark"] .line-table tbody tr:nth-child(2n) td {
  background: rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] .line-table tbody tr:hover td,
html[data-theme="dark"] .line-table tr.material-autocomplete-open td {
  background: rgba(15, 122, 95, 0.1);
}

html[data-theme="dark"] .line-table td,
html[data-theme="dark"] .line-table-footer {
  border-color: var(--separator);
}

html[data-theme="dark"] .line-table tr[data-index] {
  border-color: var(--border-soft);
  background: linear-gradient(180deg, rgba(12, 23, 20, 0.96), rgba(17, 31, 27, 0.94));
}

html[data-theme="dark"] .line-table tr.material-autocomplete-open {
  background: linear-gradient(180deg, rgba(14, 36, 29, 0.98), rgba(17, 31, 27, 0.96));
}

html[data-theme="dark"] .line-table tr.line-has-anomaly {
  background: rgba(184, 126, 33, 0.12);
}

html[data-theme="dark"] .line-table td[data-label="Qte"],
html[data-theme="dark"] .line-table td[data-label="Unité"],
html[data-theme="dark"] .line-table td[data-label="Prix unitaire HT"],
html[data-theme="dark"] .line-table td.line-total {
  border-color: rgba(148, 181, 169, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .line-table td[data-label="Matériel / description"] {
  border-color: rgba(148, 181, 169, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .line-material-input-wrap {
  background: var(--input-bg);
}

html[data-theme="dark"] .line-material-input-wrap:focus-within {
  box-shadow: 0 0 0 2px rgba(73, 169, 232, 0.28);
}

html[data-theme="dark"] .line-table td input:hover,
html[data-theme="dark"] .line-table td select:hover,
html[data-theme="dark"] .line-material-input-wrap:hover,
html[data-theme="dark"] .line-table td[data-label="Matériel / description"]:hover,
html[data-theme="dark"] .line-table td[data-label="Qte"]:hover,
html[data-theme="dark"] .line-table td[data-label="Unité"]:hover,
html[data-theme="dark"] .line-table td[data-label="Prix unitaire HT"]:hover,
html[data-theme="dark"] .line-table td.line-total:hover {
  border-color: rgba(148, 181, 169, 0.12);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: none;
}

html[data-theme="dark"] .line-material-autocomplete {
  border-color: var(--border-soft);
  background: linear-gradient(180deg, rgba(11, 22, 19, 0.99), rgba(17, 31, 27, 0.98));
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.32);
}

html[data-theme="dark"] .line-material-option {
  border-color: var(--border-soft);
  background: rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .line-material-option:hover {
  border-color: var(--border-soft);
  background: rgba(255, 255, 255, 0.04);
  transform: none;
}

html[data-theme="dark"] .line-material-option.active {
  border-color: rgba(63, 178, 138, 0.34);
  background: rgba(15, 122, 95, 0.16);
}

html[data-theme="dark"] .line-material-option-main,
html[data-theme="dark"] .line-total,
html[data-theme="dark"] .quote-summary-row.strong strong,
html[data-theme="dark"] .preview-row.strong {
  color: #8ce5be;
}

html[data-theme="dark"] .preview-row.deposit {
  color: #7fdfc2;
}

html[data-theme="dark"] .preview-row.balance-due {
  border-top-color: rgba(127, 223, 194, 0.2);
}

html[data-theme="dark"] .preview-payment-note {
  color: #a5bcb2;
}

html[data-theme="dark"] .line-anomaly {
  color: #ffd27d;
  border-color: rgba(214, 159, 63, 0.24);
  background: rgba(184, 126, 33, 0.1);
}

html[data-theme="dark"] .line-anomaly-ack {
  border-color: rgba(255, 210, 125, 0.22);
  background: rgba(31, 39, 36, 0.72);
  color: #ffd27d;
}

html[data-theme="dark"] .line-anomaly-ack:hover {
  background: rgba(43, 54, 49, 0.92);
}

html[data-theme="dark"] .line-has-anomaly td {
  background: rgba(184, 126, 33, 0.12);
}

html[data-theme="dark"] .line-table tr.line-has-anomaly {
  box-shadow: inset 0 0 0 1px rgba(214, 159, 63, 0.28);
}

html[data-theme="dark"] .icon-btn {
  border-color: rgba(214, 101, 101, 0.34);
  background: rgba(184, 69, 69, 0.18);
  color: #ffd4d4;
}

html[data-theme="dark"] .icon-btn:hover {
  background: rgba(184, 69, 69, 0.26);
}

html[data-theme="dark"] .icon-btn.icon-btn-neutral {
  border-color: rgba(63, 178, 138, 0.34);
  background: rgba(15, 122, 95, 0.16);
  color: #8ce5be;
}

html[data-theme="dark"] .icon-btn.icon-btn-neutral:hover {
  background: rgba(15, 122, 95, 0.24);
}

html[data-theme="dark"] .line-table td.line-total,
html[data-theme="dark"] .line-table td.line-total:hover,
html[data-theme="dark"] .line-table tr[data-index]:hover td.line-total {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(148, 181, 169, 0.12);
  box-shadow: none;
}

html[data-theme="dark"] .line-table td[data-label="Action"],
html[data-theme="dark"] .line-table td[data-label="Action"]:hover,
html[data-theme="dark"] .line-table tr[data-index]:hover td[data-label="Action"] {
  background: transparent !important;
  border-color: transparent;
  box-shadow: none;
}

html[data-theme="dark"] .line-table .icon-btn:hover {
  background: rgba(184, 69, 69, 0.18);
  border-color: rgba(214, 101, 101, 0.34);
  color: #ffd4d4;
}

html[data-theme="dark"] .line-table .icon-btn.icon-btn-neutral:hover {
  background: rgba(15, 122, 95, 0.16);
  border-color: rgba(63, 178, 138, 0.34);
  color: #8ce5be;
}

html[data-theme="dark"] .line-table-footer {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.05));
}

html[data-theme="dark"] .line-add-manual-btn {
  border-color: rgba(63, 178, 138, 0.3);
  background:
    radial-gradient(circle at 0% 50%, rgba(15, 122, 95, 0.18), transparent 36%),
    rgba(255, 255, 255, 0.05);
  color: #dff5eb;
}

html[data-theme="dark"] .line-add-manual-btn:hover {
  border-color: rgba(63, 178, 138, 0.42);
  background:
    radial-gradient(circle at 0% 50%, rgba(15, 122, 95, 0.22), transparent 38%),
    rgba(15, 122, 95, 0.16);
}

@media (min-width: 1180px) {
  html[data-theme="dark"] .line-table tbody td,
  html[data-theme="dark"] .line-table tbody tr:nth-child(2n) td,
  html[data-theme="dark"] .line-table tbody tr:hover td,
  html[data-theme="dark"] .line-table tr.material-autocomplete-open td,
  html[data-theme="dark"] .line-table tr.line-has-anomaly td {
    background: transparent;
  }

  html[data-theme="dark"] .line-table tr[data-index]:hover {
    border-color: var(--border-soft);
    box-shadow:
      0 14px 30px rgba(0, 0, 0, 0.2),
      inset 0 1px 0 rgba(255, 255, 255, 0.03);
  }

  html[data-theme="dark"] .line-table tr.material-autocomplete-open,
  html[data-theme="dark"] .line-table tr.material-autocomplete-open:hover {
    border-color: var(--border-soft);
    box-shadow:
      0 14px 30px rgba(0, 0, 0, 0.2),
      inset 0 1px 0 rgba(255, 255, 255, 0.03);
  }

  html[data-theme="dark"] .line-table tr.line-has-anomaly {
    border-color: rgba(214, 159, 63, 0.28);
    background:
      radial-gradient(circle at 100% 0%, rgba(184, 126, 33, 0.18), transparent 40%),
      linear-gradient(180deg, rgba(32, 24, 13, 0.98), rgba(24, 20, 13, 0.96));
  }
}

html[data-theme="dark"] .quote-summary-row.strong span {
  color: #c8ddd5;
}

@media (max-width: 560px) {
  .quote-profitability-inputs,
  .quote-profitability-hero,
  .quote-profitability-metrics,
  .quote-facturx-grid,
  .quote-total-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quote-profitability-inputs .quote-inline-field:last-child,
  .quote-profitability-metrics .quote-profitability-metric:last-child,
  .quote-total-card-wide,
  .quote-total-card-hero {
    grid-column: 1 / -1;
  }

  .quote-total-card-date,
  .quote-total-card-subtotal,
  .quote-total-card-tva,
  .quote-total-card-tva-amount {
    grid-column: auto;
  }

  .quote-inline-field,
  .quote-total-card,
  .quote-facturx-grid .quote-total-card,
  .quote-profitability-focus,
  .quote-profitability-metric {
    padding: 11px;
  }

  .quote-total-card-hero strong,
  .quote-profitability-focus-value {
    font-size: clamp(1.25rem, 9vw, 1.75rem);
  }
}
