:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --sidebar-width: 260px;
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --sidebar-active: #0d6efd;
}

/*
 * DigiUp Billing System
 * Modern Sidebar Layout with Dark Theme
 * 
 * Layout Structure:
 * ┌─────────────┬──────────────────────────────┐
 * │   SIDEBAR   │      MAIN CONTENT            │
 * │   (260px)   │      (Fluid)                 │
 * │             │                              │
 * │  Brand      │   Dashboard Content          │
 * │  ─────      │                              │
 * │  Home       │   Cards, Tables, Forms       │
 * │  Users      │                              │
 * │  Products   │                              │
 * │  Settings   │                              │
 * │  Test APIs  │                              │
 * │             │                              │
 * │  ─────      │                              │
 * │  User Info  │                              │
 * │  Logout     │                              │
 * └─────────────┴──────────────────────────────┘
 */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    margin: 0;
    padding: 0;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar-brand {
    padding: 1.5rem;
    font-size: 1.3rem;
    font-weight: bold;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background-color: var(--sidebar-hover);
    color: white;
    border-left-color: var(--sidebar-active);
}

.sidebar-link.active,
.sidebar-link:active {
    background-color: var(--sidebar-hover);
    color: white;
    border-left-color: var(--sidebar-active);
}

.sidebar-link i {
    font-size: 1.2rem;
    width: 1.5rem;
    text-align: center;
}

.sidebar-link span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 1rem 0;
    margin-top: auto;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: rgba(255,255,255,0.9);
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar-user i {
    font-size: 1.5rem;
}

/* Sidebar scrollbar */
.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.3);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding: 2rem;
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.3rem;
}

.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.card-header {
    background-color: #fff;
    border-bottom: 2px solid #f8f9fa;
    font-weight: 600;
}

.btn {
    border-radius: 6px;
    padding: 0.5rem 1rem;
    transition: all 0.3s;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.table {
    background-color: #fff;
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    color: #495057;
}

.table tbody tr {
    transition: background-color 0.2s;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

.badge {
    padding: 0.4em 0.7em;
    font-weight: 500;
    border-radius: 6px;
}

.modal-content {
    border: none;
    border-radius: 10px;
}

.modal-header {
    background-color: var(--primary-color);
    color: white;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.modal-header .btn-close {
    filter: invert(1);
}

.form-control, .form-select {
    border-radius: 6px;
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.footer {
    margin-top: auto;
    padding: 1rem 0;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

/* Login page specific styles */
body.bg-light .card {
    border-radius: 15px;
    overflow: hidden;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card, .alert {
    animation: fadeIn 0.3s ease-in-out;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sidebar {
        width: 70px;
    }
    
    .sidebar-link span,
    .sidebar-brand,
    .sidebar-user span {
        display: none;
    }
    
    .sidebar-link {
        justify-content: center;
        padding: 1rem;
    }
    
    .main-content {
        margin-left: 70px;
        padding: 1rem;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .table {
        font-size: 0.9rem;
    }
    
    .btn-sm {
        padding: 0.2rem 0.4rem;
        font-size: 0.8rem;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Loading spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* Alert improvements */
.alert {
    border-radius: 8px;
    border-left: 4px solid;
}

.alert-success {
    border-left-color: var(--success-color);
}

.alert-danger {
    border-left-color: var(--danger-color);
}

.alert-warning {
    border-left-color: var(--warning-color);
}

.alert-info {
    border-left-color: var(--info-color);
}
