: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;
  --radius-xl: 24px;
  --radius-lg: 16px;
  --shadow-soft: 0 18px 45px rgba(10, 32, 24, 0.09);
}

*,
*::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;
  display: grid;
  place-items: center;
  padding: 20px;
}

.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;
}

.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: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

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

.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;
}

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

.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-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-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;
}

.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);
}

.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;
  padding: 0;
  margin: 0;
  text-align: left;
  cursor: pointer;
}

.brand-lockup-auth {
  width: min(100%, 460px);
  height: 130px;
  margin: -8px auto -2px;
}

.brand-lockup-topbar {
  width: min(100%, 330px);
  height: 88px;
  margin-top: -6px;
}

.app-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform-origin: center;
}

.auth-logo {
  transform: scale(1.16);
  object-position: center 51%;
}

.topbar-logo {
  transform: scale(1.48);
  object-position: center 52%;
}

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

.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 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.kpi-card .label {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.kpi-card .value {
  margin: 6px 0 3px;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 750;
}

.kpi-card .meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.proactive-card {
  margin-top: 14px;
  position: relative;
  overflow: hidden;
  border-color: rgba(11, 84, 67, 0.2);
  background:
    radial-gradient(circle at 100% 0%, rgba(26, 136, 217, 0.2), transparent 45%),
    radial-gradient(circle at 0% 100%, rgba(15, 122, 95, 0.16), transparent 38%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(240, 249, 245, 0.92));
  box-shadow:
    0 18px 42px rgba(10, 42, 33, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.6) inset;
}

.proactive-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, rgba(6, 91, 69, 0.86), rgba(26, 136, 217, 0.88));
}

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

.proactive-head-main {
  min-width: 0;
}

.proactive-kicker {
  margin: 0;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #3f7262;
  font-weight: 820;
}

.proactive-head h2 {
  margin: 4px 0 0;
  font-size: clamp(1.12rem, 2.2vw, 1.4rem);
}

.proactive-summary {
  margin: 7px 0 0;
  color: #2f6050;
  font-size: 0.92rem;
  font-weight: 630;
}

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

.proactive-block {
  border: 1px solid rgba(12, 57, 45, 0.14);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.76);
  padding: 12px;
  display: grid;
  gap: 8px;
  align-content: start;
}

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

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

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

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

.proactive-carousel-track {
  display: grid;
  gap: 8px;
  height: clamp(170px, 29vh, 220px);
  overflow-y: auto;
  padding-right: 4px;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(to bottom, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
}

.proactive-carousel-track .proactive-item {
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.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.2);
  border-radius: 11px;
  background: rgba(249, 252, 251, 0.88);
  color: #506e63;
  font-size: 0.85rem;
  padding: 10px;
}

.proactive-item {
  border: 1px solid rgba(16, 34, 26, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  padding: 10px;
  display: grid;
  gap: 6px;
}

.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: flex-start;
  justify-content: space-between;
  gap: 7px;
}

.proactive-item-title {
  margin: 0;
  font-size: 0.89rem;
  font-weight: 760;
  line-height: 1.3;
}

.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 {
  margin: 0;
  color: #446257;
  font-size: 0.82rem;
  line-height: 1.35;
}

.proactive-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.proactive-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 23px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.73rem;
  font-weight: 820;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.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;
}

.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;
  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;
}

.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-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-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 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: 160px;
  border-radius: 999px;
  border-color: rgba(8, 92, 70, 0.3);
  background: rgba(255, 255, 255, 0.94);
  color: #103a2d;
  font-weight: 740;
  box-shadow:
    0 10px 22px rgba(10, 87, 66, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.history-more-btn:hover {
  border-color: rgba(8, 92, 70, 0.45);
  background: linear-gradient(135deg, rgba(15, 122, 95, 0.14), rgba(22, 126, 183, 0.16));
  color: #0a3529;
}

.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;
}

.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-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: 6px 0 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-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.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: 228px;
  max-width: min(280px, calc(100vw - 40px));
  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: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);
}

.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.in-progress {
  background: rgba(199, 120, 8, 0.16);
  color: #8a4e00;
}

.badge.invoice {
  background: rgba(15, 122, 95, 0.14);
  color: #05543f;
}

