:root {
    --fondo: #07111f;
    --panel: #0d1b2d;
    --panel-2: #10243b;
    --texto: #eef6ff;
    --muted: #9eb2c8;
    --azul: #38bdf8;
    --azul-2: #2563eb;
    --borde: rgba(255,255,255,.10);
    --verde: #22c55e;
    --rojo: #ef4444;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 10% 0%, rgba(56,189,248,.15), transparent 28rem),
        linear-gradient(180deg, #06101d, #091725 55%, #07111f);
    color: var(--texto);
    min-height: 100vh;
}

.cabecera {
    border-bottom: 1px solid var(--borde);
    background: rgba(5,15,28,.82);
    padding: 22px max(18px, calc((100% - 1180px)/2));
}

.marca { display: flex; align-items: center; gap: 14px; }

.logo {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    font-weight: 800;
    color: #05111f;
    background: linear-gradient(135deg, #7dd3fc, #38bdf8);
    box-shadow: 0 12px 30px rgba(56,189,248,.20);
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 2px; font-size: clamp(1.5rem, 4vw, 2rem); }
.marca p, .datos p { color: var(--muted); margin-bottom: 0; }

.contenedor {
    width: min(1180px, calc(100% - 28px));
    margin: 28px auto;
    display: grid;
    gap: 22px;
}

.estrecho { width: min(820px, calc(100% - 28px)); }

.panel {
    background: linear-gradient(180deg, rgba(16,36,59,.96), rgba(11,27,45,.96));
    border: 1px solid var(--borde);
    border-radius: 24px;
    padding: clamp(18px, 3vw, 28px);
    box-shadow: 0 20px 60px rgba(0,0,0,.18);
}

.titulo-seccion, .cabecera-lista {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: end;
    flex-wrap: wrap;
}

.etiqueta {
    color: var(--azul);
    font-weight: 800;
    letter-spacing: .12em;
    font-size: .74rem;
}

.formulario {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 22px;
}

.campo { min-width: 0; }
.campo-completo { grid-column: 1 / -1; }

label {
    display: block;
    color: #cfe1f3;
    font-size: .9rem;
    margin-bottom: 7px;
}

input {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--borde);
    background: #071625;
    color: var(--texto);
    border-radius: 13px;
    padding: 11px 13px;
    font-size: 16px;
    outline: none;
}

input:focus {
    border-color: var(--azul);
    box-shadow: 0 0 0 3px rgba(56,189,248,.13);
}

.boton {
    min-height: 44px;
    border: 0;
    border-radius: 12px;
    padding: 10px 16px;
    text-decoration: none;
    font-weight: 750;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: .92rem;
}

.principal {
    background: linear-gradient(135deg, var(--azul), var(--azul-2));
    color: white;
}

.secundario {
    background: #172a40;
    color: #d8eaff;
    border: 1px solid var(--borde);
}

.editar { background: rgba(56,189,248,.14); color: #8bdbff; }
.eliminar { background: rgba(239,68,68,.12); color: #ff9b9b; }

.acciones-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.buscador {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.buscador input { width: min(360px, 70vw); }

.limpiar { color: var(--azul); text-decoration: none; font-size: .9rem; }

.contador {
    margin: 18px 0 10px;
    color: var(--muted);
    font-size: .9rem;
}

.tarjetas { display: grid; gap: 12px; }

.contacto {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    align-items: start;
    background: rgba(5,17,31,.58);
    border: 1px solid var(--borde);
    border-radius: 18px;
    padding: 17px;
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    background: rgba(56,189,248,.14);
    border: 1px solid rgba(56,189,248,.24);
    color: #8bdcff;
    font-weight: 900;
    font-size: 1.2rem;
}

.datos { min-width: 0; }
.datos h3 { margin-bottom: 8px; }
.datos p {
    margin: 4px 0;
    overflow-wrap: anywhere;
    font-size: .92rem;
}
.datos strong { color: #d9e9f9; }

.acciones {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.vacio {
    text-align: center;
    padding: 42px 12px 26px;
    color: var(--muted);
}

.vacio-icono {
    font-size: 3rem;
    color: var(--azul);
    margin-bottom: 10px;
}

.mensaje {
    padding: 13px 16px;
    border-radius: 13px;
    border: 1px solid var(--borde);
}

.mensaje.ok { background: rgba(34,197,94,.12); color: #baf7c8; }
.mensaje.error { background: rgba(239,68,68,.12); color: #ffc0c0; }

footer {
    width: min(1180px, calc(100% - 28px));
    margin: 10px auto 30px;
    color: #7690a8;
    text-align: center;
    font-size: .84rem;
}

@media (max-width: 720px) {
    .formulario { grid-template-columns: 1fr; }
    .campo-completo { grid-column: auto; }

    .contacto {
        grid-template-columns: auto 1fr;
    }

    .acciones {
        grid-column: 1 / -1;
        padding-left: 64px;
    }

    .acciones .boton,
    .acciones form {
        flex: 1;
    }

    .acciones form .boton { width: 100%; }

    .buscador { width: 100%; }
    .buscador input { width: 100%; }
}
