:root {
  --primary: #096bec;
  --secondary: #0f5ca3;
  --accent: #22c55e;
  --danger: #ec0909;

  --bg: #f4f6f9;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;

  --radius: 12px;
  --shadow: 0 10px 22px rgba(0,0,0,.06);

  --header-h: 56px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.header-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--border);
  display: none;
}

.header-title {
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 52vw;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f3f4f6;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  max-width: 46vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chip strong { font-weight: 700; }

.btn {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 600;
  background: #fff;
  color: var(--text);
  line-height: 1;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--primary);
  border-color: transparent;
  color: #fff;
}

.btn-danger {
  background: var(--danger);
  border-color: transparent;
  color: #fff;
}

.btn-secondary { background: #eef2ff; }

/* ✅ FULL WIDTH (opción 1): sin “container” fijo */
.main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 14px;
  padding-top: calc(var(--header-h) + 14px);
}

.card {
  background: #fff;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,.02);
}

h2, h3 { margin: 0 0 12px 0; }

.field { display: grid; gap: 6px; margin-bottom: 12px; }

.label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.input, select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 12px;
  font-size: 16px; /* iOS no zoom */
  outline: none;
  background: #fff;
}

.input:focus, select:focus {
  border-color: rgba(9,107,236,.35);
  box-shadow: 0 0 0 3px rgba(9,107,236,.12);
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.actions .btn { flex: 1 1 180px; }

@media (max-width: 420px) {
  .header-title { max-width: 44vw; }
  .chip { display: none; }
}

/* ---------- Informe list UI ---------- */
.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.toolbar-left {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f9fafb;
  font-size: 12px;
  font-weight: 700;
}

.badge-ok {
  border-color: rgba(34,197,94,.25);
  background: rgba(34,197,94,.10);
  color: #14532d;
}

.badge-pend {
  border-color: rgba(245,158,11,.25);
  background: rgba(245,158,11,.12);
  color: #7c2d12;
}

.list {
  display: grid;
  gap: 12px;
}

.inf-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(0,0,0,.05);
}

.inf-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}

.inf-title {
  font-weight: 800;
  margin: 0;
  font-size: 15px;
}

.inf-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.inf-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

.btn-small {
  padding: 7px 10px;
  font-size: 12px;
}

.details {
  margin-top: 10px;
  border-top: 1px dashed var(--border);
  padding-top: 10px;
  display: none;
}

.details.show { display: block; }

.ul-clean {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.det-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: #f9fafb;
  border: 1px solid rgba(0,0,0,.03);
}

.det-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.det-state {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  opacity: .9;
}

.det-state.ok { color: #166534; }
.det-state.pend { color: #92400e; }

.skel {
  height: 14px;
  border-radius: 10px;
  background: #eef2f7;
  margin: 8px 0;
  overflow: hidden;
  position: relative;
}
.skel::after {
  content: "";
  position: absolute;
  top: 0; left: -40%;
  width: 40%; height: 100%;
  background: rgba(255,255,255,.55);
  animation: shimmer 1.2s infinite;
}
@keyframes shimmer {
  0% { left: -40%; }
  100% { left: 110%; }
}

/* Toast */
.toast {
  position: fixed;
  bottom: 18px;
  right: 18px;
  left: 18px;
  max-width: 520px;
  margin-left: auto;
  background: #111;
  color: #fff;
  padding: 12px 14px;
  border-radius: 14px;
  opacity: 0;
  transition: opacity .25s;
  z-index: 400;
}
.toast.show { opacity: 1; }
