:root {
    --blue-600: #204EAB;
    --blue-700: #1a3e8a;
    --blue-50: #eff6ff;
    --text-900: #111827;
    --text-700: #374151;
    --text-500: #6b7280;
    --border-200: #e5e7eb;
    --bg-50: #f9fafb;
    --radius: 12px;
    --sidebar-width: 260px;
    --topbar-height: 56px;
    --transition: 120ms ease;
}

body {
    font-family: 'Poppins', sans-serif;
    background: #ffffff;
    color: var(--text-900);
    line-height: 1.5;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-900);
    font-weight: 600;
}

.text-primary-custom { color: var(--blue-600) !important; }
.bg-primary-custom { background-color: var(--blue-600) !important; }
.bg-primary-light { background-color: var(--blue-50) !important; }
.border-primary-custom { border-color: var(--blue-600) !important; }

.shadow, .shadow-sm, .shadow-lg { box-shadow: none !important; }

.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: #ffffff;
    border-right: 1px solid var(--border-200);
    transition: transform var(--transition);
    z-index: 1050;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    height: 64px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    border-bottom: 1px solid var(--border-200);
}
.sidebar-brand { display: flex !important; flex-direction: row !important; align-items: center; gap: 12px; }
.sidebar-brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.sidebar-brand-title, .sidebar-brand-subtitle { white-space: nowrap; }
.sidebar-brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 0;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}
.sidebar-brand-mark img { width: 36px; height: 36px; object-fit: contain; }
.sidebar-brand-title { font-size: 20px; font-weight: 750; letter-spacing: -0.02em; color: var(--text-900); }
.sidebar-brand-subtitle { font-size: 14px; font-weight: 650; letter-spacing: 0.08em; color: var(--text-500); margin-top: 1px; text-transform: uppercase; }

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 16px 8px;
}

.sidebar-heading {
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-500);
    font-weight: 600;
    margin: 16px 8px 8px 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin: 4px 8px;
    color: var(--text-700);
    text-decoration: none;
    border-radius: 10px;
    transition: background var(--transition), color var(--transition);
}

.sidebar-link i {
    width: 18px;
    text-align: center;
    font-size: 14px;
    color: var(--text-500);
}

.sidebar-link:hover {
    background: var(--blue-50);
    color: var(--blue-600);
}

.sidebar-link.active {
    background: var(--blue-50);
    color: var(--blue-700);
    font-weight: 600;
    position: relative;
}

.sidebar-link.active i { color: var(--blue-700); }

.sidebar-link.active:before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    background: var(--blue-600);
    border-radius: 999px;
}

/* DataTables Pagination Styling */
.dataTables_wrapper .dataTables_paginate {
    padding-top: 1.25rem !important;
}

.dataTables_wrapper .pagination {
    display: flex !important;
    gap: 6px !important;
    align-items: center !important;
}

.dataTables_wrapper .pagination .page-item .page-link {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    font-size: 13px !important;
    border: 1px solid #e5e7eb !important;
    color: #6b7280 !important;
    background-color: transparent !important;
    transition: all 0.2s ease !important;
}

.dataTables_wrapper .pagination .page-item.active .page-link {
    background-color: #eff6ff !important;
    border-color: #dbeafe !important;
    color: #204EAB !important;
    font-weight: 600 !important;
}

.dataTables_wrapper .pagination .page-item:not(.active):not(.disabled) .page-link:hover {
    background-color: #f3f4f6 !important;
    border-color: #d1d5db !important;
    color: #374151 !important;
}

.dataTables_wrapper .pagination .page-item.disabled .page-link {
    background-color: transparent !important;
    border-color: #f3f4f6 !important;
    color: #d1d5db !important;
    opacity: 0.5 !important;
}

.dataTables_wrapper .pagination .page-item .page-link:focus {
    box-shadow: none !important;
}

/* Adjust chevron icons size */
.dataTables_wrapper .pagination .page-item .page-link i {
    font-size: 10px !important;
}

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding: 8px 24px 24px 24px;
    background: #ffffff;
    transition: margin-left var(--transition);
}

.top-navbar {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    margin: -8px -24px 4px -24px;
    background: #ffffff;
    border-bottom: 1px solid var(--border-200);
    position: sticky;
    top: 0;
    z-index: 900;
}

.top-navbar .btn-link {
    color: var(--text-700) !important;
    text-decoration: none !important;
}

.overlay {
    background: rgba(17, 24, 39, 0.18);
    z-index: 1040;
}

.card {
    background: #ffffff;
    border: 1px solid var(--border-200);
    border-radius: var(--radius);
    box-shadow: none;
    overflow: hidden;
}
.card.border-0 { border: 1px solid var(--border-200) !important; }

