/*
 * Enterprise Light Portal Design System
 * Clean SaaS Theme: Deep Slate Sidebar, Pure White Cards, Royal Blue Accents
 * Created for T-M NETWORK Portal
 */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
    /* Enterprise Light Palette */
    --bg-app: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --bg-sidebar: #0f172a;
    --bg-header: #ffffff;
    
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-glow: rgba(37, 99, 235, 0.15);
    
    --success: #16a34a;
    --success-glow: rgba(22, 163, 74, 0.15);
    --warning: #d97706;
    --warning-glow: rgba(217, 119, 6, 0.15);
    --danger: #dc2626;
    --danger-glow: rgba(220, 38, 38, 0.15);
    --info: #0284c7;
    
    --border: #e2e8f0;
    --border-hover: #cbd5e1;
    --border-active: #93c5fd;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    /* Layout Constants */
    --sidebar-width: 260px;
    --transition-speed: 0.25s;
    --border-radius: 14px;
    --shadow-main: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-card: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
}

/* Master Reset & Typography */
body {
    background-color: var(--bg-app) !important;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text-primary) !important;
    overflow-x: hidden;
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
}

/* Scrollbar customization */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-app);
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Sidebar Styling - Professional Navy Contrast */
#sidebar-wrapper {
    width: var(--sidebar-width) !important;
    background: var(--bg-sidebar) !important;
    border-right: 1px solid #1e293b !important;
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    position: fixed;
    height: 100vh;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.08);
}

.sidebar-heading {
    padding: 1.75rem 1.5rem !important;
    font-size: 1.25rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.02em;
    color: #ffffff !important;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #1e293b !important;
}

.sidebar-heading i {
    color: #60a5fa;
}

#sidebar-wrapper .list-group {
    padding: 1.25rem 0.85rem !important;
    gap: 4px;
}

#sidebar-wrapper .list-group-item {
    border: none !important;
    padding: 0.75rem 1rem !important;
    margin: 0 !important;
    border-radius: 10px !important;
    color: #94a3b8 !important;
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    background: transparent !important;
    transition: all 0.2s ease;
}

#sidebar-wrapper .list-group-item i {
    margin-right: 12px !important;
    font-size: 1.05rem;
    width: 22px;
    text-align: center;
    color: #64748b;
    transition: all 0.2s ease;
}

#sidebar-wrapper .list-group-item:hover {
    background: rgba(255, 255, 255, 0.06) !important;
    color: #ffffff !important;
    transform: translateX(3px);
}

#sidebar-wrapper .list-group-item:hover i {
    color: #60a5fa;
}

#sidebar-wrapper .list-group-item.active {
    background: var(--primary) !important;
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

#sidebar-wrapper .list-group-item.active i {
    color: #ffffff !important;
}

#sidebar-wrapper .list-group-item.text-danger {
    color: #f87171 !important;
    margin-top: 1.5rem !important;
    border-top: 1px solid #1e293b !important;
}

#sidebar-wrapper .list-group-item.text-danger:hover {
    background: rgba(239, 68, 68, 0.1) !important;
}

#sidebar-wrapper .list-group-item.text-danger i {
    color: #ef4444;
}

/* Page Layout & Container */
#wrapper {
    display: flex;
    width: 100vw;
    min-height: 100vh;
    overflow-x: hidden;
}

#page-content-wrapper {
    width: calc(100% - var(--sidebar-width)) !important;
    margin-left: var(--sidebar-width) !important;
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

#wrapper.toggled #sidebar-wrapper {
    margin-left: calc(-1 * var(--sidebar-width)) !important;
}

#wrapper.toggled #page-content-wrapper {
    width: 100% !important;
    margin-left: 0 !important;
}

.container-fluid-custom, .container-fluid {
    padding: 1.5rem 1.75rem !important;
    flex-grow: 1;
    max-width: 100%;
    box-sizing: border-box;
}

/* Navbar top style */
.navbar {
    background: var(--bg-header) !important;
    border-bottom: 1px solid var(--border) !important;
    padding: 0.85rem 2rem !important;
    position: sticky;
    top: 0;
    z-index: 990;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

#menu-toggle, #sidebarToggle {
    background: #f1f5f9 !important;
    border: 1px solid var(--border) !important;
    color: var(--text-primary) !important;
    border-radius: 10px !important;
    padding: 0.5rem 0.75rem !important;
    transition: all 0.2s ease;
}

#menu-toggle:hover, #sidebarToggle:hover {
    background: #e2e8f0 !important;
    color: var(--primary) !important;
}

