/* Crux Invoice Management System - Stylesheet */

/* CSS Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-brand .brand-link {
    color: white;
    font-size: 1.4rem;
    font-weight: 700;
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.nav-links a:hover, .nav-links a.active {
    background: rgba(255,255,255,0.15);
    color: white;
}

.btn-logout {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: rgba(255,255,255,0.2);
}

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

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    color: #1a73e8;
    font-size: 1.8rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary {
    background: #1a73e8;
    color: white;
}

.btn-primary:hover {
    background: #1557b0;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

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

.btn-sm {
    padding: 0.35rem 0.8rem;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

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

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

/* Tables */
.table-wrapper {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    overflow: hidden;
}

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

.data-table th {
    background: #f8f9fa;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.data-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #eee;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.data-table .actions {
    display: flex;
    gap: 0.5rem;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: #6c757d; }

/* Forms */
.form-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-section {
    margin-bottom: 2rem;
}

.form-section h3 {
    color: #495057;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #eee;
}

.section-hint {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 500;
    color: #495057;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26,115,232,0.1);
}

.form-group .error {
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Checkbox */
.checkbox-group {
    display: flex;
    align-items: center;
    padding-top: 1.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 1.2rem;
    height: 1.2rem;
}

.checkbox-text {
    font-weight: 600;
    color: #333;
}

/* Invoice Layout */
.invoice-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.form-column, .preview-column {
    min-width: 0;
}

/* Line Items Table */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h3 {
    margin: 0;
    border: none;
    padding: 0;
}

.line-items-table {
    overflow-x: auto;
}

.line-items-table table {
    width: 100%;
    border-collapse: collapse;
}

.line-items-table th {
    background: #f0f7ff;
    padding: 0.6rem;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: #2c3e50;
    border: 1px solid #4a90e2;
}

.line-items-table td {
    padding: 0.3rem;
    border: 1px solid #4a90e2;
}

.line-items-table .input-sm {
    width: 100%;
    padding: 0.4rem;
    border: none;
    font-size: 0.9rem;
    text-align: center;
}

.line-items-table .input-full {
    width: 100%;
    padding: 0.4rem;
    border: none;
    font-size: 0.9rem;
}

.line-items-table .taxable-cell {
    text-align: right;
    padding-right: 0.5rem;
    font-weight: 500;
}

.btn-remove {
    background: #dc3545;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

.btn-remove:hover {
    background: #c82333;
}

/* Preview Card */
.preview-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 1.5rem;
    position: sticky;
    top: 1rem;
}

.preview-card h3 {
    color: #495057;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #eee;
}

.preview-section {
    margin-bottom: 1.5rem;
}

.preview-header {
    text-align: center;
    font-size: 1.2rem;
    color: #1a73e8;
    padding: 0.5rem;
    border: 1px solid #1a73e8;
    margin-bottom: 1rem;
}

.preview-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.preview-totals {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
}

.total-highlight {
    font-weight: 700;
    font-size: 1.1rem;
    border-top: 2px solid #ddd;
    padding-top: 0.75rem;
    margin-top: 0.5rem;
}

.total-row.payable {
    background: #e8f4fd;
    margin: 0.5rem -1rem -1rem;
    padding: 0.75rem 1rem;
    border-radius: 0 0 6px 6px;
    color: #1a73e8;
}

/* Filter Bar */
.filter-bar {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.filter-form {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.filter-form .form-group {
    margin: 0;
}

.filter-form label {
    font-size: 0.85rem;
}

.filter-form input {
    padding: 0.5rem;
}

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 1rem;
}

.login-card {
    background: white;
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    color: #1a73e8;
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: #6c757d;
    font-size: 0.9rem;
}

.login-form .form-group {
    margin-bottom: 1.25rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 1.5rem;
    color: #6c757d;
    font-size: 0.9rem;
    margin-top: 2rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .invoice-layout {
        grid-template-columns: 1fr;
    }
    
    .preview-column {
        order: -1;
    }
    
    .preview-card {
        position: static;
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}
