/* ─────────────────────────────────────────────────────────
   Cotizador SIO — Estilos Globales
   Colores corporativos: #00AEFC · #200F96 · #FD00BF
───────────────────────────────────────────────────────── */

/* ── Variables ──────────────────────────────────────── */
:root {
  --c1: #00AEFC;
  --c2: #200F96;
  --c3: #FD00BF;
  --c2l: #2f15d0;
  --c1d: #0090d4;
  --bg: #f0f7ff;
  --border: #dde6f5;
  --text: #1e2340;
  --muted: #64748b;
  --shadow: 0 2px 12px rgba(32, 15, 150, .10);
  --shadow-lg: 0 8px 32px rgba(32, 15, 150, .16);
}

/* ── Reset ──────────────────────────────────────────── */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Header ─────────────────────────────────────────── */
.app-header {
  background: linear-gradient(110deg, var(--c2) 0%, #2a16b8 45%, var(--c1) 100%);
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-lg);
}

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

.brand-logo {
  height: 46px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, .12);
  border: 2px solid rgba(255, 255, 255, .3);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-bar {
  width: 5px;
  height: 36px;
  background: var(--c3);
  border-radius: 3px;
}

.brand-text h1 {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
}

.brand-text p {
  font-size: 12px;
  color: rgba(255, 255, 255, .7);
  margin-top: 1px;
}

.header-badge {
  font-size: 12px;
  color: rgba(255, 255, 255, .6);
  text-align: right;
}

.header-badge b {
  color: #fff;
  display: block;
  font-size: 13px;
}

/* ── Layout ─────────────────────────────────────────── */
.container {
  max-width: 1380px;
  margin: 0 auto;
  padding: 26px 18px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: start;
}

@media (max-width: 1060px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* ── Cards ──────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 18px;
}

.card:last-child {
  margin-bottom: 0;
}

