/* RESET */
body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    background: radial-gradient(circle at top, #0f172a, #020617);
    color: #e5e7eb;
}

/* HEADER */
.app-header {
    background: #020617;
    color: #e0f2fe;
    padding: 16px;
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    border-bottom: 1px solid rgba(148,163,184,0.2);
}

/* CONTENEDOR GENERAL */
.app-main {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* BUSCADOR CENTRADO */
.search-section {
    width: 100%;
    display: flex;
    justify-content: center;
}

.input-group {
    display: flex;
    width: 100%;
    max-width: 420px;
    margin: 0 auto; /* 🔥 esto lo centra SIEMPRE */
}

/* INPUT */
.search-input {
    flex: 1;
    background: #ffffff;
    border: none;
    padding: 14px;
    border-radius: 10px 0 0 10px;
    font-size: 16px;
    outline: none;
    color: #111;
}

/* BOTON */
.search-btn {
    display: flex;
    align-items: center;
    justify-content: center;

    padding: 14px;
    background: #2563eb;
    border: none;
    border-radius: 0 10px 10px 0;
    cursor: pointer;

    transition: 0.2s;
}

.search-btn svg {
    width: 20px;
    height: 20px;
    color: white;
}

.search-btn:hover {
    background: #1d4ed8;
    transform: scale(1.05);
}

/* CARD / PANEL */
.card {
    margin: 30px auto;
    padding: 24px;
    width: 95%;
    max-width: 1100px;

    background: linear-gradient(
        145deg,
        #0f172a,
        #020617
    );

    border-radius: 16px;
    border: 1px solid rgba(148,163,184,0.2);

    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

/* TITULO */
.article-title {
    color: #38bdf8;
    margin-bottom: 15px;
    font-size: 18px;
}

/* TABLA */
.table {
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(148,163,184,0.2);
}

/* HEADER TABLA */
.table-header {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: #020617;
    color: #e0f2fe;
    font-weight: 600;
    padding: 14px 0;
    text-align: center;
    font-size: 15px;
}

/* FILAS */
.table-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 16px 0;
    text-align: center;
    font-size: 16px;
    color: #f1f5f9;
}

/* ZEBRA */
.table-row:nth-child(even) {
    background: rgba(255,255,255,0.05);
}

.table-row:nth-child(odd) {
    background: rgba(255,255,255,0.1);
}

/* HOVER */
.table-row:hover {
    background: rgba(59,130,246,0.25);
    transition: 0.2s;
}

/* ESPACIADO COLUMNAS */
.table-header span,
.table-row span {
    padding: 0 10px;
}

/* LINEA ENTRE UNID Y DOC */
.table-header span:nth-child(3),
.table-row span:nth-child(3) {
    border-right: 2px solid rgba(148,163,184,0.4);
}

/* DESTACADO */
.blue {
    color: #38bdf8;
    font-weight: 700;
}

/* ESTADOS */
.state-message {
    text-align: center;
    padding: 20px;
    display: none;
}

.state-message.active {
    display: block;
}

.error {
    color: #ef4444;
}

/* SPINNER */
.spinner {
    width: 30px;
    height: 30px;
    border: 4px solid #1e293b;
    border-top: 4px solid #38bdf8;
    border-radius: 50%;
    margin: 10px auto;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

/* 📱 RESPONSIVE */
@media (max-width: 600px) {

    .input-group {
        max-width: 100%;
    }

    .card {
        margin: 12px;
        padding: 14px;
    }

    .table {
        overflow-x: auto;
    }

    .table-header,
    .table-row {
        min-width: 500px;
        font-size: 14px;
    }
}