:root {
  --bg: #f5f7fa;
  --fg: #1a1a2e;
  --accent: #1d4ed8;
  --border: #e2e8f0;
  --muted: #64748b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
  font-size: 14px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 24px;
  background: #273165;
  color: #fff;
}
.topbar .brand { font-weight: 700; }
.topbar nav { display: flex; gap: 16px; flex: 1; }
.topbar nav a { color: #cbd5e1; }
.topbar .user { color: #cbd5e1; font-size: 13px; }
.topbar .user a { color: #fff; margin-left: 8px; }

.container { max-width: 1200px; margin: 24px auto; padding: 0 20px; }

h1 { font-size: 22px; margin-bottom: 16px; }
h2 { font-size: 17px; margin: 24px 0 12px; }
.muted { color: var(--muted); }

.card {
  max-width: 420px;
  margin: 0 auto;
  padding: 24px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}
.card-narrow { max-width: 380px; }

label { display: block; margin-bottom: 12px; font-size: 13px; color: #475569; }
input, select, button { font: inherit; }
input, select {
  width: 100%;
  padding: 8px 10px;
  margin-top: 4px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
}
button {
  padding: 9px 14px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
button:hover { opacity: .92; }
.btn-ok { background: #16a34a; }
.btn-danger { background: #dc2626; }
.btn-neutral { background: #64748b; }

.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; }
.flash-success { background: #dcfce7; color: #166534; }
.flash-error { background: #fee2e2; color: #991b1b; }
.flash-warning { background: #fef9c3; color: #854d0e; }

.filtros, .form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
}
.filtros input, .filtros select, .form-inline input, .form-inline select {
  width: auto;
  min-width: 150px;
  margin-top: 0;
}

.tabla { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.tabla th, .tabla td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.tabla th { background: #f1f5f9; font-size: 12px; text-transform: uppercase; color: var(--muted); }
.tabla tr:last-child td { border-bottom: 0; }
.vacio { color: var(--muted); padding: 12px; }

.badge { padding: 2px 8px; border-radius: 999px; font-size: 12px; }
.badge-pendiente { background: #fef9c3; color: #854d0e; }
.badge-aprobada { background: #dcfce7; color: #166534; }
.badge-rechazada { background: #fee2e2; color: #991b1b; }

.acciones { margin: 10px 0 18px; }
.acciones form { display: flex; gap: 8px; }

.galeria { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.img-card { background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.img-card img { width: 100%; height: 220px; object-fit: cover; display: block; background: #e2e8f0; }
.img-card figcaption { padding: 8px 10px; display: flex; justify-content: space-between; align-items: center; }
.datos-ia { font-size: 11px; padding: 8px 10px; background: #f8fafc; overflow-x: auto; }

.estado-ia { font-size: 12px; }
.estado-procesada { color: #16a34a; }
.estado-error { color: #dc2626; }
.estado-pendiente { color: #854d0e; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; background: #fff; padding: 16px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.form-grid .full { grid-column: 1 / -1; }

.lista { display: flex; flex-direction: column; gap: 6px; }
.fila { display: flex; gap: 8px; align-items: center; background: #fff; padding: 8px 12px; border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.fila.encabezado { background: #f1f5f9; font-size: 12px; text-transform: uppercase; color: var(--muted); box-shadow: none; }
.fila-form { display: flex; gap: 8px; align-items: center; flex: 1; }
.fila-form input, .fila-form select { margin-top: 0; }
.fila .id { width: 40px; color: var(--muted); }
.fila .estado { width: 90px; font-size: 13px; color: var(--muted); }
.fila .tel { width: 140px; font-size: 12px; color: var(--muted); }
.fila .tel small { display: block; font-size: 11px; margin-top: 2px; }
