/* style.css - Professional Wide Layout Stylesheet */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1400px; /* Increased from 1200px for wider tables */
    margin: 0 auto;
    padding: 20px;
}

/* Wide container for table-heavy pages */
.container.wide {
    max-width: 95%;
    min-width: 1200px;
}

/* Header Styles */
.header {
    background: #fff;
    padding: 25px 30px;
    margin-bottom: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-left: 4px solid #2c3e50;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.header p {
    color: #6c757d;
    font-size: 14px;
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.user-info {
    text-align: right;
    color: #6c757d;
    font-size: 14px;
}

.user-info p {
    margin-bottom: 8px;
    font-weight: 500;
}

/* Navigation */
.nav-bar {
    background: #2c3e50;
    padding: 0;
    margin-bottom: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow-x: auto; /* Handle nav overflow on smaller screens */
    white-space: nowrap;
}

.nav-bar a {
    color: #ecf0f1;
    text-decoration: none;
    padding: 16px 18px; /* Slightly reduced padding for more nav items */
    display: inline-block;
    font-weight: 500;
    font-size: 13px; /* Slightly smaller for more items */
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.nav-bar a:hover {
    background-color: #34495e;
    color: #fff;
}

.nav-bar a.active {
    background-color: #3498db;
    border-bottom-color: #2980b9;
    color: #fff;
}

/* Content Areas */
.content {
    background: #fff;
    padding: 25px; /* Reduced padding for more content space */
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ecf0f1;
}

/* Forms */
.form-section {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.form-section h2 {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
}

.form-grid {
    display: grid;
    gap: 15px;
    grid-template-columns: 1fr 1fr;
}

.form-grid.three-col {
    grid-template-columns: 1fr 1fr 1fr;
}

.form-grid.four-col {
    grid-template-columns: 1fr 1fr 1fr 1fr;
}

.form-grid.five-col {
    grid-template-columns: repeat(5, 1fr);
}

.form-group {
    margin-bottom: 15px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #495057;
    font-size: 13px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 13px;
    font-family: inherit;
    background-color: #fff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.form-group textarea {
    height: 80px;
    resize: vertical;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 6px 6px 0;
    min-width: 90px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 11px;
    min-width: 70px;
}

.btn-primary {
    background-color: #3498db;
    color: #fff;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-success {
    background-color: #25d66f;
    color: #fff;
}

.btn-success:hover {
    background-color: #106f38;
}

.btn-danger {
    background-color: #e74c3c;
    color: #fff;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-secondary {
    background-color: #95a5a6;
    color: #fff;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-warning {
    background-color: #f39c12;
    color: #fff;
}

.btn-warning:hover {
    background-color: #e67e22;
}

.btn-info {
    background-color: #17a2b8;
    color: #fff;
}

.btn-info:hover {
    background-color: #138496;
}

.logout-btn {
    background-color: #e74c3c;
    color: #fff;
    padding: 8px 16px;
    font-size: 12px;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.logout-btn:hover {
    background-color: #c0392b;
}

/* Messages */
.message {
    padding: 12px 18px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 500;
    border-left: 4px solid;
    font-size: 14px;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border-left-color: #27ae60;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border-left-color: #e74c3c;
}

.message.info {
    background-color: #cce7ff;
    color: #004085;
    border-left-color: #3498db;
}

/* Enhanced Tables for Wide Layout */
.table-container {
    background: #fff;
    border-radius: 8px;
    overflow: auto; /* Allow horizontal scrolling if needed */
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-top: 20px;
    border: 1px solid #e9ecef;
}

table {
    width: 100%;
    min-width: 1200px; /* Ensure minimum width for wide tables */
    border-collapse: collapse;
    font-size: 13px;
}

table th {
    background-color: #f8f9fa;
    color: #495057;
    font-weight: 600;
    padding: 12px 10px;
    text-align: left;
    border-bottom: 2px solid #e9ecef;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
}

table td {
    padding: 12px 10px;
    border-bottom: 1px solid #f1f3f4;
    vertical-align: middle;
    font-size: 12px;
}

table tbody tr:hover {
    background-color: #f8f9fa;
}

table tbody tr:last-child td {
    border-bottom: none;
}

/* Enhanced table columns for invoice tables */
table .bill-no-col {
    min-width: 120px;
    font-weight: 600;
}

table .customer-col {
    min-width: 200px;
}

table .route-owner-col {
    min-width: 150px;
}

table .amount-col {
    min-width: 100px;
    text-align: right;
    font-weight: 600;
}

table .date-col {
    min-width: 100px;
}

table .status-col {
    min-width: 80px;
    text-align: center;
}

table .actions-col {
    min-width: 120px;
    text-align: center;
}

/* Status badges */
.status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.status-partial {
    background-color: #cce7ff;
    color: #004085;
}

.status-paid {
    background-color: #d1e7dd;
    color: #0a3622;
}

/* Stats Dashboard - Responsive Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stats-grid.three-col {
    grid-template-columns: repeat(3, 1fr);
}

.stats-grid.four-col {
    grid-template-columns: repeat(4, 1fr);
}

.stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
    border-left: 4px solid #3498db;
}

.stat-card h3 {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 8px;
}

.stat-card p {
    color: #6c757d;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Amount calculation box */
.amount-calculation {
    background: #e8f4fd;
    border: 1px solid #bee5eb;
    padding: 15px;
    border-radius: 6px;
    margin-top: 10px;
}

.amount-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 13px;
}

.amount-row.total {
    font-weight: 600;
    font-size: 15px;
    border-top: 2px solid #3498db;
    padding-top: 8px;
    margin-top: 10px;
    color: #2c3e50;
}

/* Actions column */
.actions {
    white-space: nowrap;
}

.actions .btn {
    padding: 4px 8px;
    font-size: 11px;
    margin: 0 2px;
}

/* Settlement details */
.settlement-details {
    font-size: 11px;
    color: #6c757d;
    margin-top: 3px;
    line-height: 1.4;
}

.outstanding-amount {
    font-weight: 600;
    font-size: 13px;
}

/* Filter section */
.filter-section {
    background: #e9ecef;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.filter-section h4 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 16px;
}

/* Invoice summary */
.invoice-summary {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.invoice-summary h3 {
    color: #2c3e50;
    font-size: 18px;
    margin-bottom: 15px;
}

/* Customer info in forms */
.customer-info {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 5px;
    margin-top: 10px;
    font-size: 12px;
    border-left: 3px solid #3498db;
}

/* Recent invoices in manual entry */
.recent-invoices {
    background: #f8f9fa;
    border-radius: 5px;
    padding: 15px;
    margin-top: 20px;
}

.recent-invoices h3 {
    color: #2c3e50;
    font-size: 16px;
    margin-bottom: 15px;
}

/* Login page specific styles */
.login-container {
    max-width: 420px;
    margin: 80px auto;
    background: #fff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.login-header {
    text-align: center;
    margin-bottom: 35px;
}

.login-header h1 {
    font-size: 26px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.login-header p {
    color: #6c757d;
    font-size: 15px;
}

.login-btn {
    width: 100%;
    background: #2c3e50;
    color: #fff;
    padding: 15px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.login-btn:hover {
    background: #34495e;
}

.demo-info {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.demo-info h4 {
    color: #2c3e50;
    font-size: 16px;
    margin-bottom: 15px;
    font-weight: 600;
}

.demo-info p {
    color: #495057;
    font-size: 13px;
    margin: 8px 0;
}

/* Responsive design */
@media (max-width: 1400px) {
    .container {
        max-width: 98%;
        padding: 15px;
    }
    
    .container.wide {
        max-width: 98%;
        min-width: auto;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header-flex {
        flex-direction: column;
        text-align: left;
    }
    
    .user-info {
        text-align: left;
        margin-top: 15px;
    }
    
    .nav-bar a {
        padding: 12px 15px;
        font-size: 12px;
    }
    
    .form-grid,
    .form-grid.three-col,
    .form-grid.four-col,
    .form-grid.five-col {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .content {
        padding: 15px;
    }
    
    table {
        font-size: 11px;
        min-width: 800px; /* Smaller minimum on mobile */
    }
    
    table th,
    table td {
        padding: 8px 6px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-card h3 {
        font-size: 20px;
    }
}

/* Print styles */
@media print {
    .container {
        max-width: none;
        margin: 0;
        padding: 0;
    }
    
    .nav-bar,
    .header .btn,
    .actions {
        display: none;
    }
    
    .table-container {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    table {
        font-size: 10px;
    }
}