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

:root {
    --primary: #dc2626;
    --primary-light: rgba(220, 38, 38, 0.08);
    --primary-hover: #b91c1c;
    --secondary: #64748b;
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.1);
    --info: #06b6d4;
    --info-light: rgba(6, 182, 212, 0.1);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.1);
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.1);
    --dark: #0f172a;
    --light: #f8fafc;
    --body-bg: #f8fafc;
    --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 12px;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--body-bg);
    color: #334155;
    overflow-x: hidden;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Layout Wrapper */
#wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* ==========================================
   SIDEBAR SYSTEM
   ========================================== */
#accordionSidebar.bg-gradient-primary,
#accordionSidebar {
    background: #0f172a !important; /* Deep Slate */
    background-image: none !important;
    color: #94a3b8;
    border-right: 1px solid #1e293b;
    display: flex;
    flex-direction: column;
    transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1), margin 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Sidebar Widths on Desktop */
@media (min-width: 768px) {
    #accordionSidebar:not(.toggled) {
        width: 260px !important;
        min-width: 260px !important;
    }
    #accordionSidebar.toggled {
        width: 6.5rem !important;
        min-width: 6.5rem !important;
    }
    /* Sticky sidebar on desktop */
    #accordionSidebar {
        position: sticky;
        top: 0;
        height: 100vh;
        align-self: flex-start;
        overflow-y: auto;
        z-index: 1030;
    }
}

/* Sidebar Widths on Mobile/Tablet (< 768px) */
@media (max-width: 767.98px) {
    #accordionSidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 1040;
        width: 260px !important;
        max-width: 260px !important;
        transform: translateX(-260px);
        height: 100vh;
        overflow-y: auto;
    }
    #wrapper.show-sidebar #accordionSidebar {
        transform: translateX(0) !important;
    }
}


/* Brand header */
.sidebar-brand {
    border-bottom: 1px solid #1e293b !important;
    background: #090d16 !important;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1.25rem;
}

.sidebar-brand-icon {
    font-size: 1.35rem;
    color: var(--primary);
    text-shadow: 0 0 12px rgba(220, 38, 38, 0.4);
}

.sidebar-brand-text {
    font-weight: 800 !important;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #ffffff !important;
    font-size: 0.9rem;
    margin-left: 0.75rem;
}

/* Sidebar headings */
.sidebar-heading {
    font-size: 0.65rem !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.15em !important;
    padding: 1.75rem 1.25rem 0.5rem 1.25rem !important;
    color: #475569 !important;
}

/* Navigation items */
.nav-item {
    padding: 0.25rem 0.75rem !important;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem !important;
    color: #94a3b8 !important;
    font-weight: 500;
    font-size: 0.875rem;
    border-radius: 8px;
    transition: var(--transition);
}

.nav-link i {
    font-size: 1.05rem;
    margin-right: 0.85rem;
    width: 20px;
    text-align: center;
    transition: var(--transition);
    color: #475569;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.04);
    color: #f8fafc !important;
}

.nav-link:hover i {
    color: #f8fafc;
}

/* Active Menu state - modern indicators */
.nav-item.active,
.nav-item.bg-light {
    background-color: transparent !important;
}

.nav-item.active .nav-link,
.nav-item.bg-light .nav-link {
    background: rgba(220, 38, 38, 0.1) !important;
    color: #ffffff !important;
    border-left: 4px solid var(--primary);
    border-top-left-radius: 0px !important;
    border-bottom-left-radius: 0px !important;
    font-weight: 600;
}

.nav-item.active .nav-link i,
.nav-item.bg-light .nav-link i {
    color: var(--primary) !important;
}

/* Dropdowns / Collapses */
.nav-link[data-bs-toggle="collapse"]::after {
    display: inline-block;
    margin-left: auto;
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    content: "\f107";
    border: 0;
    transition: transform 0.2s ease;
    font-size: 0.8rem;
    opacity: 0.7;
}

.nav-link[data-bs-toggle="collapse"]:not(.collapsed)::after {
    transform: rotate(180deg);
}

.collapse-inner {
    background-color: #0b111e !important; /* Slightly darker than sidebar */
    border: 1px solid #1e293b;
    border-radius: 10px !important;
    padding: 0.5rem !important;
    margin: 0.25rem 0 0.5rem 0;
}

.collapse-item {
    display: block;
    padding: 0.5rem 1rem !important;
    font-size: 0.825rem !important;
    color: #94a3b8 !important;
    text-decoration: none;
    transition: var(--transition);
    border-radius: 6px !important;
    margin: 0.1rem 0;
}

.collapse-item:hover {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.05) !important;
    padding-left: 1.25rem !important;
}

.collapse-item.active {
    background-color: var(--primary) !important;
    color: #ffffff !important;
}

.collapse-header {
    font-size: 0.65rem;
    font-weight: 700;
    color: #475569;
    padding: 0.25rem 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ==========================================
   CONTENT WORKSPACE & TOPBAR
   ========================================== */
#content-wrapper {
    flex: 1;
    width: 100%;
    min-width: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--body-bg);
}

