.logo {
    max-width: 250px;
    height: auto;
}

.card {
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn {
    padding: 12px 20px;
    border-radius: 8px;
}

.btn-primary {
    background-color: #8B0D32;
    border-color: #8B0D32;
}

.btn-primary:hover {
    background-color: #6d0a27;
    border-color: #6d0a27;
}

.btn-outline-primary {
    color: #8B0D32;
    border-color: #8B0D32;
}

.btn-outline-primary:hover {
    background-color: #8B0D32;
    border-color: #8B0D32;
}

.form-control {
    padding: 12px;
    border-radius: 8px;
}

.table th {
    background-color: #f8f9fa;
}

.action-buttons .btn {
    margin: 0 2px;
    padding: 8px 12px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container-fluid {
        padding: 0 15px;
    }
    
    .navbar-brand img {
        height: 30px;
    }
    
    .card {
        margin-bottom: 15px;
        border-radius: 12px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn-group {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .btn-group .btn {
        font-size: 12px;
        padding: 8px 12px;
        margin-bottom: 5px;
    }
    
    .table-responsive {
        font-size: 14px;
        border-radius: 8px;
        overflow: hidden;
    }
    
    .table {
        margin-bottom: 0;
    }
    
    .table th,
    .table td {
        padding: 12px 8px;
        vertical-align: middle;
        border-bottom: 1px solid #dee2e6;
    }
    
    .table tbody tr:hover {
        background-color: #f8f9fa;
    }
    
    .action-buttons .d-flex {
        min-width: 120px;
    }
    
    .action-buttons .btn {
        font-size: 12px;
        padding: 8px 12px;
        min-width: 40px;
        border-radius: 6px;
    }
    
    .form-control-sm {
        font-size: 14px;
        padding: 8px 12px;
        border-radius: 8px;
    }
    
    .form-label.small {
        font-size: 12px;
        font-weight: 600;
        color: #6c757d;
        margin-bottom: 4px;
    }
    
    .fw-bold {
        font-size: 14px;
        color: #212529;
    }
    
    .text-muted small {
        font-size: 12px;
        line-height: 1.2;
    }
}

@media (max-width: 576px) {
    .container-fluid {
        padding: 0 10px;
    }
    
    .navbar-brand {
        font-size: 16px;
    }
    
    .navbar-nav {
        text-align: center;
    }
    
    .navbar-nav .nav-link {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    .card-body {
        padding: 12px;
    }
    
    .card-title {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .table {
        font-size: 13px;
    }
    
    .table th,
    .table td {
        padding: 10px 6px;
    }
    
    .btn-group {
        justify-content: center;
    }
    
    .btn-group .btn {
        font-size: 11px;
        padding: 6px 10px;
    }
    
    .action-buttons .btn {
        font-size: 11px;
        padding: 6px 10px;
        min-width: 36px;
    }
    
    .form-control-sm {
        font-size: 13px;
        padding: 6px 10px;
    }
    
    .fw-bold {
        font-size: 13px;
    }
    
    .text-muted small {
        font-size: 11px;
    }
    
    .d-flex.gap-1 {
         gap: 0.25rem !important;
     }
 }

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px;
    background: linear-gradient(135deg, #8B0D32 0%, #6d0a27 100%);
    color: white;
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar-header {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

.sidebar-logo {
    height: 40px;
    margin-bottom: 0.5rem;
    filter: brightness(0) invert(1);
}

.sidebar-title {
    color: white;
    font-weight: 600;
    margin: 0;
    font-size: 1.1rem;
}

.sidebar-subtitle {
    color: rgba(255,255,255,0.8);
    font-weight: 400;
    margin: 0;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.sidebar-user {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    font-size: 2.5rem;
    color: rgba(255,255,255,0.8);
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.user-role {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.7);
}

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

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

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

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.5rem;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 0;
    position: relative;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    transform: translateX(5px);
}

.sidebar-nav .nav-link.active {
    background: rgba(255,255,255,0.15);
    color: white;
    border-right: 3px solid white;
}

.sidebar-nav .nav-link i {
    font-size: 1.1rem;
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
}

.sidebar-nav .nav-link span {
    font-weight: 500;
    font-size: 0.9rem;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: auto;
}

.sidebar-footer .btn {
    border-color: rgba(255,255,255,0.3);
    color: rgba(255,255,255,0.8);
    transition: all 0.3s ease;
}

.sidebar-footer .btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.5);
    color: white;
}

/* Mobile Header */
.mobile-header {
    background: white;
    border-bottom: 1px solid #dee2e6;
    position: sticky;
    top: 0;
    z-index: 999;
}

.mobile-header .btn-link {
    color: #8B0D32;
    text-decoration: none;
    padding: 0.5rem;
}

.mobile-header .btn-link:hover {
    color: #6d0a27;
}

/* Main Content */
.main-content {
    margin-left: 280px;
    min-height: 100vh;
    background: #f8f9fa;
    transition: margin-left 0.3s ease;
}

/* Sidebar Toggle Buttons */
.sidebar-toggle-show {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.sidebar-toggle-show:hover {
    background: #f8f9fa;
    transform: scale(1.05);
}

.sidebar-header .btn-link {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

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

/* Sidebar Hidden State */
.layout-container.sidebar-hidden .sidebar {
    transform: translateX(-100%);
}

.layout-container.sidebar-hidden .main-content {
    margin-left: 0;
}

.layout-container.sidebar-hidden .sidebar-toggle-show {
    display: flex !important;
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Mobile Responsive */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar-user {
        display: none !important;
    }
    
    .sidebar-footer {
        display: none !important;
    }
}

@media (max-width: 576px) {
    .sidebar {
        width: 260px;
    }
    
    .sidebar-nav .nav-link {
        padding: 0.75rem 1rem;
    }
    
    .sidebar-nav .nav-link i {
        margin-right: 0.5rem;
    }
    
    .sidebar-header {
         padding: 1rem;
     }
 }



.dropdown-menu {
    border: none;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-radius: 10px;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
}

.dropdown-header {
    color: #8B0D32;
    font-weight: 600;
    padding: 0.5rem 1rem;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: #f8f9fa;
    color: #8B0D32;
}

.dropdown-item.text-danger:hover {
    background: #f8d7da;
    color: #dc3545;
}

/* Welcome Card */
.welcome-card {
    background: linear-gradient(135deg, #8B0D32 0%, #A91B47 100%);
    color: white;
    padding: 2.5rem 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(139, 13, 50, 0.25);
}

.welcome-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: 0.3px;
}

.welcome-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 0;
    font-weight: 400;
}

.welcome-stats {
    display: flex;
    gap: 3rem;
}

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

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    opacity: 0.85;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Search Filters */
.search-filters {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.filter-title {
    color: #495057;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.btn-search {
    background: #8B0D32;
    border: none;
    color: white;
    font-weight: 500;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.btn-search:hover {
    background: #6d0a27;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 13, 50, 0.3);
}

/* Filter Card */
.filter-card .card-header {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.filter-card .card-title {
    color: #8B0D32;
    font-weight: 600;
}





@media (min-width: 769px) and (max-width: 1024px) {
    /* Tablet styles */
    .container {
        max-width: 95%;
    }
    
    .table {
        font-size: 15px;
    }
    
    .btn-group .btn {
        font-size: 14px;
        padding: 10px 15px;
    }
    
    .action-buttons .btn {
        padding: 8px 10px;
        margin: 0 3px;
    }
}

/* Modality Filters */
.modality-filters {
    margin-bottom: 1.5rem;
}

.modality-btn {
    background: white;
    border: 2px solid #e9ecef;
    color: #6c757d;
    padding: 0.5rem 1.2rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 60px;
}

.modality-btn:hover {
    border-color: #8B0D32;
    color: #8B0D32;
    background: #f8f9fa;
    transform: translateY(-1px);
}

.modality-btn.active {
    background: #8B0D32;
    border-color: #8B0D32;
    color: white;
    box-shadow: 0 2px 8px rgba(139, 13, 50, 0.3);
}

.modality-btn.active:hover {
    background: #6d0a27;
    border-color: #6d0a27;
    color: white;
}

/* Studies Table */
.studies-table {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
}

.studies-table thead {
    background: #f8f9fa;
}

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

.studies-table td {
    padding: 1rem 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f3f4;
    font-size: 0.9rem;
}

.studies-table tbody tr:hover {
    background-color: #f8f9fa;
    transition: background-color 0.2s ease;
}

/* Modality Badges */
.modality-badge {
    padding: 0.4rem 0.8rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #495057 !important; /* Color más oscuro para mejor legibilidad */
}

.modality-rx {
    background: #e3f2fd;
    color: #1976d2 !important;
}

.modality-tc {
    background: #fff3e0;
    color: #f57c00 !important;
}

/* Status Badges */
.status-badge {
    padding: 0.4rem 0.8rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-completed {
    background: #e8f5e8;
    color: #2e7d32;
}

.status-processing {
    background: #fff3e0;
    color: #f57c00;
}

/* Action Buttons */
.btn-action {
    border: 1px solid #e9ecef;
    background: white;
    color: #6c757d;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-view:hover {
    background: #8B0D32;
    border-color: #8B0D32;
    color: white;
}

.btn-download:hover {
    background: #6c757d;
    border-color: #6c757d;
    color: white;
}

/* Utility classes for responsive behavior */
.text-truncate-mobile {
    @media (max-width: 768px) {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 120px;
    }
}

.hide-mobile {
    @media (max-width: 576px) {
        display: none !important;
    }
}

.show-mobile {
    display: none;
    @media (max-width: 576px) {
        display: block !important;
    }
}