/* =====================================================================
   BlindNote - Hoja de estilos · Diseno sobrio (plano, neutro, 1 acento)
   ===================================================================== */
:root {
    --fondo:        #f6f7f8;
    --panel:        #ffffff;
    --panel-suave:  #f3f4f6;
    --borde:        #e3e5e8;
    --borde-fuerte: #c9cdd2;
    --texto:        #1a1d21;
    --texto-fuerte: #111418;
    --texto-suave:  #5f6b76;
    --primario:     #17181c;  /* botones en tinta */
    --acento:       #1d4ed8;  /* azul para enlaces y focos */
    --ok:           #15803d;
    --error:        #b91c1c;
    --aviso:        #b45309;
    --radio:        8px;
    --radio-sm:     6px;
    --sombra:       0 1px 2px rgba(16, 24, 40, .05);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    background: var(--fondo);
    color: var(--texto);
    line-height: 1.55;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

.contenedor { width: min(1120px, 94%); margin-inline: auto; }
main.contenedor { flex: 1; padding: 2rem 0 3rem; }

h1, h2, h3 { line-height: 1.3; color: var(--texto-fuerte); }
h2 { font-size: 1.05rem; margin-top: 0; letter-spacing: -.01em; }

/* ------------------------- Barra superior ------------------------- */
.topbar {
    background: var(--panel);
    border-bottom: 1px solid var(--borde);
    position: sticky; top: 0; z-index: 20;
}
.topbar__inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; padding: .7rem 0; flex-wrap: wrap;
}
.marca {
    display: flex; align-items: center; gap: .5rem;
    color: var(--texto-fuerte); font-weight: 700; font-size: 1rem; letter-spacing: -.01em;
}
.marca:hover { text-decoration: none; }
.marca__logo {
    display: grid; place-items: center;
    width: 28px; height: 28px; border-radius: 6px;
    background: var(--texto-fuerte); color: #fff;
    font-size: .85rem; font-weight: 800;
}
.nav { display: flex; align-items: center; gap: .15rem; flex-wrap: wrap; }
.nav a {
    color: var(--texto-suave); font-weight: 600; font-size: .9rem;
    padding: .35rem .65rem; border-radius: 6px; transition: background .12s ease, color .12s ease;
}
.nav a:hover { color: var(--texto-fuerte); background: var(--panel-suave); text-decoration: none; }
.nav a.activo { color: var(--texto-fuerte); background: var(--panel-suave); }
.nav a.btn--primario { color: #fff; }
.nav a.btn--primario:hover { color: #fff; background: #2e3036; }
.nav__usuario {
    color: var(--texto-suave); font-size: .88rem; font-weight: 600;
    padding: 0 .5rem;
}
.nav__usuario em { font-weight: 400; font-style: normal; opacity: .75; }
.inline { display: inline; }

/* ------------------------- Botones ------------------------- */
.btn {
    display: inline-block; border: 1px solid transparent; cursor: pointer;
    padding: .55rem 1rem; border-radius: var(--radio-sm);
    font-weight: 600; font-size: .9rem; font-family: inherit;
    transition: background .12s ease, border-color .12s ease, color .12s ease;
    text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn--primario { background: var(--primario); color: #fff; }
.btn--primario:hover { background: #2e3036; }
.btn--primario:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; }
.btn--peligro { background: #fff; color: var(--error); border-color: var(--borde-fuerte); }
.btn--peligro:hover { background: #fef2f2; border-color: #fca5a5; }
.btn--sm { padding: .32rem .7rem; font-size: .82rem; }
.btn--block { display: block; width: 100%; text-align: center; margin-top: .5rem; }

/* ------------------------- Tarjetas ------------------------- */
.tarjeta {
    background: var(--panel);
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    padding: 1.35rem 1.5rem;
    margin-bottom: 1.5rem;
}
.grid { display: grid; gap: 1rem; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid--3 .tarjeta { margin-bottom: 0; }

.enlace-tarjeta {
    display: block; color: var(--texto); margin-bottom: 1.5rem;
    transition: border-color .12s ease;
}
.enlace-tarjeta:hover { text-decoration: none; border-color: var(--borde-fuerte); }
.enlace-tarjeta h3 { margin-top: 0; font-size: .98rem; color: var(--texto-fuerte); }
.enlace-tarjeta p { color: var(--texto-suave); font-size: .88rem; margin-bottom: 0; }

.encabezado-seccion { margin-bottom: 1.5rem; }
.encabezado-seccion h1 { font-size: 1.5rem; margin: 0 0 .2rem; letter-spacing: -.01em; }
.encabezado-seccion p { color: var(--texto-suave); margin: 0; font-size: .92rem; }

/* ------------------------- Estadisticas ------------------------- */
.stat { margin-bottom: 0; padding: 1rem 1.2rem; }
.stat__num { display: block; font-size: 1.15rem; font-weight: 700; color: var(--texto-fuerte); word-break: break-word; }
.stat__etiq { display: block; color: var(--texto-suave); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; margin-top: .25rem; }

/* ------------------------- Formularios ------------------------- */
.campo { margin-bottom: 1rem; }
.campo label { display: block; font-weight: 600; margin-bottom: .3rem; font-size: .87rem; color: var(--texto-fuerte); }
.campo input, .campo textarea {
    width: 100%; padding: .58rem .75rem; border-radius: var(--radio-sm);
    border: 1px solid var(--borde-fuerte); background: #fff; color: var(--texto);
    font-family: inherit; font-size: .92rem; transition: border-color .12s ease, box-shadow .12s ease;
}
.campo input:focus, .campo textarea:focus {
    outline: none; border-color: var(--acento);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, .12);
}
.campo textarea { resize: vertical; }
.ayuda { display: block; color: var(--texto-suave); font-size: .8rem; margin-top: .3rem; }

/* ------------------------- Autenticacion ------------------------- */
.auth { display: flex; justify-content: center; padding-top: 2.5rem; }
.auth__card { width: min(420px, 100%); margin-bottom: 0; }
.auth__titulo { margin: 0 0 .2rem; text-align: center; font-size: 1.35rem; }
.auth__subtitulo { text-align: center; color: var(--texto-suave); margin: 0 0 1.3rem; font-size: .88rem; }
.auth__pie { text-align: center; color: var(--texto-suave); font-size: .88rem; margin-top: 1rem; }

/* ------------------------- Alertas ------------------------- */
.alerta { border-radius: var(--radio-sm); padding: .75rem .95rem; margin-bottom: 1.2rem; border: 1px solid; font-size: .9rem; }
.alerta ul { margin: 0; padding-left: 1.1rem; }
.alerta--error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alerta--ok    { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alerta--info  { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

/* ------------------------- Listas ------------------------- */
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { padding: .45rem 0; border-bottom: 1px solid var(--borde); font-size: .9rem; }
.checklist li:last-child { border-bottom: 0; }
.ok { color: var(--ok); font-weight: 700; margin-right: .45rem; }

.pasos { padding-left: 1.2rem; }
.pasos li { margin-bottom: .5rem; font-size: .9rem; }
code {
    font-family: Consolas, "Courier New", monospace;
    background: var(--panel-suave); padding: .1rem .4rem; border-radius: 4px;
    color: var(--texto); font-size: .87em;
    border: 1px solid var(--borde);
}

/* ------------------------- Notas ------------------------- */
.lista-notas { list-style: none; padding: 0; margin: 0; }
.nota {
    display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start;
    padding: .8rem .9rem; border: 1px solid var(--borde);
    border-radius: var(--radio-sm); margin-bottom: .75rem; background: var(--panel);
}
.nota__cuerpo p { margin: .3rem 0 .35rem; color: var(--texto); white-space: pre-wrap; word-break: break-word; font-size: .92rem; }
.nota__fecha { color: var(--texto-suave); font-size: .76rem; }
.vacio { color: var(--texto-suave); font-style: italic; }

/* ------------------------- Tablas ------------------------- */
.tabla-wrap { overflow-x: auto; }
.tabla { width: 100%; border-collapse: collapse; font-size: .87rem; }
.tabla th, .tabla td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--borde); vertical-align: top; }
.tabla th { background: var(--panel); color: var(--texto-suave); text-transform: uppercase; font-size: .7rem; letter-spacing: .05em; border-bottom: 1px solid var(--borde-fuerte); }
.tabla tbody tr:hover td { background: var(--panel-suave); }

/* ------------------------- Etiquetas / severidad ------------------------- */
.badge { padding: .12rem .5rem; border-radius: 4px; font-size: .74rem; font-weight: 600; display: inline-block; }
.badge--admin   { background: #eef2ff; color: #4338ca; }
.badge--usuario { background: #f1f5f9; color: #475569; }
.badge--ok      { background: #f0fdf4; color: #15803d; }

.sev { padding: .1rem .45rem; border-radius: 4px; font-size: .72rem; font-weight: 700; white-space: nowrap; display: inline-block; }
.sev--critica { background: #ffe4e4; color: #b91c1c; }
.sev--alta    { background: #ffedd5; color: #c2410c; }
.sev--media   { background: #fef9c3; color: #a16207; }
.sev--baja    { background: #e0f2fe; color: #0369a1; }

/* ------------------------- Pie de pagina ------------------------- */
.footer {
    background: var(--panel); color: var(--texto-suave);
    border-top: 1px solid var(--borde);
    padding: 1.2rem 0; margin-top: 2rem; font-size: .83rem;
}
.footer p { margin: .2rem 0; }
.footer__meta { font-size: .76rem; opacity: .8; }

@media (max-width: 640px) {
    .nav { gap: .1rem; }
    .encabezado-seccion h1 { font-size: 1.25rem; }
}
