:root {
  --bg: #f4f6f2;
  --surface: #ffffff;
  --surface-2: #f8faf7;
  --ink: #18211f;
  --muted: #66736f;
  --line: #dfe6e1;
  --green: #1f7a5a;
  --green-dark: #145d45;
  --blue: #2f66c5;
  --amber: #b46a12;
  --red: #bd3a3a;
  --teal: #00898a;
  --shadow: 0 18px 45px rgba(24, 33, 31, 0.1);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
}

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

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(15, 38, 32, 0.96) 0%, rgba(19, 58, 48, 0.96) 50%, transparent 50.15%),
    linear-gradient(135deg, #f8faf7 0%, #eef3ef 100%);
  overflow: hidden;
}

.login-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.35;
  pointer-events: none;
}

.login-screen.hidden {
  display: none;
}

.login-panel {
  position: relative;
  width: min(520px, 100%);
  padding: 30px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid rgba(223, 230, 225, 0.9);
  box-shadow: 0 30px 90px rgba(16, 37, 31, 0.28);
  overflow: hidden;
}

.login-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, #0b2a4d, #1f7a5a 48%, #b79561);
}

.login-panel::after {
  content: "";
  position: absolute;
  right: 28px;
  top: 26px;
  width: 74px;
  height: 74px;
  border: 1px solid rgba(183, 149, 97, 0.24);
  transform: rotate(18deg);
  pointer-events: none;
}

.login-brand {
  position: relative;
  padding: 0 112px 24px 0;
  color: var(--ink);
  border-bottom: 1px solid #eef2ef;
  margin-bottom: 20px;
}

.login-panel h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.04;
  letter-spacing: 0;
}

.login-panel p {
  max-width: 390px;
  margin: 10px 0 22px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.login-form,
.user-form {
  display: grid;
  gap: 12px;
}

.login-form label,
.user-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.login-form input,
.user-form input,
.user-form select {
  min-height: 46px;
  padding: 11px 13px;
}

.login-form input {
  border-color: #dce5df;
  box-shadow: inset 0 1px 0 rgba(24, 33, 31, 0.02);
}

.login-form input:focus {
  outline: 0;
  border-color: rgba(31, 122, 90, 0.65);
  box-shadow: 0 0 0 4px rgba(31, 122, 90, 0.12);
}

.login-form .primary-btn {
  min-height: 48px;
  margin-top: 4px;
  font-size: 16px;
  font-weight: 850;
  box-shadow: 0 12px 24px rgba(31, 122, 90, 0.18);
}

.login-hint {
  margin-top: 16px;
  display: grid;
  gap: 5px;
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
}

.login-hint strong {
  color: var(--ink);
}

.app-shell {
  display: none;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

body.authenticated .app-shell {
  display: grid;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  background: #10251f;
  color: #eef8f2;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px 14px;
}

.brand-logo {
  width: 58px;
  height: 34px;
  object-fit: contain;
  padding: 0;
  border-radius: 6px;
  background: #08294d;
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex: 0 0 58px;
}

.login-brand .brand-logo {
  width: 92px;
  height: 54px;
  flex-basis: 92px;
  border-color: rgba(8, 41, 77, 0.22);
  box-shadow: 0 10px 22px rgba(8, 41, 77, 0.12);
}

.login-language {
  position: absolute;
  top: 26px;
  right: 30px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 38px;
  padding: 4px;
  border: 1px solid #dfe7e1;
  border-radius: 999px;
  background: #f8faf7;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.login-lang-button {
  min-width: 44px;
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #51635d;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.login-lang-button:hover {
  color: var(--ink);
}

.login-lang-button.active {
  color: #fff;
  background: #10251f;
  box-shadow: 0 5px 14px rgba(16, 37, 31, 0.2);
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 18px;
}

.brand span {
  margin-top: 2px;
  color: #a9c2b8;
  font-size: 13px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  border: 0;
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #d9e9e1;
  background: transparent;
  text-align: left;
  min-height: 44px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.nav-item span:last-child {
  min-width: 0;
}

.nav-item:hover,
.nav-item.active {
  background: #1c3a32;
  color: #ffffff;
}

.sidebar-card {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-card strong {
  display: block;
  margin: 7px 0 4px;
}

.sidebar-card p {
  margin: 0;
  color: #b9ccc3;
  font-size: 13px;
  line-height: 1.45;
}

.workspace {
  padding: 24px;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.topbar h1 {
  margin: 4px 0 0;
  font-size: clamp(25px, 3vw, 34px);
  line-height: 1.1;
  letter-spacing: 0;
}

.eyebrow,
.mini-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

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

.search-box {
  min-width: min(360px, 100%);
  height: 42px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}

select,
input,
textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

select {
  min-height: 42px;
  padding: 0 38px 0 12px;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.icon-btn,
.access-pill,
.user-pill {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  white-space: nowrap;
}

.primary-btn {
  color: #fff;
  background: var(--green);
}

.primary-btn:hover {
  background: var(--green-dark);
}

.secondary-btn,
.ghost-btn,
.icon-btn {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}

.danger-btn {
  color: #a13a28;
  background: #fff7f4;
  border-color: #f0c6bb;
}

a.secondary-btn,
a.ghost-btn {
  text-decoration: none;
}

.access-pill {
  color: var(--green-dark);
  background: #e8f5ed;
  border-color: #c9e6d5;
  font-size: 13px;
  font-weight: 800;
}

.user-pill {
  color: #1f3d6d;
  background: #edf3ff;
  border-color: #c9d8f4;
  font-size: 13px;
  font-weight: 800;
}

.icon-btn {
  width: 42px;
  padding: 0;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metric-grid,
.report-grid,
.settings-grid,
.roadmap-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metric-card,
.report-card,
.settings-card,
.roadmap-card,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric-card,
.report-card,
.settings-card,
.roadmap-card {
  padding: 18px;
  min-height: 126px;
  display: grid;
  align-content: space-between;
}

.metric-card,
.report-card {
  position: relative;
  overflow: hidden;
}

.metric-card::before,
.report-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, #2fa881, #f0b429);
}

.metric-card strong,
.report-card strong,
.settings-card strong,
.roadmap-card strong {
  display: block;
  margin-top: 8px;
  font-size: 29px;
  line-height: 1;
}

.metric-card span:last-child,
.report-card span:last-child,
.settings-card span:last-child,
.roadmap-card span:last-child {
  color: var(--muted);
  font-size: 13px;
}

.settings-card strong {
  font-size: 20px;
}

.roadmap-card {
  align-content: start;
  gap: 10px;
}

.roadmap-card strong {
  font-size: 18px;
}

.roadmap-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.roadmap-card .badge {
  width: fit-content;
}

.settings-card ul {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.55;
}

.content-grid,
.distributor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.75fr);
  gap: 16px;
  margin-bottom: 16px;
}

.products-grid {
  grid-template-columns: 1fr;
}

.contacts-grid {
  grid-template-columns: minmax(0, 2.15fr) minmax(240px, 0.65fr);
  align-items: start;
}

.contact-main-panel {
  grid-row: span 5;
}

.compact-side-panel {
  padding: 12px;
}

.compact-side-panel .panel-head {
  margin-bottom: 10px;
}

.compact-side-panel h2 {
  font-size: 15px;
}

.panel {
  padding: 18px;
  min-width: 0;
}

.panel-head,
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-row select {
  min-width: 160px;
}

.panel h2 {
  margin: 4px 0 0;
  font-size: 18px;
  letter-spacing: 0;
}

.stage-summary {
  display: grid;
  gap: 10px;
}

.stage-row {
  display: grid;
  grid-template-columns: 170px 1fr 120px;
  align-items: center;
  gap: 12px;
}

.progress {
  height: 10px;
  border-radius: 999px;
  background: #edf2ee;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 13px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

td {
  font-size: 14px;
  overflow-wrap: anywhere;
}

.product-catalog-panel .table-wrap,
.contact-main-panel .table-wrap {
  border-radius: 8px;
  border: 1px solid var(--line);
}

.product-table th,
.contact-table th {
  background: #f6fbf8;
}

.product-row td:first-child strong {
  color: #0a1d37;
  font-size: 14px;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover td {
  background: #f8fbf9;
}

.contact-table {
  min-width: 980px;
}

.contact-table td {
  font-size: 13px;
  line-height: 1.35;
}

.person-cell strong,
.deal-card strong {
  display: block;
}

.person-cell span,
.small-muted {
  overflow-wrap: anywhere;
}

.person-cell span,
.deal-card span,
.small-muted {
  color: var(--muted);
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  background: #eef5f0;
  color: var(--green-dark);
}

.badge.blue {
  background: #edf3ff;
  color: var(--blue);
}

.badge.amber {
  background: #fff6e9;
  color: var(--amber);
}

.badge.red {
  background: #fff0f0;
  color: var(--red);
}

.task-stack,
.task-list,
.automation-list,
.bar-list,
.distributor-cards {
  display: grid;
  gap: 10px;
}

.task-item,
.automation-item,
.distributor-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.task-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: start;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbf9 100%);
}

.automation-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.task-item input {
  margin-top: 3px;
}

.task-item strong,
.automation-item strong,
.distributor-card strong {
  display: block;
  margin-bottom: 3px;
}

.quality-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

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

.mail-account-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-start;
}

.mail-account-card p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.mail-account-card > .small-muted {
  grid-column: 1 / -1;
}

.communications-grid {
  grid-template-columns: 1fr;
}

#communicationsView .panel {
  width: 100%;
}

#communicationsView #emailAccountList {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#communicationsView table {
  min-width: 900px;
}

.communication-lead-only {
  display: none;
  max-width: 760px;
}

.communication-lead-only p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.segmented button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
}