.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-full {
  grid-column: 1 / -1;
}

.field > span {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 0.9rem;
}

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);
}

.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.2rem;
  font-weight: 760;
}

.quote-capture-subtitle {
  margin: 0;
  color: #5a766a;
}

.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;
}

.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: 770;
  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: 9px 10px;
  display: grid;
  gap: 8px;
}

.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.92rem;
}

.lya-chat-proposal-actions {
  display: flex;
  justify-content: flex-start;
}

.lya-proposal-apply-btn {
  border-radius: 999px;
  padding: 0 14px;
  min-height: 32px;
  font-size: 0.78rem;
  font-weight: 780;
}

.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;
}

@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-wrap {
  margin-top: 14px;
  overflow: visible;
  border: 1px solid rgba(9, 67, 52, 0.2);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow:
    0 18px 36px rgba(8, 57, 44, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.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 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;
}

.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,
.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;
}

.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: 12px;
  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 {
  border-style: dashed;
  border-width: 2px;
  border-color: rgba(15, 122, 95, 0.3);
  background: rgba(255, 255, 255, 0.9);
  color: #245b4a;
  font-weight: 760;
}

.line-add-manual-btn:hover {
  border-color: rgba(15, 122, 95, 0.5);
  background: rgba(15, 122, 95, 0.08);
}

.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;
  gap: 8px;
  min-height: 42px;
  padding: 9px 15px;
  border-radius: 12px;
  border: 1px solid rgba(15, 122, 95, 0.26);
  background:
    linear-gradient(180deg, rgba(236, 247, 243, 0.92), rgba(224, 241, 235, 0.9));
  color: #0e3a2d;
  font-weight: 760;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 8px 18px rgba(8, 74, 57, 0.1);
}

.business-catalog-trigger.btn-secondary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  opacity: 0.78;
  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.36);
  background:
    linear-gradient(180deg, rgba(229, 245, 239, 0.95), rgba(214, 237, 229, 0.94));
}

.business-catalog-menu[open] .business-catalog-trigger {
  border-color: rgba(15, 122, 95, 0.42);
  background:
    linear-gradient(180deg, rgba(214, 239, 231, 0.98), rgba(198, 230, 219, 0.98));
}

.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;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(16, 34, 26, 0.15);
  background: linear-gradient(180deg, rgba(251, 254, 253, 0.96), rgba(242, 248, 245, 0.92));
  box-shadow: 0 8px 20px rgba(12, 52, 41, 0.08);
  color: #335a4d;
  font-size: 0.74rem;
  font-weight: 640;
  line-height: 1.3;
}

.market-catalog-update-hint::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 8px;
  background: #6f867c;
  box-shadow: 0 0 0 5px rgba(111, 134, 124, 0.16);
}

.market-catalog-update-hint.is-fresh {
  border-color: rgba(15, 122, 95, 0.3);
  background: linear-gradient(180deg, rgba(240, 252, 247, 0.95), rgba(229, 247, 239, 0.92));
  color: #1d634e;
}

.market-catalog-update-hint.is-fresh::before {
  background: #12906f;
  box-shadow: 0 0 0 5px rgba(18, 144, 111, 0.18);
}

.market-catalog-update-hint.is-warning {
  border-color: rgba(178, 109, 35, 0.32);
  background: linear-gradient(180deg, rgba(255, 249, 239, 0.95), rgba(255, 243, 220, 0.9));
  color: #7b5822;
}

.market-catalog-update-hint.is-warning::before {
  background: #c97a2b;
  box-shadow: 0 0 0 5px rgba(201, 122, 43, 0.16);
}

.market-catalog-update-hint.is-muted {
  border-color: rgba(95, 122, 111, 0.22);
  background: linear-gradient(180deg, rgba(248, 251, 250, 0.95), rgba(239, 245, 242, 0.9));
  color: #4f6c62;
}

.market-catalog-update-hint.is-muted::before {
  background: #6f867c;
  box-shadow: 0 0 0 5px rgba(111, 134, 124, 0.15);
}

.line-count {
  margin: 0;
  color: #355e51;
  font-size: 0.9rem;
  font-weight: 740;
  font-variant-numeric: tabular-nums;
}

.quote-bottom-panels {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: stretch;
}

