/**
 * Main Stylesheet for Multi-Tenant Invoicing System
 * 
 * This file contains custom styles for the application,
 * with focus on the sidebar navigation and multi-tenant UI elements.
 */

/* General Layout */
body {
    overflow-x: hidden;
    background-color: #f8f9fc;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Wrapper for sidebar and content */
#wrapper {
    display: flex;
}

/* Sidebar styles */
#sidebar-wrapper {
    min-height: 100vh;
    width: 250px;
    margin-left: -250px;
    transition: margin 0.25s ease-out;
    background-color: #f8f9fc;
    border-right: 1px solid #e3e6f0;
    z-index: 1000;
}

#sidebar-wrapper .sidebar-heading {
    padding: 0.875rem 1.25rem;
    font-size: 1.2rem;
    font-weight: bold;
    color: #4e73df;
    border-bottom: 1px solid #e3e6f0;
}

#sidebar-wrapper .list-group {
    width: 250px;
}

#sidebar-wrapper .list-group-item {
    border: none;
    padding: 0.75rem 1.25rem;
    background-color: transparent;
    color: #5a5c69;
    font-size: 0.85rem;
    border-radius: 0;
}

#sidebar-wrapper .list-group-item:hover {
    background-color: #eaecf4;
    color: #3a3b45;
}

#sidebar-wrapper .list-group-item.active {
    background-color: #4e73df;
    color: #fff;
    border-color: #4e73df;
}

#sidebar-wrapper .list-group-item i {
    margin-right: 0.5rem;
    opacity: 0.75;
}

#sidebar-wrapper .sidebar-heading {
    font-weight: bold;
    color: #4e73df;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
    padding: 1rem 1.25rem 0.5rem;
}

/* Content wrapper */
#page-content-wrapper {
    min-width: 100vw;
    background-color: #f8f9fc;
}

/* Toggle behavior */
#wrapper.toggled #sidebar-wrapper {
    margin-left: 0;
}

/* Organization badge */
.org-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
    background-color: #4e73df;
    color: #fff;
    margin-left: 0.5rem;
}

/* Organization switcher */
.org-switcher {
    padding: 0.5rem 1rem;
    background-color: #fff;
    border-radius: 0.35rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    margin-bottom: 1rem;
}

.org-switcher-header {
    padding: 0.5rem 0;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #e3e6f0;
    font-weight: bold;
    color: #5a5c69;
}

.org-item {
    padding: 0.5rem;
    border-radius: 0.25rem;
    margin-bottom: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.org-item:hover {
    background-color: #eaecf4;
}

.org-item.active {
    background-color: #4e73df;
    color: #fff;
}

/* Card customization */
.card {
    border: none;
    border-radius: 0.35rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

.card-header {
    background-color: #f8f9fc;
    border-bottom: 1px solid #e3e6f0;
    padding: 0.75rem 1.25rem;
}

/* Button customization */
.btn-primary {
    background-color: #4e73df;
    border-color: #4e73df;
}

.btn-primary:hover {
    background-color: #2e59d9;
    border-color: #2653d4;
}

/* Multi-tenant specific styles */
.tenant-indicator {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    background-color: #4e73df;
    color: #fff;
    margin-left: 0.5rem;
}

.switch-back-btn {
    background-color: #f6c23e;
    border-color: #f6c23e;
    color: #fff;
}

.switch-back-btn:hover {
    background-color: #f4b619;
    border-color: #f4b30d;
    color: #fff;
}

/* Responsive adjustments */
@media (min-width: 768px) {
    #sidebar-wrapper {
        margin-left: 0;
    }
    
    #page-content-wrapper {
        min-width: 0;
        width: 100%;
    }
    
    #wrapper.toggled #sidebar-wrapper {
        margin-left: -250px;
    }
    
    .navbar-expand-lg .navbar-nav .dropdown-menu {
        position: absolute;
    }
}

/* Dashboard cards */
.dashboard-card {
    border-left: 0.25rem solid #4e73df;
    border-radius: 0.35rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

.dashboard-card-primary {
    border-left-color: #4e73df;
}

.dashboard-card-success {
    border-left-color: #1cc88a;
}

.dashboard-card-info {
    border-left-color: #36b9cc;
}

.dashboard-card-warning {
    border-left-color: #f6c23e;
}

.dashboard-card .card-body {
    padding: 1.25rem;
}

.dashboard-card .card-title {
    text-transform: uppercase;
    color: #4e73df;
    font-weight: 700;
    font-size: 0.7rem;
    margin-bottom: 0.25rem;
}

.dashboard-card .card-value {
    color: #5a5c69;
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 0;
}

/* Form styling */
.form-control:focus {
    border-color: #bac8f3;
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
}

/* Tables */
.table-responsive {
    border-radius: 0.35rem;
    overflow: hidden;
}

.table thead th {
    background-color: #f8f9fc;
    color: #6e707e;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05rem;
    border-top: none;
    border-bottom: 2px solid #e3e6f0;
}

/* Footer customization */
.footer {
    background-color: #fff;
    border-top: 1px solid #e3e6f0;
}
