/* ========================================
   Julmedics Custom Styles
   ======================================== */

:root {
    /* Julmedics Brand Colors - Basados en el logo oficial */
    --julmedics-primary: #1B3A6D;      /* Azul marino del logo */
    --julmedics-secondary: #20B2AA;    /* Turquesa del logo */
    --julmedics-primary-dark: #122643;
    --julmedics-secondary-dark: #188B85;
    --julmedics-primary-light: #2D5090;
    --julmedics-secondary-light: #40C9C0;
    --julmedics-gray: #808080;         /* Gris del subtítulo */
}

/* Override Bootstrap primary colors with Julmedics brand */
.btn-primary {
    background-color: var(--julmedics-primary);
    border-color: var(--julmedics-primary);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: var(--julmedics-primary-dark);
    border-color: var(--julmedics-primary-dark);
}

.btn-info {
    background-color: var(--julmedics-primary);
    border-color: var(--julmedics-primary);
}

.btn-info:hover,
.btn-info:focus,
.btn-info:active {
    background-color: var(--julmedics-primary-dark);
    border-color: var(--julmedics-primary-dark);
}

.text-primary {
    color: var(--julmedics-primary) !important;
}

.bg-primary {
    background-color: var(--julmedics-primary) !important;
}

/* Success color override with Julmedics green */
.text-success {
    color: var(--julmedics-secondary) !important;
}

.bg-success {
    background-color: var(--julmedics-secondary) !important;
}

/* Auth page customizations */
.auth-page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.auth-one-bg {
    /* Gradiente usando los colores del logo Julmedics */
    background: linear-gradient(135deg, var(--julmedics-primary) 0%, var(--julmedics-secondary) 100%);
}

.auth-logo img {
    max-height: 80px;
    /* Asegurar que el logo se vea bien en el fondo degradado */
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
    transition: transform 0.3s ease;
}

.auth-logo:hover img {
    transform: scale(1.05);
}

/* Mejorar contraste del subtítulo en auth pages */
.auth-page-content .text-white-50 {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Form customizations */
.form-control:focus {
    border-color: var(--julmedics-primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
}

.form-check-input:checked {
    background-color: var(--julmedics-primary);
    border-color: var(--julmedics-primary);
}

/* Loading spinner */
.spinner-border-julmedics {
    color: var(--julmedics-primary);
}

/* Card hover effects */
.card {
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Smooth transitions */
.btn,
.form-control,
.card {
    transition: all 0.3s ease;
}

/* Password toggle button */
.password-addon {
    color: #878a99;
    transition: color 0.3s ease;
}

.password-addon:hover {
    color: var(--julmedics-primary);
}

/* Link colors */
a {
    color: var(--julmedics-primary);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--julmedics-primary-dark);
}

/* Loading state */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .auth-logo img {
        max-height: 40px;
    }

    .card {
        margin: 1rem;
    }
}

/* Accessibility improvements */
.form-control:focus,
.btn:focus,
.form-check-input:focus {
    outline: 2px solid var(--julmedics-primary);
    outline-offset: 2px;
}

/* Alert customizations */
.alert-danger {
    background-color: #ffeef0;
    border-color: #ff5757;
    color: #c41e3a;
}

.alert-success {
    background-color: #e6f9f0;
    border-color: var(--julmedics-secondary);
    color: var(--julmedics-secondary-dark);
}

.alert-info {
    background-color: #e6f2ff;
    border-color: var(--julmedics-primary);
    color: var(--julmedics-primary-dark);
}

/* Footer */
.footer {
    padding: 1.5rem 0;
    margin-top: auto;
}

.footer .text-muted {
    font-size: 0.875rem;
}

/* ============================================
   SIDEBAR UX IMPROVEMENTS
   ============================================ */

/* Quick Access Links - Estilo compacto */
.quick-access-link {
    display: flex;
    align-items: center;
    padding: 0.55rem 1rem !important;
    margin: 0.125rem 0.75rem;
    border-radius: 0.375rem;
    transition: all 0.25s ease;
    background: transparent;
    border-left: 3px solid transparent;
}

.quick-access-link i {
    font-size: 1.1rem;
    width: 24px;
    margin-right: 0.75rem;
    transition: transform 0.25s ease;
}

.quick-access-link span:not(.badge) {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--vz-gray-700);
}

