/**
 * SFMTA Manager - Custom Styles
 * Modern, clean design for login and dashboard
 */

/* Login Page Styling */
.login-page {
    background: #f0f4f8;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.login-container {
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-logo {
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
}

.login-logo img {
    display: block;
    width: 220px;
    height: auto;
    max-width: 100%;
}

.login-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 32px;
    text-align: center;
}

.login-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 32px;
    width: 100%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.login-page .form-group {
    margin-bottom: 20px;
}

.login-page .form-label-with-icon {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e40af;
    margin-bottom: 8px;
}

.login-page .form-label-with-icon i {
    font-size: 1rem;
}

.login-page .form-control {
    border-radius: 8px;
    padding: 12px 16px;
    border: 1px solid #cbd5e1;
    font-size: 0.9375rem;
    transition: all 0.2s;
    width: 100%;
}

.login-page .form-control:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper .form-control {
    padding-right: 45px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: #1e40af;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.password-toggle:hover {
    color: #2563eb;
}

.password-toggle:focus {
    outline: none;
}

.password-toggle i {
    font-size: 1.125rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
}

.remember-me input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #2563eb;
}

.remember-me label {
    font-size: 0.9375rem;
    color: #475569;
    cursor: pointer;
    margin: 0;
    user-select: none;
}

.btn-signin {
    width: 100%;
    background: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 14px 20px;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-signin:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-signin:active {
    transform: translateY(0);
}

.btn-signin i {
    font-size: 1.125rem;
}

.copyright {
    margin-top: 32px;
    font-size: 0.875rem;
    color: #64748b;
    text-align: center;
}

.login-page .alert {
    border-radius: 8px;
    margin-bottom: 20px;
    border: none;
    padding: 12px 16px;
}

.login-page .alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Dashboard Styling */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 0.5rem 1rem !important;
    min-height: auto !important;
    height: auto !important;
    max-height: 50px !important;
    flex-wrap: nowrap !important;
    overflow: visible !important;
}

/* Professional Heading Styles */
h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
}

.main-content h1,
.main-content h2,
.page-heading {
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    color: #333 !important;
    margin-bottom: 0 !important;
    line-height: 1 !important;
    padding: 0 !important;
}

.breadcrumb {
    margin-bottom: 0.125rem !important;
    margin-top: 0 !important;
    font-size: 0.8rem;
    padding: 0.1rem 0 !important;
    min-height: auto !important;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: #6c757d;
}

/* Compact spacing for main content */
.main-content .container-fluid > div:first-child {
    margin-bottom: 0 !important;
}

/* Remove spacing from first card or search form */
.main-content .container-fluid > .card:first-of-type,
.main-content .container-fluid > #searchForm:first-of-type {
    margin-top: 0 !important;
}

/* Reduce spacing in heading container */
.page-heading-container {
    margin-bottom: 0 !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    height: 24px !important;
    min-height: 24px !important;
    max-height: 24px !important;
    align-items: center !important;
    line-height: 24px !important;
    display: flex !important;
    overflow: hidden !important;
}

/* Remove all spacing from heading container itself */
.page-heading-container * {
    margin-bottom: 0 !important;
}

