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

:root {
    --primary-color: #175884;
    --primary-dark: #0f3d5c;
    --accent-color: #f5a700;
    --bg-light: #f4f6f9;
    --text-color: #333333;
    --text-muted: #6c757d;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --card-hover-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --border-radius-lg: 12px;
    --border-radius-md: 8px;
    --border-radius-sm: 4px;
    --transition-speed: 0.3s;
}

body {
    font-family: 'Inter', sans-serif !important;
    background-color: var(--bg-light);
    color: var(--text-color);
}

/* --- Global Improvements --- */
.content-wrapper {
    background-color: var(--bg-light) !important;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600 !important;
    color: var(--primary-color);
}

.btn {
    border-radius: var(--border-radius-md) !important;
    font-weight: 500;
    padding: 8px 16px;
    transition: all var(--transition-speed) ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* --- Sidebar Styling --- */
.main-sidebar {
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.05);
}

.sidebar-menu > li > a {
    border-radius: 0 25px 25px 0;
    margin-right: 10px;
    transition: all 0.2s ease-in-out;
}

.sidebar-menu > li:hover > a,
.sidebar-menu > li.active > a {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    border-left-color: var(--accent-color) !important;
    padding-left: 20px;
}

.sidebar-menu .treeview-menu {
    background-color: rgba(0, 0, 0, 0.15) !important;
    margin-right: 10px;
    border-radius: 0 0 15px 0;
}

/* --- Dashboard / Cards --- */
.box,
.info-box {
    border-radius: var(--border-radius-lg) !important;
    box-shadow: var(--card-shadow) !important;
    border: none !important;
    transition:
        transform var(--transition-speed) ease,
        box-shadow var(--transition-speed) ease;
    background: #fff;
    overflow: hidden; /* For border radius */
}

/* .box:hover,
.info-box:hover {
    transform: translateY(-3px);
    box-shadow: var(--card-hover-shadow) !important;
} */

/* Fix for modal blinking/jittering - disable hover transform inside modals */
/* Fix for modal blinking/jittering - disable hover transform inside modals */
.modal .box:hover,
.modal .info-box:hover {
    transform: none !important;
    box-shadow: var(--card-shadow) !important;
    transition: none !important;
}

.modal .box,
.modal .info-box {
    transition: none !important;
}

.box-header {
    background-color: transparent !important; /* Override legacy colored headers */
    color: var(--primary-color) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 15px 20px !important;
}

.box-header .box-title {
    color: var(--primary-color) !important;
    font-size: 1.1rem;
}

.box-header .box-title a {
    color: var(--primary-color) !important;
}

/* Custom Extra Large Modal */
@media (min-width: 992px) {
    .modal-xl {
        width: 1300px;
        max-width: 95%;
    }
}

.info-box-icon {
    border-radius: var(--border-radius-lg) 0 0 var(--border-radius-lg) !important;
}

/* --- Modals --- */
.modal-content {
    border-radius: 16px !important;
    border: none !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
    overflow: hidden;
}

.modal-header {
    background: var(--primary-color) !important;
    color: #fff;
    padding: 15px 20px;
    border-bottom: none;
}

.modal-title {
    font-weight: 600;
}

.modal-body {
    padding: 25px !important;
}

.modal-footer {
    background-color: #f8f9fa;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: 15px 20px;
}

/* Backdrop blur for modals (glassmorphism) */
.modal-backdrop.in {
    opacity: 0.5 !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    background-color: rgba(23, 88, 132, 0.3); /* Tinted backdrop */
}

/* --- Form Elements --- */
.form-control {
    border-radius: var(--border-radius-md) !important;
    border: 1px solid #dee2e6;
    padding: 10px 15px !important; /* Larger padding */
    height: auto !important; /* Let padding define height */
    font-size: 0.95rem !important;
    background-color: #fff;
    transition:
        border-color 0.15s ease-in-out,
        box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(23, 88, 132, 0.15);
    outline: 0;
}

.select2-container--default .select2-selection--single {
    border-radius: var(--border-radius-md) !important;
    height: 42px !important; /* Match text input approx height */
    border: 1px solid #dee2e6 !important;
    padding: 6px 0;
}

.select2-selection__arrow {
    height: 40px !important;
}

/* --- Tables (/sells view) --- */
.table-responsive {
    border-radius: var(--border-radius-lg);
    box-shadow: var(--card-shadow);
    background: #fff;
    padding: 5px; /* Tiny padding frame */
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background-color: #f1f5f9 !important; /* Light gray header instead of dark */
    color: var(--primary-color) !important;
    border-bottom: 2px solid #e2e8f0 !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    padding: 15px !important;
    border-top: none !important;
}

/* Override existing dark header if specific selector is strong */
.skin-blue .table thead th {
    background-color: #f8f9fa !important;
    color: var(--primary-color) !important;
}

.table tbody td {
    padding: 12px 15px !important;
    vertical-align: middle !important;
    border-top: 1px solid #f1f5f9;
    color: #4b5563;
}

.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: #f8fafc !important;
}

.table-hover > tbody > tr:hover {
    background-color: #e0f2fe !important; /* Light blue hover */
    transform: scale(1); /* Fix for some old adminlte hover effects */
}

/* Badge / Label improvements */
.label,
.badge {
    border-radius: 20px !important;
    padding: 5px 10px !important;
    font-weight: 500;
    font-size: 85%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
