/* ===================================
   TRAZAPP - Estilos Generales
   =================================== */

:root {
    --sidebar-width: 260px;
    --sidebar-bg: #212529;
    --sidebar-hover: #343a40;
    --primary-color: #0d6efd;
    --transition-speed: 0.3s;
}

/* Login Page */
.bg-login {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Wrapper */
#wrapper {
    overflow-x: hidden;
    width: 100%;
}

/* Sidebar */
.sidebar {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: #fff;
    transition: all var(--transition-speed);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

.sidebar.toggled {
    margin-left: calc(-1 * var(--sidebar-width));
}

.sidebar-header {
    padding: 1.5rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header .brand-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
}

.sidebar-header a {
    color: #fff;
    text-decoration: none;
}

.sidebar-nav {
    padding: 1rem 0;
}

.sidebar-nav .nav-item {
    margin-bottom: 0.25rem;
}

.sidebar-nav .nav-link {
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    color: #fff;
    background: var(--sidebar-hover);
    border-left-color: var(--primary-color);
}

.sidebar-nav .nav-link i {
    min-width: 25px;
    margin-right: 10px;
}

.sidebar-nav .nav-link .arrow {
    margin-left: auto;
    transition: transform 0.2s;
}

.sidebar-nav .nav-link[aria-expanded="true"] .arrow {
    transform: rotate(90deg);
}

/* Submenu */
.sidebar-nav .submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    background: rgba(0, 0, 0, 0.2);
}

.sidebar-nav .submenu .nav-link {
    padding-left: 3.5rem;
    font-size: 0.9rem;
}

/* Content Wrapper */
.content-wrapper {
    width: 100%;
    margin-left: var(--sidebar-width);
    transition: all var(--transition-speed);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.content-wrapper.toggled {
    margin-left: 0;
}

/* Navbar */
.navbar {
    padding: 1rem 1.5rem;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem 1.5rem;
    background: #f8f9fa;
}

/* Footer */
.footer {
    padding: 1rem 1.5rem;
    background: #fff;
    border-top: 1px solid #dee2e6;
}

/* Cards */
.card {
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 1.25rem;
}

/* Dashboard Stats */
.stat-card {
    border-left: 4px solid;
}

.stat-card.primary {
    border-left-color: var(--primary-color);
}

.stat-card.success {
    border-left-color: #198754;
}

.stat-card.warning {
    border-left-color: #ffc107;
}

.stat-card.danger {
    border-left-color: #dc3545;
}

.stat-card .stat-icon {
    font-size: 2rem;
    opacity: 0.3;
}

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: bold;
}

.stat-card .stat-label {
    color: #6c757d;
    font-size: 0.875rem;
}

/* Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.gallery-item {
    position: relative;
    border-radius: 0.5rem;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
}

.gallery-item:hover {
    transform: scale(1.05);
}

.gallery-item img,
.gallery-item video {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.gallery-item .overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.gallery-item:hover .overlay {
    opacity: 1;
}

.gallery-item .overlay .actions {
    display: flex;
    gap: 0.5rem;
}

/* Upload Area */
.upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(13, 110, 253, 0.05);
}

.upload-area i {
    font-size: 3rem;
    color: #6c757d;
}

/* Tables */
.table-responsive {
    border-radius: 0.5rem;
    overflow: hidden;
}

.table thead th {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

/* Buttons */
.btn {
    border-radius: 0.375rem;
}

.btn-circle {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Modal */
.modal-header {
    border-bottom: 1px solid #e9ecef;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
    }
    
    .sidebar.toggled {
        margin-left: 0;
    }
    
    .content-wrapper {
        margin-left: 0;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

/* Scrollbar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1050;
}

/* Badge Roles */
.badge-admin { background-color: #dc3545; }
.badge-operador { background-color: #0d6efd; }
.badge-soporte { background-color: #ffc107; color: #000; }
.badge-supervisor { background-color: #198754; }
