/* CFDI Recibidos MX — Office taskpane, tabbed v2 */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --ink: #182230;
  --muted: #667085;
  --primary: #107c41;
  --primary-2: #16a34a;
  --primary-soft: #ecfdf3;
  --border: #e4e7ec;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --amber: #b54708;
  --amber-soft: #fffaeb;
  --ok: #027a48;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 20px rgba(16, 24, 40, .04);
}
* { box-sizing: border-box; }
html, body { min-width: 0; overflow-x: hidden; }
body {
  margin: 0;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #ffffff 0%, var(--bg) 120px);
  font-size: 13px;
}
.hero {
  color: white;
  background: linear-gradient(135deg, #0b5a2e 0%, #107c41 62%, #15a34a 100%);
  padding: 14px 14px 13px;
  box-shadow: 0 10px 26px rgba(16,124,65,.18);
}
.hero h1 { margin: 2px 0 5px; font-size: clamp(19px, 5vw, 23px); line-height: 1.05; letter-spacing: -.02em; }
.hero p { margin: 0; line-height: 1.32; opacity: .92; font-size: 12px; }
.eyebrow { margin: 0; text-transform: uppercase; letter-spacing: .16em; opacity: .72; font-weight: 800; font-size: 10px; }
.tabs {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 10px;
  background: rgba(248,250,252,.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display:none; }
.tab {
  flex: 0 0 auto;
  width: auto;
  min-height: 34px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: #475467;
  font-size: 12px;
  font-weight: 800;
  box-shadow: none;
}
.tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
main { padding: 12px; display: block; min-width: 0; }
.tabPanel { display: none; animation: fade .14s ease-out; }
.tabPanel.active { display: grid; gap: 12px; }
@keyframes fade { from { opacity:.55; transform: translateY(3px);} to {opacity:1; transform:none;} }
.card, .metric {
  background: rgba(255,255,255,.98);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.card { overflow: hidden; }
h2 { margin: 0 0 8px; font-size: 15px; line-height: 1.2; letter-spacing: -.01em; }
.muted { color: var(--muted); font-size: 12px; line-height: 1.42; margin: 0 0 10px; overflow-wrap: anywhere; }
.drop {
  display: grid;
  gap: 4px;
  place-items: center;
  text-align: center;
  min-height: 78px;
  border: 1.5px dashed #cbd5e1;
  border-radius: 14px;
  cursor: pointer;
  background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(248,250,252,.9));
  padding: 12px;
  color: var(--ink);
  margin-top: 10px;
}
.drop strong { display:block; font-size: 13px; color: var(--primary); }
.drop span { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.drop.drag { border-color: var(--primary); background: var(--primary-soft); }
input[type="file"] { display: none; }
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 11px 12px;
  font: 12px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace;
  resize: vertical;
  background: #fff;
  color: var(--ink);
  outline: none;
}
textarea:focus { border-color: rgba(16,124,65,.55); box-shadow: 0 0 0 3px rgba(16,124,65,.10); }
.actions { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 10px; }
.compactActions { margin-top: 6px; }
button, .buttonLike {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  font-size: 12px;
  line-height: 1;
  min-height: 38px;
  box-shadow: 0 1px 1px rgba(16,24,40,.04);
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
button.primary, .buttonLike.primary { background: linear-gradient(180deg, #16a34a, #107c41); color: #fff; border-color: #107c41; }
button:hover, .buttonLike:hover { filter: brightness(.98); }
.grid.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.metricsGrid { margin-top: 12px; }
.metric { text-align: left; padding: 12px; min-height: 76px; display: grid; align-content: center; border-radius: 15px; }
.metric span { display:block; font-weight: 850; font-size: 24px; line-height: 1; color: var(--primary); letter-spacing: -.04em; }
.metric small { color: var(--muted); font-size: 11px; line-height: 1.25; margin-top: 6px; }
.results { display: grid; gap: 8px; margin-top: 10px; min-width: 0; }
.resultBox { border: 1px solid var(--border); border-radius: 14px; padding: 11px; background: #fff; min-width: 0; }
.resultBox h3 { margin: 0 0 7px; font-size: 13px; line-height: 1.3; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.resultBox ul { margin: 6px 0 0; padding: 0; list-style: none; max-height: 180px; overflow: auto; display: grid; gap: 6px; }
.resultBox li { padding: 7px 8px; border: 1px solid #eef2f6; border-radius: 10px; background: var(--surface-soft); font-size: 11.5px; line-height: 1.32; overflow-wrap: anywhere; }
.badge { display: inline-flex; align-items:center; justify-content:center; border-radius: 999px; padding: 3px 8px; font-size: 11px; font-weight: 850; min-width: 26px; }
.ok { background: var(--primary-soft); color: var(--ok); }
.warn { background: var(--amber-soft); color: var(--amber); }
.danger { background: var(--danger-soft); color: var(--danger); }
.tableWrap { overflow: auto; max-height: 390px; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 11px; table-layout: fixed; min-width: 0; }
th, td { border-bottom: 1px solid #eef2f6; text-align: left; padding: 8px 7px; vertical-align: top; overflow-wrap: anywhere; white-space: normal; }
th { position: sticky; top: 0; background: #f8fafc; z-index: 1; color: #475467; font-size: 10px; text-transform: uppercase; letter-spacing: .03em; }
.warning { border-color: #fedf89; background: #fffcf5; }
.warning h2 { color: #93370d; }
code { background: #eef2f6; border-radius: 5px; padding: 1px 5px; overflow-wrap:anywhere; }
@media (min-width: 430px) { .actions { grid-template-columns: repeat(2, minmax(0, 1fr)); } main { padding: 14px; } }
@media (max-width: 340px) { .hero { padding: 13px 12px; } main { padding: 10px; } .grid.two { grid-template-columns: 1fr; } }