.segmented button.active {
  background: #dff2e7;
  color: var(--green-dark);
  font-weight: 700;
}

.pipeline-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(230px, 1fr));
  gap: 12px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 8px;
}

.stage-column {
  min-height: 520px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #f8fbf9 0%, #eef5f1 100%);
  box-shadow: 0 10px 24px rgba(10, 29, 55, 0.06);
}

.stage-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.stage-title strong {
  font-size: 14px;
}

.deal-stack {
  display: grid;
  gap: 10px;
}

.deal-card {
  padding: 13px;
  border: 1px solid #d9e2dc;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(10, 29, 55, 0.06);
}

.deal-meta {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.deal-actions {
  display: flex;
  gap: 6px;
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.quote-actions {
  min-width: 220px;
  gap: 6px;
}

.quote-actions .secondary-btn {
  padding: 8px 10px;
  font-size: 0.82rem;
}

.danger-btn {
  color: #b42318;
  border-color: #f3c5bf;
  background: #fff7f5;
}

.mini-btn {
  min-width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.permission-list {
  display: grid;
  gap: 12px;
}

.permission-list label {
  display: flex;
  gap: 10px;
  align-items: center;
}

.readonly-permission-list label {
  color: var(--muted);
  cursor: default;
}

.readonly-permission-list input {
  cursor: not-allowed;
  accent-color: #64748b;
}

.permission-note {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.distributor-hero {
  background: #f6fbf8;
}

.distributor-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0 14px;
}

.distributor-stat {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.distributor-stat strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
}

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

.distributor-focus-card,
.distributor-activity-item {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.distributor-focus-card strong {
  display: block;
  margin: 4px 0 2px;
  font-size: 22px;
}

.distributor-focus-card span:last-child,
.distributor-activity-item span {
  color: var(--muted);
  font-size: 13px;
}

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

.project-tracking-page {
  display: grid;
  gap: 16px;
}

.project-tracking-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(16, 37, 31, 0.96), rgba(31, 122, 90, 0.9)),
    var(--surface);
  color: #fff;
  overflow: hidden;
}

.project-tracking-hero .mini-label,
.project-tracking-hero p {
  color: rgba(255, 255, 255, 0.78);
}

.project-tracking-hero h2 {
  margin: 5px 0 7px;
  color: #fff;
  font-size: 28px;
}

.project-tracking-hero p {
  max-width: 760px;
  margin: 0;
  line-height: 1.5;
}

.project-tracking-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.project-tracking-stat {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.project-tracking-stat strong {
  display: block;
  margin-top: 7px;
  font-size: 24px;
}

.project-tracking-modal {
  width: min(1040px, calc(100vw - 24px));
  max-height: min(920px, calc(100vh - 24px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 30px 80px rgba(16, 37, 31, 0.28);
}

.project-tracking-modal::backdrop {
  background: rgba(16, 37, 31, 0.42);
}

.project-tracking-modal .modal-card {
  max-height: min(920px, calc(100vh - 24px));
  overflow: auto;
  padding: 22px;
  border: 0;
  box-shadow: none;
}

.distributor-activity-item strong {
  display: block;
  margin-bottom: 4px;
}

.distributor-activity-item p {
  margin: 0 0 6px;
  line-height: 1.45;
}

.elegant-site-link {
  text-decoration: none;
}

.proforma-request-page {
  display: grid;
  gap: 16px;
}

.proforma-request-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 0.5fr);
  gap: 22px;
  align-items: center;
  padding: 26px;
  border: 1px solid #d9ccb8;
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff 0%, #fbfaf7 58%, #edf5ec 100%);
  box-shadow: 0 18px 42px rgba(16, 37, 31, 0.08);
}

.proforma-request-hero-copy {
  max-width: 840px;
}

.proforma-request-hero h2 {
  margin: 4px 0 8px;
  color: #20341d;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.02;
}

.proforma-request-hero p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.proforma-request-contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.proforma-request-contact a,
.proforma-preview-card {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #e4dacb;
  border-radius: 8px;
  background: #fff;
  color: inherit;
  text-decoration: none;
}

.proforma-request-contact a:hover {
  border-color: #b79561;
  background: #fffdf8;
}

.proforma-request-contact span,
.proforma-preview-card span {
  color: #8d7048;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.proforma-request-contact strong,
.proforma-preview-card strong {
  overflow-wrap: anywhere;
  color: #263d22;
  font-size: 14px;
}

.proforma-request-notice {
  display: grid;
  grid-template-columns: minmax(160px, 0.25fr) 1fr;
  gap: 14px;
  padding: 14px 18px;
  border: 1px solid #ded5c8;
  border-left: 4px solid #b79561;
  border-radius: 8px;
  background: #fbfaf7;
  color: #5e5448;
  line-height: 1.5;
}

.proforma-request-notice strong {
  color: #263d22;
}

.proforma-launch-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 22px;
  border-color: #d9ccb8;
  background: #fffdf8;
}

.proforma-launch-copy {
  display: grid;
  gap: 7px;
}

.proforma-launch-copy h2 {
  margin: 0;
  color: #20341d;
  font-size: 26px;
}

.proforma-launch-copy p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.proforma-launch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.proforma-request-layout {
  display: none;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 0.34fr);
  gap: 16px;
  align-items: start;
}

.proforma-request-form {
  display: grid;
  gap: 14px;
}

.proforma-section {
  overflow: hidden;
}

.proforma-section > .form-grid,
.proforma-section > .proforma-check-grid {
  padding: 16px;
}

.proforma-request-form .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.proforma-business-grid,
.proforma-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 16px;
}

.proforma-business-card,
.proforma-check-grid label {
  display: grid;
  gap: 6px;
  min-height: 84px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.proforma-business-card {
  cursor: pointer;
}

.proforma-business-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.proforma-business-card:has(input:checked) {
  border-color: #8ea37f;
  background: #f4f8f0;
  box-shadow: inset 0 0 0 1px #c7d5bd;
}

.proforma-business-card strong {
  color: #1c2923;
}

.proforma-business-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.proforma-product-head {
  align-items: end;
}

.proforma-product-search {
  display: grid;
  gap: 6px;
  min-width: min(330px, 100%);
}

.proforma-product-search span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.proforma-product-search input {
  width: 100%;
}

.proforma-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
  padding: 16px;
}

.proforma-product-card {
  display: grid;
  gap: 12px;
  min-height: 220px;
  padding: 14px;
  border: 1px solid #e7ded2;
  border-radius: 8px;
  background: #fff;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.proforma-product-card:hover {
  border-color: #c9b89d;
  box-shadow: 0 8px 22px rgba(35, 31, 25, 0.08);
}

.proforma-product-card.has-qty {
  border-color: #8ea37f;
  background: #fbfdf8;
  box-shadow: 0 8px 22px rgba(38, 61, 34, 0.08);
}

.proforma-product-card strong {
  display: block;
  margin-top: 6px;
  color: #1f241f;
  line-height: 1.3;
}

.proforma-product-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.proforma-product-card dl {
  display: grid;
  gap: 7px;
  margin: 0;
}

.proforma-product-card dl div {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 8px;
  padding-top: 7px;
  border-top: 1px solid #edf2ee;
}

.proforma-product-card dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.proforma-product-card dd {
  margin: 0;
  color: #263d22;
  font-size: 13px;
  font-weight: 800;
}

.proforma-qty-control {
  align-self: end;
  display: grid;
  gap: 7px;
}

.proforma-qty-control > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.proforma-qty-control div {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  overflow: hidden;
  border: 1px solid #d8d0c4;
  border-radius: 8px;
}

.proforma-qty-control button {
  min-height: 36px;
  border: 0;
  background: #f2eee7;
  color: #1f241f;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
}

.proforma-qty-control input {
  border: 0;
  border-inline: 1px solid #d8d0c4;
  border-radius: 0;
  text-align: center;
  font-weight: 900;
}

.proforma-dry-amenities {
  padding: 0;
}

.proforma-dry-amenities summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  cursor: pointer;
  list-style: none;
}