.card-header {
    background: #ffffff;
    border-bottom: 1px solid var(--border-200);
    padding: 16px;
}

.card-body { padding: 16px; }
.card-footer {
    background: #ffffff;
    border-top: 1px solid var(--border-200);
}

.table { margin-bottom: 0; }
.table thead th {
    background: var(--blue-600) !important;
    color: #ffffff !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border-200) !important;
    padding: 12px 16px;
    vertical-align: middle;
    text-align: center !important;
}

table.dataTable > thead > tr > th,
table.dataTable > thead > tr > td {
    text-align: center !important;
}

.table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-200);
    color: var(--text-900);
    vertical-align: middle;
}

.table tbody tr { height: 44px; }
.table-hover tbody tr:hover { background: #fbfdff; }

.btn {
    border-radius: 10px;
    padding: 8px 12px;
    font-weight: 600;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.btn-primary {
    background: var(--blue-600) !important;
    border-color: var(--blue-600) !important;
}

.btn-primary:hover { background: var(--blue-700) !important; border-color: var(--blue-700) !important; }

.btn-outline-primary {
    border-color: var(--blue-600) !important;
    color: var(--blue-600) !important;
}

.btn-outline-primary:hover {
    background: var(--blue-50) !important;
    border-color: var(--blue-600) !important;
    color: var(--blue-700) !important;
}

.btn-danger { background: #ef4444 !important; border-color: #ef4444 !important; }
.btn-outline-danger { border-color: #ef4444 !important; color: #ef4444 !important; }
.btn-outline-danger:hover { background: #fef2f2 !important; color: #b91c1c !important; }

.badge {
    border-radius: 999px;
    padding: 4px 10px;
    font-weight: 600;
    font-size: 12px;
    box-shadow: none;
}

.form-control, .form-select {
    border-radius: 10px;
    border-color: var(--border-200);
    min-height: 40px;
}

/* DataTables length menu and search input fixes */
.dataTables_wrapper .dataTables_filter {
    float: right;
    text-align: right;
}

.dataTables_wrapper .dataTables_filter label {
    font-weight: 500;
    color: var(--text-700);
    display: flex;
    align-items: center;
    gap: 8px;
}

.dataTables_wrapper .dataTables_filter input {
    margin-left: 0 !important;
    border-radius: 10px;
    border: 1px solid var(--border-200);
    padding: 6px 12px;
    min-height: 38px;
    width: 240px;
    transition: all 0.2s;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--blue-600);
    box-shadow: 0 0 0 3px rgba(32, 78, 171, 0.12);
    outline: none;
}

.dataTables_length select {
    display: inline-block !important;
    width: auto !important;
    margin: 0 0.5rem !important;
    padding-top: 4px !important;
    padding-bottom: 4px !important;
    min-height: 36px !important;
}

.dataTables_filter input {
    display: inline-block !important;
    width: auto !important;
    margin-left: 0.5rem !important;
    min-height: 36px !important;
}

.dataTables_info, .dataTables_paginate {
    margin-top: 1rem;
    font-size: 0.875rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--blue-600);
    box-shadow: 0 0 0 3px rgba(32, 78, 171, 0.12);
}

.dropdown-menu {
    border: 1px solid var(--border-200);
    border-radius: 12px;
    box-shadow: none;
}

/* Global Modal Customization */
.modal-header {
    background-color: var(--blue-600) !important;
    color: #ffffff !important;
}

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

.modal-header .btn-close {
    filter: brightness(0) invert(1); /* Make close button white */
}

.modal-footer .btn-primary, 
.modal-footer button[type="submit"] {
    background-color: var(--blue-600) !important;
    border-color: var(--blue-600) !important;
    color: #ffffff !important;
}

.modal-footer .btn-primary:hover, 
.modal-footer button[type="submit"]:hover {
    background-color: var(--blue-700) !important;
    border-color: var(--blue-700) !important;
}

.modal-content {
    border-radius: 12px;
    overflow: hidden;
    border: none;
}

@media (min-width: 769px) {
    .sidebar.active { transform: translateX(calc(var(--sidebar-width) * -1)); }
    .main-content.active { margin-left: 0; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.active { transform: translateX(0); }
    .main-content { margin-left: 0 !important; padding: 8px 12px 20px; }
    .top-navbar { padding: 0 12px; margin: -8px -12px 10px -12px; }
    .overlay { display: none; position: fixed; inset: 0; opacity: 0; transition: opacity var(--transition); }
    .overlay.active { display: block; opacity: 1; }
}