.dropdown-toggle {
    background: #f8fafc;
    border: 1px solid var(--border);
    color: var(--text-primary) !important;
    padding: 0.5rem 1.1rem !important;
    border-radius: 30px !important;
    font-weight: 500;
}

.dropdown-toggle::after {
    border-top-color: var(--text-secondary);
}

.dropdown-menu {
    background: #ffffff !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow-card) !important;
    border-radius: 14px !important;
    padding: 0.5rem !important;
    margin-top: 0.5rem !important;
}

.dropdown-item {
    color: var(--text-secondary) !important;
    border-radius: 8px !important;
    padding: 0.55rem 0.9rem !important;
    font-size: 0.9rem;
    font-weight: 500;
}

.dropdown-item:hover {
    background: #f1f5f9 !important;
    color: var(--text-primary) !important;
}

.dropdown-item.text-danger {
    color: #dc2626 !important;
}

.dropdown-item.text-danger:hover {
    background: #fef2f2 !important;
}

/* Enterprise Pure White Cards */
.card {
    background: #ffffff !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--border-radius) !important;
    box-shadow: var(--shadow-main) !important;
    margin-bottom: 1.5rem !important;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card) !important;
    border-color: var(--border-hover) !important;
}

.card-header {
    background: #ffffff !important;
    border-bottom: 1px solid var(--border) !important;
    padding: 1.25rem 1.5rem !important;
    font-weight: 700 !important;
    font-size: 1rem;
    color: var(--text-primary) !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body {
    padding: 1.5rem !important;
    color: var(--text-secondary);
}

.card-footer {
    background: #f8fafc !important;
    border-top: 1px solid var(--border) !important;
    padding: 1rem 1.5rem !important;
}

/* Dashboard Statistics Grid */
.stat-card {
    background: #ffffff !important;
    border: 1px solid var(--border) !important;
}

.stat-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modern Clean Tables */
.table-responsive {
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #ffffff;
    overflow: hidden;
}

.table {
    margin-bottom: 0 !important;
    background: #ffffff !important;
    color: var(--text-primary) !important;
}

.table th {
    background-color: #f8fafc !important;
    color: var(--text-secondary) !important;
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 1rem 1.25rem !important;
    border-bottom: 1px solid var(--border) !important;
}

.table td {
    padding: 1rem 1.25rem !important;
    border-bottom: 1px solid var(--border) !important;
    vertical-align: middle;
    color: var(--text-primary) !important;
}

.table tbody tr {
    transition: background-color 0.15s ease;
}

.table tbody tr:hover {
    background-color: #f8fafc !important;
}

.table tbody tr:last-child td {
    border-bottom: none !important;
}

/* Badges and status states */
.badge-status {
    padding: 0.35rem 0.75rem;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.badge-status.bg-soft-success {
    background: #dcfce7 !important;
    color: #15803d !important;
    border: 1px solid #bbf7d0 !important;
}

.badge-status.bg-soft-danger {
    background: #fee2e2 !important;
    color: #b91c1c !important;
    border: 1px solid #fecaca !important;
}

.badge-status.bg-soft-warning {
    background: #fef3c7 !important;
    color: #b45309 !important;
    border: 1px solid #fde68a !important;
}

/* Forms */
.form-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.82rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.form-control, .form-select {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: var(--text-primary) !important;
    border-radius: 10px !important;
    padding: 0.7rem 1rem !important;
    font-size: 0.95rem;
    transition: all 0.2s ease !important;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12) !important;
    outline: none !important;
}

/* Buttons */
.btn {
    border-radius: 10px !important;
    padding: 0.65rem 1.25rem !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    transition: all 0.2s ease !important;
}

.btn-primary {
    background-color: var(--primary) !important;
    border: none !important;
    color: white !important;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2) !important;
}

.btn-primary:hover {
    background-color: var(--primary-hover) !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3) !important;
}

.avatar-circle {
    width: 36px;
    height: 36px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #2563eb;
}

code {
    background-color: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
}

/* Footer Section */
footer {
    border-top: 1px solid var(--border);
    background: #ffffff;
    color: var(--text-muted);
}

/* Responsive Media Queries */
@media (max-width: 991.98px) {
    #sidebar-wrapper {
        margin-left: calc(-1 * var(--sidebar-width)) !important;
    }
    #page-content-wrapper {
        width: 100% !important;
        margin-left: 0 !important;
    }
    #wrapper.toggled #sidebar-wrapper {
        margin-left: 0 !important;
    }
    #wrapper.toggled #page-content-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
    }
}