.proforma-dry-amenities summary::-webkit-details-marker {
  display: none;
}

.proforma-dry-amenities summary span {
  display: grid;
  gap: 4px;
}

.proforma-dry-amenities summary b {
  color: #1c2923;
  font-size: 18px;
}

.proforma-dry-amenities summary small {
  color: var(--muted);
  line-height: 1.45;
}

.proforma-dry-amenities summary em {
  min-width: 34px;
  padding: 6px 8px;
  border: 1px solid #cdbd9f;
  border-radius: 999px;
  color: #7b623e;
  font-style: normal;
  font-weight: 900;
  text-align: center;
}

.proforma-check-grid label {
  min-height: auto;
  grid-template-columns: auto 1fr;
  align-items: center;
  color: #1f241f;
  font-weight: 700;
}

.proforma-request-summary {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 12px;
}

.proforma-request-summary .panel {
  padding: 18px;
}

.proforma-summary-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 14px 0;
}

.proforma-summary-metrics div {
  padding: 11px;
  border: 1px solid #e5ddd0;
  border-radius: 8px;
  background: #f7f5f0;
}

.proforma-summary-metrics span {
  display: block;
  color: #776c5e;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.proforma-summary-metrics strong {
  display: block;
  margin-top: 4px;
  color: #263d22;
  font-size: 20px;
}

