:root {
    --primary: #ff6b57;
    --primary-hover: #fa5a44;
    --bg-app: #0f172a;
    --bg-sidebar: #1e293b;
    --bg-card: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Outfit', 'Inter', sans-serif;
    background: var(--bg-app);
    background-image: 
        radial-gradient(at 0% 0%, rgba(255, 107, 87, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(59, 130, 246, 0.05) 0px, transparent 50%);
    color: var(--text-main);
    min-height: 100vh;
}

.app {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    padding: 32px 20px;
    display: flex;
    flex-direction: column;
}

.brand {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 40px;
}

.brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--primary);
    color: white;
    display: grid;
    place-items: center;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(255, 107, 87, 0.3);
}

.brand h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.brand p {
    margin: 2px 0 0;
    color: var(--text-dim);
    font-size: 13px;
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.menu-item {
    border: none;
    background: transparent;
    text-align: left;
    padding: 14px 18px;
    border-radius: 14px;
    cursor: pointer;
    font-size: 15px;
    color: var(--text-dim);
    transition: all 0.3s;
    font-weight: 500;
}

.menu-item.active,
.menu-item:hover {
    background: rgba(255, 107, 87, 0.1);
    color: var(--primary);
}

.content {
    padding: 32px 40px;
    overflow-y: auto;
    overflow-x: hidden;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.topbar h2 {
    margin: 0 0 6px;
    font-size: 28px;
    font-weight: 700;
}

.topbar p {
    margin: 0;
    color: var(--text-dim);
}

.user-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 12px 20px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    backdrop-filter: blur(10px);
}

.cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 24px;
    backdrop-filter: blur(10px);
    transition: transform 0.3s, border-color 0.3s;
}

.card:hover {
    border-color: rgba(255, 107, 87, 0.3);
}

.stat span {
    display: block;
    color: var(--text-dim);
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat strong {
    display: block;
    margin-top: 12px;
    font-size: 36px;
    font-weight: 700;
}

.grid.two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.card-header {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.4);
    color: white;
    font-size: 15px;
    transition: all 0.3s;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(15, 23, 42, 0.6);
}

input[readonly] {
    background: rgba(15, 23, 42, 0.2);
    color: var(--text-dim);
}

.btn-primary {
    border: none;
    background: var(--primary);
    color: white;
    padding: 12px 24px;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(255, 107, 87, 0.2);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 87, 0.3);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding: 16px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

th {
    color: var(--text-dim);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
}

td {
    color: var(--text-main);
}

.view {
    display: none;
}

.view.active {
    display: block;
}

.hidden {
    display: none !important;
}

.checks {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 10px;
    background: rgba(255,255,255,0.03);
    padding: 15px;
    border-radius: 12px;
}

.checks label {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    font-size: 15px;
    line-height: 1.3;
}

.checks input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    flex-shrink: 0;
}

@media (max-width: 980px) {
    .app {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        padding: 10px 20px;
        border-right: none;
        border-bottom: 1px solid var(--border);
        flex-direction: row;
        justify-content: center;
        align-items: center;
        height: 70px;
        position: sticky;
        top: 0;
        z-index: 1000;
        background: #1e293b;
        backdrop-filter: blur(15px);
    }

    .brand {
        margin-bottom: 0;
        display: flex;
        justify-content: center;
        width: 100%;
    }
    
    .brand p, .brand span, .brand-logo {
        display: none !important;
    }

    .brand img {
        display: block !important;
        width: auto !important;
        height: 40px !important;
        max-width: 180px !important;
        margin: 0 auto !important;
    }

    .menu {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: #1e293b;
        flex-direction: row;
        justify-content: space-around;
        padding: 6px 10px;
        border-top: 1px solid var(--border);
        z-index: 2000;
        backdrop-filter: blur(20px);
        box-shadow: 0 -4px 30px rgba(0,0,0,0.5);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .menu-item {
        padding: 10px 12px;
        font-size: 11px;
        text-align: center;
        flex: 1;
        min-width: 70px;
        border-radius: 12px;
        white-space: nowrap;
    }

    .content {
        padding: 20px;
        padding-bottom: 100px; /* Espacio para el menú inferior */
    }

    .topbar {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        margin-bottom: 25px;
    }

    .user-box {
        width: 100%;
        justify-content: space-between;
        padding: 10px 15px;
    }

    .user-box span {
        font-size: 13px;
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .cards,
    .grid.two {
        grid-template-columns: 1fr;
    }

    .stat strong {
        font-size: 24px;
    }

    .card {
        padding: 15px;
        border-radius: 20px;
    }

    table {
        display: block;
        overflow-x: auto;
        width: 100%;
    }

    .modal-content {
        margin: 10px;
        padding: 20px;
        width: calc(100% - 20px);
    }
}

/* Modal classes */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(8px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: #1e293b;
    width: 100%;
    max-width: 500px;
    padding: 32px;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    position: relative;
    border: 1px solid var(--border);
    color: var(--text-main);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 24px;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-dim);
    line-height: 1;
}

.modal-close:hover {
    color: var(--primary);
}

.clickable-row {
    transition: background-color 0.2s ease;
}
.clickable-row:hover {
    background-color: rgba(255, 107, 87, 0.1);
}