/* Variables */
:root {
    --primary-color: #2563eb;
    --navbar-height: 56px;
    --bottom-nav-height: 60px;
}

/* General */
body {
    padding-top: var(--navbar-height);
    padding-bottom: calc(var(--bottom-nav-height) + 20px);
    background-color: #f8f9fa;
}

/* Navbar */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: 600;
}

/* Sidebar para Admin */
.has-sidebar .sidebar {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    width: 220px;
    height: calc(100vh - var(--navbar-height));
    overflow-y: auto;
    z-index: 100;
}

.has-sidebar .main-wrapper {
    margin-left: 220px;
}

.sidebar .nav-link {
    padding: 10px 15px;
    border-radius: 5px;
    margin: 2px 0;
    transition: background-color 0.2s;
}

.sidebar .nav-link:hover {
    background-color: rgba(255,255,255,0.1);
}

.sidebar .nav-link.active {
    background-color: var(--primary-color);
}

.sidebar .nav-link i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: white;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #6c757d;
    font-size: 0.75rem;
    padding: 5px 15px;
}

.bottom-nav a i {
    font-size: 1.3rem;
    margin-bottom: 2px;
}

.bottom-nav a.active {
    color: var(--primary-color);
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-radius: 10px;
}

.card-header {
    background-color: white;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

/* List Groups */
.list-group-item {
    border-left: none;
    border-right: none;
}

.list-group-item:first-child {
    border-top: none;
}

/* Progress bars */
.progress {
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    transition: width 0.5s ease;
}

/* Badges */
.badge {
    font-weight: 500;
}

/* Forms */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
}

/* Notifications dropdown */
.notif-dropdown {
    border: none;
    box-shadow: 0 5px 25px rgba(0,0,0,0.15);
}

.notif-dropdown .dropdown-item {
    white-space: normal;
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
}

/* Responsive */
@media (max-width: 991.98px) {
    .has-sidebar .sidebar {
        display: none;
    }

    .has-sidebar .main-wrapper {
        margin-left: 0;
    }

    body.has-sidebar {
        padding-bottom: calc(var(--bottom-nav-height) + 20px);
    }
}

@media (min-width: 992px) {
    .bottom-nav {
        display: none !important;
    }

    body {
        padding-bottom: 20px;
    }
}

/* Utilidades */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Animaciones */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 2s infinite;
}

/* PWA Install Banner */
.pwa-install-banner {
    position: fixed;
    bottom: 70px;
    left: 10px;
    right: 10px;
    background: linear-gradient(135deg, var(--primary-color), #1e40af);
    color: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    z-index: 999;
    display: none;
}

.pwa-install-banner.show {
    display: block;
}

/* Foto preview */
#preview-foto img {
    max-height: 200px;
    object-fit: contain;
}

/* Table responsive en mobile */
@media (max-width: 767.98px) {
    .table-responsive {
        font-size: 0.875rem;
    }

    .table td, .table th {
        padding: 0.5rem;
    }
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Status badges */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 5px;
}

.status-dot.online { background-color: #28a745; }
.status-dot.offline { background-color: #dc3545; }
.status-dot.away { background-color: #ffc107; }
