/* ── Wrapper ─────────────────────────────────────────────────── */
.dni-tabs {
    text-align: center;
    padding: 10px 30px 50px;
    border-radius: 1rem;
    background-color: #fff;
    box-shadow: 0 0 10px #00000029;
    position: relative;
    max-width: 560px;
    margin: 20px auto;
}

/* ── Tab menu ────────────────────────────────────────────────── */
.dni-tab-menu {
    list-style: none;
    display: flex;
    margin-bottom: 20px;
    justify-content: center;
    column-gap: 1px;
    background: #f9f3f4;
    border-radius: 1.5rem;
    padding: 5px;
}
.dni-tab-menu li {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 28px;
    cursor: pointer;
    border-radius: 1rem;
    font-weight: bold;
    color: #314158;
    transition: all 0.3s ease;
    min-width: 130px;
    justify-content: center;
}
.dni-tab-menu li.active,
.dni-tab-menu li:hover {
    background: #00008B;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,.1);
    color: #fff;
}

/* ── Form title ──────────────────────────────────────────────── */
.ttl {
    font-size: 20px;
    line-height: 23px;
    font-weight: 700;
    color: #00008B;
    margin-bottom: 25px;
}

/* ── Inputs ──────────────────────────────────────────────────── */
.dni-tabs input[type="text"] {
    display: block;
    width: 100%;
    height: calc(2em + .75rem + 2px);
    padding: .375rem 1rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #495057;
    background-color: #fcf9fa;
    border: 1px solid #f5ecef;
    border-radius: 1.5rem;
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
    margin-bottom: 12px;
    text-transform: uppercase;
}
.dni-tabs input[type="text"]:focus {
    outline: none;
    border-color: #00008B;
    box-shadow: 0 0 0 3px rgba(0,0,139,.12);
}

/* ── Submit button ───────────────────────────────────────────── */
.dni-tabs button[type="submit"] {
    color: #fff;
    background-color: #00008B;
    border: 0;
    text-align: center;
    padding: 10px 40px;
    font-size: 1.1rem;
    line-height: 1.5;
    border-radius: 1.5rem;
    cursor: pointer;
    margin-bottom: 20px;
    transition: background-color .2s, transform .1s;
    display: inline-flex;
    align-items: center;
}
.dni-tabs button[type="submit"]:hover  { background-color: #0000b8; }
.dni-tabs button[type="submit"]:active { transform: scale(.97); }

/* ── Hint text ───────────────────────────────────────────────── */
.dni-hint {
    font-size: .82rem;
    color: #888;
    margin: -6px 0 14px;
    text-align: left;
    padding-left: 4px;
}

/* ── Error messages ──────────────────────────────────────────── */
.dni-error {
    color: #c0392b;
    background: #fdf0ef;
    border: 1px solid #f5c6c2;
    border-radius: .5rem;
    padding: 10px 14px;
    font-size: .9rem;
    text-align: left;
    margin-top: 10px;
}

/* ── Loading spinner ─────────────────────────────────────────── */
.dni-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    color: #00008B;
    font-weight: 600;
}
.dni-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid #d0d8f0;
    border-top-color: #00008B;
    border-radius: 50%;
    animation: dniSpin .7s linear infinite;
}
@keyframes dniSpin { to { transform: rotate(360deg); } }

/* ── DNI number badge ────────────────────────────────────────── */
.dni-result-card { margin-top: 20px; text-align: left; }
.dni-result-header { margin-bottom: 10px; }
.dni-badge {
    background: #00008B;
    color: #fff;
    padding: 5px 14px;
    border-radius: 999px;
    font-weight: bold;
    font-size: .9rem;
    display: inline-block;
}
.dni-badge-sm {
    background: #e8eaff;
    color: #00008B;
    padding: 2px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: .82rem;
    white-space: nowrap;
}

/* ── Result tables ───────────────────────────────────────────── */
.dni-result-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: .93rem;
}
.dni-result-table th,
.dni-result-table td {
    border: 1px solid #e2e8f0;
    padding: 8px 12px;
    text-align: left;
}
.dni-result-table thead tr {
    background: #00008B;
    color: #fff;
}
.dni-result-table thead th {
    border-color: #00008B;
}
.dni-result-table tbody tr:nth-child(even) { background: #f7f9ff; }
.dni-result-table tbody tr:hover           { background: #eef0ff; }
.dni-result-table th { background-color: #f4f4f4; width: 180px; }

/* Fix: thead th overrides th background */
.dni-result-table thead th { background-color: #00008B; width: auto; }

/* ── Name search results wrapper ─────────────────────────────── */
.dni-name-results { text-align: left; margin-top: 16px; }
.dni-count {
    font-size: .88rem;
    color: #555;
    margin-bottom: 8px;
}
.dni-table-wrap { overflow-x: auto; }

/* ── Pagination ──────────────────────────────────────────────── */
.dni-pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
}
.dni-page-btn {
    background: #fff;
    border: 2px solid #00008B;
    color: #00008B;
    padding: 6px 20px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
    font-size: .88rem;
    transition: all .2s;
}
.dni-page-btn:hover {
    background: #00008B;
    color: #fff;
}

/* ── Admin debug block ───────────────────────────────────────── */
.dni-debug {
    margin-top: 12px;
    background: #1e1e2e;
    border-radius: 6px;
    color: #cdd6f4;
    font-size: .78rem;
    text-align: left;
}
.dni-debug summary {
    cursor: pointer;
    padding: 8px 12px;
    font-weight: 600;
    color: #f5c2e7;
}
.dni-debug-body {
    padding: 10px 14px;
    border-top: 1px solid #45475a;
}
.dni-debug-body code {
    color: #a6e3a1;
    word-break: break-all;
    font-size: .75rem;
}
.dni-debug-body pre {
    background: #313244;
    border-radius: 4px;
    padding: 6px;
    white-space: pre-wrap;
    word-break: break-all;
    color: #cba6f7;
    font-size: .72rem;
    margin: 4px 0 10px;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 480px) {
    .dni-tabs { padding: 10px 15px 30px; }
    .dni-tab-menu li { padding: 8px 14px; min-width: auto; font-size: .85rem; }
    .ttl { font-size: 17px; }
}

/* ── Inline debug block (DNI number tab) ─────────────────────── */
.dni-debug-inline {
    background: #1e1e2e;
    color: #cba6f7;
    border-radius: 6px;
    font-size: .72rem;
    padding: 8px 12px;
    white-space: pre-wrap;
    word-break: break-all;
    margin-top: 10px;
    text-align: left;
}
