:root {
  --bg: #eef1f2;
  --surface: #ffffff;
  --surface-soft: #f6f8f8;
  --ink: #18211f;
  --muted: #59645f;
  --line: #cfd8d5;
  --green: #c62712;
  --green-strong: #9f1e0f;
  --brand-red: #c62712;
  --mint: #fbe7e4;
  --amber: #f2b441;
  --coral: #e46b5d;
  --teal: #4c4c4c;
  --brand-gray: #4c4c4c;
  --shadow: 0 12px 34px rgba(21, 32, 29, 0.12);
  color-scheme: light;
  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;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] {
  display: none !important;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(100%, 460px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
  display: grid;
  gap: 16px;
}

.auth-logo {
  width: 260px;
  max-width: 100%;
  display: block;
}

.inline-logo svg,
.inline-visual svg {
  width: 100%;
  height: 100%;
  display: block;
}

.auth-card h1,
.auth-card p {
  margin: 0;
}

.auth-copy,
.auth-message {
  color: var(--muted);
  line-height: 1.5;
}

.auth-message.error {
  color: #a4372f;
}

.auth-message.success {
  color: #147a58;
}

.auth-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.auth-actions button {
  flex: 1 1 160px;
}

.auth-divider {
  margin: 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.pending-approval-screen .auth-copy strong {
  color: var(--ink);
}

.pending-accounts-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid #e8c27a;
  border-radius: 8px;
  background: #fff9eb;
}

.compact-heading {
  margin-bottom: 0;
}

.compact-heading h4 {
  margin: 0;
  font-size: 1rem;
}

.compact-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.account-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.account-status-badge.pending {
  background: #fff3d6;
  color: #9a6700;
}

.account-status-badge.approved {
  background: #e6f6ef;
  color: #147a58;
}

.account-status-badge.rejected {
  background: #fde8e6;
  color: #a4372f;
}

.user-row.pending-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

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

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

button {
  cursor: pointer;
}

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

.sidebar {
  background: #303030;
  color: #f5fbf8;
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand-block {
  display: grid;
  align-items: start;
  gap: 12px;
}

.brand-logo {
  width: 220px;
  height: auto;
  max-width: 100%;
  display: block;
  background: #ffffff;
  border-radius: 8px;
  padding: 10px;
  object-fit: contain;
}

.brand-block h1,
.brand-block p,
.topbar h2,
.topbar p,
.section-heading h3,
.section-heading p,
.summary-header h3,
.summary-header p,
.offer-card h4,
.offer-card p {
  margin: 0;
}

.brand-block h1 {
  font-size: 1.05rem;
}

.brand-block p,
.sidebar-note p {
  color: #b9c9c3;
  line-height: 1.5;
}

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

.business-lines {
  display: grid;
  gap: 8px;
}

.nav-section-label,
.business-lines > span {
  color: #b9c9c3;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.general-nav {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.business-line-button {
  display: grid;
  gap: 3px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: #eaf3ef;
  text-align: left;
  padding: 11px 12px;
  min-height: 58px;
  cursor: pointer;
}

.business-line-button:hover,
.business-line-button.active {
  background: rgba(198, 39, 18, 0.18);
  border-color: rgba(198, 39, 18, 0.55);
}

.business-line-button strong {
  font-size: 0.96rem;
}

.business-line-button small {
  color: #b9c9c3;
  font-weight: 700;
}

.nav-item {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: #eaf3ef;
  text-align: left;
  padding: 12px 14px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.nav-count-badge {
  flex-shrink: 0;
  min-width: 1.4rem;
  padding: 2px 7px;
  border-radius: 999px;
  background: #c62712;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
}

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

.sidebar-note strong {
  color: #ffffff;
}

.main-area {
  min-width: 0;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.48), rgba(255, 255, 255, 0) 260px),
    var(--bg);
}

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

.eyebrow {
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.topbar h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  letter-spacing: 0;
  color: #111817;
}

.risk-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.risk-result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.risk-summary-panel {
  position: sticky;
  top: 20px;
}

.risk-score-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  padding: 18px;
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
}

.risk-score-block span,
.risk-message,
.risk-source-row span,
.risk-metric-row span,
.risk-check p {
  color: var(--muted);
}

