:root {
  color-scheme: light;
  --brand-primary: #24337f;
  --brand-primary-dark: #16245f;
  --brand-secondary: #6ec6e8;
  --brand-soft: #eef7fc;
  --brand-border: #c7dff0;
  --brand-text: #14213d;
  --ink: var(--brand-text);
  --muted: #5d6b88;
  --line: var(--brand-border);
  --brand: var(--brand-primary);
  --brand-dark: var(--brand-primary-dark);
  --accent: #c1462f;
  --accent-soft: #fff2ee;
  --success-soft: var(--brand-soft);
  --surface: #ffffff;
  --bg: #f5f8fc;
  --shadow: 0 18px 45px rgba(20, 33, 61, .09);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
a { color: var(--brand); }
.page { width: min(1120px, calc(100% - 32px)); margin: 32px auto 48px; }
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  margin: 18px 0;
  box-shadow: 0 10px 28px rgba(20, 33, 61, .05);
}
.auth-panel { max-width: 430px; margin: 72px auto; }
.topbar, .proposal-grid, .summary {
  display: grid;
  gap: 16px;
}
.topbar {
  grid-template-columns: 1fr auto;
  align-items: center;
}
.proposal-grid { grid-template-columns: 1fr 1fr auto; align-items: end; }
.form-stack { display: grid; gap: 14px; }
h1, h2 { margin: 0 0 8px; }
.muted { color: var(--muted); }
label { display: grid; gap: 6px; font-weight: 700; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  font: inherit;
  background: #fff;
}
button, .button {
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button:hover, .button:hover { background: var(--brand-dark); }
.secondary { background: #e8f1f8; color: var(--ink); }
.alert, .error { background: #fff0ed; color: #842818; border: 1px solid #f1b5aa; padding: 12px; border-radius: 6px; }
.success { background: var(--brand-soft); border-color: var(--brand-border); }
.result { margin-top: 16px; padding: 12px; border-radius: 6px; }
.table-wrap { overflow-x: auto; border-radius: 8px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; background: #f7fbff; }
tbody tr:hover { background: #f8fbff; }
.badge { background: #e8f1f8; border-radius: 99px; padding: 4px 9px; font-size: 12px; font-weight: 700; }
.summary { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.proposal-meta {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
dt { color: var(--muted); font-size: 13px; }
dd { margin: 3px 0 0; font-weight: 700; }
.commercial-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.commercial-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  min-height: 116px;
  display: grid;
  align-content: center;
  gap: 8px;
  box-shadow: var(--shadow);
}
.commercial-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.commercial-card strong {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1;
}
.commercial-card.subtotal {
  background: linear-gradient(180deg, #f7fbff, #fff);
}
.commercial-card.subtotal strong { color: var(--ink); }
.commercial-card.savings {
  background: linear-gradient(180deg, var(--accent-soft), #fff);
  border-color: #f1c2b7;
}
.commercial-card.savings strong { color: var(--accent); }
.commercial-card.total {
  background: linear-gradient(180deg, var(--brand-soft), #fff);
  border-color: var(--brand-border);
  box-shadow: 0 20px 48px rgba(36, 51, 127, .16);
}
.commercial-card.total strong { color: var(--brand-dark); }
.proposal-items-table {
  min-width: 860px;
}
.proposal-items-table td:nth-child(n+2),
.proposal-items-table th:nth-child(n+2) {
  white-space: nowrap;
}
.additionals-note {
  background: #fffaf2;
  border: 1px solid #ead8b8;
  border-radius: 8px;
  color: #6e4b16;
  font-weight: 700;
  margin: 18px 0;
  padding: 14px 16px;
}
.proposal-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #ffffff 0%, var(--brand-soft) 100%);
  color: var(--ink);
  border: 1px solid var(--brand-border);
  border-radius: 8px;
  padding: 18px 22px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  box-shadow: var(--shadow);
}
.proposal-hero::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: var(--brand);
}
.hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-visual-left {
  min-width: 94px;
}
.hero-visual-right {
  min-width: 180px;
  justify-content: flex-end;
}
.hero-content {
  min-width: 0;
}
.proposal-logo-animated {
  width: 96px;
  height: 70px;
  object-fit: contain;
  flex: 0 0 auto;
}
.company-logo {
  width: min(190px, 22vw);
  max-height: 72px;
  object-fit: contain;
  display: block;
}
.proposal-hero h1 {
  margin: 2px 0 0;
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1.08;
  color: var(--brand-dark);
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  margin-top: 10px;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--brand-border);
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--brand-dark);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.eyebrow { text-transform: uppercase; letter-spacing: 0; font-weight: 700; color: var(--brand); margin: 0; }
details { margin-top: 12px; }
summary { cursor: pointer; font-weight: 700; }
.opportunity-table table {
  min-width: 640px;
}
.opportunities-section {
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 18px;
}
.product-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
  display: grid;
  gap: 16px;
  box-shadow: 0 12px 30px rgba(20, 33, 61, .07);
}
.suggestion-card {
  border-color: var(--brand-border);
  border-top: 4px solid var(--brand-secondary);
}
.promotion-card {
  border-color: var(--brand-border);
  border-top: 4px solid var(--brand-primary);
}
.product-card-main {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: flex-start;
}
.product-card h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
}
.product-card-price {
  display: grid;
  gap: 4px;
}
.product-price-stack {
  display: grid;
  gap: 8px;
}
.suggestion-original-price {
  display: grid;
  gap: 3px;
}
.suggestion-original-price span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.suggestion-original-price strong {
  color: var(--muted);
  font-size: 16px;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}
.product-card-price span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.product-card-price strong {
  color: var(--brand-dark);
  font-size: 28px;
  line-height: 1;
}
.product-action-form {
  display: grid;
  gap: 12px;
}
.quantity-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.action-button,
.approve-button {
  width: 100%;
  text-align: center;
  border-radius: 8px;
}
.selected-badge {
  white-space: nowrap;
  background: var(--success-soft);
  border: 1px solid var(--brand-border);
  border-radius: 999px;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
  padding: 5px 9px;
}
.selected-copy {
  color: var(--brand-dark);
  font-weight: 700;
  margin: 0;
}
.approval-note {
  margin: 0;
  color: var(--brand-dark);
  background: var(--success-soft);
  border: 1px solid var(--brand-border);
  border-radius: 8px;
  padding: 14px 16px;
  font-weight: 700;
}
.approval-panel {
  border-color: var(--brand-border);
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 18px 45px rgba(36, 51, 127, .11);
}
.approval-panel h2 {
  color: var(--brand-dark);
}
.approve-button {
  font-size: 18px;
  padding: 16px 20px;
  box-shadow: 0 14px 28px rgba(36, 51, 127, .18);
}
.price-cell {
  color: var(--brand-dark);
  font-weight: 800;
  white-space: nowrap;
}
.promotions-panel {
  border: 1px solid var(--brand-border);
  border-radius: 8px;
  padding: 0;
  background: #f8fbff;
  overflow: hidden;
}
.promotions-panel summary {
  padding: 16px 18px;
  background: var(--success-soft);
  color: var(--brand-dark);
}
.promotions-panel .table-wrap {
  border-radius: 0;
}
.promotions-panel .product-grid {
  padding: 18px;
}
.inline-form {
  display: contents;
}
.qty-input {
  width: 92px;
  min-width: 92px;
  text-align: center;
  font-weight: 700;
  border-color: var(--brand-border);
  border-radius: 8px;
  padding: 10px;
  display: inline-block;
}
input:focus,
select:focus,
textarea:focus,
.qty-input:focus {
  border-color: var(--brand-secondary);
  box-shadow: 0 0 0 3px rgba(110, 198, 232, .24);
  outline: none;
}
.check-form {
  margin: 0;
}
.check-label {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--brand-dark);
}
.check-label input {
  width: auto;
}
.unit-label {
  margin-left: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
@media (max-width: 760px) {
  .page { width: min(100% - 20px, 1120px); margin: 16px auto; }
  .panel { padding: 16px; }
  .topbar, .proposal-grid { grid-template-columns: 1fr; }
  .commercial-summary { grid-template-columns: 1fr; }
  .commercial-card { min-height: 96px; }
  .proposal-hero { grid-template-columns: 1fr; padding: 18px; }
  .hero-visual-left,
  .hero-visual-right { min-width: 0; justify-content: flex-start; }
  .proposal-logo-animated { width: 86px; height: 62px; }
  .company-logo { width: min(176px, 72vw); max-height: 64px; }
  .hero-meta { align-items: flex-start; }
  th, td { padding: 12px 10px; }
  .product-grid { grid-template-columns: 1fr; }
  .product-card { padding: 16px; }
  .qty-input { min-width: 96px; width: 96px; }
}
