:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-soft: #f8f9ff;
    --surface-muted: #eef2ff;
    --border: #dfe5f2;
    --text: #1f2740;
    --muted: #7b869b;
    --accent: #6c5ce7;
    --accent-strong: #8e7cff;
    --shadow-soft: 0 10px 30px rgba(25, 32, 53, 0.08);
    --radius: 18px;
}

* {
    box-sizing: border-box;
    font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    padding: 0;
}

.page-header {
    background: #ffffff;
    border-bottom: 1px solid rgba(110, 128, 170, 0.14);
    box-shadow: 0 6px 24px rgba(20, 30, 60, 0.06);
    padding: 18px 20px;
}

.page-header nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.page-header nav a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 700;
    transition: 0.25s ease;
}

.page-header nav a:hover {
    color: var(--accent);
}

.page-main {
    padding: 24px 20px 40px;
}

.card {
    width: 100%;
    max-width: 880px;
    background: var(--surface);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    margin: 0 auto;
    border: 1px solid rgba(110, 128, 170, 0.14);
}

h1 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #20263a;
    text-align: center;
    font-size: 2rem;
    font-weight: 800;
}

h2 {
    color: #20263a;
    margin-top: 30px;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(110, 128, 170, 0.18);
    padding-bottom: 10px;
    font-size: 1.3rem;
}

form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--surface-soft);
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 20px;
    border: 1px solid rgba(110, 128, 170, 0.14);
}

label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    font-weight: 700;
    color: #49536c;
}

input,
textarea,
button {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: white;
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
}

textarea {
    resize: vertical;
    min-height: 92px;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: rgba(108, 92, 231, 0.48);
    box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.12);
}

button {
    margin-top: 10px;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    background-size: 200%;
    color: white;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.25s ease;
    border: none;
    box-shadow: 0 10px 20px rgba(108, 92, 231, 0.18);
}

button:hover {
    background-position: right;
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(108, 92, 231, 0.28);
}

button#btnCancelar {
    background: linear-gradient(135deg, #ff7a59, #ff4f7a);
    background-size: 200%;
}

button#btnCancelar:hover {
    background-position: right;
    box-shadow: 0 14px 28px rgba(255, 87, 106, 0.22);
}

.categorias-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.categoria-item {
    background: var(--surface);
    padding: 20px;
    border-radius: 16px;
    border-left: 4px solid var(--accent);
    transition: all 0.25s ease;
    box-shadow: var(--shadow-soft);
}

.categoria-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 38px rgba(25, 32, 53, 0.14);
}

.categoria-item h3 {
    margin: 0 0 10px 0;
    color: #20263a;
    font-size: 1.1rem;
}

.categoria-item p {
    margin: 0 0 15px 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.categoria-acciones {
    display: flex;
    gap: 10px;
}

.btn-editar,
.btn-eliminar {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.25s ease;
}

.btn-editar {
    background: #4b6bff;
    color: white;
}

.btn-editar:hover {
    background: #314fd8;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(75, 107, 255, 0.24);
}

.btn-eliminar {
    background: #ff5f78;
    color: white;
}

.btn-eliminar:hover {
    background: #ef4d66;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 95, 120, 0.24);
}

.volver {
    display: inline-block;
    margin-top: 20px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
}

.volver:hover {
    text-decoration: underline;
}

.mensaje-vacio {
    text-align: center;
    color: var(--muted);
    padding: 40px 20px;
    font-size: 16px;
}

.seccion-categorias {
    margin-top: 30px;
}

@media (max-width: 600px) {
    .categorias-list {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 20px;
    }

    form {
        padding: 15px;
    }

    .categoria-acciones {
        flex-direction: column;
    }
}