.risk-score-block strong {
  font-size: 2.4rem;
  line-height: 1;
}

.field-help {
  color: var(--muted);
  font-weight: 600;
  line-height: 1.35;
}

.field-help {
  font-size: 0.75rem;
}

.risk-advanced-options {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
}

.risk-advanced-options summary {
  color: var(--ink);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 900;
}

.risk-advanced-options .input-grid {
  margin-top: 12px;
}

.risk-decision-box strong {
  font-size: 1rem;
  line-height: 1.4;
}

.compact-heading {
  margin-bottom: 14px;
}

.risk-message {
  align-self: center;
  font-weight: 700;
}

.risk-message.success {
  color: #147a58;
}

.risk-message.error {
  color: #a4372f;
}

.drilling-price-approval-panel {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid #e8c27a;
  border-radius: 10px;
  background: #fff9ed;
}

.drilling-price-approval-panel .field-help {
  margin: 0 0 10px;
  color: #6b5a2e;
}

.approval-status-message {
  margin: 10px 0 0;
  font-size: 0.88rem;
  font-weight: 700;
}

.approval-status-message.pending {
  color: #9a6700;
}

.approval-status-message.success {
  color: #147a58;
}

.approval-status-message.error {
  color: #a4372f;
}

.drilling-foraje-section {
  margin-top: 8px;
}

.drilling-foraje-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.drilling-foraje-header h4 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.drilling-foraje-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.drilling-foraj-card {
  padding: 14px 16px;
  border: 1px solid #dde5e1;
  border-radius: 12px;
  background: #fafcfb;
}

.drilling-foraj-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.drilling-foraj-card-header strong {
  font-size: 0.95rem;
}

.drilling-foraj-card .input-grid {
  gap: 10px;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  min-width: 42px;
  padding: 0;
}

.icon-button svg {
  display: block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.drilling-foraj-remove,
.drilling-custom-field-remove {
  width: 42px;
  min-width: 42px;
  padding: 0;
}

.drilling-foraj-card .price-below-minimum {
  border-color: #e8c27a;
  background: #fff9ed;
}

.drilling-custom-fields-section {
  margin-top: 14px;
}

.drilling-custom-fields-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drilling-custom-field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px 14px;
  border: 1px solid #dde5e1;
  border-radius: 12px;
  background: #fafcfb;
}

.drilling-foraj-custom-fields {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e6ece9;
}

.drilling-foraj-custom-fields-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.drilling-foraj-custom-fields-header strong {
  font-size: 0.82rem;
}

.drilling-foraj-add-custom-field {
  padding: 6px 10px;
  font-size: 0.82rem;
}

.drilling-foraj-custom-fields .drilling-custom-field-row {
  padding: 10px 12px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto;
}

.drilling-foraj-addons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e6ece9;
}

.drilling-foraj-addon-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid #dde5e1;
  border-radius: 8px;
  background: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  color: #46514d;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.drilling-foraj-addon-check:hover {
  border-color: #b8c9c0;
  background: #fafcfb;
}

.drilling-foraj-addon-check:has(input:checked) {
  border-color: #c9ddd3;
  background: #f4fbf7;
}

.drilling-foraj-addon-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
  flex: 0 0 16px;
  accent-color: var(--green);
  box-shadow: none;
  border-radius: 4px;
  cursor: pointer;
}

input.price-below-minimum {
  border-color: #d4a017;
  background: #fffdf6;
}

.price-request-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.price-request-row strong {
  display: block;
}

.price-request-row span {
  display: block;
  color: var(--brand-gray);
  font-size: 0.84rem;
}

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

.offer-card .price-approval-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fff3cd;
  color: #856404;
  font-size: 0.72rem;
  font-weight: 800;
}

.risk-metrics-list,
.risk-checks-list,
.risk-sources-list {
  display: grid;
  gap: 10px;
}

.risk-metric-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(140px, 0.8fr) 64px;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.risk-metric-row > div:first-child {
  display: grid;
  gap: 2px;
}

.risk-score-bar {
  height: 9px;
  background: #e6ece9;
  border-radius: 999px;
  overflow: hidden;
}

.risk-score-bar span {
  display: block;
  height: 100%;
  background: var(--brand-red);
}