/* ======================================
   DASHBOARD GRADIENT STAT CARDS
   ====================================== */
.stat-card-gradient {
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 110px;
}
.stat-card-gradient:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
}
.stat-card-gradient::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
}
.stat-card-gradient::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: -20%;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
}
.stat-card-blue {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    box-shadow: 0 8px 32px rgba(37, 99, 235, 0.25);
}
.stat-card-green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.25);
}
.stat-card-orange {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 8px 32px rgba(245, 158, 11, 0.25);
}
.stat-card-purple {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.25);
}
.stat-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
    flex-shrink: 0;
    backdrop-filter: blur(8px);
    position: relative;
    z-index: 1;
}
.stat-card-content {
    position: relative;
    z-index: 1;
}
.stat-card-label {
    color: rgba(255,255,255,0.8);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 2px;
}
.stat-card-value {
    color: #fff;
    font-weight: 800;
    font-size: 1.7rem;
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1.1;
}
.stat-card-badge {
    color: rgba(255,255,255,0.75);
    font-size: 0.68rem;
    font-weight: 500;
    display: inline-block;
    margin-top: 4px;
}

/* Mini Stat Icons */
.mini-stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

/* Activity Feed */
.activity-item {
    transition: background-color 0.15s ease;
}
.activity-item:hover {
    background-color: #f8fafc;
}

/* Pulse Dot */
.pulse-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #10b981;
    display: inline-block;
    position: relative;
    animation: pulse-ring 2s ease infinite;
}
.pulse-dot::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid #10b981;
    animation: pulse-ring-outer 2s ease infinite;
}
@keyframes pulse-ring {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
@keyframes pulse-ring-outer {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.8); opacity: 0; }
}

/* Badge Status Variants */
.bg-soft-info {
    background-color: rgba(2, 132, 199, 0.12) !important;
    color: #0284c7 !important;
    border: 1px solid rgba(2, 132, 199, 0.2);
}
.bg-soft-secondary {
    background-color: rgba(100, 116, 139, 0.12) !important;
    color: #64748b !important;
    border: 1px solid rgba(100, 116, 139, 0.2);
}

/* Chart Card Improvements */
canvas {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
}

/* ======================================
   DASHBOARD GRADIENT STAT CARDS
   ====================================== */
.stat-card-gradient {
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 110px;
}
.stat-card-gradient:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
}
.stat-card-gradient::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
}
.stat-card-gradient::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: -20%;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
}
.stat-card-blue {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    box-shadow: 0 8px 32px rgba(37, 99, 235, 0.25);
}
.stat-card-green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.25);
}
.stat-card-orange {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 8px 32px rgba(245, 158, 11, 0.25);
}
.stat-card-purple {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.25);
}
.stat-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
    flex-shrink: 0;
    backdrop-filter: blur(8px);
    position: relative;
    z-index: 1;
}
.stat-card-content {
    position: relative;
    z-index: 1;
}
.stat-card-label {
    color: rgba(255,255,255,0.8);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 2px;
}
.stat-card-value {
    color: #fff;
    font-weight: 800;
    font-size: 1.7rem;
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1.1;
}
.stat-card-badge {
    color: rgba(255,255,255,0.75);
    font-size: 0.68rem;
    font-weight: 500;
    display: inline-block;
    margin-top: 4px;
}

/* Mini Stat Icons */
.mini-stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

/* Activity Feed */
.activity-item {
    transition: background-color 0.15s ease;
}
.activity-item:hover {
    background-color: #f8fafc;
}

/* Pulse Dot */
.pulse-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #10b981;
    display: inline-block;
    position: relative;
    animation: pulse-ring 2s ease infinite;
}
.pulse-dot::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid #10b981;
    animation: pulse-ring-outer 2s ease infinite;
}
@keyframes pulse-ring {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
@keyframes pulse-ring-outer {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.8); opacity: 0; }
}

/* Badge Status Variants */
.bg-soft-info {
    background-color: rgba(2, 132, 199, 0.12) !important;
    color: #0284c7 !important;
    border: 1px solid rgba(2, 132, 199, 0.2);
}
.bg-soft-secondary {
    background-color: rgba(100, 116, 139, 0.12) !important;
    color: #64748b !important;
    border: 1px solid rgba(100, 116, 139, 0.2);
}

/* Chart Card Improvements */
canvas {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
}
