:root {
    --bg: #111;
    --surface: #1f1f1f;
    --surface-2: #2a2a2a;
    --border: #343434;
    --text: #f5f5f5;
    --muted: #bdbdbd;
    --accent: #ff4141;
    --focus: #ff8c8c;
}

* {
    box-sizing: border-box;
}

/* OCULTAR SCROLLBAR */
body {
    scrollbar-width: none;
}

body::-webkit-scrollbar {
    display: none;
}

/* DESACTIVAR SELECCIÓN */
.icon-btn,
.close-menu label,
.gallery {
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
}

/* BASE HTML Y BODY */
html,
body {
    overflow-x: hidden;
    overflow-y: auto;
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, Arial, sans-serif;
}

html {
    font-size: 16px;
}

body {
    line-height: 1.5;
    padding-top: 90px;
}

h2 {
    font-size: clamp(1.45rem, 2.8vw, 2rem);
    margin-top: 0;
}

h3 {
    font-size: clamp(1.1rem, 2vw, 1.35rem);
}

.btn,
.btn-link,
.menu-width a,
.icon-btn,
input,
textarea {
    transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .12s ease, box-shadow .12s ease;
}

/* BOTONES GENERALES */
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border: 1px solid transparent;
    border-radius: 10px;
    color: #000;
    text-decoration: none;
    cursor: pointer;
    font-weight: 600;
    min-height: 2.8rem;
    padding: 0.5rem 0.95rem;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: scale(0.96);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

/* BOTONES DE ACCIÓN */
.btn-add {
    background: #303030;
    border-color: #4a4a4a;
    color: #fff;
}

.btn-delete {
    background: var(--accent);
    color: #fff;
}

/* BOTONES DE ICONO */
.icon-btn {
    width: 90px;
    height: 90px;
    border: none;
    border-radius: 50%;
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.icon-btn:active {
    transform: scale(0.9);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.25);
}

/* ICONOS SVG */
.icon {
    width: 40px;
    height: 30px;
    fill: currentColor;
}

.icon-btn.white {
    color: #fff;
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.8));
}

.icon-btn.red {
    width: 40px;
    height: 40px;
    color: var(--accent);
}

.icon-btn:hover .icon {
    color: var(--accent);
}

/* HEADER */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1100;
}

/* CONTENIDO HEADER */
.header-gruop {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 90px;
    padding: 0 12px;
    width: 100%;
    background-color: rgb(31, 31, 31);
}

.header-gruop img {
    width: 75px;
    height: auto;
    display: block;
}

.header-gruop h1 {
    font-size: clamp(28px, 3.5vw, 48px);
    line-height: 1;
    margin: 0;
    font-weight: bold;
}

.header-gruop .user-link .icon {
    width: 40px;
    height: 40px;
}

/* GRUPO DERECHO HEADER */
.logo-link {
    display: flex;
    align-items: center;
}

.right-group {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* BUSCADOR */
.search {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 14px;
    border-radius: 50px;
    border: 2px solid var(--accent);
    background: transparent;
    width: min(300px, 36vw);
}

.search-input {
    width: 100%;
    height: 100%;
    line-height: 1;
    font-size: 16px;
    color: var(--text);
    outline: none;
    border: none;
    background: transparent;
}

/* MENU LATERAL */
#menu-toggle {
    display: none;
}

.menu-width {
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    max-width: 300px;
    height: 100%;
    overflow-y: auto;
    background: #1b1b1b;
    padding-top: 120px;
    list-style: none;
    margin: 0;
    transition: left 0.3s ease;
    z-index: 1000;
}

.menu-width li {
    padding: 20px 30px;
    border-bottom: 1px solid #444;
}

.menu-width li a {
    text-decoration: none;
    color: var(--text);
    font-size: 18px;
}

.menu-width li a:hover {
    color: var(--accent);
}

.logout button {
    color: var(--accent);
    background: none;
    font-size: large;
    border: none;
    padding: 0;
}

.logout button:hover {
    border-bottom: 2px solid var(--accent);
    display: inline;
}

#menu-toggle:checked~.menu-width {
    left: 0;
}

/* TABLET */
@media screen and (max-width: 768px) {
    body {
        padding-top: 80px;
    }

    .header-gruop {
        position: relative;
        height: 80px;
    }

    .search {
        display: none;
    }

    .icon-btn {
        width: 70px;
        height: 70px;
    }

    .logo-link {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }

    .header-gruop h1 {
        display: none;
    }
}

/* MÓVIL */
@media screen and (max-width: 480px) {
    body {
        padding-top: 70px;
    }

    .header-gruop {
        height: 70px;
    }

    .menu-width {
        width: 100%;
        max-width: none;
    }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ===== Sistema global de contenido ===== */
.page-main {
    padding: 1.5rem 0 2.5rem;
}

.layout-container {
    width: min(1180px, 92vw);
    margin: 0 auto;
    display: grid;
    gap: 1.25rem;
}

.card-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    padding: 1.5rem;
}

.card-grid {
    display: grid;
    gap: 1rem;
}

.card-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.content-card {
    background: var(--surface-2);
    border-radius: 12px;
    padding: 1rem;
}

.content-card p {
    color: #c8c8c8;
}

.section-title {
    margin-top: 0;
    margin-bottom: 1rem;
}

.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: 1rem;
}

.btn-link {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    border: 1px solid transparent;
    padding: .55rem .8rem;
    font-weight: 600;
}

.btn-link:hover {
    background: #e43636;
}

.field-group {
    display: grid;
    gap: .45rem;
}

.field-group label {
    font-weight: 600;
    color: var(--text);
}

.field-group input,
.field-group textarea {
    width: 100%;
    background: #181818;
    border: 1px solid #5a5a5a;
    color: var(--text);
    margin-top: 0.35rem;
    min-height: 2.7rem;
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    font: inherit;
}

textarea {
    min-height: 6.5rem;
    resize: vertical;
}

.container {
    width: min(1100px, 92vw);
    margin: 0 auto;
}

.site-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.footer-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    text-align: center;
}

.footer-links a {
    color: #a0a0a0;
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
    color: #d0d0d0;
}

.footer-legal {
    margin: 1.5rem 0;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
}



:where(a, button, input, textarea, select):focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

@media (min-width: 601px) and (max-width: 1024px) {
    .card-grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .layout-container {
        width: 95vw;
    }

    .card-panel {
        padding: 1rem;
    }

    .card-grid-3 {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}