.quote-bottom-left-stack {
  display: grid;
  align-content: start;
  gap: 12px;
}

.quote-bottom-right-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100%;
}

.quote-bottom-right-stack .quote-conditions-panel {
  margin-top: auto;
}

.quote-panel {
  border: 1px solid rgba(16, 34, 26, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  padding: 14px;
  box-shadow:
    0 12px 28px rgba(12, 48, 37, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.quote-panel-title {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.78rem;
  color: #6e847b;
}

.quote-conditions-input {
  min-height: 146px;
  resize: vertical;
  border-radius: 14px;
  border: 1px solid rgba(16, 34, 26, 0.14);
  background: rgba(255, 255, 255, 0.95);
  color: #1c3f33;
}

.quote-summary-panel {
  display: grid;
  align-content: start;
}

.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: auto;
  min-width: 132px;
  max-width: 176px;
  min-height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(13, 67, 52, 0.26);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 250, 247, 0.95));
  color: #12392c;
  font-size: 0.84rem;
  font-weight: 700;
  padding: 4px 10px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 8px 16px rgba(13, 68, 53, 0.08);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

.quote-summary-row .quote-summary-control,
.quote-summary-row input.quote-summary-control {
  width: 168px;
  min-width: 168px;
  max-width: 168px;
  flex: 0 0 168px;
}

.quote-summary-control-wrap {
  position: relative;
  width: 168px;
  min-width: 168px;
  max-width: 168px;
  flex: 0 0 168px;
}

.quote-summary-control-wrap .quote-summary-control,
.quote-summary-control-wrap input.quote-summary-control {
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
  flex: 1 1 auto !important;
}

.quote-summary-control-suffix {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.78rem;
  color: #44675a;
  pointer-events: none;
}

.quote-summary-margin {
  padding-right: 22px;
}

.quote-profitability-panel {
  position: relative;
  overflow: hidden;
  border-color: rgba(12, 72, 56, 0.2);
  background:
    radial-gradient(circle at 100% 0%, rgba(15, 122, 95, 0.09), transparent 44%),
    linear-gradient(180deg, rgba(252, 255, 254, 0.95), rgba(244, 250, 247, 0.93));
}

.quote-profitability-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, rgba(15, 122, 95, 0.72), rgba(49, 161, 132, 0.52));
}

.quote-profitability-panel .quote-panel-title {
  margin-bottom: 8px;
  letter-spacing: 0.08em;
  color: #526f64;
}

.quote-profitability-panel .quote-profitability-row {
  padding: 11px 0;
  border-bottom: 1px solid rgba(16, 34, 26, 0.09);
}

.quote-profitability-panel .quote-profitability-row:first-of-type {
  padding-top: 6px;
}

.quote-profitability-panel .quote-profitability-row span {
  color: #3f6356;
  font-size: 0.93rem;
  font-weight: 640;
}

.quote-profitability-panel .quote-summary-row .quote-profitability-value {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
  width: auto;
  min-width: 102px;
  max-width: 220px;
  min-height: 30px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid rgba(13, 67, 52, 0.2);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(244, 250, 247, 0.97));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 3px 10px rgba(13, 68, 53, 0.08);
  font-size: 0.9rem;
  font-weight: 780;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quote-profitability-panel .quote-summary-row.quote-profitability-row-highlight .quote-profitability-value {
  border-color: rgba(15, 122, 95, 0.34);
  background: linear-gradient(180deg, rgba(248, 254, 251, 0.98), rgba(232, 246, 240, 0.96));
  font-weight: 800;
}

.quote-profitability-panel .quote-summary-row.quote-profitability-row-target .quote-profitability-value {
  font-weight: 820;
}

.quote-profitability-panel .quote-summary-row .quote-profitability-value.is-positive {
  color: #0f7a5f;
  border-color: rgba(15, 122, 95, 0.35);
  background: linear-gradient(180deg, rgba(245, 253, 249, 0.98), rgba(226, 245, 237, 0.96));
}

.quote-profitability-panel .quote-summary-row .quote-profitability-value.is-warning {
  color: #7f540f;
  border-color: rgba(183, 126, 48, 0.42);
  background: linear-gradient(180deg, rgba(255, 250, 242, 0.98), rgba(255, 241, 210, 0.96));
}

