/* Multiserve Internal Styles - Staff/Internal Pages with Sidebar Navigation */
/* This is the main internal system with the important sidebar for parts, RMA, ISO, Finance, etc. */

/* ================================================
   SIDEBAR NAVIGATION (Most Important!)
   ================================================ */

/* NEW MULTISERVE SIDEBAR NAVIGATION (Clean Hierarchical Design) */
.multiserve-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 0;
    height: 100%;
    overflow-y: auto;
}

.nav-section {
    display: flex;
    flex-direction: column;
}

.nav-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: transparent;
    border: none;
    color: #2c3e50;
    font-weight: 400;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    width: 100%;
    border-left: 3px solid transparent;
}

.nav-section-header:hover {
    background: #f5f5f5;
    border-left-color: #00897b;
}

.nav-section-header i:first-child {
    font-size: 1rem;
    width: 18px;
    text-align: center;
    color: #6c757d;
}

.nav-section-header span {
    flex: 1;
}

.section-toggle {
    font-size: 0.7rem;
    margin-left: auto;
    color: #6c757d;
}

.nav-section-items {
    display: flex;
    flex-direction: column;
    background: #fafafa;
}

.multiserve-sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px 8px 40px;
    color: #495057;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.15s ease;
    width: 100%;
    border-left: 3px solid transparent;
}

.multiserve-sidebar-nav .nav-link i {
    font-size: 0.9rem;
    width: 18px;
    text-align: center;
    color: #6c757d;
}

.multiserve-sidebar-nav .nav-link:hover {
    background: #e9ecef;
    color: #00897b;
    text-decoration: none;
    border-left-color: #00897b;
}

.multiserve-sidebar-nav .nav-link:hover i {
    color: #00897b;
}

.multiserve-sidebar-nav .nav-link.active {
    background: #00897b;
    color: white;
    font-weight: 500;
    border-left-color: #004d40;
}

.multiserve-sidebar-nav .nav-link.active i {
    color: white;
}

.multiserve-sidebar-nav .nav-link.active:hover {
    background: #00796b;
}
}

/* Scrollbar styling for sidebar */
.multiserve-sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.multiserve-sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.multiserve-sidebar-nav::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.multiserve-sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* ================================================
   OLD SIDEBAR STYLES (Legacy - keeping for compatibility)
   ================================================ */

/* Dashboard Link (Top of sidebar) */
.dashboard-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: #fff;
    border: 1px solid var(--multiserve-border-color);
    border-radius: 12px;
    color: var(--multiserve-text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin-bottom: 1rem;
}

.dashboard-link:hover {
    background: rgba(0, 137, 123, 0.08);
    color: var(--multiserve-primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    text-decoration: none;
}

.dashboard-link i {
    font-size: 1.25rem;
}

.dashboard-link-active {
    background: linear-gradient(135deg, var(--multiserve-primary) 0%, var(--multiserve-primary-dark) 100%) !important;
    color: white !important;
    border-color: transparent !important;
    box-shadow: 0 4px 12px rgba(0, 137, 123, 0.4) !important;
}

.dashboard-link-active:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 137, 123, 0.5) !important;
}

/* Sidebar Sections (Main navigation groups) */
.sidebar-section {
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--multiserve-border-color);
    transition: box-shadow 0.2s ease;
    margin-bottom: 1rem;
}

.sidebar-section:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.sidebar-section-header {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--multiserve-text-dark);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-section-header:hover {
    background: rgba(0, 137, 123, 0.08);
    color: var(--multiserve-primary);
}

.sidebar-section-header i {
    transition: transform 0.2s ease;
}

.sidebar-section-header:hover i {
    transform: scale(1.1);
}

.sidebar-section-body {
    display: none;
    flex-direction: column;
    background: var(--multiserve-bg-light);
}

.sidebar-section-body.show {
    display: flex;
}

/* Sidebar Links (Inside sections) */
.sidebar-section-body .list-group-item {
    border: none;
    border-top: 1px solid var(--multiserve-border-color);
    border-radius: 0;
    background: transparent;
    font-size: 0.875rem;
    padding: 0.75rem 1.25rem 0.75rem 2.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--multiserve-text-muted);
    transition: all 0.2s ease;
    text-decoration: none;
}

.sidebar-section-body .list-group-item:hover {
    background: rgba(0, 137, 123, 0.08);
    color: var(--multiserve-primary);
    padding-left: 2.75rem;
    text-decoration: none;
}