.container-fluid {
    padding: 2rem 2.5rem !important;
}
@media (max-width: 768px) {
    .container-fluid {
        padding: 1.5rem 1rem !important;
    }
}

/* Navbar Topbar */
.topbar {
    background-color: rgba(255, 255, 255, 0.75) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid #f1f5f9;
    height: 70px;
    z-index: 1000;
    padding: 0 2.5rem;
}
@media (max-width: 768px) {
    .topbar {
        padding: 0 1rem;
    }
}

.topbar #sidebarToggleTop {
    color: #475569;
    font-size: 1.25rem;
    border-radius: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    border: 1px solid #e2e8f0;
    background-color: #ffffff;
}

.topbar #sidebarToggleTop:hover {
    background-color: #f1f5f9;
    color: var(--primary);
}

/* Search bar pill design */
.navbar-search .form-control {
    background-color: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 20px 0 0 20px !important;
    padding-left: 1.25rem !important;
    font-size: 0.85rem !important;
}

.navbar-search .btn {
    border-radius: 0 20px 20px 0 !important;
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
}

/* Profile controls */
.img-profile {
    width: 38px !important;
    height: 38px !important;
    border-radius: 50% !important;
    border: 2px solid #ffffff !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
    object-fit: cover;
}

.dropdown-menu-right {
    border: 0 !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05) !important;
    border-radius: 12px !important;
    padding: 0.5rem !important;
    background-color: #ffffff;
    min-width: 200px;
    border: 1px solid rgba(0, 0, 0, 0.04) !important;
}

.dropdown-item {
    border-radius: 8px !important;
    padding: 0.6rem 1rem !important;
    font-size: 0.875rem;
    color: #475569;
    transition: var(--transition);
}

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

.dropdown-header-name {
    padding: 0.5rem 1rem;
    font-weight: 700;
    color: var(--dark);
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

/* ==========================================
   CARDS & GRID STYLES
   ========================================== */
.card {
    background-color: #ffffff;
    border: 1px solid #f1f5f9 !important;
    border-radius: var(--border-radius) !important;
    box-shadow: var(--card-shadow) !important;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05) !important;
}

.card-header {
    background-color: #ffffff !important;
    border-bottom: 1px solid #f1f5f9 !important;
    padding: 1.25rem 1.5rem !important;
    border-top-left-radius: var(--border-radius) !important;
    border-top-right-radius: var(--border-radius) !important;
}

.card-header h6 {
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    margin: 0;
}

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

/* Dynamic Left border metrics */
.border-left-primary {
    border-left: 4px solid var(--primary) !important;
}
.border-left-success {
    border-left: 4px solid var(--success) !important;
}
.border-left-info {
    border-left: 4px solid var(--info) !important;
}
.border-left-danger {
    border-left: 4px solid var(--danger) !important;
}
.border-left-warning {
    border-left: 4px solid var(--warning) !important;
}

/* Soft hover tints on metrics */
.card.border-left-primary:hover {
    background: linear-gradient(90deg, rgba(220, 38, 38, 0.01) 0%, rgba(255,255,255,1) 100%) !important;
}
.card.border-left-success:hover {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.01) 0%, rgba(255,255,255,1) 100%) !important;
}
.card.border-left-info:hover {
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.01) 0%, rgba(255,255,255,1) 100%) !important;
}
.card.border-left-warning:hover {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.01) 0%, rgba(255,255,255,1) 100%) !important;
}
.card.border-left-danger:hover {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.01) 0%, rgba(255,255,255,1) 100%) !important;
}

/* Clean, modern typography in metrics */
.card .text-primary.font-weight-bold,
.card .text-success.font-weight-bold,
.card .text-info.font-weight-bold,
.card .text-warning.font-weight-bold,
.card .text-danger.font-weight-bold {
    color: #64748b !important;
    font-size: 0.75rem !important;
    letter-spacing: 0.05em !important;
    text-transform: uppercase !important;
}

.card .text-gray-800 {
    color: #0f172a !important;
    font-size: 1.625rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.025em;
    margin-top: 0.25rem;
}

/* Metric Icon Hover Effects */
.card .text-gray-300 {
    color: var(--primary) !important;
    opacity: 0.2;
    font-size: 2.25rem !important;
    transition: var(--transition);
}

.card:hover .text-gray-300 {
    transform: scale(1.1) rotate(5deg);
    opacity: 0.35;
}

/* ==========================================
   DATA LISTS & TABLES
   ========================================== */
.table {
    border-collapse: separate !important;
    border-spacing: 0;
    width: 100%;
    color: #475569;
}

.table th {
    background: #f8fafc !important;
    color: #64748b !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    padding: 0.85rem 1rem !important;
    border-bottom: 1px solid #e2e8f0 !important;
    border-top: none !important;
}

.table td {
    padding: 1rem !important;
    color: #334155 !important;
    border-bottom: 1px solid #f1f5f9 !important;
    font-size: 0.875rem !important;
    background-color: #ffffff;
    transition: var(--transition);
}

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

.table-bordered {
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    overflow: hidden;
}

.table-bordered th, 
.table-bordered td {
    border: 1px solid #f1f5f9 !important;
}

