/* ============ RESET Y ESTILOS BASE ============ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    background: #000;
    color: #fff;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ============ MOBILE-FIRST BASE (default: <768px) ============ */

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #000;
}

.sidebar {
    display: none; /* Escondido en móvil */
}

.main-content {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 80px; /* Espacio para menú inferior */
    display: flex;
    flex-direction: column;
}

/* ============ SIDEBAR ============ */

.sidebar-header {
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid #30363d;
}

.app-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 4px;
}

.account {
    color: #888;
    font-size: 13px;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    color: #fff;
    border-radius: 9999px;
    transition: background 0.2s ease;
    font-size: 15px;
    font-weight: 500;
}

.nav-item:hover {
    background: #1a1a1a;
}

.nav-item.active {
    background: #fff;
    color: #000;
}

.nav-item .icon {
    font-size: 20px;
    width: 24px;
}

.sidebar-footer {
    padding-top: 16px;
    border-top: 1px solid #30363d;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    color: #fff;
    border-radius: 9999px;
    transition: background 0.2s ease;
    font-weight: 500;
    cursor: pointer;
}

.logout-btn:hover {
    background: #1a1a1a;
}

/* ============ TOP BAR ============ */

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #1a1a1a;
    border-bottom: 1px solid #30363d;
}

.page-title {
    font-size: 18px;
    margin: 0;
    color: #fff;
    font-weight: 700;
}

.top-bar-actions {
    display: flex;
    gap: 10px;
}

.btn-refresh {
    background: #30363d;
    border: none;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    color: #fff;
    transition: opacity 0.2s ease;
}

.btn-refresh:hover {
    opacity: 0.7;
}

/* ============ CONTENIDO ============ */

.content {
    flex: 1;
    padding: 15px 10px;
    overflow-y: auto;
}

.page-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ============ COMPONENTES COMUNES ============ */

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 9999px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #fff;
    color: #000;
}

.btn-primary:hover {
    background: #e8e8e8;
}

.btn-secondary {
    background: #30363d;
    color: #fff;
}

.btn-secondary:hover {
    background: #484f58;
}

.btn-success {
    background: #238636;
    color: #fff;
}

.btn-success:hover {
    background: #2d7c4f;
}

.btn-danger {
    background: #cc4455;
    color: #fff;
}

.btn-danger:hover {
    background: #bb3344;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============ ALERTAS ============ */

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-success {
    background: #238636;
    color: #fff;
    border: 1px solid #2d7c4f;
}

.alert-error {
    background: #cc4455;
    color: #fff;
    border: 1px solid #bb3344;
}

.alert-info {
    background: #888;
    color: #fff;
    border: 1px solid #666;
}

/* ============ FORMULARIOS ============ */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #fff;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px;
    background: #0f1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
}

.form-control:focus {
    outline: none;
    border-color: #888;
    box-shadow: 0 0 0 3px rgba(136, 136, 136, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* ============ TARJETAS ============ */

.card {
    background: #0f1117;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 20px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    border-color: #888;
    box-shadow: 0 0 0 1px rgba(136, 136, 136, 0.1);
}

/* ============ GRID Y FLEXBOX ============ */

.grid {
    display: grid;
    gap: 16px;
}

.grid-cols-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-cols-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }

.justify-between {
    justify-content: space-between;
}

.items-center {
    align-items: center;
}

/* ============ UTILIDADES ============ */

.text-center {
    text-align: center;
}

.text-muted {
    color: #888;
}

.text-small {
    font-size: 13px;
}

.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.p-4 { padding: 16px; }

.opacity-50 {
    opacity: 0.5;
}

/* ============ BOTTOM NAV (móvil) ============ */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #1a1a1a;
    border-top: 1px solid #30363d;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0;
    margin: 0;
    z-index: 1000;
}

.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    text-decoration: none;
    color: #888;
    font-size: 11px;
    gap: 4px;
    transition: color 0.2s;
}

.bottom-nav a.active {
    color: #1d9bf0;
}

.bottom-nav a:hover {
    color: #fff;
}

.bottom-nav svg {
    width: 24px;
    height: 24px;
    stroke-width: 1.5;
}

/* Centro: botón +Crear más grande */
.bottom-nav .nav-create {
    position: relative;
}

.bottom-nav .nav-create svg {
    width: 32px;
    height: 32px;
    background: #1d9bf0;
    border-radius: 50%;
    padding: 4px;
    stroke: #fff;
}

/* ============ RESPONSIVE ============ */

@media (min-width: 768px) {
    .container {
        flex-direction: row;
    }

    .sidebar {
        display: flex;
        flex-direction: column;
        width: 275px;
        background: #0f1117;
        border-right: 1px solid #30363d;
        overflow-y: auto;
        padding: 20px;
    }

    .main-content {
        flex: 1;
        padding-bottom: 0; /* No necesita espacio para nav inferior */
        overflow-y: auto;
    }

    .top-bar {
        border-bottom: 1px solid #30363d;
        padding: 20px;
        background: #000;
    }

    .page-title {
        font-size: 22px;
    }

    .content {
        padding: 20px;
    }

    .bottom-nav {
        display: none; /* No mostrar menú inferior en desktop */
    }
}

/* ============ TABLET (768px-1024px) ============ */

@media (min-width: 768px) and (max-width: 1024px) {
    .sidebar {
        width: 200px;
    }
}

/* ============ MOBILE ADJUSTMENTS (< 480px - small phones) ============ */

@media (max-width: 480px) {
    .top-bar {
        padding: 12px 15px;
    }

    .page-title {
        font-size: 16px;
    }

    .btn {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* ============ SCROLL ============ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #000;
}

::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #48515f;
}

/* ============ SVG ICONS ============ */

.icon-inline {
    display: inline-block;
    width: 18px;
    height: 18px;
    vertical-align: text-bottom;
    margin-right: 6px;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke: currentColor;
}
