/*
  Project     : Email-Deliverability-EF
  File        : static/css/main.css
  Description : App stylesheet governed by marz-ui-template.css plus app mappings.
  Author      : Diego Vázquez (marz.biz)
  Version     : 0.1.0
  © 2026 Marz Automation. All rights reserved.
*/

@import url("/static/css/marz-ui-template.css");

/* Compatibility layer for existing JS hooks and app-specific IDs. */
.app-shell { max-width: 1240px; margin: 14px auto 32px; padding: 0 14px; }
.app-header { margin-bottom: 10px; }
.app-header p { color: var(--muted); }

.tabs { display: flex; gap: 8px; padding: 0 0 12px; border-bottom: 1px solid var(--stroke); margin-bottom: 14px; }
.tab-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid rgba(70, 76, 88, 0.14);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.70);
  color: #566062;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: 140ms ease;
}
.tab-button:hover { border-color: rgba(63, 103, 215, 0.22); color: #304247; transform: translateY(-1px); }
.tab-button.active { background: var(--blue-soft); border-color: var(--blue-border); color: var(--blue); font-weight: 700; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
#action-lists-grid {
  grid-template-columns: 1fr;
}
.metric {
  border: 1px solid var(--stroke);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.86);
  padding: 12px;
}
.metric h3 { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.metric .value { font-size: 26px; font-weight: 700; line-height: 1; letter-spacing: -0.01em; color: var(--text); margin-top: 5px; }
.metrics-breakdown .metric-compact { padding: 10px 11px; min-height: 72px; }
.metrics-breakdown .metric-compact h3 {
  font-size: 10px;
  line-height: 1.25;
  white-space: normal;
  word-break: break-word;
  margin-bottom: 4px;
}
.metrics-breakdown .metric-compact .value {
  font-size: 22px;
  line-height: 1.05;
  white-space: nowrap;
}
.metric-list {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.45;
  max-height: 240px;
  overflow: auto;
}
.metric-list .empty { color: var(--muted); }
.metric-list .item { margin-bottom: 4px; }
.domain-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.domain-metric-card {
  border: 1px solid var(--stroke);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.92);
  padding: 10px 11px;
  min-height: 64px;
}
.domain-metric-card .label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}
.domain-metric-card .value {
  margin-top: 6px;
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-table {
  display: grid;
  gap: 4px;
}
.list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px 56px 64px;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.65);
}
.list-row-two {
  grid-template-columns: minmax(0, 1fr) 72px;
}
.list-head {
  position: sticky;
  top: 0;
  z-index: 1;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: rgba(246, 246, 246, 0.98);
  border: 1px solid var(--stroke);
}
.list-head span:not(:first-child) {
  text-align: center;
}
.domain-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fail-mark {
  text-align: center;
  font-size: 17px;
  font-weight: 800;
  color: #ff1f1f;
}

.button-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.panel h2 { margin-bottom: 10px; }
.button-row { margin-top: 8px; }
.button-row .btn {
  min-width: 0;
  width: auto;
  justify-content: center;
  white-space: nowrap;
}

pre { margin-top: 10px; min-height: 92px; max-height: 280px; overflow: auto; }
.panel pre { width: 100%; }

.quota-row { margin-bottom: 8px; }
.quota-row .label { color: var(--muted); margin-bottom: 4px; display: block; font-size: 12px; }
.bar { width: 100%; height: 10px; border-radius: var(--r-pill); background: #ece8dc; border: 1px solid var(--stroke); overflow: hidden; }
.bar { width: 50%; }
.bar > span { display: block; height: 100%; background: var(--ok); }
.bar > span.warn { background: var(--warn); }
.bar > span.crit { background: var(--error); }
.help-text { color: var(--muted); margin-top: 6px; font-size: 12px; }
.credit-test-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.credit-test-item {
  border: 1px solid var(--stroke);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.8);
  padding: 10px;
}
.credit-test-item h3 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.payload-input {
  width: 100%;
  min-height: 78px;
  border: 1px solid var(--stroke);
  border-radius: var(--r-md);
  background: #fff;
  padding: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  margin-bottom: 8px;
  resize: vertical;
}
.payload-input-single {
  width: 100%;
  border: 1px solid var(--stroke);
  border-radius: var(--r-md);
  background: #fff;
  padding: 8px;
  font-size: 12px;
  margin-bottom: 8px;
}

.canonical-row {
  margin-top: 18px;
  padding-top: 12px;
}

.canonical-inline-form {
  display: grid;
  gap: 10px;
  align-items: center;
}

.canonical-inline-form-manual {
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1fr) auto;
}