/* Badges */
.badge {
    padding: 0.4em 0.75em !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    font-size: 0.75rem !important;
    text-transform: capitalize;
}

.badge-success {
    background-color: var(--success-light) !important;
    color: #065f46 !important;
}

.badge-danger {
    background-color: var(--danger-light) !important;
    color: #991b1b !important;
}

.badge-warning {
    background-color: var(--warning-light) !important;
    color: #92400e !important;
}

.badge-info {
    background-color: var(--info-light) !important;
    color: #075985 !important;
}

.badge-primary {
    background-color: var(--primary-light) !important;
    color: var(--primary) !important;
}

/* ==========================================
   BUTTONS & FORM CONTROLS
   ========================================== */
.btn {
    border-radius: 8px !important;
    font-weight: 600 !important;
    letter-spacing: 0.01em !important;
    padding: 0.55rem 1.25rem !important;
    transition: var(--transition) !important;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #ef4444 100%) !important;
    border: none !important;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.2) !important;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%) !important;
    box-shadow: 0 6px 14px rgba(220, 38, 38, 0.3) !important;
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%) !important;
    border: none !important;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2) !important;
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
    box-shadow: 0 6px 14px rgba(16, 185, 129, 0.3) !important;
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%) !important;
    border: none !important;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.2) !important;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%) !important;
    box-shadow: 0 6px 14px rgba(239, 68, 68, 0.3) !important;
    transform: translateY(-1px);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%) !important;
    border: none !important;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.2) !important;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%) !important;
    box-shadow: 0 6px 14px rgba(245, 158, 11, 0.3) !important;
    transform: translateY(-1px);
}

.btn-info {
    background: linear-gradient(135deg, #06b6d4 0%, #22d3ee 100%) !important;
    border: none !important;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(6, 182, 212, 0.2) !important;
}

.btn-info:hover {
    background: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%) !important;
    box-shadow: 0 6px 14px rgba(6, 182, 212, 0.3) !important;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #64748b !important;
    border: none !important;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(100, 116, 139, 0.15) !important;
}

.btn-secondary:hover {
    background: #475569 !important;
    box-shadow: 0 6px 14px rgba(100, 116, 139, 0.25) !important;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.35rem 0.85rem !important;
    font-size: 0.8rem !important;
    border-radius: 6px !important;
}

/* Form Fields */
.form-control, .form-select {
    border: 1px solid #e2e8f0 !important;
    background-color: #f8fafc !important;
    border-radius: 10px !important;
    padding: 0.65rem 1rem !important;
    font-size: 0.875rem !important;
    color: #1e293b !important;
    transition: var(--transition) !important;
}

.form-control:focus, .form-select:focus {
    background-color: #ffffff !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12) !important;
    outline: none !important;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    font-weight: 600;
    font-size: 0.825rem;
    color: #475569;
    margin-bottom: 0.5rem;
    display: inline-block;
}

/* ==========================================
   MODALS, DATA TABLES PAGINATIONS & ALERTS
   ========================================== */
.modal-content {
    border: 0;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.modal-header {
    border-bottom: 1px solid #f1f5f9;
    padding: 1.25rem 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #f1f5f9;
    padding: 1.25rem 1.5rem;
}

.modal .card-header.bg-info {
    background-color: var(--primary) !important;
    color: #fff;
    border-radius: 0 !important;
}

/* DataTables elements */
div.dataTables_wrapper div.dataTables_filter {
    text-align: right;
    margin-bottom: 1rem;
}

div.dataTables_wrapper div.dataTables_filter input {
    margin-left: 0.5rem;
    display: inline-block;
    width: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.45rem 0.75rem;
    font-size: 0.875rem;
    background-color: #ffffff;
}

div.dataTables_wrapper div.dataTables_length select {
    width: auto;
    display: inline-block;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.45rem 1.75rem 0.45rem 0.75rem;
    font-size: 0.875rem;
    background-color: #ffffff;
}

/* Pagination modern pills */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    border: none !important;
    background: transparent !important;
    border-radius: 6px !important;
    padding: 0.35rem 0.85rem !important;
    margin: 0 2px !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    transition: var(--transition) !important;
    color: #475569 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current, 
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--primary) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 8px rgba(220, 38, 38, 0.25) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
}

/* Alerts */
.alert {
    border: 0;
    border-radius: var(--border-radius);
    padding: 1rem 1.25rem;
}

.alert-success {
    background-color: var(--success-light);
    color: #065f46;
}

.alert-info {
    background-color: var(--primary-light);
    color: var(--primary);
}

.alert-danger {
    background-color: var(--danger-light);
    color: #991b1b;
}

/* Responsive sidebar overlay blur backdrop */
@media (max-width: 767.98px) {
    .sidebar-toggled::before,
    #wrapper.show-sidebar::before {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(15, 23, 42, 0.4);
        backdrop-filter: blur(4px);
        z-index: 1030;
    }
}

/* General Typography overrides */
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    color: #0f172a !important;
    font-weight: 700 !important;
    letter-spacing: -0.025em;
}

.text-gray-500 {
    color: #64748b !important;
}

marquee {
    font-weight: 600;
}
