/* Custom CSS for ERP System */

:root {
    --primary-color: #0d6efd;
    --sidebar-width: 250px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 56px;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 0;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
    overflow-y: auto;
}

.sidebar .nav-link {
    font-weight: 500;
    color: #333;
    padding: 10px 15px;
}

.sidebar .nav-link:hover {
    background-color: #e9ecef;
}

.sidebar .nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

.sidebar .nav-link i {
    margin-right: 8px;
}

/* Main Content */
main {
    margin-top: 20px;
}

/* Card Styles */
.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border: none;
    margin-bottom: 20px;
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
}

/* Table Styles */
.table {
    font-size: 13px;
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
}

/* Dark table header styles - must come after general table rules */
#depreciationTable thead.table-dark th,
.table thead.table-dark th,
.table.table-striped.table-hover thead.table-dark th,
.table-dark thead th {
    background-color: #343a40 !important;
    border-color: #454d55 !important;
    color: #ffffff !important;
    font-weight: 600;
}

.table-hover tbody tr:hover {
    background-color: #f1f3f5;
}

/* Button Styles */
.btn {
    font-size: 13px;
    padding: 6px 12px;
}

.btn-sm {
    font-size: 12px;
    padding: 4px 8px;
}

/* Form Styles */
.form-label {
    font-weight: 500;
    margin-bottom: 5px;
}

.form-control, .form-select {
    font-size: 13px;
}

/* Badge Styles */
.badge {
    font-size: 11px;
    padding: 4px 8px;
}

/* Dashboard Cards */
.dashboard-card {
    border-left: 4px solid var(--primary-color);
}

.dashboard-card .card-body {
    padding: 20px;
}

.dashboard-card h3 {
    font-size: 28px;
    margin: 0;
}

.dashboard-card p {
    margin: 0;
    color: #6c757d;
}

/* Stats Cards Colors */
.card-primary { border-left-color: #0d6efd; }
.card-success { border-left-color: #198754; }
.card-warning { border-left-color: #ffc107; }
.card-danger { border-left-color: #dc3545; }
.card-info { border-left-color: #0dcaf0; }

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.login-header {
    text-align: center;
    padding: 30px 20px 20px;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

/* Action Buttons in Tables */
.btn-action {
    padding: 2px 8px;
    font-size: 12px;
    margin: 0 2px;
}

/* Status Colors */
.status-draft { color: #6c757d; }
.status-approved { color: #198754; }
.status-pending { color: #ffc107; }
.status-rejected { color: #dc3545; }
.status-completed { color: #198754; }

/* Pagination */
.pagination {
    font-size: 13px;
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: relative;
        top: 0;
    }
    
    main {
        margin-top: 10px;
    }
}

/* Print Styles */
@media print {
    .sidebar, .navbar, .btn, .no-print {
        display: none !important;
    }
    
    main {
        margin: 0;
        padding: 0;
    }
}

/* Additional utility classes */
.text-muted-light {
    color: #adb5bd !important;
}

.cursor-pointer {
    cursor: pointer;
}

.hover-shadow:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
    transition: box-shadow 0.3s ease-in-out;
}

/* No-wrap table utility: prevent wrapping and allow horizontal scroll */
.table-nowrap th,
.table-nowrap td {
    white-space: nowrap;
}

/* Make the whole table expand horizontally to fit content so it doesn't wrap */
.table-nowrap {
    width: max-content;
    min-width: 100%;
}

/* Ensure any buttons or inline controls inside cells also don't wrap */
.table-nowrap td .btn, .table-nowrap th .btn {
    white-space: nowrap;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overflow-y: hidden;
}

/* Kanban board styles */
.kanban-board {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
}
.kanban-board .kanban-column-container {
    flex: 0 0 320px;
    width: 320px;
    margin-right: 12px;
}
.kanban-column {
    min-height: 200px;
    max-height: 70vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    background: #fff;
}
.kanban-column.drag-over {
    background: #f8fbff;
    box-shadow: inset 0 0 0 2px rgba(13,110,253,0.06);
}
.kanban-card { cursor: grab; }
.kanban-card:active { cursor: grabbing; }
.kanban-card .card-body { cursor: default; }

