* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f6f8;
  color: #1f2937;
}
.topbar {
  background: #0f172a;
  color: #fff;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.brand { font-weight: 600; font-size: 16px; }
.topbar nav { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.topbar nav a { color: #cbd5e1; text-decoration: none; font-size: 14px; }
.topbar nav a:hover { color: #fff; }
.topbar .user { color: #94a3b8; font-size: 13px; }
.topbar .logout { color: #f87171; }

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

.flash {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 14px;
}
.flash-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.flash-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.flash-info    { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

.card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  padding: 24px;
  margin-bottom: 16px;
}

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #e5e7eb; }
th { background: #f9fafb; font-weight: 600; color: #374151; font-size: 12px; text-transform: uppercase; }
tr:hover { background: #fafafa; }

.badge {
  display: inline-block; padding: 3px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
}
.badge-0 { background: #fef3c7; color: #92400e; } /* pendiente */
.badge-1 { background: #d1fae5; color: #065f46; } /* procesada */
.badge-2 { background: #fee2e2; color: #991b1b; } /* fallida */

.btn {
  display: inline-block; padding: 8px 14px; border-radius: 6px;
  border: none; cursor: pointer; font-size: 13px; font-weight: 500;
  text-decoration: none; transition: all .15s;
}
.btn-primary  { background: #2563eb; color: #fff; }
.btn-primary:hover  { background: #1d4ed8; }
.btn-success  { background: #16a34a; color: #fff; }
.btn-danger   { background: #dc2626; color: #fff; }
.btn-secondary{ background: #e5e7eb; color: #1f2937; }

input[type=text], input[type=password], input[type=email],
input[type=number], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #d1d5db;
  border-radius: 6px; font-size: 14px; font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
label { display: block; font-size: 12px; font-weight: 600; color: #374151; margin-bottom: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 14px; }
.form-row.full { grid-template-columns: 1fr; }

/* Login */
.login-box {
  max-width: 380px; margin: 80px auto; background: #fff;
  padding: 32px; border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,.08);
}
.login-box h1 { margin: 0 0 24px; font-size: 20px; text-align: center; }

.footer { text-align: center; padding: 24px; color: #6b7280; }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 12px; }
.search input { width: 280px; }

.actions-cell { white-space: nowrap; display: flex; gap: 6px; }
.actions-cell form { display: inline; margin: 0; }
