/* ===========================
   RESET GENERAL
=========================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #eef1f4;
    color: #333;
}

/* ===========================
   SIDEBAR
=========================== */

:root {
    --sidebar-width: 240px;
    --sidebar-bg: #1f2d3d;
    --sidebar-bg-light: #26374a;
    --sidebar-accent: #3498db;
    --sidebar-text: #cfd8e3;
    --sidebar-text-active: #ffffff;
    --sidebar-danger: #e74c3c;
}

.sidebar-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1100;
    width: 44px;
    height: 44px;
    background: var(--sidebar-bg);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: background 0.3s ease;
}

.sidebar-toggle:hover {
    background: var(--sidebar-bg-light);
}

.sidebar-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.sidebar-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.sidebar-toggle.active span:nth-child(2) {
    opacity: 0;
}

.sidebar-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.sidebar-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100%;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    padding: 0 0 20px;
    z-index: 1050;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 28px 20px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 12px;
}

.sidebar-header h2 {
    font-size: 19px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #fff;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 14px;
    overflow-y: auto;
}

.sidebar-nav a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 14.5px;
    font-weight: 500;
    border-radius: 8px;
    transition: background 0.25s ease, color 0.25s ease, padding-left 0.25s ease;
}

.sidebar-nav a .icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-nav a .icon svg {
    width: 19px;
    height: 19px;
    stroke: currentColor;
    transition: transform 0.25s ease;
}

.sidebar-nav a:hover .icon svg,
.sidebar-nav a.activo .icon svg {
    transform: scale(1.05);
}

.sidebar-nav a .label {
    white-space: nowrap;
}

.sidebar-nav a:hover {
    background: var(--sidebar-bg-light);
    color: var(--sidebar-text-active);
    padding-left: 18px;
}

.sidebar-nav a.activo {
    background: var(--sidebar-bg-light);
    color: var(--sidebar-text-active);
}

.sidebar-nav a.activo::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: var(--sidebar-accent);
    border-radius: 0 4px 4px 0;
}

.sidebar-nav a.logout {
    color: #f1a9a0;
}

.sidebar-nav a.logout:hover {
    background: var(--sidebar-danger);
    color: #fff;
}

.sidebar-divider {
    height: 1px;
    margin: 12px 6px;
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

/* ===========================
   CONTENIDO PRINCIPAL
=========================== */

.main-content {
    margin-left: 240px;
    padding: 25px 30px;
}

/* ===========================
   TOPBAR
=========================== */

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;

    background: #fff;
    padding: 12px 20px;
    margin-bottom: 25px;

    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ===========================
   TARJETAS
=========================== */

.card {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.card h3 {
    margin-top: 0;
}

/* ===========================
   BOTONES
=========================== */

.btn {
    display: inline-block;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    cursor: pointer;
    color: #fff;
    font-weight: bold;
    transition: 0.3s;
}

.btn-primary {
    background: #007bff;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-success {
    background: #28a745;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-warning {
    background: #fd7e14;
}

.btn-warning:hover {
    background: #e66a00;
}

/* ===========================
   MENSAJES
=========================== */

.error {
    color: #dc3545;
    text-align: center;
}

.success {
    color: #28a745;
    text-align: center;
}

/* ===========================
   FORMULARIOS GENERALES
=========================== */

input,
select,
textarea {
    font-family: inherit;
}

label {
    font-weight: bold;
}

.main-content{
    margin-left:240px;
    padding:30px;
}

.card{
    background:white;
    max-width:700px;
    margin:auto;
    padding:30px;
    border-radius:12px;
    box-shadow:0 2px 10px rgba(0,0,0,.15);
}

.card h2{
    margin-top:0;
    color:#2c3e50;
}

.form-group{
    margin-bottom:20px;
}

.form-group label{
    display:block;
    font-weight:bold;
    margin-bottom:8px;
}

.form-group input{
    width:100%;
    padding:12px;
    border:1px solid #ccc;
    border-radius:6px;
    box-sizing:border-box;
}

.btn{
    width:100%;
    background:#007bff;
    color:white;
    border:none;
    padding:14px;
    border-radius:6px;
    cursor:pointer;
    font-size:15px;
    font-weight:bold;
}

.btn:hover{
    background:#0056b3;
}

.success{
    background:#d4edda;
    color:#155724;
    padding:12px;
    border-radius:6px;
    margin-bottom:15px;
}

.error{
    background:#f8d7da;
    color:#721c24;
    padding:12px;
    border-radius:6px;
    margin-bottom:15px;
}








/* ===========================
   RESPONSIVE
=========================== */

@media (max-width: 992px) {
    .sidebar-nav a {
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .sidebar-toggle {
        display: flex;
    }

    .sidebar-overlay {
        display: block;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 260px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-header {
        padding-top: 60px;
    }

    .main-content {
        margin-left: 0;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 82%;
    }
}

