/* Network Installation Quotation Generator
   Neutral business styling with a yellow accent; suitable for any networking company. */
:root {
  --yellow: #ffcc00;
  --yellow-dark: #e4b600;
  --navy: #102b4e;
  --navy-deep: #091d36;
  --ink: #172638;
  --muted: #6b7888;
  --line: #dfe5eb;
  --surface: #ffffff;
  --background: #f3f6f9;
  --green: #16845b;
  --radius: 16px;
  --shadow: 0 8px 28px rgba(19, 42, 68, 0.06);
}
* {
  box-sizing: border-box;
}
html {
  color-scheme: light;
}
body {
  margin: 0;
  background: var(--background);
  color: var(--ink);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  line-height: 1.5;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px clamp(18px, 4vw, 56px);
  color: white;
  background: var(--navy-deep);
  border-bottom: 5px solid var(--yellow);
}
.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 62px;
  height: 42px;
  overflow: hidden;
  border-radius: 7px;
  color: var(--navy-deep);
  background: var(--yellow);
  font-weight: 950;
  letter-spacing: -1px;
  font-size: 15px;
}
.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: white;
  padding: 3px;
}
.brand-lockup h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
}
.eyebrow,
.step-label {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.4px;
}
.topbar .eyebrow {
  color: #d4deea;
}
.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.page-shell {
  width: min(1160px, calc(100% - 32px));
  margin: 30px auto 24px;
}
.intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 22px;
}
.intro h2 {
  margin: 0 0 7px;
  color: var(--navy);
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -1px;
}
.muted {
  color: var(--muted);
  margin: 0;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  border: 1px solid #cce8dc;
  background: #effaf5;
  color: #146b4b;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #1b9a6b;
}
.action-message {
  display: none;
  margin: 0 0 14px;
  padding: 10px 13px;
  border-radius: 9px;
  background: #eef6ff;
  color: #173c63;
  border: 1px solid #d3e5f7;
  font-size: 12px;
}
.action-message.visible {
  display: block;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(18px, 2.5vw, 28px);
  margin-bottom: 18px;
  min-width: 0;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.section-heading h3 {
  margin: 0;
  color: var(--navy);
  font-size: 19px;
  letter-spacing: -0.35px;
}
.step-label {
  color: #9a7b00;
}
.small-note,
.small {
  font-size: 12px;
}
.small-note {
  color: var(--muted);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.business-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #344456;
  font-size: 12px;
  font-weight: 750;
  min-width: 0;
}
.field-label {
  color: #344456;
  font-size: 12px;
  font-weight: 750;
}
.span-2 {
  grid-column: span 2;
}
input,
select,
textarea {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  background: #fff;
  border: 1px solid #d7dfe7;
  border-radius: 8px;
  padding: 11px 12px;
  outline: none;
  font-size: 13px;
  font-weight: 450;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
input:focus,
select:focus,
textarea:focus {
  border-color: #d0a900;
  box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.18);
}
textarea {
  resize: vertical;
}
.hint {
  color: var(--muted);
  font-size: 11px;
  margin: 6px 0 0;
}
.logo-upload-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
#businessLogo {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.file-picker {
  display: inline-flex;
  align-items: center;
}
.logo-preview-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 150px;
  height: 90px;
  margin-top: 10px;
  padding: 8px;
  border: 1px dashed #c8d2dd;
  border-radius: 9px;
  background: #fafbfd;
}
.logo-preview-wrap img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 11px 15px;
  font-size: 12px;
  font-weight: 800;
  transition:
    transform 0.12s ease,
    background 0.12s ease;
}
.button:active {
  transform: translateY(1px);
}
.button-yellow {
  color: var(--navy-deep);
  background: var(--yellow);
  border-color: var(--yellow);
}
.button-yellow:hover {
  background: #ffda36;
}
.button-light {
  color: white;
  background: transparent;
  border-color: #51647a;
}
.button-light:hover {
  background: #173657;
}
.button-outline {
  color: var(--navy);
  background: white;
  border-color: #cbd5df;
}
.button-outline:hover {
  background: #f7f9fb;
}
.button-full {
  width: 100%;
  margin-top: 18px;
  padding: 14px;
}
.quote-number {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.quote-number span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 1px;
}
.quote-number input {
  width: 180px;
  padding: 8px 10px;
  text-align: right;
  font-weight: 800;
  color: var(--navy);
}
.line-heading {
  align-items: flex-end;
}
.line-heading .muted {
  margin-top: 4px;
}
.item-picker-controls {
  display: grid;
  grid-template-columns: minmax(140px, 0.85fr) minmax(190px, 1.15fr) auto;
  align-items: center;
  gap: 8px;
}
.item-picker-field {
  min-width: 0;
}
.item-picker-controls select {
  min-height: 40px;
  padding: 9px 10px;
  font-size: 12px;
}
.item-picker-controls .button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.item-picker-note {
  grid-column: 1 / -1;
  margin: 0;
}
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.items-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 850px;
}
.items-table th {
  padding: 12px 10px;
  text-align: left;
  background: #f6f8fa;
  color: #647284;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  letter-spacing: 0.55px;
  text-transform: uppercase;
  font-weight: 850;
}
.items-table td {
  padding: 9px 8px;
  border-bottom: 1px solid #edf0f3;
  vertical-align: middle;
}
.items-table tbody tr:last-child td {
  border-bottom: 0;
}
.items-table .description-col {
  width: 36%;
}
.items-table .qty-col {
  width: 8%;
}
.items-table .unit-col {
  width: 12%;
}
.items-table .price-col {
  width: 18%;
}
.items-table .amount-col {
  width: 18%;
}
.items-table .remove-col {
  width: 8%;
}
.item-unit {
  min-width: 100px;
  padding: 8px 6px;
  font-size: 11px;
}
.item-description {
  min-width: 210px;
}
.item-qty {
  min-width: 70px;
  text-align: right;
}
.item-price {
  min-width: 125px;
  text-align: right;
}
.line-amount {
  text-align: right;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 800;
  color: var(--navy);
  padding-right: 12px !important;
}
.remove-item {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 7px;
  background: #fff0f0;
  color: #b12b37;
  font-weight: 800;
}
.remove-item:hover {
  background: #ffdddd;
}
.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  color: var(--muted);
  font-size: 11px;
}
.text-button {
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--navy);
  font-weight: 800;
  font-size: 12px;
}
.totals-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.82fr);
  gap: 18px;
  align-items: start;
}
.notes-panel .field + .field {
  margin-top: 16px;
}
.summary-panel {
  border-top: 5px solid var(--yellow);
}
.summary-panel > .step-label {
  margin-bottom: 20px;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #edf0f3;
  color: #637083;
  font-size: 12px;
}
.summary-row strong {
  color: var(--navy);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.adjustment-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #edf0f3;
  color: #637083;
  font-size: 12px;
}
.adjustment-row > label {
  font-weight: 700;
}
.adjustment-controls {
  display: flex;
  align-items: center;
  gap: 7px;
}
.adjustment-controls select {
  width: 108px;
  padding: 7px 8px;
  font-size: 11px;
}
.adjustment-controls input[type="number"] {
  width: 92px;
  padding: 7px 8px;
  text-align: right;
}
.switch-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  white-space: nowrap;
  font-size: 11px;
}
.switch-label input {
  width: 15px;
  height: 15px;
  accent-color: var(--navy);
}
.vat-rate-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
}
.vat-rate-wrap input {
  width: 65px !important;
}
.grand-total {
  margin-top: 18px;
  padding: 18px;
  border-radius: 12px;
  background: var(--navy);
  color: white;
}
.grand-total span {
  display: block;
  color: #d7e1ed;
  font-size: 12px;
  font-weight: 700;
}
.grand-total strong {
  display: block;
  margin: 5px 0 3px;
  color: var(--yellow);
  font-size: clamp(25px, 3vw, 31px);
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.grand-total small {
  color: #b9c8d9;
  font-size: 10px;
}
.app-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 2px 20px;
  color: #8793a1;
  font-size: 10px;
}
.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;
}
@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .top-actions {
    width: 100%;
  }
  .top-actions .button {
    flex: 1;
  }
  .page-shell {
    width: min(100% - 22px, 650px);
    margin-top: 20px;
  }
  .intro {
    align-items: flex-start;
    flex-direction: column;
  }
  .form-grid,
  .business-grid {
    grid-template-columns: 1fr;
  }
  .span-2 {
    grid-column: auto;
  }
  .section-heading {
    align-items: flex-start;
  }
  .quote-number input {
    width: 145px;
  }
  .totals-layout {
    grid-template-columns: 1fr;
  }
  .line-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .item-picker-controls {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .item-picker-note {
    grid-column: 1 / -1;
  }
  .item-picker-controls .button {
    grid-column: 1 / -1;
  }
  .app-footer {
    flex-direction: column;
    gap: 5px;
  }
}
@media (max-width: 420px) {
  .brand-lockup h1 {
    font-size: 17px;
  }
  .brand-mark {
    width: 54px;
    height: 38px;
    font-size: 13px;
  }
  .panel {
    padding: 16px;
  }
  .adjustment-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .adjustment-controls {
    width: 100%;
  }
  .adjustment-controls input[type="number"] {
    flex: 1;
  }
}
@media print {
  @page {
    size: A4;
    margin: 12mm;
  }
  body {
    background: white;
    color: #172638;
    font-size: 10pt;
  }
  .topbar {
    padding: 0 0 10px;
    background: white !important;
    color: var(--navy) !important;
    border-bottom: 4px solid var(--yellow);
  }
  .topbar .eyebrow {
    color: var(--muted);
  }
  .top-actions,
  .status-pill,
  .button,
  .remove-item,
  .table-footer,
  .hint,
  .app-footer,
  .text-button,
  .action-message {
    display: none !important;
  }
  .page-shell {
    width: 100%;
    margin: 12px 0 0;
  }
  .intro {
    margin-bottom: 12px;
  }
  .intro h2 {
    font-size: 21pt;
  }
  .panel {
    padding: 13px;
    margin-bottom: 10px;
    box-shadow: none;
    border-color: #cbd3dc;
    break-inside: avoid;
  }
  .section-heading {
    margin-bottom: 12px;
  }
  .form-grid {
    gap: 9px;
  }
  input,
  select,
  textarea {
    padding: 5px 6px;
    border: 0;
    border-bottom: 1px solid #cbd3dc;
    border-radius: 0;
    box-shadow: none !important;
    color: #172638;
    background: transparent;
  }
  input::placeholder,
  textarea::placeholder {
    color: transparent;
  }
  .items-table {
    min-width: 0;
  }
  .items-table th {
    padding: 7px 5px;
    background: #edf1f5 !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  .items-table td {
    padding: 5px;
  }
  .items-table .remove-col,
  .items-table th.remove-col {
    display: none;
  }
  .item-description {
    min-width: 0;
  }
  .item-qty,
  .item-price {
    min-width: 0;
  }
  .totals-layout {
    grid-template-columns: 1fr 0.85fr;
    gap: 10px;
  }
  .grand-total {
    background: var(--navy) !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  .summary-panel {
    break-inside: avoid;
  }
  .adjustment-controls select {
    appearance: none;
  }
  .notes-panel textarea {
    min-height: 50px;
  }
  .logo-upload-row,
  .logo-preview-wrap {
    display: none !important;
  }
}

/* Cross-device responsive layout refinements */
@media (max-width: 760px) {
  .topbar { padding: 12px 14px; gap: 12px; }
  .brand-lockup { gap: 10px; }
  .top-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .top-actions .button { min-height: 42px; padding: 9px 10px; white-space: normal; }
  .page-shell { width: calc(100% - 16px); max-width: none; margin: 14px auto 16px; }
  .intro { margin-bottom: 14px; gap: 12px; }
  .intro h2 { font-size: clamp(21px, 5.8vw, 29px); }
  .panel { padding: 14px; border-radius: 12px; margin-bottom: 12px; }
  .section-heading { gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
  .form-grid, .business-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .span-2 { grid-column: auto; }
  input, select, textarea { min-height: 42px; padding: 10px 11px; font-size: 16px; }
  .field { gap: 5px; }
  .logo-upload-row { gap: 8px; }
  .line-heading { gap: 12px; }
  .item-picker-controls { gap: 8px; }
  .items-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .items-table { min-width: 590px; }
}
@media (max-width: 420px) {
  .topbar { padding: 10px; }
  .top-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top-actions .button { font-size: 12px; min-height: 40px; }
  .page-shell { width: calc(100% - 12px); margin-top: 10px; }
  .panel { padding: 12px; margin-bottom: 10px; }
  .section-heading h3 { font-size: 17px; }
  .quote-number input { width: min(145px, 40vw); }
}
@media (min-width: 761px) {
  .page-shell { width: min(1160px, calc(100% - 40px)); }
  .top-actions .button { min-height: 42px; }
}
@media (display-mode: standalone) {
  body { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
}
