:root {
    --bg: #eef2f7;
    --panel: #132238;
    --panel-soft: #1b3252;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --text: #122033;
    --muted: #5e6c80;
    --border: #d9e2ec;
    --accent: #d97706;
    --accent-dark: #b45309;
    --success: #166534;
    --error: #b91c1c;
    --shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background:
        radial-gradient(circle at top right, rgba(217, 119, 6, 0.14), transparent 22%),
        linear-gradient(180deg, #f4f7fb 0%, #eaf0f6 100%);
    color: var(--text);
    display: flex;
}

.sidebar {
    width: 280px;
    min-height: 100vh;
    padding: 32px 24px;
    background: linear-gradient(180deg, var(--panel) 0%, #0f1b2d 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 28px;
    position: sticky;
    top: 0;
}

.sidebar--admin {
    background: linear-gradient(180deg, #1e1b4b 0%, #172554 100%);
}

.sidebar h1 {
    margin: 0;
    font-size: 2rem;
}

.sidebar__eyebrow,
.eyebrow {
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.72rem;
    font-weight: 700;
    color: #fbbf24;
}

.sidebar__user,
.sidebar__footer p {
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.6;
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.menu__link {
    display: block;
    padding: 14px 16px;
    border-radius: 14px;
    text-decoration: none;
    color: #fff;
    background: transparent;
    transition: 0.2s ease;
}

.menu__link:hover,
.menu__link.is-active {
    background: rgba(255, 255, 255, 0.12);
    transform: translateX(4px);
}

.contenido {
    flex: 1;
    padding: 34px;
}

.hero,
.section-card,
.table-card,
.login-card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.hero {
    padding: 28px;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: end;
    margin-bottom: 24px;
}

.hero--compact {
    align-items: start;
}

.hero h2,
.section-card h2,
.section-card h3,
.gallery-card h3,
.login-card h2 {
    margin: 0;
}

.hero p,
.section-card p,
.gallery-card p,
.admin-item p,
.login-card p {
    color: var(--muted);
    line-height: 1.6;
}

.section-card,
.table-card {
    padding: 26px;
    margin-bottom: 24px;
}

.section-card__header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 20px;
}

.button {
    border: none;
    border-radius: 14px;
    padding: 12px 18px;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
}

.button:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
}

.button--ghost {
    background: #e2e8f0;
    color: var(--text);
}

.button--ghost:hover {
    background: #cbd5e1;
}

.button--danger {
    background: #dc2626;
}

.button--danger:hover {
    background: #b91c1c;
}

.alert {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 16px;
    font-weight: 600;
}

.alert--success {
    background: #dcfce7;
    color: var(--success);
}

.alert--error {
    background: #fee2e2;
    color: var(--error);
}

.carousel {
    position: relative;
    overflow: hidden;
    min-height: 460px;
    border-radius: 24px;
    background: #0f172a;
}

.carousel__slide {
    display: none;
    position: relative;
}

.carousel__slide.is-active {
    display: block;
}

.carousel__slide img {
    width: 100%;
    height: 460px;
    object-fit: cover;
    display: block;
}

.carousel__overlay {
    position: absolute;
    inset: auto 0 0 0;
    padding: 28px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0), rgba(15, 23, 42, 0.88));
    color: #fff;
}

.carousel__overlay p {
    color: rgba(255, 255, 255, 0.86);
}

.carousel__controls {
    position: absolute;
    left: 28px;
    bottom: 22px;
    display: flex;
    gap: 10px;
}

.carousel__dot {
    width: 13px;
    height: 13px;
    border-radius: 999px;
    border: 0;
    background: rgba(255, 255, 255, 0.45);
    cursor: pointer;
}

.carousel__dot.is-active {
    background: #fff;
}

.gallery-grid,
.admin-grid,
.stats-grid,
.quick-actions {
    display: grid;
    gap: 20px;
}

.gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.gallery-card,
.admin-item,
.stat-card,
.quick-actions__item {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 15px 32px rgba(15, 23, 42, 0.08);
    border: 1px solid var(--border);
}

.gallery-card img,
.admin-item img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.gallery-card__body,
.admin-item__body,
.stat-card {
    padding: 18px;
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-bottom: 24px;
}

.stat-card strong {
    display: block;
    margin-top: 8px;
    font-size: 2rem;
}

.quick-actions {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.quick-actions__item {
    text-decoration: none;
    color: var(--text);
    padding: 22px;
    font-weight: 700;
}

.editor-form,
.form-stack {
    display: grid;
    gap: 16px;
}

.field {
    display: grid;
    gap: 8px;
}

.field span {
    font-weight: 700;
}

.field input,
.field textarea {
    width: 100%;
    padding: 13px 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    font: inherit;
}

.form-actions,
.admin-item__actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.admin-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.admin-item__actions {
    padding: 0 18px 18px;
}

.admin-item__actions form {
    margin: 0;
}

.login-shell {
    min-height: calc(100vh - 68px);
    display: grid;
    place-items: center;
}

.login-card {
    width: min(100%, 520px);
    padding: 30px;
}

.login-card__text,
.login-card__hint {
    margin-bottom: 18px;
}

code {
    background: #e2e8f0;
    padding: 2px 6px;
    border-radius: 8px;
}

@media (max-width: 900px) {
    body {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        min-height: auto;
        position: static;
    }

    .contenido {
        padding: 20px;
    }

    .hero {
        flex-direction: column;
        align-items: start;
    }

    .carousel,
    .carousel__slide img {
        min-height: 320px;
        height: 320px;
    }
}
