/* Panel interno de cotizaciones. Independiente del template Spirex del sitio
   publico: aqui no hay jQuery ni Bootstrap. */

:root {
  --brand: #d42a56;
  --ink: #111;
  --muted: #6b6b6b;
  --line: #e4e4e4;
  --bg: #f4f4f5;
}

* {
  box-sizing: border-box;
}

/* El atributo `hidden` se apoya en el `display:none` del navegador, y cualquier
   regla de autor que fije `display` lo anula (p. ej. `label` o `.actions` mas
   abajo). Esta regla lo vuelve a imponer. */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 24px;
  background: var(--ink);
  color: #fff;
  border-bottom: 3px solid var(--brand);
}

.topbar h1 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-right form {
  margin: 0;
}

.topbar .who {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
}

.linkish {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: underline;
  cursor: pointer;
}

.linkish:hover {
  color: #fff;
}

/* Login ----------------------------------------------------------------- */

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  margin: 0;
  text-align: center;
}

.login-logo {
  width: 150px;
  height: auto;
  margin: 4px auto 18px;
  display: block;
}

.login-card h1 {
  margin: 0 0 4px;
  font-size: 19px;
  font-weight: 600;
}

.login-card .hint {
  margin: 0 0 22px;
}

.login-card label {
  text-align: left;
  margin-bottom: 14px;
}

.btn.block {
  width: 100%;
  margin-top: 4px;
}

main {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  margin-bottom: 18px;
}

.card h2 {
  margin: 0 0 16px;
  font-size: 12px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

label {
  display: block;
  font-size: 13px;
  color: var(--muted);
}

label.full {
  margin-top: 14px;
}

input,
textarea,
select {
  width: 100%;
  margin-top: 5px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: #fff;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(212, 42, 86, 0.12);
}

/* Conceptos ------------------------------------------------------------- */

.table-scroll {
  overflow-x: auto;
}

#itemsTable {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

#itemsTable th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 8px 8px;
  font-weight: 700;
}

#itemsTable th.col-qty,
#itemsTable th.col-price,
#itemsTable th.col-amount {
  text-align: right;
}

#itemsTable td {
  padding: 6px 8px;
  border-top: 1px solid var(--line);
  vertical-align: top;
}

#itemsTable .col-qty,
#itemsTable .col-price {
  width: 130px;
}

#itemsTable .col-amount {
  width: 130px;
}

#itemsTable .col-actions {
  width: 44px;
}

#itemsTable td.amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
  padding-top: 16px;
  color: var(--muted);
}

#itemsTable .qty,
#itemsTable .price {
  text-align: right;
}

.remove {
  margin-top: 8px;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.remove:hover {
  border-color: var(--brand);
  color: var(--brand);
}

/* Totales --------------------------------------------------------------- */

.totals {
  margin-top: 18px;
  margin-left: auto;
  width: 280px;
  max-width: 100%;
}

.totals div {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 14px;
  color: var(--muted);
}

.totals b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.totals .grand {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 2px solid var(--brand);
  font-size: 17px;
}

.totals .grand b {
  font-size: 19px;
}

/* Acciones -------------------------------------------------------------- */

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.btn {
  padding: 11px 22px;
  border-radius: 5px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn.primary {
  background: var(--ink);
  color: #fff;
}

.btn.primary:hover:not(:disabled) {
  background: var(--brand);
}

.btn.primary:disabled {
  opacity: 0.55;
  cursor: default;
}

.btn.ghost {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.btn.ghost:hover {
  border-color: var(--brand);
  color: var(--brand);
}

/* Vista previa ---------------------------------------------------------- */

.preview iframe {
  width: 100%;
  height: 780px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.hint {
  margin: -8px 0 14px;
  font-size: 13px;
  color: var(--muted);
}

.hint.recipients {
  margin: 14px 0 0;
}

/* Avisos ---------------------------------------------------------------- */

.notice {
  margin-top: 16px;
  padding: 11px 14px;
  border-radius: 5px;
  font-size: 14px;
  border: 1px solid;
}

.notice.error {
  background: #fdf2f5;
  border-color: #f2c2ce;
  color: #a01840;
}

.notice.ok {
  background: #f0f9f2;
  border-color: #bfe3c8;
  color: #1d6b33;
}

@media (max-width: 640px) {
  .card {
    padding: 16px;
  }

  .preview iframe {
    height: 520px;
  }
}