.quick-access-link .badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    font-weight: 600;
    display: none; /* Oculto por defecto, se muestra vía JavaScript */
    animation: fadeIn 0.3s ease-in;
}

.quick-access-link:hover {
    background: var(--vz-gray-100);
    border-left-color: var(--vz-gray-300);
    transform: translateX(2px);
    text-decoration: none;
}

.quick-access-link:hover i {
    transform: scale(1.15);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Menu Separator */
.menu-separator {
    margin: 0.75rem 1.5rem;
    border-color: var(--vz-gray-200);
    opacity: 0.5;
}

/* Enhanced Nav Link Styles */
.nav-link {
    transition: all 0.25s ease-in-out;
    position: relative;
    border-radius: 0.375rem;
    margin: 0.125rem 0.5rem;
}

.nav-link:hover {
    background-color: var(--vz-gray-100);
    padding-left: 1.25rem;
}

.nav-link.active {
    background: linear-gradient(90deg,
        rgba(64, 81, 137, 0.12) 0%,
        rgba(64, 81, 137, 0.04) 100%);
    border-left: 3px solid var(--vz-primary);
    font-weight: 600;
    padding-left: 1rem;
}

.nav-link.active i {
    color: var(--vz-primary);
}

/* Badges in Navigation */
.nav-link .badge {
    margin-left: auto;
    font-size: 0.65rem;
    padding: 0.25rem 0.5rem;
    font-weight: 600;
}

/* Sidebar Search */
.sidebar-search {
    background: rgba(255, 255, 255, 0.5);
    border-bottom: 1px solid var(--vz-gray-200);
    margin-bottom: 0.5rem;
}

.sidebar-search input {
    background: white;
    border: 1px solid var(--vz-gray-300);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    transition: all 0.3s ease;
}

.sidebar-search input:focus {
    border-color: var(--vz-primary);
    box-shadow: 0 0 0 0.2rem rgba(64, 81, 137, 0.15);
    outline: none;
}

.sidebar-search .ri-search-line {
    pointer-events: none;
    font-size: 1rem;
}

/* Logo Header Styles */
.navbar-brand-box.horizontal-logo .logo-lg img {
    height: auto;
    max-height: 44px;
    width: auto;
    object-fit: contain;
}

.navbar-header {
    padding-top: 0.875rem;
    padding-bottom: 0.875rem;
}

/* Menu Title Styles */
.menu-title {
    padding: 0.75rem 1rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--vz-gray-500);
}

.menu-title i.ri-rocket-line {
    color: var(--vz-warning);
}