.quote-profitability-panel .quote-summary-row .quote-profitability-value.is-danger {
  color: #9e2b2f;
  border-color: rgba(173, 64, 64, 0.42);
  background: linear-gradient(180deg, rgba(255, 245, 245, 0.98), rgba(251, 228, 228, 0.96));
}

.profitability-hint {
  display: block;
  margin-top: 10px;
  min-height: 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px dashed rgba(80, 112, 101, 0.34);
  background: rgba(245, 249, 247, 0.92);
  color: #4f695f;
  line-height: 1.32;
  font-size: 0.81rem;
}

.profitability-hint.is-positive {
  color: #0f7a5f;
  border-color: rgba(15, 122, 95, 0.4);
  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.42);
  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.4);
  background: linear-gradient(180deg, rgba(255, 244, 244, 0.96), rgba(250, 230, 230, 0.92));
}

.profitability-apply-btn {
  margin-top: 10px;
  width: 100%;
  min-height: 44px;
  justify-content: center;
  border-color: rgba(15, 122, 95, 0.3);
  background: linear-gradient(180deg, rgba(249, 253, 251, 0.98), rgba(231, 246, 239, 0.96));
  font-size: 0.99rem;
  font-weight: 780;
  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: 6px;
}

.quote-summary-tva {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  text-align: left;
  padding-right: 34px;
  background-image:
    linear-gradient(45deg, transparent 50%, #187f63 50%),
    linear-gradient(135deg, #187f63 50%, transparent 50%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 250, 247, 0.95));
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px),
    0 0;
  background-size:
    6px 6px,
    6px 6px,
    100% 100%;
  background-repeat: no-repeat;
}

.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-row {
  padding-top: 6px;
  padding-bottom: 8px;
}

.quote-summary-hint-row .quote-summary-hint {
  margin: 0;
  font-size: 0.78rem;
  color: #577066;
}

.quote-summary-row span {
  color: #4d675d;
  font-size: 0.9rem;
}

.quote-summary-row strong {
  color: #112f24;
  font-size: 0.98rem;
  font-weight: 760;
}

.quote-summary-row.strong {
  margin-top: 6px;
  padding-top: 16px;
}

.quote-summary-row.strong span {
  font-size: 0.86rem;
  font-weight: 820;
  text-transform: uppercase;
  color: #172e26;
}

.quote-summary-row.strong strong {
  font-size: 1.95rem;
  line-height: 1;
  color: #0f7a5f;
  font-weight: 800;
}

.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-title {
  margin: 0;
  font-size: 1.15rem;
}

.preview-muted {
  margin: 4px 0 0;
  color: var(--muted);
}

.preview-client {
  margin: 0;
}

.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.strong {
  font-weight: 700;
  font-size: 1.05rem;
}

.share-status {
  min-height: 1.2em;
  margin: 8px 0 0;
  color: var(--primary-strong);
  font-weight: 600;
}

.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: rgba(255, 255, 255, 0.84);
  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;
}

.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-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: 1040px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .planning-layout {
    grid-template-columns: 1fr;
  }

  .history-filters {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .history-type-filters {
    justify-self: start;
  }

  .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: end;
    padding: 10px;
  }

  .send-confirm-popup-card {
    width: 100%;
  }

  .send-confirm-popup-actions {
    justify-content: stretch;
  }

  .send-confirm-popup-actions .btn {
    width: 100%;
  }
}

@media (max-width: 940px) {
  .topbar {
    flex-direction: column;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .history-type-filters {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 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;
  }

  #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%, 286px);
    height: 78px;
  }

  .topbar-logo {
    transform: scale(1.42);
  }

  .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;
  }

  .line-count {
    text-align: right;
    font-size: 0.86rem;
  }
}

