:root {
  --blue-950: #0b1f3a;
  --blue-850: #12345d;
  --blue-700: #1f5b98;
  --gray-50: #f7f9fc;
  --gray-100: #edf1f7;
  --gray-200: #d9e1ec;
  --gray-500: #607086;
  --gray-800: #243246;
  --green: #137a4f;
  --yellow: #996d00;
  --red: #b42318;
  --white: #ffffff;
  --shadow: 0 12px 30px rgba(11, 31, 58, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--gray-800);
  background: var(--gray-50);
  font-family: Arial, Helvetica, sans-serif;
}

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

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 36px;
  color: var(--white);
  background: var(--blue-950);
}

.app-header h1 {
  margin: 4px 0 0;
  font-size: clamp(24px, 3vw, 36px);
  letter-spacing: 0;
}

.eyebrow {
  margin: 0;
  color: #b8c7db;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.header-actions,
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.action-row.end {
  justify-content: flex-end;
}

.btn {
  min-height: 40px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.btn-primary {
  color: var(--white);
  background: var(--blue-700);
}

.btn-secondary {
  color: var(--blue-950);
  background: var(--white);
  border-color: var(--gray-200);
}

.btn-danger {
  color: var(--white);
  background: var(--red);
}

.product-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 0 24px;
  align-items: center;
  padding: 0;
  color: var(--white);
  background: var(--blue-950);
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  margin: 28px auto 0;
  max-width: 1280px;
  box-shadow: var(--shadow);
}

.product-banner-image {
  grid-column: 1 / -1;
  display: block;
  width: 100%;
  height: clamp(240px, 24vw, 360px);
  object-fit: cover;
  object-position: center;
}

.banner-copy h2 {
  max-width: 850px;
  margin: 8px 0;
  font-size: clamp(24px, 3.4vw, 42px);
  line-height: 1.08;
  letter-spacing: 0;
}

.banner-copy p {
  max-width: 780px;
  margin: 0;
  color: #d7e1ef;
  font-size: 16px;
  line-height: 1.5;
}

.banner-copy {
  padding: 22px 30px 30px;
}

.banner-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  color: var(--blue-950);
  background: var(--white);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.banner-status {
  width: min(260px, 100%);
  margin-right: 30px;
  padding: 16px;
  color: var(--blue-950);
  background: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 8px;
}

.banner-status span,
.banner-status small {
  display: block;
  color: var(--gray-500);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.banner-status strong {
  display: block;
  margin: 8px 0;
  color: var(--blue-950);
  font-size: 24px;
}

.tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 28px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
}

.tab {
  white-space: nowrap;
  padding: 10px 12px;
  color: var(--gray-500);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
}

.tab.active {
  color: var(--blue-950);
  background: var(--gray-100);
}

main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

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

.panel-title h2,
.maintenance-card h3 {
  margin: 0;
  color: var(--blue-950);
  font-size: 24px;
}

.panel-title p {
  margin: 6px 0 0;
  color: var(--gray-500);
}

.quote-number {
  padding: 10px 14px;
  color: var(--blue-950);
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-weight: 800;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 20px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.form-grid.compact {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 18px;
}

label,
fieldset {
  display: grid;
  gap: 7px;
  color: var(--blue-950);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  color: var(--gray-800);
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
}

textarea {
  resize: vertical;
}

input:disabled,
select:disabled,
textarea:disabled {
  color: var(--gray-500);
  background: var(--gray-100);
}

fieldset {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
}

legend {
  padding: 0 6px;
}

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

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

.checkbox-grid label,
.switch-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.checkbox-grid input,
.switch-line input {
  width: 18px;
  min-height: 18px;
}

.switch-line {
  margin: 0 0 16px;
  padding: 12px 14px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
}

.catalog-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(320px, 1.4fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
  padding: 18px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-left: 5px solid var(--blue-700);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.catalog-panel h3 {
  margin: 0;
  color: var(--blue-950);
  font-size: 20px;
}

.catalog-panel p {
  margin: 6px 0 0;
  color: var(--gray-500);
}

.catalog-controls {
  display: grid;
  grid-template-columns: 120px minmax(220px, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.file-picker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 12px;
  color: var(--blue-950);
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
}

.file-picker input {
  display: none;
}

.catalog-status {
  grid-column: 1 / -1;
  font-size: 13px;
  font-weight: 700;
}

.table-wrap {
  overflow: auto;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
}

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

th {
  color: var(--blue-950);
  background: var(--gray-100);
  font-size: 12px;
  text-transform: uppercase;
}

td {
  font-size: 14px;
}

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

.icon-btn {
  padding: 6px 9px;
  color: var(--blue-950);
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  cursor: pointer;
}

.icon-btn.danger-action {
  color: var(--red);
  background: #fff0ee;
  border-color: #ffd0ca;
}

.notice {
  margin-bottom: 16px;
  padding: 13px 14px;
  border-radius: 8px;
  font-weight: 700;
}

.notice.danger {
  color: var(--red);
  background: #fff0ee;
  border: 1px solid #ffd0ca;
}

.notice.warning {
  color: var(--yellow);
  background: #fff8e1;
  border: 1px solid #f4d06f;
}

.notice.success {
  color: var(--green);
  background: #eaf7f0;
  border: 1px solid #b9e4cc;
}

.hidden {
  display: none !important;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric {
  padding: 16px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric span {
  display: block;
  color: var(--gray-500);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 8px;
  color: var(--blue-950);
  font-size: 22px;
}

.proforma-page {
  padding: 34px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.proforma-banner {
  width: 100%;
  height: 145px;
  margin-bottom: 24px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--blue-950);
}

.proforma-banner img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.proforma-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 3px solid var(--blue-950);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-box {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  color: var(--white);
  background: var(--blue-950);
  border-radius: 8px;
  font-weight: 900;
}

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

.proforma-title h2 {
  margin: 0;
  color: var(--blue-950);
  font-size: 34px;
}

.proforma-section {
  margin-top: 24px;
}

.proforma-section p,
.conditions-list li,
.info-box p {
  text-align: justify;
}

.proforma-header p,
.proforma-title p,
.brand-lockup p,
.totals span,
.totals strong,
td,
th {
  text-align: left;
}

.proforma-section h3 {
  margin: 0 0 10px;
  color: var(--blue-950);
  font-size: 18px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.info-box {
  padding: 16px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
}

.info-box p {
  margin: 6px 0;
}

.totals {
  display: grid;
  justify-content: end;
  gap: 8px;
  margin-top: 18px;
}

.total-line {
  display: grid;
  grid-template-columns: 180px 140px;
  gap: 18px;
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-200);
}

.total-line.grand {
  color: var(--blue-950);
  font-size: 20px;
  font-weight: 900;
}

.conditions-list {
  margin: 0;
  padding-left: 20px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 20px;
  background: rgba(11, 31, 58, 0.46);
}

.modal {
  width: min(720px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 24px;
  background: var(--white);
  border-radius: 8px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
}

.checklist {
  display: grid;
  gap: 8px;
  margin: 18px 0;
}

.checklist label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
}

.modal-actions {
  position: sticky;
  right: 0;
  bottom: -24px;
  left: 0;
  margin: 18px -24px -24px;
  padding: 16px 24px;
  background: var(--white);
  border-top: 1px solid var(--gray-200);
}

.maintenance-card {
  margin-top: 22px;
}

@media (max-width: 960px) {
  .app-header,
  .panel-title,
  .proforma-header {
    align-items: stretch;
    flex-direction: column;
  }

  .product-banner {
    grid-template-columns: 1fr;
  }

  .catalog-panel,
  .catalog-controls {
    grid-template-columns: 1fr;
  }

  .form-grid,
  .form-grid.compact,
  .metric-grid,
  .two-col,
  .checkbox-grid {
    grid-template-columns: 1fr 1fr;
  }

  .proforma-title {
    text-align: left;
  }
}

@media (max-width: 640px) {
  main {
    padding: 18px;
  }

  .app-header {
    padding: 22px;
  }

  .product-banner {
    padding: 22px;
    padding: 0;
  }

  .product-banner-image {
    height: 220px;
  }

  .banner-copy,
  .banner-status {
    margin: 0;
    padding: 22px;
  }

  .form-grid,
  .form-grid.compact,
  .metric-grid,
  .two-col,
  .checkbox-grid {
    grid-template-columns: 1fr;
  }

  .proforma-page {
    padding: 20px;
  }
}

@media print {
  body {
    background: var(--white);
  }

  .app-header,
  .product-banner,
  .tabs,
  .panel-title,
  .modal-backdrop,
  body.print-external .panel:not(#cliente),
  body.print-internal .panel:not(#interno) {
    display: none !important;
  }

  main {
    max-width: none;
    padding: 0;
  }

  .panel,
  .panel.active,
  body.print-external #cliente,
  body.print-internal #interno {
    display: block !important;
  }

  .proforma-page,
  .table-wrap,
  .metric {
    border: 0;
    box-shadow: none;
  }

  .proforma-section {
    break-inside: avoid;
  }

  table {
    page-break-inside: auto;
  }

  tr {
    page-break-inside: avoid;
  }
}
