/* ============================================================
   DESIGN TOKENS & COLOR PALETTE
   ============================================================ */
:root {
    --dash-canvas: #f4f6f9;
    --dash-card: #ffffff;
    --dash-border: #e2e8f0;
    --dash-slate: #1e293b;
    --dash-navy: #0f172a;
    --dash-blue: #2563eb;
    --dash-emerald: #059669;
    --dash-amber: #d97706;
    --dash-red: #dc2626;
    --dash-text-dark: #0f172a;
    --dash-text-muted: #64748b;
}

body {
    background-color: var(--dash-canvas);
}

/* ============================================================
   GLOBAL NAVIGATION & SCAFFOLDING
   ============================================================ */
.navbar-custom {
    background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
    border-bottom: 2px solid #0d6efd;
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 0.85rem !important;
    transition: all 0.2s ease-in-out;
}

.nav-link:hover {
    color: #60a5fa !important;
}

.dropdown-item:active {
    background-color: #0d6efd;
}

.avatar-nav {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #60a5fa;
}

.status-dot {
    width: 9px;
    height: 9px;
    background-color: #10b981;
    border-radius: 50%;
    display: inline-block;
}

header.sticky-top {
    z-index: 1030;
}

footer.fixed-bottom {
    z-index: 1020;
    background-color: #ffffff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

main.main-content {
    padding-bottom: 75px !important;
}

/* ============================================================
   MATRIX CARDS & DASHBOARD TABLES
   ============================================================ */
.matrix-card {
    background: var(--dash-card);
    border: 1px solid var(--dash-border);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.matrix-card:hover {
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.table-scroll-window {
    max-height: 235px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f8fafc;
}

.table-scroll-window::-webkit-scrollbar {
    width: 5px;
}

.table-scroll-window::-webkit-scrollbar-track {
    background: #f8fafc;
}

.table-scroll-window::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.matrix-table {
    margin-bottom: 0;
    font-size: 0.84rem;
}

.matrix-table thead th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    color: var(--dash-text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--dash-border);
    z-index: 2;
    padding: 0.6rem 0.75rem;
}

.matrix-table tbody td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    color: var(--dash-text-dark);
}

/* Badges & Pulsing Outage Alerts */
.badge-ticket-open {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    font-weight: 700;
    font-size: 0.7rem;
    padding: 0.25rem 0.55rem;
    border-radius: 9999px;
    letter-spacing: 0.3px;
}

.badge-ticket-closed {
    background-color: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
    font-weight: 700;
    font-size: 0.7rem;
    padding: 0.25rem 0.55rem;
    border-radius: 9999px;
    letter-spacing: 0.3px;
}

.pulse-dot-alert {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--dash-red);
    display: inline-block;
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4);
    animation: pulse-ring 1.8s infinite cubic-bezier(0.66, 0, 0, 1);
}

@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.5); }
    70% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

/* ============================================================
   RESPONSIVE MOBILE ADJUSTMENTS (< 768px)
   ============================================================ */
@media (max-width: 767.98px) {
    footer.fixed-bottom {
        position: static !important;
        box-shadow: none !important;
        margin-top: auto;
    }

    main.main-content {
        padding-bottom: 1.5rem !important;
        margin-top: 1rem !important;
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    .dropdown-menu-end {
        right: 0 !important;
        left: auto !important;
        max-width: 92vw !important;
    }

    .d-flex.align-items-center.gap-2.flex-wrap a.btn {
        flex: 1 1 calc(50% - 0.5rem);
        text-align: center;
        padding: 0.4rem 0.5rem !important;
        font-size: 0.75rem !important;
    }

    .matrix-card {
        padding: 0.75rem !important;
    }

    .matrix-card h4 {
        font-size: 1.25rem !important;
    }

    .table-scroll-window {
        max-height: 40vh !important;
        -webkit-overflow-scrolling: touch;
    }

    .matrix-card div[style*="height: 175px"] {
        height: 150px !important;
    }

    .table-scroll-window table {
        min-width: 580px;
    }
}