/* Project: APEX Billing ERP */
/* File: assets/css/style.css */

:root {
    --primary-color: #4e73df;
    --primary-dark: #2e59d9;
    --secondary-color: #858796;
    --success-color: #1cc88a;
    --info-color: #36b9cc;
    --warning-color: #f6c23e;
    --danger-color: #e74a3b;
    --light-color: #f8f9fc;
    --dark-color: #5a5c69;
    
    --bg-color: #f4f7f6;
    --sidebar-bg: #212529; /* Dark Indigo / Gray theme */
    --sidebar-hover: #343a40;
    --sidebar-color: #ffffff;
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 80px;
    
    --border-radius: 0.5rem;
    --card-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    --transition-speed: 0.3s;
}

body {
    background-color: var(--bg-color);
    font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: var(--dark-color);
    overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1; 
}
::-webkit-scrollbar-thumb {
    background: var(--secondary-color); 
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--dark-color); 
}

/* Layout Wrapper */
#wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
    min-height: 100vh;
}

/* Sidebar Styling */
#sidebar {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-color);
    transition: all var(--transition-speed) ease-in-out;
    z-index: 1000;
}

#sidebar.collapsed {
    min-width: var(--sidebar-collapsed-width);
    max-width: var(--sidebar-collapsed-width);
}

#sidebar .sidebar-brand {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    font-size: 1.25rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#sidebar.collapsed .sidebar-brand-text {
    display: none;
}

#sidebar .user-info {
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#sidebar.collapsed .user-info {
    display: none;
}

#sidebar .nav-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#sidebar .nav-link {
    display: flex;
    align-items: center;
    padding: 1rem;
    color: rgba(255,255,255,0.8);
    font-weight: 500;
    transition: all var(--transition-speed);
}

#sidebar .nav-link i {
    font-size: 1.1rem;
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
}

#sidebar.collapsed .nav-link span,
#sidebar.collapsed .nav-link .dropdown-indicator {
    display: none;
}

#sidebar.collapsed .nav-link i {
    margin-right: 0;
    font-size: 1.3rem;
    margin: 0 auto;
}

#sidebar .nav-link:hover,
#sidebar .nav-item.active .nav-link {
    color: #fff;
    background: var(--sidebar-hover);
    border-left: 4px solid var(--primary-color);
}

#sidebar .collapse-inner {
    padding: 0.5rem 0;
    background: #1a1e21;
    border-radius: 0;
}

#sidebar .collapse-item {
    padding: 0.5rem 1rem 0.5rem 3.5rem;
    margin: 0;
    display: block;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}

#sidebar .collapse-item:hover {
    color: #fff;
    background: var(--sidebar-hover);
}

#sidebar.collapsed .collapse {
    display: none !important;
}

/* Content Area */
#content-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow-x: hidden;
    transition: all var(--transition-speed);
}

/* Top Navbar */
.topbar {
    height: 70px;
    background-color: #fff;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

.topbar .nav-item .nav-link {
    height: 70px;
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
}

.topbar-divider {
    width: 0;
    border-right: 1px solid #e3e6f0;
    height: calc(4.375rem - 2rem);
    margin: auto 1rem;
}

/* Main Content */
.main-content {
    padding: 1.5rem;
    flex-grow: 1;
}

.page-header {
    margin-bottom: 1.5rem;
}

/* Reusable Components */

/* Dashboard Cards */
.dashboard-card {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.5rem 2rem 0 rgba(58, 59, 69, 0.2);
}

.border-left-primary { border-left: 0.25rem solid var(--primary-color) !important; }
.border-left-success { border-left: 0.25rem solid var(--success-color) !important; }
.border-left-info { border-left: 0.25rem solid var(--info-color) !important; }
.border-left-warning { border-left: 0.25rem solid var(--warning-color) !important; }
.border-left-danger { border-left: 0.25rem solid var(--danger-color) !important; }

/* Custom Tables */
.custom-table {
    background: #fff;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
}
.custom-table thead th {
    background-color: var(--light-color);
    color: var(--dark-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    border-bottom: 2px solid #e3e6f0;
}
.custom-table tbody tr {
    transition: background-color 0.2s;
}
.custom-table tbody tr:hover {
    background-color: rgba(78, 115, 223, 0.05);
}

/* Custom Forms */
.custom-form .form-control, .custom-form .form-select {
    border-radius: 0.35rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d3e2;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.custom-form .form-control:focus, .custom-form .form-select:focus {
    color: #6e707e;
    background-color: #fff;
    border-color: #bac8f3;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
}
.custom-form label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

/* Status Badges */
.badge-status {
    padding: 0.4em 0.6em;
    font-size: 85%;
    font-weight: 600;
    border-radius: 0.25rem;
}

/* Buttons */
.btn-modern {
    border-radius: 0.35rem;
    padding: 0.375rem 0.75rem;
    font-weight: 500;
    transition: all 0.2s;
}
.btn-modern:hover {
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.5rem rgba(0,0,0,0.1);
}

/* Footer */
footer.sticky-footer {
    padding: 2rem 0;
    flex-shrink: 0;
}