.risk-metric-row b {
  justify-self: end;
  min-width: 54px;
  text-align: center;
  border-radius: 999px;
  padding: 5px 8px;
}

.risk-good {
  background: #eaf6ef;
  color: #147a58;
}

.risk-warning {
  background: #fff4dc;
  color: #9f6818;
}

.risk-danger {
  background: #fbe7e4;
  color: #a4372f;
}

.risk-check,
.risk-source-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.risk-check {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 12px;
}

.risk-check p {
  grid-column: 1 / -1;
  margin: 0;
}

.risk-check.ok span {
  color: #147a58;
}

.risk-check.warning span {
  color: #9f6818;
}

.risk-check.danger span {
  color: #a4372f;
}

.risk-source-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.risk-source-row div {
  display: grid;
  gap: 3px;
}

.risk-source-row a {
  color: var(--brand-red);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.risk-level {
  border: 1px solid transparent;
}

.risk-scazut {
  background: #eaf6ef;
  color: #147a58;
  border-color: #bde6cf;
}

.risk-mediu {
  background: #fff4dc;
  color: #9f6818;
  border-color: #f4d79a;
}

.risk-ridicat,
.risk-foarte-ridicat,
.risk-critic {
  background: #fbe7e4;
  color: #a4372f;
  border-color: #efb8b1;
}

.topbar-actions,
.quick-actions,
.action-stack,
.offer-card-actions,
.pipeline-stats {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(340px, 0.6fr);
  gap: 20px;
  align-items: start;
}

.form-panel,
.summary-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  outline: 1px solid rgba(255, 255, 255, 0.65);
}

.form-panel {
  padding: 0;
  overflow: hidden;
}

.form-section {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.form-section:last-child {
  border-bottom: 0;
}

.section-heading {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.section-heading > span {
  min-width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--mint);
  color: var(--green-strong);
  font-weight: 900;
  font-size: 0.78rem;
}

.section-heading h3,
.summary-header h3 {
  font-size: 1rem;
  letter-spacing: 0;
}

.section-heading p {
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.3;
  font-size: 0.88rem;
}

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

.input-grid.compact-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.input-grid.single-column {
  grid-template-columns: 1fr;
}

label {
  display: grid;
  gap: 5px;
  color: #46514d;
  font-size: 0.82rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 10px 11px;
  min-height: 42px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(198, 39, 18, 0.13);
}

input::placeholder,
textarea::placeholder {
  color: #9aa8a3;
  opacity: 1;
}

input[readonly],
select:disabled {
  background: #f0f1f1;
  color: var(--brand-gray);
  cursor: not-allowed;
  opacity: 1;
}

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

.check-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
}

.check-card input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  accent-color: var(--green);
}

.check-card strong,
.check-card small {
  display: block;
}

.check-card small {
  margin-top: 3px;
  color: var(--muted);
  font-weight: 600;
}

.input-grid.compact-grid .wide-field {
  grid-column: span 2;
}