.sidebar-section-body .list-group-item i {
    font-size: 1rem;
    opacity: 0.7;
}

.sidebar-section-body .list-group-item:hover i {
    opacity: 1;
}

.sidebar-section-body .list-group-item.active {
    background: linear-gradient(90deg, rgba(0, 137, 123, 0.15) 0%, rgba(0, 137, 123, 0.08) 100%);
    color: var(--multiserve-primary);
    font-weight: 600;
    border-left: 3px solid var(--multiserve-primary);
    padding-left: calc(2.5rem - 3px);
}

.sidebar-section-body .list-group-item.active i {
    opacity: 1;
}

/* Sub-sections (nested navigation) */
.sidebar-subsection {
    margin: 0;
    border-top: 1px solid var(--multiserve-border-color);
}

.sidebar-subsection-header {
    width: 100%;
    border: none;
    background: rgba(0, 0, 0, 0.03);
    color: var(--multiserve-text-light);
    padding: 0.625rem 1rem 0.625rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-subsection-header:hover {
    background: rgba(0, 137, 123, 0.12);
    color: var(--multiserve-primary);
    padding-left: 2.25rem;
}

.sidebar-subsection-header i {
    font-size: 0.75rem;
    opacity: 0.7;
    transition: all 0.2s ease;
}

.sidebar-subsection-header:hover i {
    opacity: 1;
}

.sidebar-subsection-links {
    display: none;
    flex-direction: column;
    background: var(--multiserve-bg-light);
}

.sidebar-subsection-links.show {
    display: flex;
}

.subsection-link {
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    background: transparent;
    font-size: 0.8125rem;
    padding: 0.75rem 1rem 0.75rem 3.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--multiserve-text-muted);
    transition: all 0.15s ease;
    text-decoration: none;
    font-weight: 500;
    position: relative;
}

.subsection-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(90deg, var(--multiserve-primary), transparent);
    transition: width 0.2s ease;
}

.subsection-link:hover {
    background: rgba(0, 137, 123, 0.06);
    color: var(--multiserve-primary-dark);
    padding-left: 3.5rem;
    text-decoration: none;
}

.subsection-link:hover::before {
    width: 3px;
}

.subsection-link i {
    font-size: 0.875rem;
    opacity: 0.65;
    color: #78909C;
    flex-shrink: 0;
}

.subsection-link:hover i {
    opacity: 1;
    color: var(--multiserve-primary);
}

.subsection-link.active {
    background: linear-gradient(90deg, rgba(0, 137, 123, 0.15) 0%, rgba(0, 137, 123, 0.05) 100%);
    color: var(--multiserve-primary-dark);
    font-weight: 600;
    border-left: 3px solid var(--multiserve-primary);
    padding-left: calc(3.25rem - 3px);
}

.subsection-link.active::before {
    width: 3px;
    background: var(--multiserve-primary);
}

.subsection-link.active i {
    opacity: 1;
    color: var(--multiserve-primary);
    font-weight: 600;
}

/* ================================================
   DASHBOARD & CONTENT AREA
   ================================================ */

/* Dashboard cards */
.dashboard-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 4px solid var(--multiserve-primary);
    transition: all 0.2s ease;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.dashboard-stat {
    text-align: center;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--multiserve-primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--multiserve-text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ================================================
   PARTS & RMA SPECIFIC
   ================================================ */

/* Parts search */
.parts-search-bar {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
}

/* RMA status indicators */
.rma-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.875rem;
}

.rma-status.pending {
    background: rgba(255, 193, 7, 0.15);
    color: #F57C00;
}

.rma-status.in-progress {
    background: rgba(3, 169, 244, 0.15);
    color: #0277BD;
}

.rma-status.completed {
    background: rgba(76, 175, 80, 0.15);
    color: #2E7D32;
}

.rma-status.cancelled {
    background: rgba(244, 67, 54, 0.15);
    color: #C62828;
}

/* ================================================
   FINANCE SECTION
   ================================================ */

.finance-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    margin-bottom: 1rem;
}

.finance-total {
    font-size: 2rem;
    font-weight: 700;
    color: var(--multiserve-primary);
}

/* ================================================
   ISO SECTION
   ================================================ */

.iso-document-card {
    background: white;
    border: 1px solid var(--multiserve-border-color);
    border-radius: 8px;
    padding: 1.25rem;
    transition: all 0.2s ease;
}