/* Dropdown Animations */
.menu-dropdown {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Submenu Styles */
.menu-dropdown .nav-sm .nav-link {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.menu-dropdown .nav-sm .nav-link i {
    font-size: 1rem;
    margin-right: 0.5rem;
    color: var(--vz-gray-500);
}

.menu-dropdown .nav-sm .nav-link:hover i {
    color: var(--vz-primary);
}

.menu-dropdown .nav-sm .nav-link.active {
    background: rgba(64, 81, 137, 0.08);
    color: var(--vz-primary);
    border-left: 2px solid var(--vz-primary);
}

/* Tooltip Styles */
.tooltip-inner {
    background-color: var(--vz-dark);
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
}

.tooltip.bs-tooltip-end .tooltip-arrow::before,
.tooltip.bs-tooltip-auto[data-popper-placement^=right] .tooltip-arrow::before {
    border-right-color: var(--vz-dark);
}

/* Icon Colors for Different Sections */
.nav-link i.ri-dashboard-2-line { color: #6366f1; }
.nav-link i.ri-file-list-3-line { color: #ef4444; }
.nav-link i.ri-tools-line { color: #10b981; }
.nav-link i.ri-device-line { color: #3b82f6; }
.nav-link i.ri-building-2-line { color: #f59e0b; }
.nav-link i.ri-file-chart-line { color: #8b5cf6; }
.nav-link i.ri-shield-check-line { color: #06b6d4; }
.nav-link i.ri-calendar-check-line { color: #10b981; }

/* Quick Access Link specific icon colors override */
.quick-access-link i.ri-dashboard-2-line { color: #6366f1 !important; }

.nav-link:hover i,
.nav-link.active i {
    /* Icons become primary color on hover/active */
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .quick-access-link {
        padding: 0.5rem 0.75rem !important;
        margin: 0.125rem 0.5rem;
    }

    .quick-access-link i {
        font-size: 1rem;
        width: 20px;
        margin-right: 0.5rem;
    }

    .quick-access-link span:not(.badge) {
        font-size: 0.8rem;
    }

    .quick-access-link .badge {
        font-size: 0.65rem;
        padding: 0.15rem 0.4rem;
    }

    .sidebar-search {
        padding: 0.5rem;
    }
}

/* Compact Sidebar Mode (Optional - Activado con clase .sidebar-compact) */
.sidebar-compact .nav-link span {
    display: none;
}

.sidebar-compact .quick-access-link span:not(.badge) {
    display: none;
}

.sidebar-compact .menu-title {
    text-align: center;
}

/* Smooth Scrollbar */
#scrollbar::-webkit-scrollbar {
    width: 6px;
}

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

#scrollbar::-webkit-scrollbar-thumb {
    background: var(--vz-gray-300);
    border-radius: 10px;
}

#scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--vz-gray-400);
}

/* Badge Soft Variants */
.badge-soft-danger {
    color: #dc2626;
    background-color: rgba(220, 38, 38, 0.1);
}

.badge-soft-success {
    color: #16a34a;
    background-color: rgba(22, 163, 74, 0.1);
}

.badge-soft-warning {
    color: #d97706;
    background-color: rgba(217, 119, 6, 0.1);
}

.badge-soft-info {
    color: #3b82f6;
    background-color: rgba(59, 130, 246, 0.1);
}

/* Background Subtle Variants */
.bg-primary-subtle {
    background-color: rgba(64, 81, 137, 0.1) !important;
}

.bg-success-subtle {
    background-color: rgba(16, 185, 129, 0.1) !important;
}

.bg-info-subtle {
    background-color: rgba(59, 130, 246, 0.1) !important;
}

.bg-warning-subtle {
    background-color: rgba(245, 158, 11, 0.1) !important;
}

/* Text Color Variants */
.text-primary {
    color: #405189 !important;
}

.text-success {
    color: #10b981 !important;
}

.text-info {
    color: #3b82f6 !important;
}

.text-warning {
    color: #f59e0b !important;
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    .sidebar-search input {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
        color: rgba(255, 255, 255, 0.9);
    }

    .quick-link {
        background: rgba(255, 255, 255, 0.05);
    }

    .quick-link:hover {
        background: rgba(255, 255, 255, 0.1);
    }
}

/* ============================================
   DASHBOARD METRIC CARDS - EQUAL HEIGHT
   ============================================ */

/* Ensure all metric cards have equal height */
.metric-card {
    height: 100%;
}

.metric-card .card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.metric-card .card-body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
}

/* Fixed height for titles to ensure alignment */
.metric-card .text-uppercase {
    min-height: 2.5rem;
    display: flex;
    align-items: center;
    line-height: 1.3;
}

/* ============================================
   SIDEBAR TOGGLE FUNCTIONALITY
   ============================================ */

/* Sidebar Toggle Button */
.sidebar-toggle-container {
    border-bottom: 1px solid var(--vz-gray-200);
}

.sidebar-toggle-container .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.sidebar-toggle-container .btn:hover {
    background-color: var(--vz-gray-200);
}

#sidebar-toggle-icon {
    transition: transform 0.3s ease;
    font-size: 1.2rem;
}

/* Hide toggle text on small screens to prevent overflow */
@media (max-width: 1042px) {
    .sidebar-toggle-text {
        display: none !important;
    }

    .sidebar-toggle-container .btn {
        padding: 0.5rem !important;
        justify-content: center;
    }

    /* Add more spacing between cards on smaller screens */
    .card {
        margin-bottom: 1rem !important;
    }

    .row {
        margin-left: -0.5rem !important;
        margin-right: -0.5rem !important;
    }

    .row > * {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
        margin-bottom: 0.75rem !important;
    }

    /* Metric cards need more breathing room */
    .metric-card {
        margin-bottom: 0.75rem !important;
    }
}

/* Collapsed Sidebar State */
body[data-sidebar-size="sm"] .app-menu {
    width: 70px !important;
    min-width: 70px !important;
}

body[data-sidebar-size="sm"] .sidebar-toggle-text,
body[data-sidebar-size="sm"] .logo-lg,
body[data-sidebar-size="sm"] .sidebar-search,
body[data-sidebar-size="sm"] .menu-title span,
body[data-sidebar-size="sm"] .nav-link span:not(.badge),
body[data-sidebar-size="sm"] .quick-access-link span:not(.badge) {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

body[data-sidebar-size="sm"] .logo-sm {
    display: inline-block !important;
}

body[data-sidebar-size="sm"] #sidebar-toggle-icon {
    transform: rotate(180deg);
}

body[data-sidebar-size="sm"] .sidebar-toggle-container .btn {
    justify-content: center;
    padding: 0.5rem;
    width: auto;
}

body[data-sidebar-size="sm"] .navbar-nav {
    text-align: center;
}

body[data-sidebar-size="sm"] .nav-link,
body[data-sidebar-size="sm"] .quick-access-link {
    justify-content: center;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
    margin: 0.125rem 0.25rem !important;
    overflow: hidden;
}

body[data-sidebar-size="sm"] .nav-link i,
body[data-sidebar-size="sm"] .quick-access-link i {
    margin-right: 0 !important;
    font-size: 1.2rem;
    flex-shrink: 0;
}

body[data-sidebar-size="sm"] .menu-title {
    text-align: center;
    padding: 0.75rem 0.25rem 0.5rem;
    overflow: hidden;
}

body[data-sidebar-size="sm"] .menu-title i {
    display: block;
    font-size: 1rem;
}

/* Badges del sidebar se mantienen visibles cuando está colapsado */

body[data-sidebar-size="sm"] .navbar-brand-box {
    width: 70px !important;
    text-align: center;
}

body[data-sidebar-size="sm"] #scrollbar {
    overflow-x: hidden !important;
}

body[data-sidebar-size="sm"] .container-fluid {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Submenus colapsados */
body[data-sidebar-size="sm"] .menu-dropdown {
    display: none !important;
}

/* Main content adjustment when sidebar is collapsed */
body[data-sidebar-size="sm"] .main-content {
    margin-left: 70px !important;
}

/* Smooth transitions for sidebar state changes */
.app-menu,
.main-content,
.logo-sm,
.logo-lg,
.sidebar-toggle-text,
.nav-link span,
.quick-access-link span,
.menu-title span {
    transition: all 0.3s ease;
}

/* ============================================
   LAPTOP SCREEN OPTIMIZATION (1366x768)
   ============================================ */

@media (max-width: 1400px) and (max-height: 800px) {
    /* Reduce general spacing */
    .page-content {
        padding: 1rem 0.75rem !important;
    }

    .container-fluid {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    /* Compact page title */
    .page-title-box {
        padding: 0.75rem 0 !important;
        margin-bottom: 0.75rem !important;
    }

    .page-title-box h4 {
        font-size: 1.1rem !important;
        margin-bottom: 0 !important;
    }

    /* Compact breadcrumbs */
    .breadcrumb {
        font-size: 0.75rem !important;
        margin-bottom: 0 !important;
    }

    .breadcrumb-item {
        padding: 0.25rem 0 !important;
    }

    /* Compact cards */
    .card {
        margin-bottom: 0.75rem !important;
    }

    .card-body {
        padding: 0.75rem !important;
    }

    .card-header {
        padding: 0.5rem 0.75rem !important;
        min-height: auto !important;
    }

    .card-footer {
        padding: 0.5rem 0.75rem !important;
    }

    /* Dashboard metric cards - size adjustments for laptops */
    .metric-card .card-body {
        padding: 0.75rem !important;
    }

    .metric-card .fs-22 {
        font-size: 1.25rem !important;
    }

    .metric-card .avatar-sm {
        height: 2.5rem !important;
        width: 2.5rem !important;
    }

    .metric-card .avatar-title {
        font-size: 1.25rem !important;
    }

    .metric-card .text-uppercase {
        font-size: 0.7rem !important;
        margin-bottom: 0.25rem !important;
        min-height: 2.1rem;
    }

    .metric-card .mt-4 {
        margin-top: 0.75rem !important;
    }

    /* Compact charts */
    .chart-container {
        padding: 0.75rem !important;
    }

    /* Reduce row spacing */
    .row {
        margin-left: -0.375rem !important;
        margin-right: -0.375rem !important;
    }

    .row > * {
        padding-left: 0.375rem !important;
        padding-right: 0.375rem !important;
    }

    /* Compact tables */
    .table {
        font-size: 0.8125rem !important;
    }

    .table > :not(caption) > * > * {
        padding: 0.4rem 0.5rem !important;
    }

    .table thead th {
        padding: 0.5rem 0.5rem !important;
        font-size: 0.75rem !important;
    }

    /* Compact buttons */
    .btn {
        padding: 0.4rem 0.75rem !important;
        font-size: 0.8125rem !important;
    }

    .btn-sm {
        padding: 0.25rem 0.5rem !important;
        font-size: 0.75rem !important;
    }

    .btn-lg {
        padding: 0.5rem 1rem !important;
        font-size: 0.9rem !important;
    }

    /* Compact form controls */
    .form-control,
    .form-select {
        padding: 0.4rem 0.75rem !important;
        font-size: 0.8125rem !important;
    }

    .form-label {
        font-size: 0.8125rem !important;
        margin-bottom: 0.25rem !important;
    }

    /* Compact modals */
    .modal-header {
        padding: 0.75rem 1rem !important;
    }

    .modal-body {
        padding: 0.75rem 1rem !important;
    }

    .modal-footer {
        padding: 0.5rem 1rem !important;
    }

    .modal-title {
        font-size: 1rem !important;
    }

    /* Compact alerts */
    .alert {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.8125rem !important;
        margin-bottom: 0.75rem !important;
    }

    /* Compact badges */
    .badge {
        padding: 0.25rem 0.5rem !important;
        font-size: 0.7rem !important;
    }

    /* Compact list groups */
    .list-group-item {
        padding: 0.5rem 0.75rem !important;
    }

    /* Compact sidebar */
    .app-menu {
        font-size: 0.85rem !important;
    }

    .nav-link {
        padding: 0.4rem 0.75rem !important;
    }

    .menu-title {
        font-size: 0.65rem !important;
        padding: 0.5rem 0.75rem 0.25rem !important;
    }

    /* Compact header/topbar */
    .navbar-header {
        min-height: 55px !important;
        padding: 0.5rem 0.75rem !important;
    }

    /* Reduce margins between sections */
    .mb-3 {
        margin-bottom: 0.75rem !important;
    }

    .mb-4 {
        margin-bottom: 1rem !important;
    }

    .mt-3 {
        margin-top: 0.75rem !important;
    }

    .mt-4 {
        margin-top: 1rem !important;
    }

    /* Compact pagination */
    .pagination {
        font-size: 0.8125rem !important;
    }

    .page-link {
        padding: 0.375rem 0.75rem !important;
    }

    /* Reduce footer height */
    .footer {
        padding: 0.75rem 0 !important;
        font-size: 0.75rem !important;
    }

    /* Compact dropdowns */
    .dropdown-menu {
        font-size: 0.8125rem !important;
    }

    .dropdown-item {
        padding: 0.375rem 1rem !important;
    }

    /* Avatar sizes */
    .avatar-xs {
        height: 1.5rem !important;
        width: 1.5rem !important;
    }

    .avatar-sm {
        height: 2rem !important;
        width: 2rem !important;
    }

    /* Compact tabs */
    .nav-tabs .nav-link {
        padding: 0.375rem 0.75rem !important;
        font-size: 0.8125rem !important;
    }

    /* Charts - reduce height */
    .apex-charts {
        min-height: 250px !important;
    }

    /* Compact icon sizes in cards */
    .card .fs-3 {
        font-size: 1.25rem !important;
    }

    /* Reduce widget card min-height */
    .mini-stats-wid {
        min-height: auto !important;
    }

    /* Optimize work orders table for laptop screens */
    #workOrdersTable {
        font-size: 0.75rem !important;
    }

    #workOrdersTable th {
        font-size: 0.7rem !important;
        padding: 0.4rem 0.3rem !important;
        white-space: nowrap;
    }

    #workOrdersTable td {
        padding: 0.3rem 0.3rem !important;
        vertical-align: middle !important;
    }

    #workOrdersTable .badge {
        font-size: 0.65rem !important;
        padding: 0.2rem 0.4rem !important;
    }

    #workOrdersTable small {
        font-size: 0.7rem !important;
    }

    /* Make filter section more compact */
    .border.rounded.p-3 {
        padding: 0.75rem !important;
    }

    .form-label.fw-semibold.mb-1.small {
        font-size: 0.7rem !important;
        margin-bottom: 0.25rem !important;
    }

    /* Compact dropdowns in filters */
    .form-select,
    .form-control {
        font-size: 0.75rem !important;
    }

    /* Stats cards in work orders page - more compact */
    .col-xl-3 .card {
        margin-bottom: 0.5rem !important;
    }

    .col-xl-3 .card-body {
        padding: 0.5rem !important;
    }

    .col-xl-3 .card .fs-22 {
        font-size: 1rem !important;
        margin-bottom: 0 !important;
    }

    .col-xl-3 .card .avatar-sm {
        height: 2rem !important;
        width: 2rem !important;
    }

    .col-xl-3 .card .avatar-title {
        font-size: 1rem !important;
    }

    .col-xl-3 .card .text-uppercase {
        font-size: 0.65rem !important;
    }

    .col-xl-3 .card .mt-4 {
        margin-top: 0.5rem !important;
    }
}

/* ============================================
   TABLE OPTIMIZATIONS - ALL SCREENS
   ============================================ */

/* Make tables horizontally scrollable without breaking layout */
.table-responsive {
    width: 100%;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
}

/* Force table to have fixed width to enable horizontal scroll */
#workOrdersTable {
    width: 1400px !important;
    table-layout: fixed !important;
}

/* Ensure table columns don't wrap unnecessarily */
#workOrdersTable th,
#workOrdersTable td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* All columns use ellipsis for overflow text */

/* Optimize column widths - CRITICAL: Fixed widths to prevent overflow */
#workOrdersTable th:nth-child(1) { width: 30px; max-width: 30px; } /* Checkbox */
#workOrdersTable th:nth-child(2) { width: 110px; max-width: 110px; } /* Número */
#workOrdersTable th:nth-child(3) { width: 90px; max-width: 90px; } /* Tipo */
#workOrdersTable th:nth-child(4) { width: 140px; max-width: 140px; } /* Cliente */
#workOrdersTable th:nth-child(5) { width: 140px; max-width: 140px; } /* Razón Social */
#workOrdersTable th:nth-child(6) { width: 140px; max-width: 140px; } /* Equipos */
#workOrdersTable th:nth-child(7) { width: 160px; max-width: 160px; } /* Ubicación */
#workOrdersTable th:nth-child(8) { width: 80px; max-width: 80px; } /* Prioridad */
#workOrdersTable th:nth-child(9) { width: 100px; max-width: 100px; } /* Estado */
#workOrdersTable th:nth-child(10) { width: 110px; max-width: 110px; } /* Técnico */
#workOrdersTable th:nth-child(11) { width: 130px; max-width: 130px; } /* Fecha */
#workOrdersTable th:nth-child(12) { width: 70px; max-width: 70px; } /* Acciones */

/* Apply same widths to td elements */
#workOrdersTable td:nth-child(1) { width: 30px; max-width: 30px; }
#workOrdersTable td:nth-child(2) { width: 110px; max-width: 110px; }
#workOrdersTable td:nth-child(3) { width: 90px; max-width: 90px; }
#workOrdersTable td:nth-child(4) { width: 140px; max-width: 140px; }
#workOrdersTable td:nth-child(5) { width: 140px; max-width: 140px; }
#workOrdersTable td:nth-child(6) { width: 140px; max-width: 140px; }
#workOrdersTable td:nth-child(7) { width: 160px; max-width: 160px; }
#workOrdersTable td:nth-child(8) { width: 80px; max-width: 80px; }
#workOrdersTable td:nth-child(9) { width: 100px; max-width: 100px; }
#workOrdersTable td:nth-child(10) { width: 110px; max-width: 110px; }
#workOrdersTable td:nth-child(11) { width: 130px; max-width: 130px; }
#workOrdersTable td:nth-child(12) { width: 70px; max-width: 70px; }

/* Mobile optimizations */
@media (max-width: 768px) {
    #workOrdersTable {
        font-size: 0.7rem !important;
    }

    #workOrdersTable th,
    #workOrdersTable td {
        padding: 0.25rem !important;
    }
}