.quick-actions {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.quick-actions span {
  color: var(--muted);
  font-size: 0.88rem;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
.user-badge {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 15px;
  font-weight: 800;
  white-space: nowrap;
}

.user-badge {
  display: inline-flex;
  align-items: center;
  background: #f0f1f1;
  border-color: var(--line);
  color: var(--brand-gray);
  font-size: 0.82rem;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.primary-button {
  background: var(--green);
  color: #ffffff;
}

.primary-button:hover {
  background: var(--green-strong);
}

.secondary-button {
  background: #eaf4f1;
  color: var(--green-strong);
  border-color: #c9dfd7;
}

.push-toggle-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--brand-gray);
  cursor: pointer;
}

.push-toggle-button:hover:not(:disabled) {
  background: #f7f7f7;
}

.push-toggle-button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.push-toggle-button.is-enabled {
  background: #fdeceb;
  border-color: #f0c4bf;
  color: var(--brand-red, #c62712);
}

.push-toggle-button.is-pulse {
  border-color: rgba(198, 39, 18, 0.45);
  color: var(--brand-red, #c62712);
}

.push-toggle-button.is-pulse::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 10px;
  background: rgba(198, 39, 18, 0.28);
  pointer-events: none;
  animation: push-toggle-pulse 1.6s ease-out infinite;
}

@keyframes push-toggle-pulse {
  0% {
    transform: scale(0.92);
    opacity: 0.7;
  }
  70% {
    transform: scale(1.35);
    opacity: 0;
  }
  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .push-toggle-button.is-pulse::before {
    animation: none;
    opacity: 0.35;
    transform: none;
  }
}

.push-toggle-icon {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.push-toggle-icon svg {
  display: block;
}

.push-toggle-button:not(.is-enabled) .push-toggle-icon {
  color: var(--brand-gray, #5c6670);
}

.push-toggle-button.is-enabled .push-toggle-icon {
  color: var(--brand-red, #c62712);
}

.ghost-button {
  background: #ffffff;
  color: var(--ink);
  border-color: var(--line);
}

.danger-button {
  background: #fff0ed;
  color: #a4372f;
  border-color: #f4c7c0;
}

.summary-panel {
  padding: 22px;
  position: sticky;
  top: 24px;
}

.summary-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.solar-visual {
  width: 100%;
  min-height: 220px;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 16px;
  background: var(--surface-soft);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--green-strong);
  font-size: 0.76rem;
  font-weight: 900;
}

.status-pill[data-status="Oferta trimisa"] {
  background: #e9f1ff;
  color: #31558d;
}

.status-pill[data-status="Follow-up"] {
  background: #fff1d0;
  color: #805b09;
}

.status-pill[data-status="Castigata"] {
  background: #dff7e4;
  color: #166534;
}

.status-pill[data-status="Pierduta"] {
  background: #fde4df;
  color: #9e2f26;
}

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

.metric-card {
  min-height: 86px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  display: grid;
  align-content: space-between;
}

.metric-card span,
.summary-list span,
.price-box span,
.price-box small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.metric-card strong {
  font-size: 1.2rem;
}

.price-box {
  margin: 16px 0;
  padding: 18px;
  border-radius: 8px;
  background: var(--brand-gray);
  color: #ffffff;
  display: grid;
  gap: 6px;
}

.price-box strong {
  font-size: 2rem;
  letter-spacing: 0;
}

.price-box small,
.price-box span {
  color: #c6d8d1;
}

.legacy-summary {
  display: none !important;
}

.offer-preview-sheet {
  display: block;
  margin: 12px 0 18px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e7ecea;
  box-shadow: none;
  overflow-x: auto;
}

.summary-panel .solar-visual.inline-visual {
  display: none;
}

.pdf-preview-page {
  width: 560px;
  min-height: 792px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #dfe4e2;
  color: #15201d;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 8.3px;
  line-height: 1.24;
  letter-spacing: 0;
  box-shadow: 0 14px 28px rgba(21, 32, 29, 0.16);
}

.pdf-preview-header {
  height: 86px;
  display: grid;
  grid-template-columns: 206px minmax(0, 1fr) 54px;
  gap: 12px;
  align-items: start;
  padding: 22px 41px 0;
  background: #f5f5f5;
}

.pdf-preview-logo {
  width: 202px;
  height: auto;
  margin-top: 1px;
}

.pdf-preview-contact {
  display: grid;
  gap: 3px;
  color: #4c4c4c;
  font-size: 8.4px;
  text-align: right;
}

.pdf-preview-contact span,
.pdf-preview-title-row span,
.pdf-preview-footer span {
  overflow-wrap: anywhere;
}

.pdf-preview-qr-wrap {
  display: grid;
  justify-items: center;
  gap: 3px;
  color: #4c4c4c;
  font-size: 6.4px;
  font-weight: 800;
  text-align: center;
}

.pdf-preview-qr {
  width: 49px;
  height: 49px;
  background: #ffffff;
}

.pdf-preview-band {
  position: relative;
  overflow: hidden;
  flex: 0 0 auto;
  background: #eef0f0;
  border-top: 4px solid #c62712;
}

.pdf-preview-band--solar {
  height: 55px;
}

.pdf-preview-band--drilling {
  height: 55px;
  border-top: 0;
}

.pdf-preview-band--heat-pump {
  height: 55px;
}

.pdf-preview-band--geothermal {
  height: 95px;
}

.pdf-preview-band--drilling img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: fill;
}

.solar-band-line {
  position: absolute;
  top: 8px;
  width: 34px;
  height: 1px;
  background: #d6d9d9;
  transform: rotate(47deg);
}

.solar-band-line.line-a { left: 44px; }
.solar-band-line.line-b { left: 102px; }
.solar-band-line.line-c { left: 160px; }

.solar-band-sun {
  position: absolute;
  top: 12px;
  right: 72px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #f6c445;
}

.solar-band-roof {
  position: absolute;
  right: 40px;
  bottom: 5px;
  width: 270px;
  height: 40px;
  clip-path: polygon(0 100%, 44% 0, 100% 100%);
  background: #4c4c4c;
}

.solar-band-panel {
  position: absolute;
  top: 29px;
  width: 49px;
  height: 23px;
  border-radius: 3px;
  background:
    linear-gradient(90deg, transparent 32%, rgba(140, 183, 190, 0.8) 33%, rgba(140, 183, 190, 0.8) 35%, transparent 36%, transparent 65%, rgba(140, 183, 190, 0.8) 66%, rgba(140, 183, 190, 0.8) 68%, transparent 69%),
    linear-gradient(0deg, transparent 47%, rgba(140, 183, 190, 0.8) 48%, rgba(140, 183, 190, 0.8) 52%, transparent 53%),
    #354c54;
}

.solar-band-panel.panel-a { right: 240px; }
.solar-band-panel.panel-b { right: 182px; }
.solar-band-panel.panel-c { right: 124px; }

.solar-band-base {
  position: absolute;
  right: 32px;
  bottom: 4px;
  width: 272px;
  height: 3px;
  background: #c62712;
}

.heat-pump-band-floor {
  position: absolute;
  inset: 34px 0 0;
  background: #dfe7e5;
}

.heat-pump-band-unit {
  position: absolute;
  right: 64px;
  top: 13px;
  width: 58px;
  height: 34px;
  border-radius: 5px;
  background: #4c4c4c;
  box-shadow: inset 0 0 0 4px #ffffff;
}

.heat-pump-band-fan {
  position: absolute;
  top: 21px;
  width: 16px;
  height: 16px;
  border: 2px solid #c62712;
  border-radius: 999px;
}

.heat-pump-band-fan.fan-a { right: 99px; }
.heat-pump-band-fan.fan-b { right: 75px; }

.heat-pump-band-pipe {
  position: absolute;
  left: 48px;
  right: 150px;
  height: 3px;
  border-radius: 999px;
  background: #c62712;
}

.heat-pump-band-pipe.pipe-a { top: 31px; }
.heat-pump-band-pipe.pipe-b {
  top: 42px;
  background: #4c4c4c;
}

.heat-pump-band-base {
  position: absolute;
  left: 48px;
  bottom: 7px;
  width: 340px;
  height: 3px;
  background: #c62712;
}

.pdf-preview-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 175px;
  gap: 15px;
  padding: 20px 41px 0;
}

.pdf-preview-title-row h4 {
  margin: 0;
  color: #15201d;
  font-size: 20px;
  line-height: 1.05;
}

.pdf-preview-title-row p {
  max-width: 310px;
  margin: 9px 0 0;
  color: #5c6c65;
  font-size: 9.4px;
  line-height: 1.42;
}

.pdf-preview-title-row aside {
  display: grid;
  align-content: start;
  gap: 4px;
  color: #4c4c4c;
  font-size: 8.5px;
  text-align: right;
}

.pdf-preview-title-row aside strong {
  color: #15201d;
  font-size: 10.5px;
}

.pdf-preview-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  padding: 0 41px;
  margin-top: 14px;
}

.pdf-preview-info-grid div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 22px;
  min-width: 0;
  padding: 6px 7px 5px;
  border: 1px solid #dbe3df;
  border-radius: 5px;
  background: #f6f8f7;
  overflow: visible;
}