.iso-document-card:hover {
    border-color: var(--multiserve-primary);
    box-shadow: 0 4px 12px rgba(0, 137, 123, 0.15);
}

/* ================================================
   RESPONSIVE SIDEBAR
   ================================================ */

@media (max-width: 992px) {
    .sidebar-section-body .list-group-item {
        padding-left: 2rem;
    }
    
    .sidebar-section-body .list-group-item.active {
        padding-left: calc(2rem - 3px);
    }
    
    .subsection-link {
        padding-left: 2.75rem;
    }
    
    .subsection-link:hover {
        padding-left: 3rem;
    }
    
    .subsection-link.active {
        padding-left: calc(2.75rem - 3px);
    }
}

@media (max-width: 768px) {
    .dashboard-link {
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
    }
    
    .sidebar-section-header {
        padding: 0.875rem 1rem;
    }
    
    .stat-value {
        font-size: 2rem;
    }
}


/* ==================================================
   FINANCE MODULE STYLES (Merged from finance-master.css)
   Finance is part of Multiserve Internal system
   ================================================== */

/* ============================================================================
   FINANCE MODULE - MASTER STYLESHEET
   ============================================================================
   Centralized CSS for all Finance pages
   Replaces inline <style> tags in individual Razor pages
   ============================================================================ */

/* ============================================================================
   1. GLOBAL FINANCE LAYOUT & COMMON ELEMENTS
   ============================================================================ */

/* Loading States */
.loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.loading .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Empty State Messages */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.empty-state h3 {
    color: #6c757d;
    margin-bottom: 15px;
}

/* Alert Variations */
.alert-info h5,
.alert-info h6 {
    margin-bottom: 10px;
}

/* ============================================================================
   2. DASHBOARD SPECIFIC STYLES
   ============================================================================ */

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.dashboard-header h1 {
    margin: 0;
}

.year-type-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.year-type-selector label {
    font-weight: 500;
    margin: 0;
}

.year-type-selector select {
    min-width: 200px;
}

/* Breakeven Section */
.breakeven-section {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.breakeven-section h2 {
    margin: 0 0 20px 0;
}

.breakeven-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.breakeven-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid transparent;
}

.breakeven-card.highlight {
    background: #e7f3ff;
    border-color: #007bff;
}

.breakeven-card.success-card {
    background: #d4edda;
    border-left: 5px solid #28a745;
}

.breakeven-card.warning-card {
    background: #fff3cd;
    border-left: 5px solid #ffc107;
}

.breakeven-card h3 {
    margin: 0 0 10px 0;
    font-size: 1.1rem;
    color: #495057;
}

.amount-large {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 15px 0;
    display: block;
}

.breakdown {
    margin-top: 15px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    margin: 8px 0;
    font-size: 14px;
}

/* YTD Section Styling */
.ytd-section {
    padding: 15px 0;
}

.ytd-section:not(:last-child) {
    border-bottom: 1px solid #dee2e6;
}