#proformaRequestPreview {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.proforma-preview-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.proforma-request-trust {
  background: #10251f;
  color: #eef8f2;
}

.proforma-request-trust .mini-label,
.proforma-request-trust p {
  color: rgba(238, 248, 242, 0.72);
}

.proforma-request-trust strong {
  display: block;
  margin: 8px 0;
  color: #fff;
  font-size: 20px;
}

.proforma-request-trust p {
  margin: 0;
  line-height: 1.55;
}

.proforma-resource-card {
  display: grid;
  gap: 10px;
}

.proforma-resource-card a {
  padding: 10px 12px;
  border: 1px solid #d9ccb8;
  border-radius: 8px;
  color: #263d22;
  font-weight: 850;
  text-decoration: none;
}

.user-admin-panel {
  margin-top: 16px;
}

.user-form {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
  margin-bottom: 16px;
}

.form-mode-note {
  grid-column: 1 / -1;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 800;
}

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

.permission-checks {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.permission-group {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 9px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.permission-group legend {
  padding: 0 4px;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 900;
}

.permission-group p {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.permission-checks label,
.permission-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.25;
}

.permission-group input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.disabled-permission {
  opacity: 0.48;
}

.permission-summary {
  display: flex;
  max-width: 520px;
  flex-wrap: wrap;
  gap: 6px;
}

.permission-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(96px, 1.1fr) minmax(44px, auto);
  align-items: center;
  gap: 12px;
}

.bar-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.bar-row > span:last-child {
  text-align: right;
}

.bar-track {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: #edf2ee;
}

.bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

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

.insight-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.95fr) minmax(0, 1.6fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.insight-row strong {
  display: block;
  font-size: 14px;
}

.insight-row span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.insight-metrics {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.insight-metric {
  min-width: 88px;
  padding: 8px;
  border-radius: 8px;
  background: var(--surface);
  text-align: right;
}

.insight-metric b {
  display: block;
  color: var(--ink);
  font-size: 14px;
}

.insight-empty {
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-2);
}

.lead-modal,
.detail-modal,
.quote-modal,
.quote-builder-modal,
.mail-modal,
.quote-lead-modal,
.reminder-modal,
.product-modal {
  width: min(720px, calc(100vw - 24px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 30px 80px rgba(16, 37, 31, 0.28);
}

.detail-modal {
  width: min(980px, calc(100vw - 24px));
}

.quote-modal {
  width: min(920px, calc(100vw - 24px));
}

.quote-builder-modal {
  width: min(1320px, calc(100vw - 24px));
}

.mail-modal {
  width: min(760px, calc(100vw - 24px));
}

.product-modal {
  width: min(860px, calc(100vw - 24px));
}

.proforma-frame-modal {
  width: min(1440px, calc(100vw - 24px));
  height: min(920px, calc(100vh - 24px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 30px 80px rgba(16, 37, 31, 0.28);
}

.lead-modal::backdrop,
.detail-modal::backdrop,
.quote-modal::backdrop,
.quote-builder-modal::backdrop,
.mail-modal::backdrop,
.quote-lead-modal::backdrop,
.reminder-modal::backdrop,
.product-modal::backdrop,
.proforma-frame-modal::backdrop {
  background: rgba(16, 37, 31, 0.42);
}

.lead-modal form,
.product-modal form,
.mail-modal form,
.quote-lead-modal form,
.reminder-modal form,
.detail-shell,
.proforma-frame-shell,
.quote-shell,
.quote-builder-shell {
  padding: 22px;
}

.mail-form-grid textarea {
  min-height: 190px;
  line-height: 1.5;
}

.mail-form-grid small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.modal-head,
.modal-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.modal-head h2 {
  margin: 4px 0 0;
}

.proforma-frame-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  padding: 0;
  background: #fff;
}

.proforma-frame-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.proforma-frame-head .modal-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

#proformaRequestIframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #f5f2ec;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 20px 0;
}

.form-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  color: var(--ink);
  font-weight: 500;
}

.full-field {
  grid-column: 1 / -1;
}

.modal-actions {
  justify-content: flex-end;
}

.quote-document {
  margin-top: 18px;
  max-height: min(74vh, 920px);
  overflow: auto;
  background: #edf2ee;
  padding: 18px;
}

.quote-paper {
  max-width: 780px;
  min-height: 940px;
  margin: 0 auto;
  padding: 34px;
  color: #16211e;
  background: #fff;
  border: 1px solid var(--line);
}

.elegant-proforma-paper {
  max-width: 820px;
  padding: 0;
  overflow: hidden;
}

.proforma-topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 28px 34px;
  color: #fff;
  background: linear-gradient(135deg, #0a1d37 0%, #2fa881 100%);
  border-bottom: 4px solid #8b6914;
}

.proforma-topbar strong {
  font-size: 28px;
  letter-spacing: 2px;
}

.proforma-topbar span {
  max-width: 390px;
  text-align: right;
  font-size: 12px;
  line-height: 1.4;
}

.proforma-header,
.proforma-parties,
.elegant-proforma-paper .quote-total-box,
.elegant-proforma-paper .proforma-logistics,
.elegant-proforma-paper .quote-lines-wrap,
.elegant-proforma-paper .proforma-total-panel,
.elegant-proforma-paper .amount-words,
.elegant-proforma-paper .quote-terms,
.elegant-proforma-paper .bank-details,
.proforma-auth,
.elegant-proforma-paper footer {
  margin-left: 34px;
  margin-right: 34px;
}

.proforma-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 2px solid #2fa881;
}

.proforma-logo-box {
  width: 118px;
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 4px;
  background: #0a1d37;
}

.proforma-logo-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.proforma-company {
  display: grid;
  gap: 4px;
  text-align: right;
  color: #4b5563;
}

.proforma-company strong {
  color: #1a1a1a;
}

.proforma-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  padding: 20px 0 8px;
}

