/* =========================================================
   ALS Quoting Tool — Stylesheet
   Brand: #0B3D6E (navy) · #ff6900 (orange)
   ========================================================= */

:root {
  --navy:    #0B3D6E;
  --orange:  #ff6900;
  --navy-lt: #174e8a;
  --bg:      #f4f6f9;
  --surface: #ffffff;
  --border:  #dde3ea;
  --text:    #1a2533;
  --muted:   #6b7a8d;
  --green:   #1a7a4a;
  --red:     #c0392b;
  --blue:    #1565c0;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

/* ── NAV ── */
.topnav {
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 52px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  color: #fff; text-decoration: none; font-size: 16px;
}
.nav-brand strong { font-weight: 700; }
.nav-right { display: flex; align-items: center; gap: 8px; }
.nav-user  { color: #adbdd0; font-size: 13px; margin-right: 4px; }

/* ── LOGO MARK ── */
.logo-mark {
  width: 28px; height: 28px;
  background: var(--orange);
  clip-path: polygon(0 0, 100% 0, 100% 65%, 50% 100%, 0 65%);
}
.logo-mark.sm { width: 20px; height: 20px; }

/* ── CONTAINER ── */
.container { max-width: 1100px; margin: 0 auto; padding: 28px 20px 60px; }

/* ── PAGE HEADER ── */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.page-header h1 { font-size: 22px; font-weight: 700; color: var(--navy); }
.meta-row { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 16px; border-radius: 5px; font-size: 13px; font-weight: 600;
  text-decoration: none; border: none; cursor: pointer; transition: background .15s, opacity .15s;
  white-space: nowrap;
}
.btn-primary  { background: var(--orange); color: #fff; }
.btn-primary:hover { background: #e05e00; }
.btn-secondary{ background: var(--navy);  color: #fff; }
.btn-secondary:hover { background: var(--navy-lt); }
.btn-ghost    { background: transparent; color: var(--navy); border: 1.5px solid var(--border); }
.btn-ghost:hover { background: var(--bg); }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-full { width: 100%; padding: 11px; }

/* ── CARDS ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 20px;
}
.card-title { font-size: 15px; font-weight: 700; color: var(--navy); margin-bottom: 16px; }

/* ── FORM ── */
.field       { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.field-inline { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.field-inline label { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; min-width: 130px; }

input[type=text], input[type=email], input[type=password],
input[type=number], select, textarea {
  border: 1.5px solid var(--border);
  border-radius: 5px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  width: 100%;
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--navy);
}
input[readonly] { background: var(--bg); color: var(--muted); }
textarea { resize: vertical; min-height: 70px; }
.input-sm { width: 90px; }

.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
@media (max-width: 700px) { .grid-3 { grid-template-columns: 1fr; } }

.hint { color: var(--muted); font-size: 12px; }

.pricing-config {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: 10px 14px; background: var(--bg); border-radius: 6px;
  margin-bottom: 16px; font-size: 13px;
}

/* ── TABLES ── */
.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.data-table th {
  background: var(--navy); color: #fff;
  padding: 10px 12px; text-align: left; font-size: 12px; font-weight: 600;
  white-space: nowrap;
}
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.data-table tr:hover td { background: #f7f9fc; }
.data-table a { color: var(--navy); font-weight: 600; text-decoration: none; }
.data-table a:hover { color: var(--orange); }
.mono { font-variant-numeric: tabular-nums; }
.actions { white-space: nowrap; }

/* ── LINE TABLE ── */
.line-table {
  width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 12px;
}
.line-table th {
  background: var(--navy); color: #fff;
  padding: 8px 10px; text-align: left; font-size: 11px; font-weight: 600;
}
.line-table td { padding: 4px 4px; border-bottom: 1px solid var(--border); vertical-align: top; }
.line-table input, .line-table textarea {
  border: 1.5px solid var(--border); border-radius: 4px;
  padding: 5px 7px; font-size: 12px; width: 100%;
}
.line-table textarea { min-height: 52px; resize: vertical; }
.qty-input { width: 54px !important; text-align: center; }
.btn-remove {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 18px; line-height: 1; padding: 4px 6px;
}
.btn-remove:hover { color: var(--red); }

.line-actions { margin-bottom: 20px; }

/* ── TOTALS BLOCK ── */
.totals-block {
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px; margin-top: 8px;
}
.totals-row {
  display: flex; justify-content: space-between; gap: 48px;
  font-size: 13px; padding: 4px 0;
  width: 320px;
}
.totals-row span:last-child { font-variant-numeric: tabular-nums; text-align: right; min-width: 100px; }
.totals-row--sub { border-top: 1.5px solid var(--border); padding-top: 8px; margin-top: 4px; }
.totals-row--total {
  border-top: 2px solid var(--navy); border-bottom: 2px solid var(--navy);
  padding: 6px 0; font-weight: 700; font-size: 15px; color: var(--navy);
}

/* ── BADGES ── */
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 12px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
}
.badge-grey  { background: #e8edf2; color: var(--muted); }
.badge-blue  { background: #d0e4ff; color: var(--blue); }
.badge-green { background: #d4f0e0; color: var(--green); }
.badge-red   { background: #fde8e6; color: var(--red); }

/* ── MISC ── */
.alert { padding: 10px 14px; border-radius: 5px; font-size: 13px; margin-bottom: 16px; }
.alert-error { background: #fde8e6; color: var(--red); border: 1px solid #f5c4c0; }
.filters { margin-bottom: 20px; }
.filter-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search-input { max-width: 260px; }
.empty-state { text-align: center; padding: 48px; color: var(--muted); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 8px; }
.preview-wrap { background: var(--bg); padding: 20px; border-radius: 8px; }

/* ── LOGIN ── */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--navy); }
.login-card { background: var(--surface); border-radius: 10px; padding: 40px; width: 100%; max-width: 380px; box-shadow: 0 8px 40px rgba(0,0,0,.3); }
.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.logo-text   { font-size: 20px; color: var(--navy); }
.login-card .field { margin-bottom: 16px; }

/* ── PRINT BAR ── */
.print-bar {
  background: var(--navy); color: #fff;
  padding: 12px 24px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.print-bar .hint { color: #adbdd0; }

/* ================================================================
   QUOTE DOCUMENT STYLES
   ================================================================ */

.quote-doc {
  background: #fff;
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 48px;
  border: 1px solid var(--border);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  line-height: 1.6;
  color: #1a2533;
}

@media print {
  .quote-doc {
    max-width: 100%;
    border: none;
    padding: 0;
    margin: 0;
  }
  @page { margin: 18mm 16mm; size: A4; }
}

/* Header */
.q-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 24px;
}
.q-logo-block { display: flex; flex-direction: column; gap: 10px; }
.q-logo-wordmark {
  display: flex; align-items: baseline; gap: 6px;
}
.q-logo-als {
  font-size: 32px; font-weight: 900; color: var(--navy); letter-spacing: -.02em;
  border-bottom: 4px solid var(--orange); padding-bottom: 2px;
}
.q-logo-sub {
  font-size: 13px; color: var(--muted); font-weight: 400; letter-spacing: .04em;
  text-transform: uppercase;
}
.q-contact-block {
  font-size: 11.5px; color: var(--muted); line-height: 1.7; margin-top: 6px;
}

.q-meta-block { text-align: right; }
.q-meta-title {
  font-size: 22px; font-weight: 800; color: var(--navy);
  letter-spacing: .06em; margin-bottom: 10px;
}
.q-meta-table { font-size: 12px; margin-left: auto; }
.q-meta-table th { text-align: left; color: var(--muted); padding-right: 12px; padding-bottom: 3px; font-weight: 600; }
.q-meta-table td { text-align: right; font-weight: 600; color: var(--text); padding-bottom: 3px; }

.q-divider {
  height: 4px;
  background: linear-gradient(90deg, var(--navy) 70%, var(--orange) 100%);
  border-radius: 2px;
  margin-bottom: 24px;
}

/* Address & subject */
.q-address-block { margin-bottom: 16px; }
.q-address-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 3px; }
.q-address-name  { font-size: 16px; font-weight: 700; color: var(--navy); margin-bottom: 3px; }
.q-address-block div { color: var(--text); }

.q-subject {
  background: #f0f4fa; border-left: 4px solid var(--navy);
  padding: 10px 14px; border-radius: 0 5px 5px 0;
  margin-bottom: 20px; font-size: 13px;
}

/* Intro */
.q-intro { margin-bottom: 24px; color: var(--text); }

/* Section heading */
.q-section-title {
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--navy);
  border-bottom: 1.5px solid var(--border); padding-bottom: 6px; margin-bottom: 12px;
}

/* Lines table */
.q-lines-table {
  width: 100%; border-collapse: collapse; margin-bottom: 20px; font-size: 12.5px;
}
.q-lines-table thead tr { background: var(--navy); color: #fff; }
.q-lines-table th {
  padding: 9px 10px; font-size: 11px; font-weight: 600;
  text-align: left; letter-spacing: .04em;
}
.q-lines-table td {
  padding: 10px 10px; border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.q-lines-table tbody tr:nth-child(even) td { background: #f8fafc; }
.col-ref   { width: 36px;  text-align: center; color: var(--muted); }
.col-model { width: 130px; font-family: 'Courier New', monospace; font-size: 11.5px; }
.col-desc  { /* fills remaining space */ }
.col-qty   { width: 40px;  text-align: center; }
.col-unit  { width: 90px;  text-align: right; font-variant-numeric: tabular-nums; }
.col-total { width: 90px;  text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

/* Totals */
.q-totals { display: flex; justify-content: flex-end; margin-bottom: 28px; }
.q-totals-table { font-size: 13px; }
.q-totals-table td { padding: 5px 0 5px 40px; }
.q-totals-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; min-width: 90px; }
.q-totals-grand td {
  border-top: 2px solid var(--navy); padding-top: 8px;
  font-weight: 800; font-size: 15px; color: var(--navy);
}

/* Notes */
.q-notes {
  font-size: 12px; color: var(--muted); line-height: 1.7;
  margin-bottom: 28px;
}

/* Footer */
.q-footer {
  display: flex; justify-content: space-between; align-items: flex-end;
  border-top: 1.5px solid var(--border); padding-top: 20px; margin-top: 8px;
}
.q-footer-left { font-size: 11.5px; color: var(--muted); line-height: 1.8; }
.q-footer-left p { margin-bottom: 3px; }

.q-parker-badge {
  border: 2px solid var(--orange);
  border-radius: 6px; padding: 8px 14px;
  text-align: center; font-size: 10px; font-weight: 700;
  color: var(--orange); line-height: 1.4; text-transform: uppercase;
  letter-spacing: .06em;
}
.q-parker-badge strong { font-size: 14px; display: block; }
