* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f6fa;
    color: #333;
}

.container {
    /* removed global overrides */
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: #2c3e50;
    color: white;
    transition: all 0.3s;
}

.logo {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #34495e;
}

.logo i {
    font-size: 24px;
    color: #c62828;
    /* Brand Red */
}

.logo span {
    font-size: 18px;
    font-weight: bold;
}

.nav-menu {
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: #34495e;
    color: white;
}

.nav-item.active {
    background: linear-gradient(90deg, #d32f2f 0%, #b71c1c 100%);
    /* Brand Red Gradient */
    color: white;
    border-left-color: #c62828;
}

.nav-item i {
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.header {
    background: white;
    padding: 20px 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left h1 {
    color: #2c3e50;
    font-size: 24px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.user-info img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

/* Content Sections */
.content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.section {
    display: none;
}

.section.active {
    display: block;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.stat-card:nth-child(1) .stat-icon {
    background: #c62828;
    /* Brand Red */
}

.stat-card:nth-child(2) .stat-icon {
    background: #2ecc71;
}

.stat-card:nth-child(3) .stat-icon {
    background: #e74c3c;
}

.stat-card:nth-child(4) .stat-icon {
    background: #f39c12;
}

.stat-info h3 {
    font-size: 28px;
    margin-bottom: 5px;
    color: #2c3e50;
}

.stat-info p {
    color: #7f8c8d;
    font-size: 14px;
}

/* Dashboard Content */
.dashboard-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.recent-activity,
.low-stock-alerts {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.recent-activity h3,
.low-stock-alerts h3 {
    margin-bottom: 20px;
    color: #2c3e50;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 10px;
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section-header h2 {
    color: #2c3e50;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #c62828;
    /* Brand Red */
    color: white;
}

.btn-primary:hover {
    background: #b71c1c;
    /* Darker Red */
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-outline {
    background: transparent;
    border: 1px solid #c62828;
    color: #c62828;
}

.btn-outline:hover {
    background: #c62828;
    color: white;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.data-table th {
    background: #34495e;
    color: white;
    font-weight: 600;
}

.data-table tr:hover {
    background: #f8f9fa;
}

/* Warehouses Grid */
.warehouses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.warehouse-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #c62828;
}

.warehouse-card.main {
    border-left-color: #2ecc71;
}

.warehouse-card.delivery {
    border-left-color: #f39c12;
}

.warehouse-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.warehouse-name {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.warehouse-type {
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
}

.warehouse-type.main {
    background: #d5f4e6;
    color: #27ae60;
}

.warehouse-type.delivery {
    background: #fdebd0;
    color: #e67e22;
}

.warehouse-info {
    color: #7f8c8d;
    font-size: 14px;
}

.warehouse-stats {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ecf0f1;
}

.stat {
    text-align: center;
}

.stat-value {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.stat-label {
    font-size: 12px;
    color: #7f8c8d;
}

/* Bootstrap Modal Fixes */
.modal {
    z-index: 1060 !important;
}

.modal-backdrop {
    z-index: 1050 !important;
}


/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #2c3e50;
}

input,
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #bdc3c7;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #c62828;
}

/* Invoice Items */
.invoice-items {
    margin: 25px 0;
}

.items-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
}

.invoice-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: 10px;
    padding: 10px;
    border-bottom: 1px solid #ecf0f1;
    align-items: center;
}

.invoice-summary {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 5px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
}

.summary-row.total {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    border-top: 2px solid #bdc3c7;
    padding-top: 10px;
    margin-top: 10px;
}

/* Activity List */
.activity-list,
.alert-list,
.top-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.activity-item,
.alert-item,
.top-item {
    padding: 12px;
    border-radius: 5px;
    background: #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.alert-item {
    border-left: 3px solid #e74c3c;
}

/* Reports */
.reports-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.report-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.report-card h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.chart-placeholder {
    height: 200px;
    background: #f8f9fa;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #bdc3c7;
}

.chart-placeholder i {
    font-size: 48px;
    margin-bottom: 10px;
}

/* Status Badges */
.status-badge {
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
}

.status-active {
    background: #d5f4e6;
    color: #27ae60;
}

.status-inactive {
    background: #fadbd8;
    color: #e74c3c;
}

.status-pending {
    background: #fdebd0;
    color: #f39c12;
}

.status-paid {
    background: #d5f4e6;
    color: #27ae60;
}

.status-overdue {
    background: #fadbd8;
    color: #e74c3c;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
    }

    .dashboard-content {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .reports-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
}


/* Accounting Styles */
.accounting-tabs {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.tab-headers {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.tab-header {
    padding: 15px 25px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 500;
    color: #6c757d;
    transition: all 0.3s;
}

.tab-header.active {
    color: #c62828;
    border-bottom-color: #c62828;
    background: white;
}

.tab-header:hover:not(.active) {
    color: #495057;
    background: #e9ecef;
}

.tab-pane {
    display: none;
    padding: 25px;
}

.tab-pane.active {
    display: block;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* Account Type Badges */
.account-type-asset {
    background: #d5f4e6;
    color: #27ae60;
}

.account-type-liability {
    background: #fdebd0;
    color: #e67e22;
}

.account-type-equity {
    background: #d6eaf8;
    color: #3498db;
}

.account-type-income {
    background: #d1f2eb;
    color: #1abc9c;
}

.account-type-expense {
    background: #fadbd8;
    color: #e74c3c;
}

/* Report Styles */
.report-content {
    max-height: 400px;
    overflow-y: auto;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
}

.report-table th,
.report-table td {
    padding: 10px;
    border-bottom: 1px solid #ecf0f1;
    text-align: left;
}

.report-table th {
    background: #f8f9fa;
    font-weight: 600;
}

.report-table .total-row {
    font-weight: 600;
    background: #f8f9fa;
    border-top: 2px solid #bdc3c7;
}

.report-table .section-header {
    font-weight: 600;
    background: #e9ecef;
}

.report-table .sub-account {
    padding-left: 20px;
}

/* Journal Entry Modal */
.journal-entry-items {
    margin: 20px 0;
}

.journal-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: 10px;
    padding: 10px;
    border-bottom: 1px solid #ecf0f1;
    align-items: center;
}

.journal-items-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    font-weight: 600;
    margin-bottom: 10px;
}

.journal-summary {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
}

.journal-totals {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    font-size: 16px;
}

.journal-totals.balanced {
    color: #27ae60;
}

.journal-totals.unbalanced {
    color: #e74c3c;
}

/* Auth Styles */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #b71c1c 0%, #880e4f 100%);
    /* Brand Deep Red */
    padding: 20px;
}

.auth-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.auth-card h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #333;
}

.auth-form .form-group {
    margin-bottom: 1rem;
}

.auth-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #555;
}

.auth-form input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    box-sizing: border-box;
}

.auth-form input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-block {
    width: 100%;
}

.auth-links {
    text-align: center;
    margin-top: 1rem;
}

.auth-links a {
    color: #667eea;
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 0.75rem;
    border-radius: 5px;
    margin-top: 1rem;
    border: 1px solid #fcc;
}

.success-message {
    background: #efe;
    color: #363;
    padding: 0.75rem;
    border-radius: 5px;
    margin-top: 1rem;
    border: 1px solid #cfc;
}

/* User Management Styles */
.avatar-sm {
    width: 32px;
    height: 32px;
}

.avatar-lg {
    width: 80px;
    height: 80px;
}

.btn-group-sm .btn {
    padding: 0.25rem 0.5rem;
}

/* Table responsive fixes */
.table-responsive {
    border-radius: 0.375rem;
}

/* Card improvements */
.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border: 1px solid rgba(0, 0, 0, 0.125);
}

.card-header {
    background-color: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}

/* Error Pages Styles */
.error-container,
.maintenance-container {
    padding: 3rem 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.error-icon,
.maintenance-icon {
    margin-bottom: 2rem;
}

.error-icon i,
.maintenance-icon i {
    font-size: 4rem;
}

.error-title {
    font-size: 6rem;
    font-weight: 700;
    color: #6c757d;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.error-subtitle,
.maintenance-subtitle {
    font-size: 2rem;
    font-weight: 300;
    color: #495057;
    margin-bottom: 1.5rem;
}

.maintenance-title {
    font-size: 2.5rem;
    font-weight: 300;
    color: #495057;
    margin-bottom: 1rem;
}

.error-message,
.maintenance-message {
    font-size: 1.2rem;
    color: #6c757d;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.error-details {
    background: #f8f9fa;
    border-radius: 0.375rem;
    padding: 1rem;
    margin: 1.5rem 0;
    border-left: 4px solid #6c757d;
}

.error-suggestions,
.maintenance-schedule,
.maintenance-updates {
    margin: 2rem 0;
}

.error-suggestions ul li,
.maintenance-schedule ul li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
}

.error-suggestions ul li:last-child,
.maintenance-schedule ul li:last-child {
    border-bottom: none;
}

.error-suggestions ul li i,
.maintenance-schedule ul li i {
    width: 20px;
    margin-right: 0.5rem;
}

.error-actions,
.maintenance-actions {
    margin-top: 2rem;
}

.error-actions .btn,
.maintenance-actions .btn {
    margin: 0.25rem;
}

.countdown-timer,
.maintenance-countdown {
    font-family: 'Courier New', monospace;
}

/* Debug information */
.error-debug details {
    cursor: pointer;
}

.error-debug summary {
    user-select: none;
}

.error-debug pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 0.875rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .error-title {
        font-size: 4rem;
    }

    .error-subtitle {
        font-size: 1.5rem;
    }

    .error-actions .btn {
        display: block;
        width: 100%;
        margin: 0.5rem 0;
    }
}

/* Animation for error icons */
.error-icon i,
.maintenance-icon i {
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

/* Inventory Styles */
.stock-low {
    color: #dc3545;
    font-weight: bold;
}

.stock-warning {
    color: #ffc107;
    font-weight: bold;
}

.stock-good {
    color: #198754;
    font-weight: bold;
}

.inventory-stats .card {
    transition: transform 0.2s;
}

.inventory-stats .card:hover {
    transform: translateY(-2px);
}

/* Batch number styling */
.batch-number {
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}