.pdf-preview-info-grid span {
  display: block;
  color: #66736f;
  font-size: 6px;
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
}

.pdf-preview-info-grid strong {
  display: block;
  margin-top: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-line;
  color: #15201d;
  font-size: 6.9px;
  line-height: 1.45;
}

.pdf-preview-page h5 {
  margin: 14px 41px 0;
  color: #c62712;
  font-size: 12.5px;
  line-height: 1.1;
}

.pdf-preview-table {
  width: calc(100% - 82px);
  margin: 14px 41px 0;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 7.9px;
}

.pdf-preview-table th {
  padding: 6px 8px;
  background: #4c4c4c;
  color: #ffffff;
  font-weight: 800;
  text-align: left;
}

.pdf-preview-table th:first-child {
  border-top-left-radius: 5px;
}

.pdf-preview-table th:last-child {
  border-top-right-radius: 5px;
  text-align: right;
}

.pdf-preview-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #dbe3df;
  color: #15201d;
  line-height: 1.18;
  overflow-wrap: anywhere;
  vertical-align: top;
}

.pdf-preview-table tbody tr:nth-child(even) td {
  background: #f6f8f7;
}

.pdf-preview-table td:last-child {
  text-align: right;
}

.pdf-preview-table--solar th:first-child,
.pdf-preview-table--solar td:first-child {
  width: 64%;
}

