/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header h1 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.header-left {
    display: inline-block;
}

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

.user-info {
    color: #666;
    font-size: 14px;
}

nav {
    display: flex;
    gap: 10px;
    clear: both;
    padding-top: 15px;
}

.nav-btn {
    padding: 10px 20px;
    border: none;
    background: #ecf0f1;
    color: #2c3e50;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.nav-btn:hover {
    background: #bdc3c7;
}

.nav-btn.active {
    background: #3498db;
    color: white;
}

/* Content Sections */
.content-section {
    display: none;
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.content-section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-header h2 {
    color: #2c3e50;
}

.actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background: #27ae60;
    color: white;
}

.btn-primary:hover {
    background: #229954;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-danger {
    background: #e74c3c;
    color: white;
    padding: 5px 10px;
    font-size: 12px;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-edit {
    background: #3498db;
    color: white;
    padding: 5px 10px;
    font-size: 12px;
}

.btn-edit:hover {
    background: #2980b9;
}

.btn-view {
    background: #9b59b6;
    color: white;
    padding: 5px 10px;
    font-size: 12px;
}

.btn-view:hover {
    background: #8e44ad;
}

/* Search Input */
.search-input {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    min-width: 250px;
}

.search-input:focus {
    outline: none;
    border-color: #3498db;
}

.filter-select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

/* Tables */
.data-table {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #ecf0f1;
}

th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #bdc3c7;
}

td {
    padding: 12px;
    border-bottom: 1px solid #ecf0f1;
}

tbody tr:hover {
    background: #f8f9fa;
}

.loading {
    text-align: center;
    color: #7f8c8d;
    padding: 30px !important;
}

.action-buttons {
    display: flex;
    gap: 5px;
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-draft {
    background: #ecf0f1;
    color: #7f8c8d;
}

.status-sent {
    background: #d4edda;
    color: #155724;
}

.status-paid {
    background: #cce5ff;
    color: #004085;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

.modal.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    animation: slideDown 0.3s;
}

.modal-large {
    max-width: 900px;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.close:hover,
.close:focus {
    color: #000;
}

/* Forms */
.form-group {
    margin-bottom: 15px;
    flex: 1;
}

.form-row {
    display: flex;
    gap: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #2c3e50;
}

input[type="text"],
input[type="email"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #3498db;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* Bill Lines Table */
.bill-lines-table {
    margin: 15px 0;
}

.bill-lines-table input {
    margin: 0;
}

.bill-total {
    text-align: right;
    margin-top: 15px;
    padding: 15px;
    background: #ecf0f1;
    border-radius: 5px;
    font-size: 18px;
}

/* Responsive */
@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .actions {
        width: 100%;
        flex-direction: column;
    }
    
    .search-input,
    .filter-select {
        width: 100%;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .data-table {
        font-size: 12px;
    }
    
    th, td {
        padding: 8px;
    }
}

/* Alert Messages */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    font-size: 14px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-inactive {
    background: #f8d7da;
    color: #721c24;
}

/* Badge styles */
.badge {
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-inactive {
    background: #f8d7da;
    color: #721c24;
}

/* Pagination Styles */
.pagination {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

.pagination-info {
    text-align: center;
    color: #666;
    font-size: 14px;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.pagination-controls .btn {
    min-width: 40px;
    padding: 8px 12px;
}

.pagination-ellipsis {
    padding: 8px 12px;
    color: #666;
}

/* Filter Input Styles */
.filter-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    margin-right: 10px;
}

.filter-input:focus {
    outline: none;
    border-color: #007bff;
}

/* Test Billing Results Styles */
.test-results {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.test-results h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 18px;
}

.test-results-summary {
    margin-bottom: 20px;
    padding: 15px;
    background-color: white;
    border-radius: 4px;
    border-left: 4px solid #007bff;
}

.test-results-summary p {
    margin: 5px 0;
    line-height: 1.8;
}

.test-results-details {
    margin-top: 15px;
}

.test-results-details h4 {
    margin-bottom: 10px;
    color: #495057;
}

.test-results table {
    background-color: white;
    font-size: 14px;
}

.test-results table th {
    background-color: #f8f9fa;
    font-weight: 600;
    text-align: left;
}

.test-results table td,
.test-results table th {
    padding: 10px;
    border: 1px solid #ddd;
}

.test-results table th {
    text-align: left;
}

/* Footer Styles */
.app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 8px 20px;
    font-size: 12px;
    color: #6c757d;
    z-index: 1000;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.commit-info {
    font-family: 'Courier New', monospace;
    display: flex;
    align-items: center;
    gap: 8px;
}

.commit-info::before {
    content: '📝';
}

/* Add padding to container to account for fixed footer */
.container {
    padding-bottom: 40px;
}
