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

:root {
    --bg-main: #0b0f19;
    --bg-card: rgba(30, 41, 59, 0.5);
    --bg-card-hover: rgba(30, 41, 59, 0.65);
    --border-glass: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #0ea5e9;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #090d16 0%, #0f172a 100%);
    color: var(--text-primary);
    min-height: 100vh;
    padding-bottom: 40px;
    background-attachment: fixed;
}

/* Navbar Redesign */
.navbar {
    background-color: rgba(15, 23, 42, 0.6) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-glass);
    padding: 14px 0 !important;
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.navbar-nav .nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    font-size: 14.5px;
    transition: all 0.2s ease;
    padding: 6px 12px !important;
}

.navbar-nav .nav-link:hover, 
.navbar-nav .nav-link.active {
    color: var(--text-primary) !important;
    transform: translateY(-0.5px);
}

/* Card Redesign */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass) !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-primary);
    overflow: hidden;
}

.card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(99, 102, 241, 0.2) !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
}

.card-header {
    background-color: rgba(15, 23, 42, 0.3) !important;
    border-bottom: 1px solid var(--border-glass) !important;
    font-weight: 600;
    font-size: 16px;
    color: #38bdf8 !important;
    padding: 16px 20px !important;
}

.card-body {
    padding: 24px !important;
}

/* Forms Redesign */
.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control, .form-select, textarea {
    background-color: rgba(15, 23, 42, 0.5) !important;
    border: 1px solid var(--border-glass) !important;
    color: var(--text-primary) !important;
    border-radius: 10px !important;
    padding: 10px 16px !important;
    font-size: 14px !important;
    transition: all 0.2s ease !important;
}

.form-control::placeholder {
    color: rgba(148, 163, 184, 0.4) !important;
}

.form-control:focus, .form-select:focus, textarea:focus {
    background-color: rgba(15, 23, 42, 0.8) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25) !important;
}

/* Buttons Redesign */
.btn {
    border-radius: 10px !important;
    padding: 10px 20px !important;
    font-size: 14.5px !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
}

.btn-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%) !important;
    border: none !important;
    color: #ffffff !important;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background-color: rgba(148, 163, 184, 0.1) !important;
    border: 1px solid rgba(148, 163, 184, 0.2) !important;
    color: var(--text-primary) !important;
}

.btn-secondary:hover {
    background-color: rgba(148, 163, 184, 0.2) !important;
    color: var(--text-primary) !important;
}

/* Tables Redesign */
.table-responsive {
    border: 1px solid var(--border-glass) !important;
    border-radius: 12px !important;
    background-color: rgba(15, 23, 42, 0.3) !important;
    overflow-x: auto !important;
}

.table-responsive table {
    min-width: 750px !important;
}

.table,
table.dataTable,
table.dataTable.display,
table.dataTable.stripe {
    margin-bottom: 0 !important;
    color: var(--text-primary) !important;
    background-color: transparent !important;
    border-collapse: collapse !important;
}

table.dataTable tbody tr,
table.dataTable tbody tr.odd,
table.dataTable tbody tr.even,
table.dataTable.display tbody tr.odd,
table.dataTable.display tbody tr.even,
table.dataTable.stripe tbody tr.odd,
table.dataTable.stripe tbody tr.even,
.table-striped tbody tr,
.table-striped tbody tr:nth-of-type(odd),
.table-striped tbody tr:nth-of-type(even) {
    background-color: transparent !important;
}

.table td, 
.table th,
table.dataTable tbody td,
table.dataTable tbody th {
    background-color: transparent !important;
    color: var(--text-primary) !important;
    border-bottom: 1px solid var(--border-glass) !important;
    padding: 14px 16px !important;
    font-size: 14px !important;
    white-space: nowrap !important;
}

.table th,
table.dataTable thead th,
table.dataTable thead td {
    font-weight: 600 !important;
    font-size: 12px !important;
    color: var(--text-secondary) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    background-color: rgba(15, 23, 42, 0.5) !important;
    border-bottom: 2px solid var(--border-glass) !important;
    padding: 14px 16px !important;
    white-space: nowrap !important;
}

/* Custom alternating striping colors */
.table-striped tbody tr:nth-of-type(odd),
table.dataTable.stripe tbody tr.odd,
table.dataTable.display tbody tr.odd {
    background-color: rgba(255, 255, 255, 0.02) !important;
}

.table-striped tbody tr:nth-of-type(even),
table.dataTable.stripe tbody tr.even,
table.dataTable.display tbody tr.even {
    background-color: rgba(255, 255, 255, 0.04) !important;
}

/* Hover row overrides */
.table-hover tbody tr:hover,
table.dataTable.hover tbody tr:hover,
table.dataTable.display tbody tr:hover {
    background-color: rgba(99, 102, 241, 0.15) !important;
}