.pdf-preview-table--solar th:nth-child(2),
.pdf-preview-table--solar td:nth-child(2) {
  width: 16%;
}

.pdf-preview-table--solar th:last-child,
.pdf-preview-table--solar td:last-child {
  width: 20%;
}

.pdf-preview-table--solar tbody tr:last-child td,
.pdf-preview-table--drilling tbody tr:nth-last-child(-n + 2) td {
  font-weight: 800;
  background: #f8f8f8;
}

.pdf-preview-table--drilling th:first-child,
.pdf-preview-table--drilling td:first-child {
  width: 48%;
}

.pdf-preview-table--drilling th:nth-child(2),
.pdf-preview-table--drilling td:nth-child(2) {
  width: 8%;
}

.pdf-preview-table--drilling th:nth-child(3),
.pdf-preview-table--drilling td:nth-child(3) {
  width: 9%;
}

.pdf-preview-table--drilling th:nth-child(4),
.pdf-preview-table--drilling td:nth-child(4) {
  width: 17%;
}

.pdf-preview-table--drilling th:last-child,
.pdf-preview-table--drilling td:last-child {
  width: 18%;
}

.pdf-preview-table--heat-pump th:first-child,
.pdf-preview-table--heat-pump td:first-child {
  width: 10%;
}

.pdf-preview-table--heat-pump th:nth-child(2),
.pdf-preview-table--heat-pump td:nth-child(2) {
  width: 48%;
}

.pdf-preview-table--heat-pump th:nth-child(3),
.pdf-preview-table--heat-pump td:nth-child(3) {
  width: 9%;
}

.pdf-preview-table--heat-pump th:nth-child(4),
.pdf-preview-table--heat-pump td:nth-child(4) {
  width: 13%;
}

.pdf-preview-table--heat-pump th:last-child,
.pdf-preview-table--heat-pump td:last-child {
  width: 20%;
}

.pdf-preview-table--heat-pump tbody tr:nth-last-child(-n + 2) td {
  font-weight: 800;
  background: #f8f8f8;
}

.pdf-preview-total {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  min-height: 50px;
  margin: 11px 41px 0;
  padding: 10px 16px;
  border-radius: 6px;
  background: #c62712;
  color: #ffffff;
}

.pdf-preview-total span {
  display: block;
  font-size: 10px;
  font-weight: 800;
}

.pdf-preview-total small {
  display: block;
  margin-top: 7px;
  font-size: 7.7px;
  font-weight: 500;
  color: #ffffff;
}

.pdf-preview-total strong {
  font-size: 20px;
  line-height: 1;
  text-align: right;
  white-space: nowrap;
}

.pdf-preview-total--drilling {
  min-height: 64px;
}

.pdf-preview-total--drilling span {
  font-size: 14px;
}

.pdf-preview-total--drilling strong {
  font-size: 27px;
}

.pdf-preview-notes {
  margin: 14px 41px 0;
  padding: 9px;
  border: 1px solid #dedede;
  border-radius: 5px;
  background: #f8f8f8;
}

.pdf-preview-notes strong {
  display: block;
  color: #c62712;
  font-size: 8.2px;
  margin-bottom: 7px;
}

.pdf-preview-notes p {
  margin: 0;
  color: #505050;
  font-size: 7.3px;
  line-height: 1.36;
}

