/* Mondello RFQ — estilo limpio y simple */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #f5f7fa;
  --card: #ffffff;
  --ink: #1e2733;
  --muted: #6b7686;
  --line: #e3e8ef;
  --accent: #1463d8;
  --accent-soft: #e8f0fd;
  --green: #1d9e57;
  --green-soft: #e4f6ec;
  --red: #d43c3c;
  --red-soft: #fdeaea;
  --amber: #c78a08;
  --amber-soft: #fdf3dc;
  --radius: 10px;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--ink); font-size: 14.5px; line-height: 1.45;
}
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--ink); }
img { max-width: 100%; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 18px; }
.login-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 38px 34px; width: 360px; box-shadow: 0 8px 30px rgba(20,40,80,.08); }
.login-card h1 { font-size: 22px; margin-bottom: 4px; }
.login-card .sub { color: var(--muted); margin-bottom: 22px; font-size: 13px; }
.login-card label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 12px 0 4px; }
.login-card input { width: 100%; }
.login-err { color: var(--red); font-size: 13px; margin-top: 10px; }

/* ---------- layout ---------- */
.topbar { background: var(--card); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 0 22px; height: 56px; position: sticky; top: 0; z-index: 50; }
.brand { font-weight: 800; font-size: 16px; letter-spacing: .2px; }
.brand span { color: var(--accent); }
.topbar .role-tag { font-size: 11.5px; background: var(--accent-soft); color: var(--accent); border-radius: 20px; padding: 2px 10px; font-weight: 600; }
.topbar .spacer { flex: 1; }
.lang-switch { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.lang-switch button { border: none; background: transparent; padding: 5px 10px; font-size: 12.5px; color: var(--muted); }
.lang-switch button.on { background: var(--accent); color: #fff; }
.user-chip { font-size: 13px; color: var(--muted); }
.main { max-width: 1240px; margin: 0 auto; padding: 26px 22px 80px; }

/* ---------- componentes ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
h2.page-title { font-size: 20px; margin-bottom: 4px; }
.page-sub { color: var(--muted); margin-bottom: 20px; font-size: 13.5px; }
h3.sec { font-size: 15px; margin-bottom: 12px; }
input[type=text], input[type=email], input[type=number], input[type=date], input[type=password], select, textarea {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
/* los ejemplos/sugerencias se ven claramente distintos a lo que uno escribe */
::placeholder { color: #c3cdda; opacity: 1; font-style: italic; }
textarea { resize: vertical; min-height: 60px; }
label.f { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mt { margin-top: 14px; } .mb { margin-bottom: 14px; }

.btn { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 8px 16px; font-weight: 600; color: var(--ink); }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); color:#fff; }
.btn.primary:disabled { background: #b9c6da; border-color: #b9c6da; cursor: not-allowed; }
.btn.danger { color: var(--red); }
.btn.danger:hover { border-color: var(--red); }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.sm { padding: 4px 10px; font-size: 12.5px; }
.btn.plus { border-style: dashed; color: var(--accent); }

.chip { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 20px; padding: 6px 14px; margin: 3px 6px 3px 0; cursor: pointer; user-select: none; font-size: 13px; background: #fff; }
.chip:hover { border-color: var(--accent); }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.chip small { color: var(--muted); font-weight: 400; margin-left: 5px; }
.chip.on small { color: var(--accent); }

.badge { display: inline-block; font-size: 11.5px; font-weight: 700; border-radius: 20px; padding: 2px 10px; }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.blue { background: var(--accent-soft); color: var(--accent); }
.badge.gray { background: #eef1f5; color: var(--muted); }

.count-dot { display: inline-flex; align-items:center; justify-content:center; min-width: 18px; height: 18px; border-radius: 10px; background: #e3e8ef; color: var(--muted); font-size: 11px; font-weight: 700; padding: 0 5px; margin-left: 6px; }
.count-dot.new { background: var(--red); color: #fff; }

/* tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 20px; }
.tabs button { border: none; background: transparent; padding: 10px 16px; font-weight: 600; color: var(--muted); border-bottom: 2.5px solid transparent; margin-bottom: -2px; display: flex; align-items: center; }
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }

/* tabla */
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--line); }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr.click:hover { background: var(--accent-soft); cursor: pointer; }
.tbl .thumb { width: 42px; height: 42px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background:#fafbfc; }

/* producto multi-columna */
.prod-cols { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 6px; }
.prod-col { min-width: 320px; flex: 1; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: #fbfcfe; position: relative; }
.prod-col .del-prod { position: absolute; top: 10px; right: 10px; }
.photo-drop { border: 1.5px dashed var(--line); border-radius: 8px; height: 110px; display: flex; align-items: center; justify-content: center; color: var(--muted); cursor: pointer; overflow: hidden; background: #fff; font-size: 13px; text-align:center; }
.photo-drop img { width: 100%; height: 100%; object-fit: contain; }
.qty-row { display: flex; gap: 8px; margin-bottom: 6px; align-items: center; }
.mini-x { border: none; background: none; color: var(--red); font-size: 16px; padding: 0 4px; }

/* comparación cotizaciones */
.q-compare { overflow-x: auto; }
.q-compare table { border-collapse: collapse; min-width: 100%; }
.q-compare th, .q-compare td { border: 1px solid var(--line); padding: 8px 12px; font-size: 13px; text-align: left; vertical-align: top; }
.q-compare th { background: #f0f4f9; font-size: 12px; }
.q-compare td.best { background: var(--green-soft); font-weight: 700; }
.q-compare td.worst { background: var(--red-soft); }
.q-compare .sup-head { font-weight: 700; font-size: 13.5px; }

/* dos columnas proveedor */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.two-col > div { padding: 16px; }
.two-col .left { background: #f6f8fb; border-right: 1px solid var(--line); }
.two-col h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 12px; }
.kv { margin-bottom: 8px; font-size: 13.5px; }
.kv b { color: var(--muted); font-weight: 600; font-size: 12px; display: block; }

.price-grid { width: 100%; border-collapse: collapse; margin-top: 6px; }
.price-grid th, .price-grid td { border: 1px solid var(--line); padding: 6px; font-size: 12.5px; }
.price-grid th { background: #f0f4f9; }
.price-grid input { padding: 5px 7px; font-size: 13px; }

.notice { border-radius: 8px; padding: 10px 14px; font-size: 13.5px; margin-bottom: 14px; }
.notice.info { background: var(--accent-soft); color: var(--accent); }
.notice.warn { background: var(--amber-soft); color: var(--amber); }
.notice.err { background: var(--red-soft); color: var(--red); }
.notice.ok { background: var(--green-soft); color: var(--green); }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat-card .n { font-size: 26px; font-weight: 800; }
.stat-card .l { color: var(--muted); font-size: 12.5px; }

.back-link { color: var(--accent); text-decoration: none; font-weight: 600; font-size: 13.5px; cursor: pointer; display: inline-block; margin-bottom: 14px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* admin catálogos */
.cat-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.cat-item { display: inline-flex; align-items: center; gap: 6px; background: #f0f4f9; border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; font-size: 13px; }
.cat-item button { border: none; background: none; color: var(--red); font-weight: 700; }

.attach-list { display:flex; flex-wrap:wrap; gap:8px; margin-top:6px; }
.attach-item { font-size:12.5px; background:#f0f4f9; border-radius:6px; padding:4px 10px; display:inline-flex; gap:6px; align-items:center; }

/* configuración SMTP */
.smtp-card { padding: 0; overflow: hidden; border-color: #d9e2ef; box-shadow: 0 8px 28px rgba(24, 54, 92, .06); }
.smtp-card > h3, .smtp-card > .notice { margin-left: 24px; margin-right: 24px; }
.smtp-card > h3 { margin-top: 24px; font-size: 18px; }
.smtp-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 18px 24px 0; padding: 14px 16px; background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; }
.smtp-summary-copy { display: flex; align-items: center; gap: 11px; min-width: 0; }
.smtp-status-dot { width: 11px; height: 11px; border-radius: 50%; flex: 0 0 auto; background: var(--muted); box-shadow: 0 0 0 4px #eef1f5; }
.smtp-status-dot.on { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.smtp-section { padding: 22px 24px; border-bottom: 1px solid var(--line); }
.smtp-section h4, .smtp-test-panel h4 { font-size: 14px; margin-bottom: 3px; }
.smtp-form-grid { margin-top: 16px; }
.smtp-save-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 24px; background: #fbfcfe; border-bottom: 1px solid var(--line); }
.smtp-test-panel { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(360px, 1.2fr); align-items: end; gap: 28px; margin: 24px; padding: 20px; border: 1px solid #bfe3ce; border-radius: 12px; background: linear-gradient(135deg, #f4fbf7, #fff); }
.smtp-test-controls { min-width: 0; }
.smtp-test-action { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.smtp-test-action .btn { white-space: nowrap; }
.smtp-test-action .btn:disabled { opacity: .65; cursor: wait; }

@media (max-width: 860px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .two-col .left { border-right: none; border-bottom: 1px solid var(--line); }
  .smtp-test-panel { grid-template-columns: 1fr; gap: 14px; }
  .smtp-save-row { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 520px) {
  .smtp-test-action { grid-template-columns: 1fr; }
  .smtp-test-action .btn { width: 100%; }
  .smtp-summary { align-items: flex-start; flex-direction: column; }
}