.proforma-label {
  display: block;
  margin-bottom: 8px;
  color: #2fa881;
  font-weight: 800;
}

.proforma-parties h3,
.proforma-parties p {
  margin: 4px 0;
}

.proforma-meta {
  text-align: right;
}

.proforma-auth {
  width: min(480px, calc(100% - 68px));
  margin-top: 22px;
  padding: 11px;
  border: 1px solid #2fa881;
  border-radius: 4px;
  background: #f0f9f6;
}

.proforma-auth strong {
  display: block;
  margin-bottom: 6px;
  color: #2fa881;
}

.proforma-auth p {
  margin: 0 0 6px;
  color: #374151;
  font-size: 12px;
}

.proforma-auth span {
  color: #6b7280;
  font-family: "Courier New", monospace;
  font-size: 11px;
}

.quote-paper-head,
.quote-party-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.quote-paper-head {
  align-items: start;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.quote-paper-head img {
  width: 190px;
  max-width: 100%;
  border-radius: 6px;
}

.quote-paper-head > div:last-child {
  text-align: right;
}

.quote-paper-head strong {
  display: block;
  margin: 4px 0;
  font-size: 24px;
}

.quote-party-grid {
  margin: 26px 0;
}

.quote-party-grid h3,
.quote-party-grid p {
  margin: 4px 0;
}

.quote-total-box {
  margin-bottom: 20px;
  padding: 18px;
  border: 1px solid #dce7df;
  border-radius: 8px;
  background: #f6fbf8;
}

.quote-total-box strong {
  display: block;
  margin-top: 4px;
  font-size: 28px;
}

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

.proforma-logistics div,
.quote-builder-preview {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.proforma-logistics span,
.quote-builder-preview span,
.quote-line-preview {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.proforma-logistics strong,
.quote-builder-preview strong {
  display: block;
  margin-top: 4px;
}

.quote-lines {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  font-size: 12px;
  table-layout: fixed;
}

.quote-lines-wrap {
  overflow-x: auto;
  margin-bottom: 18px;
}

.quote-lines th,
.quote-lines td {
  padding: 8px 7px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.quote-lines th:nth-child(n + 2),
.quote-lines td:nth-child(n + 2) {
  text-align: right;
}

.quote-lines th:nth-child(2),
.quote-lines td:nth-child(2) {
  width: 30%;
  text-align: left;
}

.quote-lines th:first-child,
.quote-lines td:first-child {
  width: 12%;
}

.quote-lines th:nth-child(3),
.quote-lines td:nth-child(3),
.quote-lines th:nth-child(4),
.quote-lines td:nth-child(4),
.quote-lines th:nth-child(5),
.quote-lines td:nth-child(5),
.quote-lines th:nth-child(7),
.quote-lines td:nth-child(7) {
  width: 8%;
}

.quote-lines th:nth-child(6),
.quote-lines td:nth-child(6),
.quote-lines th:nth-child(8),
.quote-lines td:nth-child(8) {
  width: 13%;
}

.quote-lines thead tr {
  color: #2fa881;
  border-bottom: 2px solid #2fa881;
  background: #fff;
}

.quote-lines .quote-packing-row td {
  color: var(--muted);
  font-size: 12px;
  text-align: left;
  background: #fafcfb;
}

.proforma-total-panel {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

.proforma-total-box {
  width: min(340px, 100%);
  padding-top: 10px;
  border-top: 2px solid #2fa881;
}

.proforma-total-box div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 5px 0;
}

.proforma-total-box .discount-line {
  color: #b42318;
}

.proforma-total-box .grand {
  margin-top: 4px;
  padding-top: 9px;
  border-top: 1px solid #e5e7eb;
  font-size: 18px;
}

.amount-words {
  margin-bottom: 18px;
  padding: 11px 12px;
  border-radius: 6px;
  background: #f8faf9;
  color: #4b5563;
  font-size: 13px;
  font-style: italic;
}

.bank-details {
  margin-top: 22px;
  margin-bottom: 24px;
  padding: 15px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fcfcfc;
  break-inside: avoid;
  page-break-inside: avoid;
}

.bank-details h3 {
  margin: 0 0 8px;
  color: #2fa881;
}

.bank-note {
  margin: 0 0 12px;
  color: #1f2937;
  font-weight: 800;
}

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

.bank-grid span {
  display: block;
  margin-bottom: 3px;
  color: #6b7280;
  font-size: 12px;
  font-weight: 800;
}

.bank-grid strong {
  color: #111827;
  overflow-wrap: anywhere;
}

.quote-builder-layout {
  display: grid;
  grid-template-columns: minmax(420px, 0.78fr) minmax(520px, 1fr);
  gap: 18px;
  align-items: start;
  margin-top: 18px;
}

.quote-builder-panel,
.quote-builder-document-panel {
  min-width: 0;
}

.quote-builder-panel {
  display: grid;
  gap: 14px;
}

.quote-builder-document-panel {
  max-height: calc(100vh - 150px);
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f8f6;
}

.quote-builder-document-panel .quote-document {
  max-height: none;
  overflow: visible;
  padding: 0;
}

.quote-lead-card,
.quote-builder-form,
.quote-product-lines {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.quote-lead-card strong {
  display: block;
  margin-top: 5px;
  font-size: 18px;
}

.quote-lead-grid,
.quote-builder-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.quote-lead-grid {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.quote-builder-form label,
.quote-builder-line label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.quote-builder-form input,
.quote-builder-form select,
.quote-builder-form textarea,
.quote-builder-line input,
.quote-builder-line select {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
}

.quote-product-lines {
  display: grid;
  gap: 10px;
}

.quote-builder-line {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 112px auto;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.quote-terms {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.quote-paper footer {
  margin-top: 60px;
  color: var(--muted);
  font-size: 12px;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
  gap: 18px;
  margin-top: 18px;
}

.detail-main,
.detail-side {
  min-width: 0;
}

.detail-summary {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.detail-summary h3,
.side-block h3 {
  margin: 0;
  font-size: 16px;
}

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

.summary-item {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.summary-item span,
.timeline-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.summary-item strong {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.note-form {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.note-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.note-form textarea {
  width: 100%;
  padding: 10px 12px;
  resize: vertical;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  position: relative;
  padding: 12px 12px 12px 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 17px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
}

.timeline-item strong {
  display: block;
  margin-bottom: 3px;
}

.detail-side {
  display: grid;
  gap: 12px;
  align-content: start;
}

.side-block {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.side-block p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

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

.quote-builder {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.quote-builder label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.quote-builder select,
.quote-builder input {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
}

.quote-line-preview {
  grid-column: 1 / -1;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f8fbf9;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: min(360px, calc(100vw - 48px));
  padding: 13px 15px;
  border-radius: 8px;
  color: #fff;
  background: #10251f;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.icon {
  width: 18px;
  height: 18px;
  position: relative;
  display: inline-block;
  flex: 0 0 18px;
}

.icon::before,
.icon::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.icon-grid::before {
  box-shadow: 9px 0 0 -2px currentColor, 0 9px 0 -2px currentColor, 9px 9px 0 -2px currentColor;
  width: 7px;
  height: 7px;
  border: 0;
  background: currentColor;
}

.icon-user::before {
  width: 8px;
  height: 8px;
  left: 5px;
  border-radius: 50%;
}

.icon-user::after {
  top: 11px;
  height: 5px;
  border-radius: 8px 8px 3px 3px;
}

.icon-pipeline::before {
  border-top: 0;
  border-bottom: 0;
  border-radius: 0;
}

.icon-pipeline::after {
  left: 2px;
  right: 2px;
  top: 2px;
  bottom: 2px;
  border-left: 0;
  border-right: 0;
  border-radius: 0;
}

.icon-check::before {
  border: 0;
  width: 12px;
  height: 7px;
  left: 2px;
  top: 3px;
  border-left: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  transform: rotate(-45deg);
}

.icon-chart::before {
  border: 0;
  border-left: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  border-radius: 0;
}

.icon-chart::after {
  border: 0;
  width: 4px;
  height: 12px;
  left: 9px;
  top: 4px;
  background: currentColor;
  box-shadow: 6px -5px 0 currentColor;
}

.icon-network::before {
  border-radius: 50%;
  width: 6px;
  height: 6px;
  left: 1px;
  top: 1px;
}

.icon-network::after {
  border-radius: 50%;
  width: 6px;
  height: 6px;
  left: 10px;
  top: 10px;
}

.icon-file::before {
  border-radius: 3px;
}

.icon-file::after {
  left: 10px;
  top: 0;
  width: 6px;
  height: 6px;
  border-left: 0;
  border-bottom: 0;
  border-radius: 0 3px 0 0;
}

.icon-gear::before {
  border-radius: 50%;
}

.icon-gear::after {
  width: 6px;
  height: 6px;
  left: 6px;
  top: 6px;
  border-radius: 50%;
  background: currentColor;
}

.icon-box::before {
  transform: rotate(45deg);
  border-radius: 3px;
}

.icon-bolt::before {
  border: 0;
  width: 8px;
  height: 16px;
  left: 5px;
  background: currentColor;
  clip-path: polygon(60% 0, 100% 0, 60% 45%, 100% 45%, 35% 100%, 48% 55%, 0 55%);
}

.icon-bolt::after {
  display: none;
}

.icon-map::before {
  border-radius: 2px;
  transform: skewY(-8deg);
}

.icon-map::after {
  left: 7px;
  right: 7px;
  border-top: 0;
  border-bottom: 0;
  border-radius: 0;
}

.icon-target::before {
  border-radius: 50%;
}

.icon-target::after {
  width: 6px;
  height: 6px;
  left: 6px;
  top: 6px;
  border-radius: 50%;
  background: currentColor;
}

.icon-search::before {
  border-radius: 50%;
  width: 10px;
  height: 10px;
}

.icon-search::after {
  border: 0;
  width: 8px;
  height: 2px;
  left: 11px;
  top: 13px;
  background: currentColor;
  transform: rotate(45deg);
}

.icon-plus::before {
  border: 0;
  top: 8px;
  height: 2px;
  background: currentColor;
}

.icon-plus::after {
  border: 0;
  left: 8px;
  width: 2px;
  background: currentColor;
}

.icon-download::before {
  border: 0;
  width: 2px;
  left: 8px;
  background: currentColor;
}

.icon-download::after {
  width: 9px;
  height: 9px;
  left: 4px;
  top: 5px;
  border-top: 0;
  border-left: 0;
  transform: rotate(45deg);
}

.icon-close::before,
.icon-close::after {
  border: 0;
  height: 2px;
  top: 8px;
  background: currentColor;
}

.icon-close::before {
  transform: rotate(45deg);
}

.icon-close::after {
  transform: rotate(-45deg);
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .brand div:last-child {
    display: none;
  }

  .nav-item {
    justify-content: center;
    padding: 12px;
    font-size: 0;
    color: #d9e9e1;
  }

  .nav-item .icon {
    width: 20px;
    height: 20px;
    flex-basis: 20px;
  }

  .brand-logo {
    width: 46px;
    height: 32px;
    flex-basis: 46px;
  }

  .sidebar-card {
    display: none;
  }

  .metric-grid,
  .report-grid,
  .settings-grid,
  .roadmap-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-grid,
  .distributor-layout,
  .proforma-request-layout,
  .proforma-request-hero,
  .proforma-request-notice {
    grid-template-columns: 1fr;
  }

  .proforma-request-summary {
    position: static;
  }

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

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

  .pipeline-board {
    grid-template-columns: repeat(5, 250px);
  }
}

@media (max-width: 760px) {
  body {
    padding-bottom: 10px;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    height: auto;
    padding: 12px;
    gap: 10px;
  }

  .brand {
    padding-bottom: 6px;
  }

  .brand strong {
    font-size: 16px;
  }

  .nav-list {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  .nav-item,
  .nav-item:not(.active) {
    color: #d9e9e1;
    flex: 0 0 112px;
    min-height: 48px;
    justify-content: center;
    padding: 10px;
    font-size: 13px;
    text-align: center;
  }

  .nav-item .icon {
    display: none;
  }

  .workspace {
    padding: 14px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions,
  .toolbar,
  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-row {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-row select {
    width: 100%;
  }

  .topbar-actions > *,
  .primary-btn,
  .secondary-btn,
  .ghost-btn,
  .access-pill,
  .user-pill,
  .segmented {
    width: 100%;
  }

  .segmented {
    overflow-x: auto;
  }

  .table-wrap {
    margin-inline: -4px;
    padding-bottom: 4px;
  }

  table {
    min-width: 680px;
  }

  .product-table {
    min-width: 0;
  }

  .product-table thead {
    display: none;
  }

  .product-table,
  .product-table tbody,
  .product-table tr,
  .product-table td {
    display: block;
    width: 100%;
  }

  .product-table tr {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
  }

  .product-table tr + tr {
    margin-top: 10px;
  }

  .product-table td {
    display: grid;
    grid-template-columns: minmax(96px, 34%) minmax(0, 1fr);
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #edf2ee;
    font-size: 13px;
  }

  .product-table td:last-child {
    border-bottom: 0;
  }

  .product-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
  }

  .product-table td strong {
    display: block;
    line-height: 1.25;
  }

  .product-table .secondary-btn {
    width: 100%;
  }

  th,
  td {
    padding: 11px 10px;
  }

  .row-actions {
    gap: 6px;
  }

  .row-actions .secondary-btn,
  .quote-actions .secondary-btn {
    width: auto;
    min-height: 38px;
    padding: 7px 9px;
    font-size: 13px;
  }

  .quality-item,
  .quality-actions {
    align-items: stretch;
    flex-direction: column;
  }

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

  .pipeline-board {
    grid-template-columns: repeat(5, minmax(220px, 76vw));
    scroll-snap-type: x proximity;
  }

  .stage-column {
    min-height: 360px;
    scroll-snap-align: start;
  }

  .deal-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .metric-grid,
  .report-grid,
  .settings-grid,
  .roadmap-grid {
    grid-template-columns: 1fr;
  }

  .stage-row {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .detail-grid,
  .summary-grid,
  .quote-builder-layout,
  .quote-lead-grid,
  .quote-builder-form,
  .bank-grid,
  .quote-paper-head,
  .quote-party-grid,
  .proforma-parties,
  .distributor-stat-grid,
  .distributor-focus-grid,
  .proforma-request-form .form-grid,
  .proforma-business-grid,
  .proforma-check-grid,
  .proforma-product-head,
  .proforma-request-contact,
  .proforma-launch-panel,
  .proforma-summary-metrics,
  .project-tracking-stats,
  .user-form {
    grid-template-columns: 1fr;
  }

  .project-tracking-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .proforma-launch-actions {
    justify-content: stretch;
  }

  .permission-checks {
    grid-template-columns: 1fr;
  }

  .quote-paper {
    min-height: auto;
    padding: 22px;
  }

  .elegant-proforma-paper {
    padding: 0;
  }

  .proforma-topbar,
  .proforma-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .proforma-topbar span,
  .proforma-company,
  .proforma-meta {
    text-align: left;
  }

  .quote-paper-head > div:last-child {
    text-align: left;
  }

  .proforma-logistics {
    grid-template-columns: 1fr;
  }

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

  .quote-builder-document-panel {
    max-height: none;
    overflow: visible;
    padding: 10px;
  }

  .bar-row {
    grid-template-columns: 1fr;
  }

  .bar-row > span:last-child {
    text-align: left;
  }

  .insight-row {
    grid-template-columns: 1fr;
  }

  .insight-metrics {
    justify-content: flex-start;
  }

  .insight-metric {
    flex: 1 1 118px;
    text-align: left;
  }
}

@media (max-width: 430px) {
  .login-panel,
  .public-lead-card {
    border-radius: 8px;
  }

  .login-panel {
    padding: 22px;
  }

  .login-panel::after {
    display: none;
  }

  .login-brand {
    padding-right: 0;
    margin-bottom: 16px;
  }

  .login-brand .brand-logo {
    width: 72px;
    height: 42px;
    flex-basis: 72px;
  }

  .login-language {
    position: static;
    width: fit-content;
    margin: 0 0 18px auto;
  }

  .login-panel h1 {
    font-size: 30px;
  }

  .brand-logo {
    width: 42px;
    height: 28px;
    flex-basis: 42px;
  }

  .topbar h1 {
    font-size: 24px;
  }

  .nav-item,
  .nav-item:not(.active) {
    flex-basis: 96px;
    font-size: 12px;
  }

  table {
    min-width: 620px;
  }

  .modal-head,
  .public-lead-head {
    gap: 12px;
  }
}

@media print {
  @page {
    size: A4;
    margin: 8mm;
  }

  html,
  body {
    width: 210mm;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: #fff !important;
  }

  body.printing-quote .app-shell,
  body.printing-quote .login-screen,
  body.printing-quote .lead-modal,
  body.printing-quote .detail-modal,
  body.printing-quote .mail-modal,
  body.printing-quote .product-modal,
  body.printing-quote .toast {
    display: none !important;
  }

  body.printing-quote dialog:not([open]) {
    display: none !important;
  }

	  .quote-modal,
	  .quote-builder-modal {
	    display: block !important;
	    position: static;
	    inset: auto !important;
	    margin: 0 !important;
	    padding: 0 !important;
	    width: 100%;
	    height: auto !important;
	    max-width: none;
	    max-height: none !important;
	    overflow: visible !important;
	    box-shadow: none;
	    border: 0 !important;
	    background: #fff !important;
	  }

  .quote-modal::backdrop,
  .quote-builder-modal::backdrop {
    display: none !important;
    background: transparent !important;
  }

  .quote-modal-actions,
  .quote-builder-panel {
    display: none;
  }

  .quote-shell,
  .quote-builder-shell,
  .quote-builder-layout,
  .quote-builder-document-panel,
  .quote-document {
    padding: 0;
    display: block;
    max-height: none;
    overflow: visible;
    border: 0;
    background: #fff;
  }

  .quote-document {
    max-height: none;
    overflow: visible;
    background: #fff;
  }

	  .quote-paper {
	    width: 190mm;
	    max-width: 190mm;
	    min-height: auto;
	    border: 0;
	    padding: 0;
	    margin: 0 auto;
	  }

	  .elegant-proforma-paper {
	    overflow: visible;
	    max-width: 190mm;
	  }

	  .proforma-topbar {
	    align-items: center !important;
	    flex-direction: row !important;
	    padding: 16px 22px;
	    background: linear-gradient(135deg, #0a1d37 0%, #2fa881 100%) !important;
	    -webkit-print-color-adjust: exact;
	    print-color-adjust: exact;
	  }

	  .proforma-topbar strong {
	    font-size: 24px;
	  }

	  .proforma-topbar span {
	    max-width: 300px;
	    text-align: right !important;
	  }

	  .proforma-header,
	  .proforma-parties,
  .elegant-proforma-paper .quote-total-box,
  .elegant-proforma-paper .proforma-logistics,
  .elegant-proforma-paper .quote-lines-wrap,
  .elegant-proforma-paper .proforma-total-panel,
  .elegant-proforma-paper .amount-words,
  .elegant-proforma-paper .quote-terms,
  .elegant-proforma-paper .bank-details,
  .proforma-auth,
  .elegant-proforma-paper footer {
    margin-left: 22px;
	    margin-right: 22px;
	  }

	  .proforma-header {
	    align-items: center !important;
	    flex-direction: row !important;
	    gap: 18px;
	    padding: 12px 0;
	  }

	  .proforma-company,
	  .proforma-meta {
	    text-align: right !important;
	  }

	  .proforma-parties {
	    grid-template-columns: minmax(0, 1fr) minmax(240px, 0.86fr) !important;
	    gap: 24px;
	    padding: 14px 0 8px;
	  }

	  .quote-lines-wrap {
	    overflow: visible;
	  }

	  .quote-lines {
	    font-size: 9px;
	  }

	  .quote-lines th,
	  .quote-lines td {
	    padding: 4px 5px;
	  }

	  .proforma-logo-box {
	    width: 92px;
	    height: 66px;
	  }

	  .elegant-proforma-paper .quote-total-box {
	    padding: 9px 10px;
	    margin-bottom: 10px;
	  }

	  .quote-total-box strong {
	    font-size: 22px;
	  }

	  .proforma-logistics {
	    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
	    gap: 6px;
	    margin-bottom: 10px;
	  }

	  .quote-lines-wrap {
	    margin-bottom: 10px;
	  }

	  .bank-grid {
	    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	  }

	  .bank-details,
	  .quote-terms,
	  .proforma-auth {
	    margin-top: 10px;
	    margin-bottom: 10px;
	    padding: 9px 10px;
	  }

  .quote-lines thead {
    display: table-header-group;
  }

  .quote-lines tr,
  .quote-lines td,
  .quote-lines th {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .quote-terms,
  .bank-details,
  .proforma-auth,
  .amount-words,
  .proforma-total-panel {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

body:not(.authenticated) .app-shell {
  display: none !important;
}
