/* ==========================================================================
   ESTILOS DE APLICACIÓN
   Consume los tokens definidos en tokens.css (colores, tipografía, espaciado,
   radios) — no declara valores propios. Ver también fonts.css.
   ========================================================================== */

* {
    box-sizing: border-box;
}

.icono {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke: currentColor;
}

body {
    margin: 0;
    font-family: var(--font-ui);
    font-size: var(--text-base);
    color: var(--ink-900);
    background: var(--paper-100);
}

header {
    padding: var(--space-4) var(--space-6);
    background: var(--paper-000);
    border-bottom: 1px solid var(--line-200);
}

header a {
    font-weight: var(--weight-semibold);
    text-decoration: none;
    color: var(--ink-900);
}

main {
    max-width: 860px;
    margin: 0 auto;
    padding: var(--space-6);
}

h1 {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: var(--weight-semibold);
    color: var(--ink-900);
    margin: 0 0 var(--space-4);
}

.flash {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-4);
}

.flash li {
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-2);
}

.flash-success {
    background: var(--state-success-soft);
    color: var(--state-success);
}

.flash-error {
    background: var(--state-error-soft);
    color: var(--state-error);
}

.tabla-tarjeta {
    background: var(--paper-000);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--paper-000);
}

th, td {
    text-align: left;
    padding: var(--space-3);
    border-bottom: 1px solid var(--line-200);
}

th {
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--ink-700);
    font-weight: var(--weight-semibold);
    background: var(--paper-100);
}

tbody tr:hover {
    background: var(--paper-100);
}

tbody tr:last-child td {
    border-bottom: none;
}

td form button[type="submit"] {
    padding: var(--space-1) var(--space-3);
    border: 1px solid var(--line-200);
    border-radius: var(--radius-pill);
    background: var(--paper-000);
    color: var(--ink-700);
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    cursor: pointer;
}

td form button[type="submit"]:hover {
    background: var(--paper-100);
}

.celda-identidad {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.celda-identidad a {
    color: var(--ink-900);
    text-decoration: none;
    font-weight: var(--weight-medium);
}

.celda-identidad a:hover {
    color: var(--blue-signal);
}

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
}

.avatar .icono {
    width: 18px;
    height: 18px;
}

.avatar--0 { background: var(--blue-signal-soft); color: var(--blue-signal); }
.avatar--1 { background: var(--state-success-soft); color: var(--state-success); }
.avatar--2 { background: var(--state-warning-soft); color: var(--state-warning); }
.avatar--3 { background: var(--state-error-soft); color: var(--state-error); }
.avatar--4 { background: var(--line-200); color: var(--ink-700); }
.avatar--5 { background: var(--ink-900); color: var(--paper-000); }

.avatar--sm {
    width: 24px;
    height: 24px;
    font-size: 10px;
}

.filtros {
    display: flex;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    align-items: end;
}

.filtros--lateral {
    flex-direction: column;
    align-items: stretch;
}

.filtros--lateral select {
    width: 100%;
    padding: var(--space-2);
    border: 1px solid var(--line-200);
    border-radius: var(--radius-sm);
    font-family: var(--font-ui);
    font-size: var(--text-sm);
}

.filtros label {
    display: block;
    font-size: var(--text-xs);
    margin-bottom: var(--space-1);
}

.acciones {
    margin: var(--space-4) 0;
}

.boton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--blue-signal);
    color: var(--paper-000);
    text-decoration: none;
    border: none;
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-family: var(--font-ui);
    font-weight: var(--weight-medium);
    font-size: var(--text-sm);
    line-height: 1.2;
    text-align: center;
}

.boton .icono {
    width: 16px;
    height: 16px;
}

.enlace-accion {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    color: var(--blue-signal);
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
}

.enlace-accion .icono {
    width: 14px;
    height: 14px;
}

.enlace-accion:hover {
    text-decoration: underline;
}

form.formulario-nota {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    max-width: 640px;
}

form.formulario-nota label {
    font-weight: var(--weight-semibold);
    display: block;
    margin-bottom: var(--space-1);
}

form.formulario-nota input[type="text"],
form.formulario-nota select,
form.formulario-nota textarea {
    width: 100%;
    padding: var(--space-2);
    border: 1px solid var(--line-200);
    border-radius: var(--radius-sm);
    font-size: var(--text-base);
    font-family: var(--font-ui);
}

form.formulario-nota textarea {
    min-height: 220px;
    white-space: pre-wrap;
}

.aviso {
    background: var(--state-warning-soft);
    border: 1px solid var(--state-warning);
    padding: var(--space-3);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-4);
}

.cuerpo-nota {
    white-space: pre-wrap;
    background: var(--paper-000);
    padding: var(--space-4);
    border: 1px solid var(--line-200);
    border-radius: var(--radius-md);
    font-family: var(--font-ui);
}

.metadatos {
    display: block;
    color: var(--ink-700);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    background: var(--paper-000);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: var(--space-4);
    margin-bottom: var(--space-4);
    line-height: 1.8;
}

.ficha-cabecera {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.ficha-cabecera .avatar {
    width: 48px;
    height: 48px;
    font-size: var(--text-base);
}

.ficha-cabecera h1 {
    margin-bottom: 0;
}

.etiquetas {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-2);
}

.estado-badge {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-pill);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    background: var(--line-200);
    color: var(--ink-700);
}

.estado-publicada {
    background: var(--state-success-soft);
    color: var(--state-success);
}

.estado-pendiente {
    background: var(--state-warning-soft);
    color: var(--state-warning);
}

.estado-rechazada {
    background: var(--state-error-soft);
    color: var(--state-error);
}