/* DataTables Styling Overrides */
.dataTables_wrapper {
    color: var(--text-primary) !important;
    padding: 16px 0;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_processing,
.dataTables_wrapper .dataTables_paginate {
    color: var(--text-secondary) !important;
}

.dataTables_length select, 
.dataTables_filter input {
    background-color: rgba(15, 23, 42, 0.5) !important;
    border: 1px solid var(--border-glass) !important;
    color: var(--text-primary) !important;
    border-radius: 8px !important;
    padding: 6px 12px !important;
}

.dataTables_info, .dataTables_paginate {
    padding-top: 16px !important;
}

.paginate_button {
    background-color: rgba(148, 163, 184, 0.08) !important;
    border: 1px solid rgba(148, 163, 184, 0.15) !important;
    color: var(--text-primary) !important;
    border-radius: 6px !important;
}

.paginate_button.current {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #ffffff !important;
}

/* Badge Styles */
.badge {
    padding: 6px 10px;
    font-size: 11.5px;
    font-weight: 600;
    border-radius: 6px;
}

.badge-in {
    background-color: rgba(16, 185, 129, 0.1) !important;
    color: var(--success) !important;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-out {
    background-color: rgba(239, 68, 68, 0.1) !important;
    color: var(--danger) !important;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Custom layout utilities */
.page-title {
    font-weight: 700;
    letter-spacing: -0.75px;
    color: var(--text-primary);
    margin-bottom: 24px;
}

.kpi-card {
    border-left: 4px solid var(--primary) !important;
}

.kpi-card.payin {
    border-left-color: var(--success) !important;
}

.kpi-card.payout {
    border-left-color: var(--danger) !important;
}

.kpi-val {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-top: 8px;
}

/* Alignments and margins */
.section-title {
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.75px;
    color: var(--info);
    margin-top: 24px;
    margin-bottom: 12px;
}

/* Modals Redesign */
.modal-content {
    background-color: #0f172a !important;
    border: 1px solid var(--border-glass) !important;
    color: var(--text-primary) !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5) !important;
}

.modal-header, .modal-footer {
    border-color: var(--border-glass) !important;
}

.modal-title {
    color: #38bdf8 !important;
    font-weight: 600 !important;
}

.btn-close {
    filter: invert(1) grayscale(100%) brightness(200%) !important;
}

/* Select element override */
select {
    background-color: rgba(15, 23, 42, 0.5) !important;
    border: 1px solid var(--border-glass) !important;
    color: var(--text-primary) !important;
    border-radius: 10px !important;
    padding: 10px 16px !important;
    font-size: 14px !important;
    transition: all 0.2s ease !important;
}

select:focus {
    background-color: rgba(15, 23, 42, 0.8) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25) !important;
    outline: none;
}

/* Select2 Overrides */
.select2-container--default .select2-selection--single {
    background-color: rgba(15, 23, 42, 0.5) !important;
    border: 1px solid var(--border-glass) !important;
    border-radius: 10px !important;
    height: 42px !important;
    display: flex !important;
    align-items: center !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text-primary) !important;
    padding-left: 16px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px !important;
    right: 12px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: var(--text-secondary) transparent transparent transparent !important;
}

.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent var(--text-secondary) transparent !important;
}

.select2-dropdown {
    background-color: #0f172a !important;
    border: 1px solid var(--border-glass) !important;
    border-radius: 10px !important;
    z-index: 9999 !important;
    overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5) !important;
}

.select2-search--dropdown {
    padding: 8px !important;
    background-color: rgba(15, 23, 42, 0.7) !important;
}

.select2-search--dropdown .select2-search__field {
    background-color: rgba(15, 23, 42, 0.9) !important;
    border: 1px solid var(--border-glass) !important;
    color: var(--text-primary) !important;
    border-radius: 6px !important;
    padding: 6px 10px !important;
}

.select2-results__option {
    padding: 8px 16px !important;
    color: var(--text-secondary) !important;
    background-color: transparent !important;
}

.select2-results__option--highlighted[aria-selected] {
    background-color: var(--primary) !important;
    color: #ffffff !important;
}

.select2-results__option[aria-selected=true] {
    background-color: rgba(99, 102, 241, 0.2) !important;
    color: var(--text-primary) !important;
}

/* Autofill overrides for Webkit browsers */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #0f172a inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Clickable table rows */
.clickable-row {
    cursor: pointer;
}

/* Custom Status Badges */
.badge-required {
    background-color: transparent !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border-glass) !important;
}

.badge-ordered {
    background-color: rgba(14, 165, 233, 0.15) !important;
    color: #38bdf8 !important;
    border: 1px solid rgba(14, 165, 233, 0.25) !important;
}

.badge-bill {
    background-color: rgba(99, 102, 241, 0.15) !important;
    color: #818cf8 !important;
    border: 1px solid rgba(99, 102, 241, 0.3) !important;
}

.badge-return {
    background-color: rgba(245, 158, 11, 0.15) !important;
    color: var(--warning) !important;
    border: 1px solid rgba(245, 158, 11, 0.25) !important;
}

/* Responsive Action Buttons */
@media (max-width: 576px) {
    .action-bar-container,
    .action-bar-container div {
        width: 100% !important;
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .action-bar-container .btn,
    .action-bar-container a.btn {
        width: 100% !important;
        margin: 0 !important;
    }
}

/* Dashboard Specific Table Override */
.dashboard-container .table-responsive table {
    min-width: auto !important;
}

/* Project Details Specific Table Override */
.project-details-container .table-responsive table {
    min-width: auto !important;
}

/* Category Details Specific Table Override */
.category-details-container .table-responsive table {
    min-width: auto !important;
}