.card-head {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-head.blue { background: linear-gradient(110deg, var(--c2), var(--c2l)); color: #fff; }
.card-head.cyan { background: linear-gradient(110deg, var(--c1), var(--c2)); color: #fff; }
.card-head.dark { background: linear-gradient(110deg, #14095a, var(--c2)); color: #fff; }

.card-head-icon {
  width: 30px;
  height: 30px;
  background: rgba(255, 255, 255, .18);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.card-head-title {
  font-size: 14px;
  font-weight: 700;
}

.card-body {
  padding: 20px;
}

/* ── Form Inputs ────────────────────────────────────── */
.fg-grid   { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fg-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

.fg {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.fg.full {
  grid-column: 1 / -1;
}

.fg label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.fg input,
.fg select {
  padding: 9px 13px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--text);
  background: #fff;
  font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
}

.fg input:focus,
.fg select:focus {
  outline: none;
  border-color: var(--c1);
  box-shadow: 0 0 0 3px rgba(0, 174, 252, .13);
}

.fg input::placeholder {
  color: #b0bdd0;
}

/* ── Roles Table ────────────────────────────────────── */
.roles-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.roles-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--c2);
}

.btn-add {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  background: linear-gradient(110deg, var(--c1), var(--c2));
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .2s, transform .1s;
}

.btn-add:hover {
  opacity: .88;
  transform: translateY(-1px);
}

.tbl-wrapper {
  border: 2px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.tbl {
  width: 100%;
  border-collapse: collapse;
}

.tbl thead tr {
  background: linear-gradient(110deg, var(--c2), var(--c2l));
}

.tbl th {
  padding: 9px 13px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  text-align: left;
}

.tbl th.tc {
  text-align: center;
}

.tbl tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}

.tbl tbody tr:last-child {
  border-bottom: none;
}

.tbl tbody tr:hover {
  background: #f4f8ff;
}

.tbl td {
  padding: 7px 12px;
}

.tbl td input {
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 6px 9px;
  font-size: 13px;
  width: 100%;
  font-family: inherit;
  color: var(--text);
}

.tbl td input:focus {
  outline: none;
  border-color: var(--c1);
  box-shadow: 0 0 0 2px rgba(0, 174, 252, .12);
}

.tbl td.tc {
  text-align: center;
}

.btn-del {
  width: 26px;
  height: 26px;
  background: #fee2e2;
  color: #ef4444;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: background .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: auto;
}

.btn-del:hover {
  background: #fecaca;
}

.totals-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 9px;
  font-size: 13px;
  color: var(--muted);
}

.totals-row strong {
  color: var(--text);
}

.tier-pill {
  padding: 2px 10px;
  background: linear-gradient(110deg, var(--c1), var(--c2));
  color: #fff;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}

/* ── Advanced Settings Panel ────────────────────────── */
.btn-settings {
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all .2s;
}

.btn-settings:hover {
  border-color: var(--c1);
  color: var(--c1);
}

.settings-box {
  display: none;
  margin-top: 14px;
  background: #f4f8ff;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 18px;
}

.settings-box.open {
  display: block;
}

.settings-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--c2);
  text-transform: uppercase;
  letter-spacing: .7px;
  margin-bottom: 11px;
}

.settings-divider {
  height: 1px;
  background: var(--border);
  margin: 14px 0;
}

.cost-preview {
  background: linear-gradient(110deg, var(--c2), var(--c2l));
  color: #fff;
  border-radius: 9px;
  padding: 12px 16px;
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.cp-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cp-label {
  font-size: 10px;
  opacity: .7;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.cp-val {
  font-size: 14px;
  font-weight: 800;
}

/* ── Action Buttons ─────────────────────────────────── */
.actions {
  display: flex;
  gap: 12px;
  margin-top: 18px;
  justify-content: center;
}

.btn-pdf {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 30px;
  background: linear-gradient(110deg, var(--c2), var(--c1));
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 174, 252, .35);
  transition: all .2s;
}

.btn-pdf:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(0, 174, 252, .45);
}

.btn-pdf:active {
  transform: none;
}

.btn-pdf:disabled {
  opacity: .65;
  cursor: not-allowed;
  transform: none;
}

.btn-reset {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  background: #fff;
  color: var(--muted);
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}

.btn-reset:hover {
  border-color: var(--c1);
  color: var(--c1);
}

/* ── Preview Panel ──────────────────────────────────── */
.preview-sticky {
  position: sticky;
  top: 20px;
}

/* ─────────────────────────────────────────────────────
   QUOTE DOCUMENT STYLES
   Usados tanto en la vista previa como en el PDF
───────────────────────────────────────────────────── */

.qdoc {
  font-family: 'Segoe UI', sans-serif;
  font-size: 12.5px;
  color: #1a1a2e;
  background: #fff;
}

/* Header del documento */
.qhead {
  background: linear-gradient(110deg, #1a0a80, #200F96 50%, #00AEFC);
  color: #fff;
  padding: 22px 28px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.qhead-brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.qhead-logo {
  height: 44px;
  width: auto;
  display: block;
  object-fit: contain;
}

.qhead-nit {
  font-size: 10.5px;
  opacity: .7;
  letter-spacing: .3px;
}

/* Portada de página completa */
.qcover {
  width: 100%;
  line-height: 0;
  overflow: hidden;
}

.qcover img {
  width: 100%;
  height: 380px;
  display: block;
  object-fit: cover;
  object-position: center top;
}
.qlabel        { font-size: 10px; opacity: .65; text-transform: uppercase; letter-spacing: 1px; }
.qnum          { font-size: 19px; font-weight: 900; margin-top: 2px; }
.qdate         { font-size: 11px; opacity: .82; margin-top: 3px; }

/* Barra de acento */
.qabar {
  height: 4px;
  background: linear-gradient(90deg, #FD00BF, #00AEFC 50%, #FD00BF);
}

/* Cuerpo del documento */
.qbody {
  padding: 22px 28px;
}

.qsection {
  font-size: 10.5px;
  font-weight: 800;
  color: #200F96;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 2.5px solid #00AEFC;
  padding-bottom: 5px;
  margin-bottom: 12px;
  margin-top: 20px;
}

.qsection:first-child {
  margin-top: 0;
}

/* Datos del cliente */
.qclient-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 20px;
}

.qci label {
  font-size: 9.5px;
  font-weight: 700;
  color: #8898aa;
  text-transform: uppercase;
  display: block;
}

.qci span {
  font-size: 12.5px;
  font-weight: 600;
  color: #1a1a2e;
}

/* Caja de descripción del servicio */
.qservice-box {
  background: linear-gradient(110deg, #f0f7ff, #e6f0ff);
  border-left: 4px solid #200F96;
  border-radius: 8px;
  padding: 13px 16px;
  page-break-inside: avoid;
  break-inside: avoid;
}

.qservice-title { font-size: 13.5px; font-weight: 800; color: #200F96; margin-bottom: 4px; }
.qservice-desc  { font-size: 11.5px; color: #4a5568; line-height: 1.5; }

.qservice-meta {
  display: flex;
  gap: 20px;
  margin-top: 9px;
  flex-wrap: wrap;
}

.qmeta {
  font-size: 12px;
  color: #200F96;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Tabla de roles */
.qtable {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  page-break-inside: avoid;
  break-inside: avoid;
}

.qtable thead tr { background: linear-gradient(110deg, #200F96, #2f15d0); }

.qtable th {
  padding: 9px 11px;
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  text-align: left;
}

.qtable th.r { text-align: right; }
.qtable th.c { text-align: center; }

.qtable td { padding: 8px 11px; }
.qtable td.r { text-align: right; }
.qtable td.c { text-align: center; }

.qtable tbody tr { border-bottom: 1px solid #e8eef7; }
.qtable tbody tr:nth-child(even) { background: #f7faff; }

.qtable tfoot tr { background: #ecf3ff; }
.qtable tfoot td { padding: 9px 11px; font-weight: 700; color: #200F96; }

/* Tabla resumen de costos */
.qsum-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  page-break-inside: avoid;
  break-inside: avoid;
}

.qsum-table tr  { border-bottom: 1px solid #e8eef7; }
.qsum-table td  { padding: 9px 12px; }
.qsum-table td.r { text-align: right; font-weight: 600; }

/* Lista de incluidos */
.qincludes {
  background: linear-gradient(110deg, #f0f8ff, #e4f4ff);
  border: 1px solid #cce8ff;
  border-radius: 9px;
  padding: 14px 16px;
  page-break-inside: avoid;
  break-inside: avoid;
}

.qinclude-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: #2d3748;
  margin-bottom: 7px;
  line-height: 1.45;
}

.qinclude-item:last-child {
  margin-bottom: 0;
}

.qcheck {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  background: #00AEFC;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  margin-top: 1px;
}

/* Nota al pie del documento */
.qnote {
  margin-top: 14px;
  page-break-inside: avoid;
  break-inside: avoid;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 11px;
  color: #92400e;
}

/* Footer del documento */
.qfooter {
  background: linear-gradient(110deg, #12076e, #200F96);
  color: rgba(255, 255, 255, .7);
  padding: 14px 28px;
  text-align: center;
  font-size: 11px;
}

.qfooter-hi {
  color: #FD00BF;
  font-weight: 700;
}

/* ── Empty State ────────────────────────────────────── */
.empty {
  text-align: center;
  padding: 50px 20px;
  color: var(--muted);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.empty p {
  font-size: 14px;
  line-height: 1.6;
}

/* ── Notification Toast ─────────────────────────────── */
.notif {
  position: fixed;
  bottom: 22px;
  right: 22px;
  background: var(--c2);
  color: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
  transform: translateY(80px);
  opacity: 0;
  transition: all .3s ease;
  z-index: 9999;
  max-width: 320px;
}

.notif.show { transform: none; opacity: 1; }
.notif.ok   { background: #059669; }
.notif.err  { background: #dc2626; }