/* Remove margin from h2 in heading container */
.page-heading-container h2 {
    margin-bottom: 0 !important;
    margin-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Remove margin from button container */
.page-heading-container .d-flex {
    margin-bottom: 0 !important;
}

/* Remove all spacing immediately after page heading */
.page-heading-container + * {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Ensure first element after heading has no spacing */
.page-heading-container ~ *:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Remove all margins from content area immediately after heading */
.page-heading-container ~ .card:first-of-type,
.page-heading-container ~ #searchForm:first-of-type,
.page-heading-container ~ .table-responsive:first-of-type {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Compact button styling in page heading */
.page-heading-container .btn {
    padding: 0.125rem 0.5rem !important;
    font-size: 0.75rem !important;
    line-height: 1.2 !important;
    height: 24px !important;
    min-height: 24px !important;
    max-height: 24px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
}

/* Reduce table spacing */
.table-responsive {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

#crudTable {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Reduce container padding */
.main-content .container-fluid,
.main-content .compact-container {
    padding-top: 0 !important;
    padding-bottom: 0.5rem !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

/* Remove all spacing from container-fluid content when it follows page-heading */
.page-heading-container ~ .container-fluid,
.page-heading-container ~ .container-fluid > *:first-child {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Ensure no spacing between heading and content */
.page-heading-container + *,
.page-heading-container ~ *,
.page-heading-container ~ .card:first-of-type,
.page-heading-container ~ form:first-of-type,
.page-heading-container ~ *:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Remove spacing from any element that follows the heading container */
.page-heading-container ~ div:first-of-type,
.page-heading-container ~ div.card,
.page-heading-container ~ form,
.page-heading-container ~ .container-fluid,
.page-heading-container ~ .container-fluid > *,
.page-heading-container ~ .container-fluid > *:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Ensure absolutely no spacing below heading container */
.page-heading-container + .container-fluid,
.page-heading-container + .container-fluid > *:first-child,
.page-heading-container + .container-fluid > .card:first-of-type,
.page-heading-container + .container-fluid > form:first-of-type,
.container-fluid:has(.page-heading-container) + .container-fluid,
.container-fluid:has(.page-heading-container) ~ .container-fluid {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Target any container-fluid that directly follows one with page-heading */
.container-fluid:first-child + .container-fluid {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Remove spacing from content elements inside the same container-fluid as page-heading */
.container-fluid:has(.page-heading-container) > *:not(.page-heading-container) {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.container-fluid:has(.page-heading-container) > .page-heading-container + * {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Very aggressive: Remove spacing from ANY element after page-heading-container */
.page-heading-container + * {
    margin-top: 0 !important;
    padding-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Remove all spacing from next sibling element */
.page-heading-container ~ *:not(.page-heading-container) {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Target any immediate child that follows page-heading-container in same parent */
* > .page-heading-container + * {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Nuclear option: Remove spacing from EVERYTHING after page-heading-container */
.page-heading-container ~ * {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.page-heading-container ~ .card,
.page-heading-container ~ form,
.page-heading-container ~ div {
    margin-top: 0 !important;
    padding-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Remove spacing from card/form that comes directly after page-heading */
.page-heading-container + .card,
.page-heading-container + form,
.page-heading-container + .card.mb-3 {
    margin-top: 0 !important;
    padding-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Ensure absolutely no spacing in the container after page-heading */
.compact-container:has(.page-heading-container) {
    padding-top: 0 !important;
}

.compact-container:has(.page-heading-container) > .page-heading-container ~ * {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Reduce spacing on cards (filters, search) */
.main-content .card {
    margin-bottom: 0 !important;
    margin-top: 0 !important;
}

.main-content .card:first-of-type {
    margin-top: 0 !important;
}

/* Remove Bootstrap mb-3 class margin when after page-heading */
.card.mb-3:has(~ .page-heading-container),
.page-heading-container ~ .card.mb-3,
.page-heading-container + .card.mb-3,
.container-fluid:has(.page-heading-container) > .card.mb-3:first-of-type,
.container-fluid:has(.page-heading-container) > .card:first-of-type {
    margin-bottom: 0 !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Remove all padding and margin from container-fluid that has page-heading-container */
.container-fluid:has(.page-heading-container),
.compact-container:has(.page-heading-container) {
    padding-top: 0 !important;
}

/* Ensure page-heading-container itself has no bottom margin */
.page-heading-container {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Remove gap from button container inside page-heading-container */
.page-heading-container .d-flex.gap-2 {
    gap: 0.25rem !important;
    margin-bottom: 0 !important;
    margin-top: 0 !important;
    padding-bottom: 0 !important;
    padding-top: 0 !important;
    align-items: center !important;
    height: 24px !important;
}

/* Remove all spacing from page-heading-container children */
.page-heading-container > * {
    margin-bottom: 0 !important;
    margin-top: 0 !important;
}

/* Remove spacing from h2 and button container */
.page-heading-container h2,
.page-heading-container .d-flex {
    margin-bottom: 0 !important;
    margin-top: 0 !important;
    padding-bottom: 0 !important;
    padding-top: 0 !important;
}

/* Remove any spacing from the h2 in page-heading-container */
.page-heading-container h2.page-heading {
    margin-bottom: 0 !important;
    margin-top: 0 !important;
    padding-bottom: 0 !important;
    padding-top: 0 !important;
    line-height: 24px !important;
    height: 24px !important;
    display: flex !important;
    align-items: center !important;
    overflow: hidden !important;
    font-size: 0.875rem !important;
}

/* Nuclear option: Remove ALL spacing from elements in container-fluid after page-heading */
.container-fluid:has(.page-heading-container) > *:not(.page-heading-container):not(.breadcrumb),
.compact-container:has(.page-heading-container) > *:not(.page-heading-container):not(.breadcrumb) {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Remove spacing from the immediate next sibling after page-heading-container */
.page-heading-container + * {
    margin-top: 0 !important;
    padding-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Target any content that comes after page-heading-container */
.page-heading-container ~ *:not(.breadcrumb):not(.page-heading-container) {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Ensure absolutely no spacing between page-heading-container and its next sibling */
*:has(> .page-heading-container) > .page-heading-container + * {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Absolutely remove any line-height or vertical spacing from page-heading-container */
.page-heading-container {
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
}

/* Remove all vertical spacing from page-heading-container and its children */
.page-heading-container,
.page-heading-container * {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Ensure h2 has absolutely no spacing - this is critical */
.page-heading-container h2,
.page-heading-container h2.page-heading {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
}

/* Ensure the entire page-heading-container row has zero height spacing */
.page-heading-container.d-flex {
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
}

/* Ensure buttons have no spacing */
.page-heading-container .btn {
    margin: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Ensure content div immediately after has zero spacing */
.container-fluid > .page-heading-container + *,
.compact-container > .page-heading-container + * {
    margin-top: 0 !important;
    padding-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Remove spacing from any card that comes immediately after page-heading-container */
.container-fluid > .page-heading-container + .card,
.container-fluid > .page-heading-container + .card.mb-3,
.compact-container > .page-heading-container + .card,
.compact-container > .page-heading-container + .card.mb-3 {
    margin-top: 0 !important;
    padding-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Ensure any wrapper div or element that comes after page-heading has no spacing */
.container-fluid > .page-heading-container ~ *:first-of-type,
.compact-container > .page-heading-container ~ *:first-of-type {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Remove ALL spacing from the first card element after page-heading-container */
.page-heading-container + .card,
.page-heading-container + .card.mb-3,
.page-heading-container ~ .card:first-of-type,
.page-heading-container ~ .card.mb-3:first-of-type {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Override Bootstrap mb-3 class for cards immediately after page-heading */
.page-heading-container + .mb-3 {
    margin-bottom: 0 !important;
    margin-top: 0 !important;
}

/* Remove ALL margin and padding from ANY element that is a direct sibling of page-heading-container */
.compact-container > .page-heading-container + *,
.container-fluid > .page-heading-container + * {
    margin-top: 0 !important !important;
    padding-top: 0 !important !important;
    margin-bottom: 0 !important !important;
}

/* Remove ALL spacing from the first child element within main-content after page-heading-container */
.main-content .page-heading-container + * {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Remove spacing from the container that wraps content after page-heading */
.compact-container .page-heading-container ~ * {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.main-content .card-body {
    padding: 0.75rem !important;
}

/* Reduce breadcrumb nav margin */
nav[aria-label="breadcrumb"] {
    margin-bottom: 0.25rem !important;
}

.navbar .container-fluid {
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    flex-wrap: nowrap !important;
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.1rem;
    padding: 0.25rem 0 !important;
    line-height: 1.2 !important;
    height: auto !important;
}

.navbar-text {
    padding: 0.25rem 0 !important;
    font-size: 0.9rem;
    line-height: 1.2 !important;
    margin: 0 !important;
}

.navbar .btn {
    padding: 0.25rem 0.75rem !important;
    font-size: 0.875rem;
    line-height: 1.2 !important;
    height: auto !important;
}

.navbar-nav {
    height: auto !important;
}

.navbar-nav .nav-item {
    height: auto !important;
}

.navbar .ms-auto {
    height: auto !important;
    max-height: none !important;
    align-items: center !important;
}

.navbar .d-flex {
    height: auto !important;
    max-height: none !important;
}

/* Card Styling */
.card {
    border: none;
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15) !important;
}

.card-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title svg {
    color: #667eea;
}

.card-text {
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.btn-outline-primary {
    border-radius: 8px;
    padding: 8px 20px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-outline-primary:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    transform: translateY(-2px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .login-page .card {
        margin: 20px;
    }
    
    .card-title {
        font-size: 1.1rem;
    }
    
    /* Mobile container adjustments */
    .main-content .container-fluid,
    .main-content .compact-container {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    
    /* Mobile navbar adjustments */
    .navbar-brand {
        font-size: 0.9rem !important;
    }
    
    .navbar-text {
        font-size: 0.8rem !important;
        display: none; /* Hide on very small screens */
    }
    
    /* Page heading adjustments */
    .page-heading-container {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.5rem;
    }
    
    .page-heading {
        font-size: 0.9rem !important;
    }
    
    .page-heading-container .btn {
        width: 100%;
        font-size: 0.875rem;
        padding: 0.375rem 0.75rem;
    }
    
    /* Breadcrumb adjustments */
    .breadcrumb {
        font-size: 0.75rem !important;
        flex-wrap: wrap;
    }
    
    /* Modal adjustments */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .modal-content {
        border-radius: 8px;
    }
    
    /* Filter card adjustments */
    .card {
        margin-bottom: 0.5rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
}

/* Alert styling */
.alert {
    border-radius: 8px;
    border: none;
}

/* Form label styling */
.form-label {
    font-weight: 500;
    color: #555;
    margin-bottom: 0.5rem;
}

/* Container spacing */
.container {
    padding-left: 15px;
    padding-right: 15px;
}


/* Dashboard Body */
.dashboard-body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background-color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Dashboard Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background-color: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    width: auto;
    background: none;
    border-radius: 0;
    flex-shrink: 0;
    line-height: 0;
    text-decoration: none;
}

.header-logo img {
    display: block;
    height: 40px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
}

.header-menu-toggle {
    background: none;
    border: none;
    color: #1f2937;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    border-radius: 4px;
}

.header-menu-toggle:hover {
    background-color: #f3f4f6;
}

.header-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 28px;
}

.header-ossi-logo {
    display: inline-flex;
    align-items: center;
    line-height: 0;
    text-decoration: none;
    flex-shrink: 0;
    margin-right: 8px;
}

.header-ossi-logo img {
    display: block;
    height: 36px;
    width: auto;
    max-width: 130px;
    object-fit: contain;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 1.125rem;
}

.user-name {
    font-size: 0.9375rem;
    color: #1f2937;
    font-weight: 500;
}

/* Dashboard Container */
.dashboard-container {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    overflow: hidden;
}

/* Site footer */
.site-footer {
    flex-shrink: 0;
    text-align: center;
    padding: 8px 16px;
    font-size: 0.75rem;
    line-height: 1.4;
    color: #6b7280;
    background-color: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

/* Dashboard Main Content */
.dashboard-main-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background-color: #ffffff;
}

/* Welcome Banner */
.welcome-banner {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 24px;
    color: #ffffff;
}

.welcome-banner h2 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #ffffff;
}

.welcome-banner p {
    font-size: 1rem;
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.dashboard-section-header {
    margin: 8px 0 16px;
}

.dashboard-section-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
}

.dashboard-section-header p {
    margin: 4px 0 0;
    color: #6b7280;
    font-size: 0.9rem;
}

.metric-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.metric-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.metric-info {
    flex: 1;
}

.metric-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0 0 8px 0;
    font-weight: 500;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.metric-value-green {
    color: #10b981;
}

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.metric-icon-blue {
    background-color: #dbeafe;
    color: #2563eb;
}

.metric-icon-green {
    background-color: #d1fae5;
    color: #10b981;
}

.metric-icon-yellow {
    background-color: #fef3c7;
    color: #f59e0b;
}

/* Recent Activity */
.recent-activity {
    margin-top: 32px;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 16px 0;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.activity-item {
    background: #ffffff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.activity-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.activity-icon-blue {
    background-color: #dbeafe;
    color: #2563eb;
}

.activity-icon-green {
    background-color: #d1fae5;
    color: #10b981;
}

.activity-icon-yellow {
    background-color: #fef3c7;
    color: #f59e0b;
}

.activity-content {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.activity-text {
    font-size: 0.9375rem;
    color: #1f2937;
    margin: 0;
    font-weight: 500;
}

.activity-time {
    font-size: 0.875rem;
    color: #9ca3af;
}

/* Sidebar Styling */
.sidebar {
    width: 280px;
    background-color: #f9fafb;
    border-right: 1px solid #e5e7eb;
    height: 100%;
    overflow-y: auto;
    transition: transform 0.3s ease, width 0.3s ease;
    position: relative;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

/* Collapsed sidebar on desktop */
@media (min-width: 769px) {
    .sidebar.collapsed {
        width: 0;
        overflow: hidden;
        border-right: none;
    }
    
    .dashboard-main-content {
        transition: margin-left 0.3s ease;
    }
}

.sidebar-nav {
    padding: 1rem 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sidebar .nav-link {
    color: #374151;
    padding: 0.75rem 1.25rem;
    border-radius: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
    text-decoration: none;
    position: relative;
    font-size: 0.9375rem;
}

.sidebar .nav-link i {
    font-size: 1.125rem;
    width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar .nav-link span {
    flex: 1;
}

.sidebar .nav-link:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.sidebar .nav-link.active {
    background-color: #dbeafe;
    color: #2563eb;
    font-weight: 500;
}

.sidebar .nav-link.active i {
    color: #2563eb;
}

/* Sign Out Styling */
.sidebar .nav-item-signout {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.sidebar-nav ul:last-of-type {
    margin-top: auto;
}

.sidebar .nav-link-signout {
    color: #dc2626 !important;
}

.sidebar .nav-link-signout i {
    color: #dc2626 !important;
}

.sidebar .nav-link-signout:hover {
    background-color: #fee2e2;
    color: #dc2626 !important;
}

.sidebar .nav-link i.bi-chevron-down {
    margin-left: auto;
    font-size: 0.875rem;
    transition: transform 0.3s;
    flex-shrink: 0;
}

.sidebar-nav > ul {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.sidebar .nav-link[data-bs-toggle="collapse"] {
    justify-content: space-between;
}

.sidebar .nav-link[aria-expanded="true"] i.bi-chevron-down {
    transform: rotate(180deg);
}

.sidebar .sub-item {
    padding-left: 2.5rem;
    font-size: 0.875rem;
    border-left: none;
}

.sidebar .sub-item:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.sidebar .sub-item.active {
    background-color: #dbeafe;
    color: #2563eb;
    font-weight: 500;
}

.sidebar .collapse {
    background-color: #ffffff;
}

.sidebar .collapse .nav {
    padding: 0.5rem 0;
}

/* Main Content Area */
.main-content {
    flex: 1;
    height: 100%;
    overflow-y: auto;
    background-color: #ffffff;
    transition: margin-left 0.3s ease;
}

/* Sidebar Toggle Button */
#sidebarToggle {
    border: none;
    padding: 0.5rem;
    font-size: 1.25rem;
}

#sidebarToggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* Responsive Dashboard */
@media (max-width: 768px) {
    .dashboard-header {
        padding: 12px 16px;
    }

    .header-title {
        font-size: 1.25rem;
    }

    .header-logo {
        height: 32px;
        width: auto;
    }

    .header-logo img {
        height: 32px;
        max-width: 110px;
    }

    .header-ossi-logo img {
        height: 28px;
        max-width: 96px;
    }

    .header-right {
        gap: 12px;
    }

    .dashboard-main-content {
        padding: 16px;
    }

    .welcome-banner {
        padding: 24px;
    }

    .welcome-banner h2 {
        font-size: 1.5rem;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .metric-card {
        padding: 20px;
    }

    .metric-value {
        font-size: 1.75rem;
    }
}

/* Responsive Sidebar */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 60px;
        height: calc(100vh - 60px);
        transform: translateX(-100%);
        box-shadow: 2px 0 8px rgba(0,0,0,0.1);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .dashboard-main-content {
        margin-left: 0 !important;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .sidebar-overlay.show {
        display: block;
    }
}

/* Scrollbar styling for sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

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

.sidebar::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #555;
}


/* Search field with magnifying glass submit */
.search-input-wrap {
    position: relative;
}

.filter-group .search-input-wrap input,
.search-input-wrap input {
    padding-right: 40px !important;
}

.search-submit-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #6b7280;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.search-submit-btn:hover {
    color: #1f2937;
    background: #f3f4f6;
}