.pdf-preview-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin: auto 41px 0;
  padding: 16px 0 18px;
  border-top: 1px solid #dbe3df;
  color: #66736f;
  font-size: 7.6px;
}

.offer-preview-sheet h4 {
  font-size: 1.05rem;
  line-height: 1.25;
}

.offer-preview-sheet .pdf-preview-title-row h4 {
  margin: 0;
  color: #15201d;
  font-size: 20px;
  line-height: 1.05;
}

.preview-topline,
.preview-total {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.preview-topline strong {
  color: var(--green);
  letter-spacing: 0.08em;
  font-size: 0.8rem;
}

.preview-topline span {
  color: var(--muted);
  font-weight: 800;
  font-size: 0.78rem;
}

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

.preview-info-grid div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  background: #f8faf9;
}

.preview-info-grid span,
.preview-notes p {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.preview-info-grid strong {
  display: block;
  overflow-wrap: anywhere;
  margin-top: 2px;
  font-size: 0.82rem;
}

.preview-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.76rem;
}

.preview-table th,
.preview-table td {
  padding: 7px 6px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.preview-table th {
  background: var(--brand-gray);
  color: #ffffff;
  text-align: left;
}

.preview-table th:first-child,
.preview-table td:first-child {
  width: 62%;
}

.preview-table th:nth-child(2),
.preview-table td:nth-child(2) {
  width: 14%;
}

.preview-table th:last-child,
.preview-table td:last-child {
  width: 24%;
  text-align: right;
}

.preview-total {
  padding: 12px;
  border-radius: 8px;
  background: var(--green);
  color: #ffffff;
}

.preview-total span {
  font-size: 0.8rem;
  font-weight: 800;
}

.preview-total strong {
  font-size: 1.3rem;
}

.preview-total small {
  font-size: 0.72rem;
  font-weight: 800;
}

.preview-total-subtotal {
  align-items: flex-start;
  background: var(--brand-red);
  box-shadow: none;
  color: #ffffff;
  flex-direction: column;
  gap: 3px;
}

.preview-total-subtotal strong {
  color: #111111;
  font-size: 1.55rem;
}

.preview-total-subtotal small {
  color: #ffffff;
}

.preview-notes {
  display: grid;
  gap: 5px;
}

.preview-notes p {
  line-height: 1.35;
}

.summary-list {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.summary-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.summary-list strong {
  text-align: right;
}

.action-stack {
  align-items: stretch;
}

.action-stack button {
  flex: 1 1 auto;
}

.pipeline-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 16px;
}

.search-box {
  max-width: 420px;
  width: 100%;
}

.pipeline-stats span {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px 12px;
  font-weight: 800;
}

.pipeline-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(210px, 1fr));
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.pipeline-column {
  min-width: 210px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.column-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  font-weight: 900;
}

.offer-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 10px;
  box-shadow: 0 8px 20px rgba(21, 32, 29, 0.08);
}

.offer-card-head,
.offer-values {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.offer-card h4 {
  font-size: 1rem;
}

.offer-meta {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.offer-values {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.offer-values span {
  color: var(--muted);
  font-weight: 800;
}

.offer-card-actions {
  align-items: stretch;
}

.offer-card-actions button {
  flex: 1 1 86px;
  min-height: 36px;
  padding: 0 10px;
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  align-items: start;
}

.business-line-panel {
  padding: 22px;
}

.drilling-workspace,
.heat-pump-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.45fr);
  gap: 20px;
  align-items: start;
}

.heat-pump-result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.heat-pump-result-grid div {
  min-width: 0;
  min-height: 74px;
  display: grid;
  align-content: space-between;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.heat-pump-result-grid span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
}

.heat-pump-result-grid strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.16;
}