.ytd-metric-header {
    font-size: 0.875rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.ytd-section .amount-large {
    margin: 10px 0;
}

.ytd-section .breakdown {
    margin-top: 10px;
}

.progress-section {
    margin-top: 15px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #5cb85c);
    transition: width 0.3s ease;
}

.progress-fill.bg-success {
    background: linear-gradient(90deg, #28a745, #5cb85c) !important;
}

.progress-fill.bg-warning {
    background: linear-gradient(90deg, #ffc107, #ffd700) !important;
}

.progress-text {
    margin-top: 8px;
    font-size: 14px;
    font-weight: 500;
}

.margin-comparison {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.margin-current {
    text-align: center;
}

.margin-label {
    font-size: 0.85rem;
    color: #6c757d;
    display: block;
    margin-bottom: 5px;
}

.margin-change {
    text-align: center;
    font-size: 0.9rem;
}

/* Year Comparison Section */
.year-comparison-section {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.year-comparison-section h2 {
    margin: 0 0 20px 0;
}

.comparison-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.comparison-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid transparent;
    text-align: center;
}

.comparison-card.highlight {
    background: #e7f3ff;
    border-color: #007bff;
}

.comparison-card.success-card {
    background: #d4edda;
    border-color: #28a745;
}

.comparison-card.warning-card {
    background: #fff3cd;
    border-color: #ffc107;
}

.comparison-card h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.comparison-card .amount {
    font-size: 32px;
    font-weight: bold;
    margin: 10px 0;
}

.comparison-card small {
    color: #6c757d;
    font-size: 13px;
}

/* Dashboard Summary */
.dashboard-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.summary-card.positive {
    border-left: 4px solid #27ae60;
}

.summary-card.negative {
    border-left: 4px solid #e74c3c;
}

.summary-card h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #6c757d;
}

.summary-card .amount {
    font-size: 28px;
    font-weight: bold;
    margin: 0 0 5px 0;
}

.summary-card small {
    color: #6c757d;
    font-size: 12px;
}

/* Quick Actions */
.quick-actions {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.quick-actions h3 {
    margin: 0 0 15px 0;
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    text-decoration: none;
    color: #495057;
    transition: all 0.2s;
}

.action-btn:hover {
    background: #f8f9fa;
    border-color: #007bff;
    color: #007bff;
    transform: translateY(-2px);
}

.action-btn.highlight {
    background: #e7f3ff;
    border-color: #007bff;
    color: #007bff;
}

.action-btn span:first-child {
    font-size: 24px;
}

.action-btn span:last-child {
    font-size: 12px;
    text-align: center;
}

/* ============================================================================
   3. COMPACT GRID STYLES (Staff & Infrastructure Allocation)
   ============================================================================ */

.compact-grid {
    font-size: 0.85rem;
    margin-bottom: 0;
}

.compact-grid th,
.compact-grid td {
    padding: 4px 6px !important;
    vertical-align: middle;
}

.compact-grid th {
    font-size: 0.8rem;
    font-weight: 600;
}

/* Sticky Header */
.sticky-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #212529;
}

/* Sticky First Column */
.sticky-col {
    position: sticky;
    left: 0;
    background: white;
    z-index: 5;
    min-width: 140px;
    max-width: 200px;
}

.sticky-header .sticky-col {
    z-index: 15;
    background: #212529;
}

.table-warning .sticky-col {
    background: #fff3cd;
}

/* Column Sizing */
.cost-col {
    width: 70px;
    text-align: right;
    font-size: 0.8rem;
}

.amount-col {
    width: 80px;
    text-align: right;
    font-size: 0.85rem;
}

.dept-col {
    width: 70px;
    padding: 2px !important;
}

.total-col {
    width: 60px;
    font-size: 0.85rem;
}

.notes-col {
    width: 120px;
}

.auto-col {
    width: 45px;
    padding: 2px !important;
}

/* Compact Inputs */
.compact-input {
    padding: 2px 4px !important;
    font-size: 0.85rem;
    height: 26px;
    text-align: center;
    border: 1px solid #dee2e6;
    margin-bottom: 2px;
}

.compact-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.1rem rgba(0, 123, 255, 0.25);
}

.notes-col .compact-input {
    text-align: left;
    font-size: 0.75rem;
}

/* Staff/Cost Name Cell */
.staff-name,
.cost-name {
    font-size: 0.85rem;
}

.staff-name strong,
.cost-name strong {
    display: block;
    line-height: 1.2;
}

.job-title,
.cost-notes {
    font-size: 0.7rem;
    color: #6c757d;
    line-height: 1.1;
    margin-top: 2px;
}

/* Allocated Amount Display */
.allocated-amount {
    font-size: 0.7rem;
    color: #6c757d;
    text-align: center;
    margin-top: 2px;
}

/* Icons */
.valid-icon {
    color: #28a745;
    font-size: 0.7rem;
    margin-top: 2px;
}

.invalid-icon {
    font-size: 0.7rem;
    margin-top: 2px;
}

/* Compact Buttons */
.compact-btns {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.compact-btns .btn {
    padding: 2px 4px !important;
    font-size: 0.85rem;
    line-height: 1.2;
    border-radius: 2px;
    min-width: 35px;
}

/* Sticky Footer */
.sticky-footer {
    position: sticky;
    bottom: 0;
    background: #f8f9fa;
    z-index: 8;
    font-size: 0.8rem;
}

.sticky-footer .sticky-col {
    background: #f8f9fa;
    z-index: 9;
}

/* Hover Effects */
.compact-grid tbody tr:hover {
    background-color: #f1f3f5;
}

.table-warning:hover {
    background-color: #ffe69c !important;
}

/* Table Responsive Container */
.table-responsive {
    max-height: 70vh;
    overflow: auto;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

/* Department Header Tooltips */
.dept-col[title] {
    cursor: help;
}

/* ============================================================================
   4. P&L ADVANCED (Matrix View)
   ============================================================================ */

.report-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.report-controls label {
    font-size: 0.85rem;
    margin-bottom: 3px;
}

.report-controls select,
.report-controls .btn {
    font-size: 0.85rem;
    padding: 4px 8px;
    height: 32px;
}

.scenario-selector {
    flex: 2;
    min-width: 250px;
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.scenario-selector select {
    flex: 1;
}

.scenario-actions {
    margin-bottom: 10px;
    display: flex;
    gap: 8px;
}

.scenario-actions .btn {
    font-size: 0.8rem;
    padding: 4px 10px;
}

.matrix-container {
    overflow-x: auto;
    max-height: 75vh;
    position: relative;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.matrix-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.85rem;
}

.matrix-table th {
    padding: 6px 8px;
    font-size: 0.8rem;
    font-weight: 600;
}

.matrix-table td {
    padding: 5px 8px;
    font-size: 0.85rem;
}

.clickable-row {
    cursor: pointer;
    transition: background-color 0.2s;
}

.clickable-row:hover {
    background-color: #f0f8ff;
}

.history-indicator {
    margin-left: 5px;
    font-size: 0.9em;
}

.history-panel {
    margin-top: 30px;
    padding: 20px;
    border: 2px solid #007bff;
    border-radius: 8px;
    background: #f8f9fa;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.history-stats {
    display: flex;
    gap: 30px;
    margin-top: 15px;
    padding: 15px;
    background: white;
    border-radius: 5px;
}

.history-stats .stat {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.edit-input {
    width: 100%;
    padding: 4px;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-align: right;
}

.edit-banner {
    background: #fff3cd;
    border: 1px solid #ffc107;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-dialog {
    background: white;
    padding: 0;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.modal-header,
.modal-footer {
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    border-top: 1px solid #ddd;
    border-bottom: none;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.section-header td {
    background: #e9ecef;
    font-weight: bold;
    padding: 6px 8px;
    font-size: 0.85rem;
}

.total-row td {
    border-top: 2px solid #dee2e6;
    font-weight: bold;
    padding: 6px 8px;
    font-size: 0.85rem;
}

.highlight-row td {
    background: #e7f3ff;
    font-weight: bold;
    padding: 6px 8px;
}

.final-profit td {
    background: #d4edda;
    font-size: 0.95rem;
    font-weight: bold;
    padding: 8px;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1em;
    padding: 0 5px;
}

/* ============================================================================
   5. DEPARTMENT PROFITABILITY
   ============================================================================ */

.view-tabs {
    margin-bottom: 20px;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card.highlight {
    background: #e7f3ff;
    border: 2px solid #007bff;
}

.card label {
    display: block;
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 10px;
}

.big-value {
    font-size: 2.5rem;
    font-weight: bold;
    display: block;
    margin: 10px 0;
}

.period-selector {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.period-selector label {
    font-weight: 500;
    margin-bottom: 5px;
}

.trends-controls {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.budget-controls {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.chart-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.chart-container.large {
    min-height: 400px;
}

/* ============================================================================
   6. STAFF MANAGEMENT
   ============================================================================ */

/* ============================================================================
   7. MULTISERVE LAYOUT (Topbar + Sidebar Structure)
   ============================================================================ */

/* Layout Container */
.multiserve-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Top Bar */
.multiserve-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: linear-gradient(135deg, #00897b 0%, #00695c 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    z-index: 1000;
    gap: 1rem;
}

.sidebar-toggle {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
}

.brand-logo {
    font-size: 1.5rem;
}

.brand-text {
    font-size: 1.25rem;
    font-weight: 600;
}

.topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Sidebar Backdrop */
.sidebar-backdrop {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    cursor: pointer;
}

/* Sidebar Structure */
.multiserve-sidebar {
    position: fixed;
    left: 0;
    top: 64px;
    bottom: 0;
    width: 260px;
    background: white;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    transition: transform 0.3s ease;
    z-index: 999;
    transform: translateX(-260px);
}

.multiserve-sidebar.show {
    transform: translateX(0);
}

.sidebar-header {
    padding: 1.5rem 1rem 1rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h5 {
    margin: 0;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #6c757d;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.btn-close-sidebar {
    background: transparent;
    border: none;
    color: #6c757d;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-close-sidebar:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #000;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid #e9ecef;
    text-align: center;
}

/* Main Content */
.multiserve-content {
    margin-left: 0;
    margin-top: 64px;
    padding: 2rem;
    min-height: calc(100vh - 64px);
    transition: margin-left 0.3s ease;
}

/* Responsive */
@media (max-width: 991px) {
    .topbar-brand .brand-text {
        display: none;
    }

    .topbar-actions .small {
        display: none;
    }
}

@media (max-width: 767px) {
    .multiserve-topbar {
        padding: 0 1rem;
        height: 56px;
    }

    .multiserve-content {
        padding: 1rem;
        margin-top: 56px;
    }

    .multiserve-sidebar {
        top: 56px;
        width: 100%;
        max-width: 280px;
    }
}

@media (max-width: 575px) {
    .multiserve-topbar {
        padding: 0 0.75rem;
    }

    .topbar-brand .brand-logo {
        font-size: 1.25rem;
    }

    .multiserve-content {
        padding: 0.75rem;
    }
}

/* Scrollbar for Sidebar */
.multiserve-sidebar::-webkit-scrollbar {
    width: 6px;
}

.multiserve-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.multiserve-sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.multiserve-sidebar::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}
.staff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.staff-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.2s;
}

.staff-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.staff-card.inactive {
    opacity: 0.6;
    background: #f8f9fa;
}

.staff-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 10px;
}

.staff-name {
    font-size: 1.1rem;
    font-weight: bold;
    margin: 0;
}

.staff-status {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.staff-status.active {
    background: #d4edda;
    color: #155724;
}

.staff-status.inactive {
    background: #f8d7da;
    color: #721c24;
}

.staff-details {
    margin: 10px 0;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    margin: 5px 0;
    font-size: 0.9rem;
}

.detail-label {
    color: #6c757d;
}

.detail-value {
    font-weight: 500;
}

.staff-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
}

/* ============================================================================
   7. IMPORT PAGES
   ============================================================================ */

.import-section {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.import-section h3 {
    margin-top: 0;
}

.upload-zone {
    border: 2px dashed #007bff;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    background: #f8f9fa;
    transition: all 0.3s;
}

.upload-zone:hover {
    background: #e7f3ff;
    border-color: #0056b3;
}

.upload-zone.drag-over {
    background: #cfe2ff;
    border-color: #0056b3;
}

.file-info {
    margin-top: 15px;
    padding: 10px;
    background: #e7f3ff;
    border-radius: 4px;
}

.import-result {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
}

.import-result.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.import-result.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* ============================================================================
   8. UTILITY CLASSES
   ============================================================================ */

.text-success {
    color: #28a745 !important;
}

.text-danger {
    color: #dc3545 !important;
}

.text-warning {
    color: #ffc107 !important;
}

.text-muted {
    color: #6c757d !important;
}

.fw-bold {
    font-weight: bold !important;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.mb-2 {
    margin-bottom: 0.5rem !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

.mt-2 {
    margin-top: 0.5rem !important;
}

.mt-3 {
    margin-top: 1rem !important;
}

.ms-1 {
    margin-left: 0.25rem !important;
}

.ms-3 {
    margin-left: 1rem !important;
}

/* ============================================================================
   9. RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .breakeven-cards,
    .comparison-cards,
    .summary-cards {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        grid-template-columns: repeat(2, 1fr);
    }

    .staff-grid {
        grid-template-columns: 1fr;
    }

    .compact-grid {
        font-size: 0.75rem;
    }

    .amount-large,
    .big-value {
        font-size: 1.8rem;
    }
}

@media (max-width: 576px) {
    .period-selector {
        flex-direction: column;
        align-items: stretch;
    }

    .report-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .scenario-selector {
        flex-direction: column;
        min-width: auto;
    }
}

/* ============================================================================
   10. PRINT STYLES
   ============================================================================ */

@media print {
    .action-buttons,
    .btn,
    .scenario-actions,
    .report-controls {
        display: none !important;
    }

    .table-responsive {
        max-height: none !important;
        overflow: visible !important;
    }

    .sticky-header,
    .sticky-col,
    .sticky-footer {
        position: static !important;
    }

    .breakeven-card,
    .comparison-card,
    .card {
        break-inside: avoid;
    }
}
