:root {
    --sidebar-width: 250px;
    --topbar-height: 56px;
    --sidebar-bg: #1e2530;
    --sidebar-bg-hover: #2c3444;
    --brand-accent: #3b7ddd;
}

body {
    background-color: #f4f6f9;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: #c2c7d0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.2s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 20px;
    color: #c2c7d0;
    text-decoration: none;
    font-size: 0.92rem;
    border-left: 3px solid transparent;
}

.sidebar-nav a i {
    width: 18px;
    text-align: center;
}

.sidebar-nav a:hover {
    background: var(--sidebar-bg-hover);
    color: #fff;
}

.sidebar-nav a.active {
    background: var(--sidebar-bg-hover);
    color: #fff;
    border-left-color: var(--brand-accent);
}

.sidebar-section {
    color: #6c7686;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 14px 20px 6px;
}

.topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #e3e6ec;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 900;
}

.topbar-title {
    font-weight: 600;
    color: #2c3444;
}

.topbar-user {
    display: flex;
    align-items: center;
}

.app-layout .content-wrapper {
    margin-left: var(--sidebar-width);
    padding-top: calc(var(--topbar-height) + 20px);
    padding-left: 24px;
    padding-right: 24px;
    min-height: 100vh;
}

.small-box {
    border-radius: 6px;
    color: #fff;
    padding: 20px;
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
}

.small-box .icon {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 3.2rem;
    opacity: 0.35;
}

.small-box .inner .value {
    font-size: 2.1rem;
    font-weight: 700;
    line-height: 1;
}

.small-box .inner .label {
    margin-top: 4px;
    font-size: 0.95rem;
}

.small-box a.more {
    display: block;
    background: rgba(0,0,0,0.12);
    color: #fff;
    padding: 6px 14px;
    font-size: 0.82rem;
    text-decoration: none;
    margin: 14px -20px -20px;
}

.small-box a.more:hover {
    background: rgba(0,0,0,0.22);
    color: #fff;
}

.bg-primary-box { background: #3b7ddd; }
.bg-danger-box { background: #dc3545; }
.bg-warning-box { background: #ffc107; color: #2c3444 !important; }
.bg-success-box { background: #198754; }

.card {
    border: none;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #eef0f4;
    font-weight: 600;
    color: #2c3444;
}

.fila-clickeable, .fila-clickeable td {
    cursor: pointer !important;
}

.fila-clickeable:hover {
    filter: brightness(0.97);
}

.col-flecha {
    width: 32px;
    text-align: center;
    color: #c2c7d0;
}

.fila-clickeable:hover .col-flecha {
    color: #3b7ddd;
}

.fila-urgencia-verde {
    background-color: #e8f7ee;
}

.fila-urgencia-amarillo {
    background-color: #fef6e0;
}

.fila-urgencia-rojo {
    background-color: #fdeaea;
}

.leyenda-color {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    margin-right: 4px;
    vertical-align: middle;
}

.foto-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.foto-thumb {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e3e6ec;
    background: #f4f6f9;
    padding: 0;
    cursor: pointer;
}

.foto-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.15s ease;
}

.foto-thumb:hover img {
    transform: scale(1.05);
}

.foto-thumb .foto-fecha {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 0.72rem;
    padding: 3px 6px;
    text-align: center;
}

.carrusel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.85;
}

.carrusel-nav:hover {
    opacity: 1;
}

.carrusel-prev { left: 12px; }
.carrusel-next { right: 12px; }

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    body.sidebar-open .sidebar {
        transform: translateX(0);
    }
    .topbar, .app-layout .content-wrapper {
        left: 0;
        margin-left: 0;
    }
}
