/* Enterprise Grade Design System */
:root {
    --sidebar-width: 260px;
    --sidebar-bg: #111116;
    --bg-workspace: #f4f7f6;
    --accent-blue: #3b82f6;
    --text-muted: #64748b;
    --text-nav: #94a3b8;
    --white: #ffffff;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-workspace);
    color: #1e293b;
    margin: 0;
    overflow-x: hidden;
}

/* Sidebar Styling */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: var(--text-nav);
    z-index: 1000;
    transition: all 0.3s;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-heading {
    color: var(--white);
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 2rem;
    padding: 0 0.5rem;
    letter-spacing: -0.025em;
}

.nav-link {
    color: var(--text-nav);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: all 0.2s;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--white);
}

.nav-link.active {
    background-color: var(--accent-blue);
    color: var(--white);
}

.sidebar .collapse .nav-link.active {
    background-color: rgba(255, 255, 255, 0.15) !important;
    color: var(--white) !important;
    font-weight: 600;
}

/* Main Content Wrapper */
.main-wrapper {
    margin-left: var(--sidebar-width);
    padding: 2rem;
    min-height: 100vh;
}

/* KPI Cards */
.kpi-card {
    background: var(--white);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    height: 100%;
    transition: transform 0.2s;
}

.kpi-card:hover {
    transform: translateY(-2px);
}

.kpi-label {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.kpi-value {
    font-size: 1.875rem;
    font-weight: 700;
    margin-top: 0.5rem;
}

/* Status Indicators */
.status-dot {
    height: 10px;
    width: 10px;
    border-radius: 50%;
    display: inline-block;
}

.status-active {
    background-color: var(--success);
    filter: drop-shadow(0 0 3px var(--success));
}

.status-pending {
    background-color: var(--warning);
}

.status-error {
    background-color: var(--danger);
}

/* Support Ticket Priorities */
.priority-alta {
    border-left: 4px solid #dc3545 !important;
}

.priority-media {
    border-left: 4px solid #ffc107 !important;
}

.priority-baja {
    border-left: 4px solid #0d6efd !important;
}

/* --- Responsive Design (Mobile & Tablet) --- */
.mobile-topbar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: var(--sidebar-bg);
    color: var(--white);
    z-index: 999;
    align-items: center;
    padding: 0 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.mobile-topbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    margin-left: 1rem;
    display: flex;
    align-items: center;
    color: var(--white);
    text-decoration: none;
}

@media (max-width: 991.98px) {
    .mobile-topbar {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
        box-shadow: 10px 0 50px rgba(0,0,0,0.5);
    }

    .main-wrapper {
        margin-left: 0 !important;
        padding: 1rem !important;
        padding-top: 5rem !important; /* Space for the mobile topbar */
    }
    
    /* Ensure tables can scroll horizontally on mobile without breaking layout */
    .table-responsive {
        overflow-x: auto;
    }
}

/* Utility: compact text size (global) */
.x-small {
    font-size: 0.72em !important;
}

/* Responsive Table-to-Card Grid Layout */
@media (min-width: 768px) {
    .responsive-card-view {
        display: none !important;
    }
}

@media (max-width: 767.98px) {
    .responsive-table-view {
        display: none !important;
    }

    .responsive-card-view {
        display: flex !important;
        flex-direction: column;
        gap: 1rem;
    }

    .mobile-card {
        background: var(--white);
        border: 1px solid rgba(0, 0, 0, 0.08);
        border-radius: 12px;
        padding: 1.1rem;
        box-shadow: 0 2px 8px rgba(0,0,0,0.04);
        transition: transform 0.2s, box-shadow 0.2s;
    }

    .mobile-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    }

    /* Main wrapper padding reduction on mobile */
    .main-wrapper {
        padding: 0.75rem !important;
    }

    /* Card padding reduction on mobile */
    .card.p-4 {
        padding: 1rem !important;
    }

    /* KPI card text truncation on very small screens */
    .col-4 .card .x-small {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}