@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --success-color: #4cc9f0;
    --info-color: #4895ef;
    --warning-color: #f72585;
    --danger-color: #e63946;
    --light-bg: #f8f9fa;
    --dark-bg: #212529;
    --sidebar-bg: #1a1d21;
    --card-bg: #ffffff;
    --text-main: #2b2d42;
    --text-muted: #8d99ae;
    --border-radius: 12px;
    --box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
}

body {
    background-color: #f3f4f6;
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    overflow-x: hidden;
}

/* Sidebar Styling */
.sidebar {
    min-height: 100vh;
    background: var(--sidebar-bg);
    color: #fff;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    z-index: 1000;
}

.sidebar h4 {
    color: #fff;
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 700;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
}

.sidebar h4 i {
    color: var(--success-color);
}

.nav-link {
    color: rgba(255, 255, 255, 0.7);
    margin: 8px 15px;
    padding: 12px 15px;
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-weight: 500;
    display: flex;
    align-items: center;
}

.nav-link i {
    width: 24px;
    text-align: center;
    margin-right: 10px;
    font-size: 1.1em;
}

.nav-link:hover,
.nav-link.active {
    color: #fff;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.4);
    transform: translateX(5px);
}

/* Main Content Area */
.main-content {
    padding: 30px;
    background-color: #f3f4f6;
    min-height: 100vh;
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    background: var(--card-bg);
    transition: var(--transition);
    margin-bottom: 24px;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.metric-card {
    position: relative;
    overflow: hidden;
    border-left: none !important;
    /* Override old style */
    min-height: 140px;
    /* Ensure consistent height */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: currentColor;
}

.metric-card h6 {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    white-space: nowrap;
    /* Prevent title wrapping */
    overflow: hidden;
    text-overflow: ellipsis;
}

.metric-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Tables */
.table-responsive {
    border-radius: var(--border-radius);
    overflow-x: auto;
}

.table {
    margin-bottom: 0;
    white-space: nowrap;
}

.table thead th {
    background-color: #f8f9fa;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    border-bottom: 2px solid #e9ecef;
    padding: 10px 8px;
}

.table tbody td {
    padding: 8px 8px;
    vertical-align: middle;
    color: var(--text-main);
    border-bottom: 1px solid #f1f3f5;
    font-size: 0.85rem;
}

.table-hover tbody tr:hover {
    background-color: #f8f9ff;
}

/* Buttons */
.btn {
    border-radius: 6px;
    padding: 8px 16px;
    font-weight: 500;
    transition: var(--transition);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    font-size: 0.9rem;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 0.8rem;
}

.btn-group .btn {
    margin: 0 1px;
}

.btn-primary {
    background: var(--primary-color);
    border: none;
}

.btn-primary:hover {
    background: var(--secondary-color);
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.4);
}

.btn-success {
    background: #2a9d8f;
    border: none;
}

.btn-danger {
    background: var(--danger-color);
    border: none;
}

/* Customer Cards */
.customer-card {
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.customer-card .badge {
    padding: 8px 12px;
    border-radius: 20px;
}

/* Forms */
.form-control,
.form-select {
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #dee2e6;
    background-color: #f8f9fa;
}

.form-control:focus,
.form-select:focus {
    background-color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.15);
}

/* Utilities */
.hidden-section {
    display: none !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

.text-success {
    color: #2a9d8f !important;
}

.text-danger {
    color: var(--danger-color) !important;
}

.text-warning {
    color: #f4a261 !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-section {
    animation: fadeIn 0.4s ease-out;
}

/* Toast Notification */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1055;
}