/* =========================
   RESET Y BASE
========================= */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f3f4f6;
    color: #111827;
    font-size: 14px;
}

/* =========================
   HEADER
========================= */
.header {
    background: #111827;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    margin: 0;
    font-size: 20px;
}

/* =========================
   CONTENEDOR
========================= */
.container {
    padding: 20px;
    width: 100%;
}

.container.narrow {
    max-width: 560px;
}

/* =========================
   CARDS
========================= */
.card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* =========================
   TIPOGRAFÍA
========================= */
h1, h2, h3 {
    margin-top: 0;
    color: #111827;
}

h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }

small {
    display: block;
    color: #6b7280;
    font-size: 12px;
    margin-top: -10px;
    margin-bottom: 12px;
}

p {
    margin: 6px 0;
    line-height: 1.5;
}

/* =========================
   BOTONES
========================= */
.btn {
    display: inline-block;
    padding: 8px 14px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    margin: 4px 4px 4px 0;
    transition: background 0.15s;
}

.btn:hover { background: #1d4ed8; }

.btn-danger { background: #dc2626; }
.btn-danger:hover { background: #b91c1c; }

.btn-success { background: #16a34a; }
.btn-success:hover { background: #15803d; }

.btn-secondary { background: #6b7280; }
.btn-secondary:hover { background: #4b5563; }

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

.btn-full {
    width: 100%;
    text-align: center;
    padding: 10px;
}

/* =========================
   FORMULARIOS
========================= */
label {
    display: block;
    font-weight: bold;
    margin-bottom: 4px;
    font-size: 14px;
    color: #374151;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 9px;
    margin-bottom: 14px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    font-size: 14px;
    color: #111827;
    background: white;
    transition: border-color 0.15s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

textarea {
    height: 90px;
    resize: vertical;
}

input[type="hidden"] {
    display: none;
}

/* =========================
   INFO BOX (solo lectura)
========================= */
.info-box {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.6;
}

/* =========================
   TABLAS
========================= */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

th, td {
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    font-size: 14px;
}

th {
    background: #f9fafb;
    font-weight: bold;
    color: #374151;
}

tr:hover {
    background: #f9fafb;
}

/* =========================
   STATUS
========================= */
.status-active  { color: #16a34a; font-weight: bold; }
.status-blocked { color: #dc2626; font-weight: bold; }

/* =========================
   BADGES
========================= */
.badge-mfa {
    background: #dbeafe;
    color: #1d4ed8;
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 11px;
    font-weight: bold;
}

/* =========================
   MENSAJES
========================= */
.msg-success {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
}

.msg-error {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
}

.msg-info {
    background: #dbeafe;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
}

.msg-warn {
    background: #fef9c3;
    color: #854d0e;
    border: 1px solid #fde047;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
}

/* =========================
   FILAS ESPECIALES
========================= */
.self-row { background: #fefce8 !important; }

/* =========================
   LOGO (login)
========================= */
.logo {
    font-size: 22px;
    font-weight: bold;
    color: #2563eb;
    margin-bottom: 10px;
}

/* =========================
   UTILIDADES
========================= */
.text-muted  { color: #6b7280; }
.text-center { text-align: center; }
.mt-10 { margin-top: 10px; }
.mb-10 { margin-bottom: 10px; }
hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 16px 0;
}

/* =========================
   LOGIN (centrado)
========================= */
body.login-page {
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

body.login-page .card {
    width: 320px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

body.login-page input {
    margin-bottom: 10px;
}

body.login-page .error {
    color: #dc2626;
    font-size: 14px;
    margin-bottom: 10px;
}