.canonical-inline-form-csv {
  grid-template-columns: minmax(260px, 1fr) auto;
}

.canonical-inline-form-filters {
  grid-template-columns: minmax(180px, 1fr) minmax(160px, 0.7fr) minmax(160px, 0.7fr) auto;
}

.canonical-field {
  min-width: 0;
}

.canonical-field .payload-input-single {
  margin-bottom: 0;
  height: 38px;
}

.canonical-field-btn {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}

.canonical-field-btn .btn {
  min-width: 150px;
  height: 38px;
}

#canonical-accounts-table .sh-table-wrap {
  max-height: 560px;
}

.canonical-accounts-table {
  margin-top: 12px;
  overflow: visible;
}

/* Spamhaus visual metrics (Configuracion) */
.panel-spamhaus-visual .spamhaus-visual-root { margin-top: 10px; }
.sh-error {
  padding: 10px 12px;
  border-radius: var(--r-md);
  border: 1px solid rgba(255, 80, 80, 0.35);
  background: rgba(255, 80, 80, 0.08);
  color: #8a1c1c;
  font-size: 13px;
}
.sh-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--stroke);
}
.sh-title { font-size: 14px; font-weight: 700; color: var(--text); }
.sh-meta { font-size: 12px; color: var(--muted); }
.sh-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sh-badge.ok { background: rgba(34, 160, 90, 0.15); color: #1d7a4a; border: 1px solid rgba(34, 160, 90, 0.35); }
.sh-badge.warn { background: rgba(220, 160, 40, 0.18); color: #8a5a00; border: 1px solid rgba(220, 160, 40, 0.4); }
.sh-badge.bad { background: rgba(200, 60, 60, 0.15); color: #a02020; border: 1px solid rgba(200, 60, 60, 0.35); }
.sh-badge.neutral { background: rgba(100, 110, 120, 0.12); color: #4a5058; border: 1px solid var(--stroke); }
.sh-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.sh-kpi {
  border: 1px solid var(--stroke);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.9);
  padding: 10px 11px;
}
.sh-kpi h4 { margin: 0 0 4px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
.sh-kpi .val { font-size: 22px; font-weight: 700; line-height: 1.1; color: var(--text); }
.sh-kpi .sub { font-size: 11px; color: var(--muted); margin-top: 4px; }
.sh-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.sh-chip {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  background: rgba(63, 103, 215, 0.1);
  color: var(--blue);
  border: 1px solid rgba(63, 103, 215, 0.2);
}
.sh-subtitle { font-size: 12px; font-weight: 700; color: var(--muted); margin: 12px 0 8px; text-transform: uppercase; letter-spacing: 0.04em; }
.sh-table-wrap { overflow: auto; max-height: 220px; border: 1px solid var(--stroke); border-radius: var(--r-md); background: #fff; }
.sh-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.sh-table th {
  text-align: left;
  padding: 8px 10px;
  background: rgba(246, 246, 246, 0.98);
  border-bottom: 1px solid var(--stroke);
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  position: sticky;
  top: 0;
}
.sh-table td { padding: 7px 10px; border-bottom: 1px solid rgba(0,0,0,0.06); vertical-align: top; }
.sh-table tr:last-child td { border-bottom: none; }
.sh-dim-grid { display: grid; gap: 6px; margin-top: 8px; }
.sh-dim-row { display: grid; grid-template-columns: 100px 1fr; gap: 8px; align-items: center; font-size: 12px; }
.sh-dim-row span:first-child { color: var(--muted); font-variant: small-caps; }
.sh-dim-bar {
  height: 8px;
  border-radius: 4px;
  background: #ece8dc;
  overflow: hidden;
}
.sh-dim-bar > i {
  display: block;
  height: 100%;
  background: var(--blue);
  border-radius: 4px;
  max-width: 100%;
}
.sh-list-note { font-size: 11px; color: var(--muted); margin-top: 8px; }

@media (max-width: 720px) {
  .button-row .btn { width: auto; min-width: 0; }
  .button-row { gap: 6px; }
  .metrics-breakdown .metric-compact .value { font-size: 18px; }
  .credit-test-grid { grid-template-columns: 1fr; }
  .bar { width: 100%; }
  .sh-dim-row { grid-template-columns: 1fr; }
  .canonical-inline-form,
  .canonical-inline-form-manual,
  .canonical-inline-form-csv,
  .canonical-inline-form-filters { grid-template-columns: 1fr; }
  .canonical-field-btn { width: 100%; }
  .canonical-field-btn .btn { width: 100%; }
}
