* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
header {
    background-color: var(--bg-header);
    padding: 15px 25px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
header h1 { font-size: 1.3em; font-weight: 500; letter-spacing: 1px; }
header h1 span { color: var(--accent-green); }
.layout { display: flex; flex: 1; min-height: calc(100vh - 60px); }
.sidebar {
    background-color: var(--bg-sidebar);
    width: 230px;
    padding: 20px 0;
    border-right: 1px solid var(--border-color);
}
.sidebar .menu-title {
    color: var(--text-dim);
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 10px 25px;
    margin-top: 10px;
}
.sidebar a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    text-decoration: none;
    padding: 12px 25px;
    font-size: 0.95em;
    transition: all 0.15s;
    border-left: 3px solid transparent;
    cursor: pointer;
}
.sidebar a:hover { background-color: var(--hover-bg); color: var(--text-main); }
.sidebar a.active {
    background-color: var(--hover-bg);
    color: var(--accent-green);
    border-left-color: var(--accent-green);
}
main { flex: 1; padding: 25px 30px; overflow-y: auto; }
.section { display: none; }
.section.active { display: block; }
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 10px;
    flex-wrap: wrap;
}
.section-header h2 { font-size: 1.4em; font-weight: 500; }
.section-header h2 span { color: var(--accent-green); }
.section-header .actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- TOGGLE SIDEBAR ---------- */

.sidebar {
    position: relative;
    transition: margin-left 0.25s ease, transform 0.25s ease;
}

.sidebar.collapsed {
    margin-left: -230px;
}

.sidebar-toggle {
    position: absolute;
    top: 8px;
    right: -14px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--accent-green);
    color: #0d0d12;
    border: 2px solid var(--bg-sidebar);
    font-size: 0.7em;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: transform 0.25s ease;
    padding: 0;
    line-height: 1;
}

.sidebar-toggle:hover {
    opacity: 0.85;
}

.sidebar.collapsed .sidebar-toggle {
    /* Cuando está colapsado, el botón se queda visible en el borde izquierdo */
    position: fixed;
    left: 0;
    top: 70px;
    right: auto;
    border-radius: 0 50% 50% 0;
    border-left: none;
}