.heat-pump-dropzone {
  position: relative;
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 136px;
  border: 2px dashed #b8c9c3;
  border-radius: 8px;
  background: #f7faf9;
  color: var(--ink);
  text-align: center;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.heat-pump-dropzone.is-dragover {
  border-color: var(--green);
  background: #eef7f4;
}

.heat-pump-dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.heat-pump-dropzone strong {
  font-size: 1rem;
}

.heat-pump-dropzone span,
.heat-pump-import-status {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.heat-pump-import-status {
  margin-top: 10px;
}

.heat-pump-import-status.error {
  color: var(--red);
}

.heat-pump-import-summary {
  margin-top: 10px;
  min-height: 92px;
  background: #fbfcfc;
}

.drilling-settings-panel {
  grid-column: 1 / -1;
  padding: 22px;
}

.form-section-actions {
  padding: 16px 18px;
}

.drilling-visual {
  height: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  background: #ecf3f5;
  margin: 16px 0;
}

.soil-layer {
  position: absolute;
  left: 0;
  right: 0;
}

.layer-top {
  top: 0;
  height: 48px;
  background: linear-gradient(90deg, #ded7cc, #c6baa8);
}

.layer-mid {
  top: 48px;
  height: 66px;
  background: linear-gradient(90deg, #b59a77, #91765b);
}

.layer-deep {
  top: 114px;
  bottom: 0;
  background: linear-gradient(90deg, #6b6b6b, #444);
}

.borehole {
  position: absolute;
  top: 16px;
  bottom: 0;
  left: 50%;
  width: 34px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, #dfe7e5 0 22%, #ffffff 22% 78%, #dfe7e5 78%);
  border-left: 4px solid var(--brand-red);
  border-right: 4px solid var(--brand-red);
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.18);
}

.water-line {
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 38px;
  height: 5px;
  background: #4ba3c7;
  border-radius: 999px;
}

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

.price-setting-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
  padding: 13px;
  display: grid;
  gap: 10px;
}

.price-setting-card strong {
  color: var(--ink);
}

.price-setting-card span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

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

.module-card {
  min-height: 156px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
  padding: 16px;
}

.module-card span {
  color: var(--brand-red);
  display: block;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.module-card strong {
  display: block;
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.module-card p,
.module-card li {
  color: var(--muted);
  line-height: 1.45;
}

.module-card ul {
  margin: 0;
  padding-left: 18px;
}

.empty-state {
  background: var(--surface);
  border: 1px dashed #b8c7c1;
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  line-height: 1.5;
}

.users-panel {
  padding: 22px;
}

.profile-panel {
  padding: 22px;
}

.users-table {
  display: grid;
  gap: 10px;
}

.user-add-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.inline-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.inline-help.error {
  color: #a4372f;
}

.inline-help.success {
  color: var(--green-strong);
}

.user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px 115px 100px;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-soft);
}

.user-row strong,
.user-row span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-row span {
  color: var(--muted);
  font-size: 0.86rem;
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }

  .nav-list {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow-x: auto;
  }

  .general-nav,
  .business-nav {
    flex: 1 1 100%;
  }

  .business-lines {
    flex: 1 1 100%;
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }

  .business-lines > span {
    grid-column: 1 / -1;
  }

  .sidebar-note {
    margin-top: 0;
    flex: 1 1 260px;
  }

  .workspace-grid,
  .settings-layout,
  .module-layout,
  .drilling-workspace,
  .heat-pump-workspace,
  .drilling-price-grid,
  .risk-workspace,
  .risk-result-grid {
    grid-template-columns: 1fr;
  }

  .summary-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .main-area {
    padding: 16px;
  }

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

  .topbar-actions {
    align-items: stretch;
  }

  .topbar-actions button {
    flex: 1 1 auto;
  }

  .input-grid,
  .metric-grid,
  .risk-metric-row {
    grid-template-columns: 1fr;
  }

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

  .drilling-custom-field-row {
    grid-template-columns: 1fr;
  }

  .drilling-foraj-custom-fields-header {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .input-grid.compact-grid .wide-field {
    grid-column: 1 / -1;
  }

  .sidebar {
    padding: 18px;
  }

  .price-box strong {
    font-size: 1.6rem;
  }
}

@media print {
  body {
    background: #ffffff;
  }

  .sidebar,
  .topbar,
  .form-panel,
  .action-stack,
  .pipeline-toolbar,
  .settings-layout,
  .pipeline-board {
    display: none !important;
  }

  .app-shell,
  .main-area,
  .workspace-grid {
    display: block;
    padding: 0;
  }

  .summary-panel {
    box-shadow: none;
    border: 0;
    position: static;
  }
}
