/**
 * Urban Link Network - Modern UI Stylesheet
 * Primary: #2563EB | Success: #22C55E | Warning: #F59E0B | Danger: #EF4444 | Dark: #111827
 */

:root {
    --uln-primary: #2563eb;
    --uln-primary-dark: #1d4ed8;
    --uln-success: #22c55e;
    --uln-warning: #f59e0b;
    --uln-danger: #ef4444;
    --uln-dark: #111827;
    --uln-sidebar-bg: #0f172a;
    --uln-sidebar-hover: #1e293b;
    --uln-body-bg: #f8fafc;
    --uln-card-bg: #ffffff;
    --uln-border-color: #e2e8f0;
}

body {
    background-color: var(--uln-body-bg);
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    color: #334155;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Sidebar Styling */
#sidebar {
    width: 260px;
    min-height: 100vh;
    background-color: var(--uln-sidebar-bg);
    transition: all 0.3s ease;
    flex-shrink: 0;
    z-index: 1040;
}

#sidebar .brand-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.025em;
}

#sidebar .nav-link {
    color: #94a3b8;
    padding: 0.7rem 1rem;
    font-weight: 500;
    border-radius: 0.5rem;
    margin: 0.15rem 0.75rem;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

#sidebar .nav-link i {
    width: 24px;
    font-size: 1.1rem;
    margin-right: 0.75rem;
}

#sidebar .nav-link:hover, #sidebar .nav-link.active {
    color: #ffffff;
    background-color: var(--uln-primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

#sidebar .nav-section {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    padding: 1rem 1.5rem 0.4rem;
    font-weight: 700;
}

/* Content Area */
#content {
    min-width: 0;
    width: 100%;
    overflow-x: hidden;
}

/* Header Navbar */
.top-navbar {
    background: #ffffff;
    border-bottom: 1px solid var(--uln-border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* Cards & Widgets */
.card {
    border: 1px solid var(--uln-border-color);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    background: var(--uln-card-bg);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);
}

/* Stat Cards (No overlap design) */
.stat-card {
    position: relative;
    border-radius: 0.75rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stat-card .stat-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* Buttons */
.btn-primary {
    background-color: var(--uln-primary);
    border-color: var(--uln-primary);
}

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

/* Tables */
.table th {
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    background-color: #f8fafc;
    border-top: none;
}

.table td.text-end, .table th.text-end {
    white-space: nowrap;
}

/* Responsive Mobile Sidebar & Layout */
@media (max-width: 991.98px) {
    #sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: -270px;
        z-index: 1050;
        box-shadow: 0 0 25px rgba(0, 0, 0, 0.4);
    }
    #sidebar.show {
        left: 0;
    }
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(15, 23, 42, 0.6);
        backdrop-filter: blur(2px);
        z-index: 1045;
        display: none;
    }
    .sidebar-overlay.show {
        display: block;
    }
}

@media (max-width: 767.98px) {
    /* Mobile Tables & DataTables */
    .table-responsive {
        border: 0;
        margin-bottom: 0;
        -webkit-overflow-scrolling: touch;
    }
    .dataTables_wrapper .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        text-align: left !important;
        padding: 0.5rem 0.75rem !important;
        float: none !important;
    }
    .dataTables_wrapper .dataTables_filter input {
        width: 100% !important;
        margin-left: 0 !important;
        margin-top: 0.25rem;
    }
    .dataTables_wrapper .dataTables_paginate ul.pagination {
        justify-content: flex-start !important;
        flex-wrap: wrap;
        gap: 2px;
    }
    
    /* Font sizing & Touch targets for phones */
    .table {
        font-size: 0.82rem;
    }
    .table td, .table th {
        padding: 0.5rem 0.6rem;
    }
    .card-body {
        padding: 0.85rem;
    }
    .stat-card {
        padding: 0.85rem !important;
    }
    .stat-card .fs-4, .stat-card .fs-5 {
        font-size: 1.15rem !important;
    }
    .stat-card .stat-icon {
        width: 36px;
        height: 36px;
        min-width: 36px;
        font-size: 1rem;
    }

    /* Modal dialogs on small screens */
    .modal-dialog {
        margin: 0.5rem;
    }
    .modal-content {
        border-radius: 0.75rem;
    }
    .modal-body {
        padding: 1rem !important;
    }

    /* Form controls on mobile */
    .form-control, .form-select {
        font-size: 0.9rem;
    }
}

/* Print Stylesheet */
@media print {
    #sidebar, .top-navbar, .no-print, .btn, .breadcrumb, footer, .sidebar-overlay {
        display: none !important;
    }
    body, #content {
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
        width: 100% !important;
    }
    .card {
        border: none !important;
        box-shadow: none !important;
    }
}