@media (max-width: 700px) {
  .stepper {
    grid-template-columns: 1fr;
  }

  .brand-lockup-auth {
    width: 100%;
    height: 118px;
  }

  .auth-logo {
    transform: scale(1.1);
  }

  .brand-lockup-topbar {
    width: min(100%, 258px);
    height: 70px;
  }

  .topbar-logo {
    transform: scale(1.36);
  }

  .topbar-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: stretch;
  }

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

  .quote-entry-modes {
    display: grid;
    grid-template-columns: 1fr;
  }

  .entry-mode-btn {
    width: 100%;
  }

  .quote-capture-grid {
    grid-template-columns: 1fr;
  }

  .quote-capture-head h3 {
    font-size: 1.2rem;
  }

  .quote-capture-photo-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

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

  .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(3, minmax(0, 1fr));
  }

  .history-filter-chip {
    width: 100%;
  }

  .history-filter-chip span {
    width: 100%;
    min-width: 0;
  }

  .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: 0;
    border-radius: 0;
    overflow: visible;
    margin-top: 10px;
  }

  .line-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 10px;
  }

  .line-table thead {
    display: none;
  }

  .line-table tbody {
    display: block;
  }

  .line-table tr[data-index] {
    display: grid;
    gap: 8px;
    border: 1px solid rgba(16, 34, 26, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.88);
    padding: 10px;
  }

  .line-table td {
    display: block;
    border: 0;
    padding: 0;
  }

  .line-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--muted);
  }

  .line-table td.line-total {
    white-space: normal;
    font-size: 1rem;
  }

  .line-table td[data-label="#"] {
    display: none;
  }

  .line-table td[data-label="Action"] {
    display: flex;
    justify-content: flex-end;
  }

  .line-table td[data-label="Action"]::before {
    display: none;
  }

  .line-table td[data-label="Action"] .icon-btn {
    width: 36px;
    min-width: 36px;
    height: 36px;
    font-size: 1.25rem;
  }

  .line-table td[data-label="Action"] .line-action-stack {
    width: 100%;
    justify-content: flex-end;
  }

  .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;
  }

  .market-catalog-update-hint {
    grid-column: 1 / -1;
    width: 100%;
    font-size: 0.72rem;
  }

  .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 - 24px));
    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;
  }

  .business-catalog-count {
    font-size: 0.74rem;
  }

  .business-catalog-category-filters {
    gap: 5px;
  }

  .business-catalog-category-chip {
    font-size: 0.69rem;
    padding: 6px 8px;
  }

  .line-count {
    text-align: right;
    font-size: 0.86rem;
  }

  .quote-bottom-panels {
    grid-template-columns: 1fr;
  }

  .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: 14px;
  }

  .quote-summary-row {
    padding: 10px 0;
  }

  .quote-summary-row .quote-summary-control,
  .quote-summary-row input.quote-summary-control {
    width: 152px;
    min-width: 152px;
    max-width: 152px;
    flex: 0 0 152px;
    min-height: 32px;
    font-size: 0.8rem;
    padding: 4px 7px;
  }

  .quote-summary-control-wrap {
    width: 152px;
    min-width: 152px;
    max-width: 152px;
    flex: 0 0 152px;
  }

  #step-create .quote-summary-row #quoteDate,
  #step-create .quote-summary-row #tvaRate {
    width: 152px !important;
    min-width: 152px !important;
    max-width: 152px !important;
  }

  #step-create .quote-summary-control-wrap {
    width: 152px !important;
    min-width: 152px !important;
    max-width: 152px !important;
    flex: 0 0 152px !important;
  }

  .quote-summary-row span {
    font-size: 0.84rem;
  }

  .quote-summary-row strong {
    font-size: 0.92rem;
  }

  .quote-summary-row.strong strong {
    font-size: 1.58rem;
  }

  .quote-profitability-panel .quote-profitability-row span {
    font-size: 0.84rem;
  }

  .quote-profitability-panel .quote-summary-row .quote-profitability-value {
    width: auto;
    min-width: 96px;
    max-width: 180px;
    min-height: 28px;
    padding: 3px 10px;
    font-size: 0.84rem;
  }

  .profitability-hint {
    padding: 8px 10px;
    font-size: 0.75rem;
  }

  .profitability-apply-btn {
    min-height: 40px;
    font-size: 0.92rem;
  }

  .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 {
    flex-direction: column;
    align-items: flex-start;
  }

  .history-actions {
    justify-content: flex-start;
  }

  .history-followup-flag {
    font-size: 0.74rem;
    padding: 4px 8px;
  }

  .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) {
  .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-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    width: min(560px, calc(100vw - 24px));
    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;
  }
}
