/* ============================================================================
   SIMPLE LOGIN PAGE STYLES - CONSISTENT WITH SITE DESIGN
   ============================================================================ */

.login-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 2.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    font-size: 0.95rem;
    color: #6c757d;
    margin: 0;
}

.form-label {
    display: flex;
    align-items: center;
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

.form-control-lg {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    border: 1px solid #ced4da;
}

.form-control-lg:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.15);
}

.btn-primary {
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.login-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
}

.btn-register {
    padding: 0.5rem 1.5rem;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-register:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
    text-decoration: none;
}

.custom-control-label {
    font-size: 0.9rem;
    color: #495057;
}

/* Register Page Specific Styles */
.register-card {
    max-width: 100%;
}

.register-section-divider {
    margin: 1.5rem 0 1rem;
    padding: 0.75rem 0;
    border-bottom: 2px solid #e9ecef;
    position: relative;
}

.register-section-title {
    display: inline-block;
    background: #ffffff;
    padding-right: 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.register-card .form-control-lg {
    font-size: 0.95rem;
}

.register-card .btn-success {
    padding: 0.875rem 1.5rem;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.register-card .btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(40, 167, 69, 0.4);
}

/* Responsive */
@media (max-width: 576px) {
    .login-card {
        padding: 1.5rem;
    }

    .login-title {
        font-size: 1.5rem;
    }
    
    .register-section-divider {
        margin: 1rem 0 0.75rem;
    }
    
    .register-section-title {
        font-size: 0.85rem;
    }
}

/* ============================================================================
   INVOICE PAGES STYLES - MODERN & CONSISTENT
   ============================================================================ */

/* Invoice Header with Action Button */
.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.invoice-header h1 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 600;
    color: #2d3748;
}

.invoice-header .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Filter Card Styling */
.invoice-filters-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    margin-bottom: 1.5rem;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    margin-bottom: 1rem;
}

.filter-header h5 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-content {
    padding-top: 1rem;
}

.filter-content .form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

/* Status Radio Group */
.status-radio-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.status-radio-group .form-check-inline {
    margin-right: 0;
    position: relative;
}

.status-radio-group .form-check-input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.status-radio-group .form-check-label {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    background: #ffffff;
    border: 2px solid #ced4da;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: #495057;
    user-select: none;
    min-width: 100px;
    text-align: center;
}

.status-radio-group .form-check-label:hover {
    border-color: #667eea;
    background: #f0f0ff;
    color: #667eea;
    transform: translateY(-1px);
}

.status-radio-group .form-check-input:checked + .form-check-label {
    background: #667eea;
    border-color: #667eea;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.status-radio-group .form-check-input:focus + .form-check-label {
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    outline: none;
}

/* Date Input Wrapper */
.date-input-wrapper {
    position: relative;
}

.date-input-wrapper .form-control {
    padding-right: 2.75rem;
    cursor: pointer;
    background: #ffffff;
    border: 2px solid #ced4da;
    transition: all 0.3s ease;
}

.date-input-wrapper .form-control:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.date-input-wrapper .form-control:focus {
    border-color: #667eea;
    background: #ffffff;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
}

.date-input-wrapper .date-icon {
    position: absolute;
    right: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: #667eea;
    pointer-events: none;
    width: 20px;
    height: 20px;
    opacity: 0.8;
}

/* Style the datetime-local input calendar icon */
.date-input-wrapper .form-control::-webkit-calendar-picker-indicator {
    opacity: 0;
    position: absolute;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.date-input-wrapper .form-control::-webkit-datetime-edit {
    padding: 0;
}

.date-input-wrapper .form-control::-webkit-datetime-edit-fields-wrapper {
    padding: 0;
}

/* Filter Actions */
.filter-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.filter-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Invoice Form Card */
.invoice-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 2.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.invoice-header-simple {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #e9ecef;
}

.invoice-header-simple h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.invoice-header-simple p {
    font-size: 1rem;
    margin: 0;
}

/* Invoice Form Styling */
.invoice-card .form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

.invoice-card .form-control {
    border-radius: 6px;
    border: 1px solid #ced4da;
    padding: 0.6rem 0.875rem;
}

.invoice-card .form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.15);
}

/* Invoice Actions */
.invoice-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
    flex-wrap: wrap;
}

.invoice-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.invoice-actions .btn-lg {
    padding: 0.75rem 1.75rem;
    font-size: 1rem;
}

.invoice-actions .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Detail Item Styling */
.detail-item {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    border-left: 3px solid #007bff;
}

.detail-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    display: block;
}

.detail-value {
    font-size: 1rem;
    font-weight: 500;
    color: #2d3748;
    margin: 0;
}

.detail-value .badge {
    font-size: 0.875rem;
    padding: 0.4rem 0.75rem;
}

/* Delete Page Styling */
.delete-card {
    border-left: 4px solid #dc3545;
}

.delete-card .alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.delete-actions .btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
}

.delete-actions .btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .invoice-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .invoice-header h1 {
        font-size: 1.5rem;
    }
    
    .invoice-filters-card {
        padding: 1rem;
    }
    
    .invoice-card {
        padding: 1.5rem;
    }
    
    .status-radio-group {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .filter-actions {
        flex-direction: column;
    }
    
    .filter-actions .btn {
        width: 100%;
    }
    
    .invoice-actions {
        flex-direction: column;
    }
    
    .invoice-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .invoice-header-simple h2 {
        font-size: 1.5rem;
    }
}

/* ============================================================================
   DARK MODE OVERRIDES
   ============================================================================ */

/* Login Card */
body.inverted .login-card {
    background: var(--dark-surface);
    border-color: var(--gray-700);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

body.inverted .login-title {
    color: var(--dark-text);
}

body.inverted .login-subtitle {
    color: var(--dark-text-secondary);
}

body.inverted .login-footer {
    border-top-color: var(--gray-700);
}

/* Register Card */
body.inverted .register-section-divider {
    border-bottom-color: var(--gray-700);
}

body.inverted .register-section-title {
    background: var(--dark-surface);
    color: var(--dark-text-secondary);
}

/* Form Labels */
body.inverted .form-label {
    color: var(--dark-text-secondary);
}

body.inverted .custom-control-label {
    color: var(--dark-text-secondary);
}

/* Form Controls */
body.inverted .form-control-lg {
    background: var(--dark-surface-light);
    border-color: var(--gray-700);
    color: var(--dark-text);
}

body.inverted .form-control-lg:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 0.2rem rgba(0, 82, 204, 0.25);
}

/* Invoice Header */
body.inverted .invoice-header h1 {
    color: var(--dark-text);
}

/* Filter Card */
body.inverted .invoice-filters-card {
    background: var(--dark-surface);
    border-color: var(--gray-700);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

body.inverted .filter-header h5 {
    color: var(--dark-text);
}

body.inverted .filter-content .form-label {
    color: var(--dark-text-secondary);
}

/* Status Radio Group */
body.inverted .status-radio-group .form-check-label {
    background: var(--dark-surface-light);
    border-color: var(--gray-700);
    color: var(--dark-text-secondary);
}

body.inverted .status-radio-group .form-check-label:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.15);
    color: #a4b4f4;
}

body.inverted .status-radio-group .form-check-input:checked + .form-check-label {
    background: #667eea;
    border-color: #667eea;
    color: #ffffff;
}

/* Date Input Wrapper */
body.inverted .date-input-wrapper .form-control {
    background: var(--dark-surface-light);
    border-color: var(--gray-700);
    color: var(--dark-text);
}

body.inverted .date-input-wrapper .form-control:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

body.inverted .date-input-wrapper .form-control:focus {
    border-color: #667eea;
    background: var(--dark-surface-light);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.2);
}

/* Invoice Form Card */
body.inverted .invoice-card {
    background: var(--dark-surface);
    border-color: var(--gray-700);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

body.inverted .invoice-header-simple {
    border-bottom-color: var(--gray-700);
}

body.inverted .invoice-header-simple h2 {
    color: var(--dark-text);
}

body.inverted .invoice-card .form-label {
    color: var(--dark-text-secondary);
}

body.inverted .invoice-card .form-control {
    background: var(--dark-surface-light);
    border-color: var(--gray-700);
    color: var(--dark-text);
}

body.inverted .invoice-card .form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 0.2rem rgba(0, 82, 204, 0.25);
}

/* Invoice Actions */
body.inverted .invoice-actions {
    border-top-color: var(--gray-700);
}

/* Detail Item */
body.inverted .detail-item {
    background: var(--dark-surface-light);
    border-left-color: var(--primary-light);
}

body.inverted .detail-label {
    color: var(--dark-text-secondary);
}

body.inverted .detail-value {
    color: var(--dark-text);
}

/* Delete Card */
body.inverted .delete-card {
    border-left-color: var(--danger);
}

/* ============================================================================
   INVOICE TABLE STYLES - MODERN DATA TABLE
   ============================================================================ */

.invoice-table-container {
    background: #ffffff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    margin-bottom: 1.5rem;
}

.invoice-table {
    table-layout: auto;
    width: 100%;
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
    overflow: visible !important;
}

.invoice-table thead th {
    color: #343a40;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 0.875rem 0.75rem;
    border: none;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
    vertical-align: middle;
}

.invoice-table .col-numeric {
    text-align: right;
    white-space: nowrap;
}

.invoice-table .col-name {
    min-width: 180px;
}

.company-name-cell {
    font-weight: 600;
    color: #2d3748;
}

.invoice-table thead th:first-child {
    border-top-left-radius: 8px;
}

.invoice-table thead th:last-child {
    border-top-right-radius: 8px;
}

.table-icon {
    width: 14px;
    height: 14px;
    margin-right: 0.375rem;
    vertical-align: middle;
    opacity: 0.9;
}

.invoice-table tbody tr {
    transition: all 0.3s ease;
    border-bottom: 1px solid #e9ecef;
}

.invoice-table tbody tr:hover {
    background: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.invoice-table tbody tr:last-child {
    border-bottom: none;
}

.invoice-table tbody td {
    padding: 0.75rem 0.75rem;
    vertical-align: middle;
    color: #495057;
    font-size: 0.875rem;
}

/* Invoice Specific Cells */
.invoice-date {
    display: inline-block;
    font-weight: 500;
}

.invoice-number {
    display: inline-block;
    font-weight: 600;
    color: #667eea;
    font-family: 'Courier New', monospace;
}

.invoice-price {
    font-weight: 600;
    color: #2d3748;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Company Link */
.company-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #495057;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.company-link:hover {
    color: #667eea;
    background: #f0f0ff;
    text-decoration: none;
}

.company-icon {
    width: 16px;
    height: 16px;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.375rem;
    justify-content: flex-end;
    flex-wrap: nowrap;
}

/* Sticky Actions Column */
.invoice-table th.col-actions,
.invoice-table td.col-actions {
    position: sticky;
    right: 0;
    z-index: 1;
    background: #ffffff;
}

.invoice-table thead th.col-actions {
    z-index: 2;
}

.invoice-table tbody tr:hover td.col-actions {
    background: #f8f9fa;
}

.invoice-table td.col-actions {
    border-left: 1px solid #e9ecef;
    box-shadow: -3px 0 6px rgba(0, 0, 0, 0.04);
}

.action-buttons .btn {
    padding: 0.375rem 0.5rem;
    transition: all 0.2s ease;
}

.action-buttons .btn:hover {
    transform: translateY(-1px);
}

.action-buttons .btn i {
    width: 16px;
    height: 16px;
}

/* Badge Styling */
.invoice-table .badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    font-weight: 600;
}

/* Pagination Styling */
.pagination {
    margin-top: 1.5rem;
    margin-bottom: 0;
}

.pagination .page-link {
    color: #667eea;
    border-color: #e9ecef;
    padding: 0.5rem 0.75rem;
    transition: all 0.2s ease;
}

.pagination .page-link:hover {
    background: #667eea;
    color: #ffffff;
    border-color: #667eea;
    transform: translateY(-1px);
}

.pagination .page-item.active .page-link {
    background: #667eea;
    border-color: #667eea;
}

.pagination .page-item.disabled .page-link {
    opacity: 0.5;
}

/* Responsive Table */
@media (max-width: 1200px) {
    .invoice-table-container {
        padding: 1rem;
    }
    
    .invoice-table thead th,
    .invoice-table tbody td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    .invoice-table-container {
        padding: 0.75rem;
        border-radius: 6px;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .action-buttons .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .invoice-table thead th {
        font-size: 0.7rem;
        padding: 0.75rem 0.375rem;
    }
    
    .invoice-table tbody td {
        padding: 0.75rem 0.375rem;
        font-size: 0.8rem;
    }
    
    .table-icon {
        display: none;
    }
}

/* ============================================================================
   INVOICE TABLE - DARK MODE OVERRIDES
   ============================================================================ */

/* Table Container */
body.inverted .invoice-table-container {
    background: var(--dark-surface);
    border-color: var(--gray-700);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

/* Table Header */
body.inverted .invoice-table thead th {
    color: var(--dark-text);
    border-bottom-color: var(--gray-600);
}

/* Table Rows */
body.inverted .invoice-table tbody tr {
    border-bottom-color: var(--gray-700);
}

body.inverted .invoice-table tbody tr:hover {
    background: var(--dark-surface-light);
}

/* Table Cells */
body.inverted .invoice-table tbody td {
    color: var(--dark-text-secondary);
}

body.inverted .company-name-cell {
    color: var(--dark-text);
}

body.inverted .invoice-price {
    color: var(--dark-text);
}

body.inverted .invoice-number {
    color: #818cf8;
}

/* Company Link */
body.inverted .company-link {
    color: var(--dark-text-secondary);
}

body.inverted .company-link:hover {
    color: #818cf8;
    background: rgba(129, 140, 248, 0.1);
}

/* Sticky Actions Column */
body.inverted .invoice-table th.col-actions,
body.inverted .invoice-table td.col-actions {
    background: var(--dark-surface);
}

body.inverted .invoice-table tbody tr:hover td.col-actions {
    background: var(--dark-surface-light);
}

body.inverted .invoice-table td.col-actions {
    border-left-color: var(--gray-700);
    box-shadow: -3px 0 6px rgba(0, 0, 0, 0.2);
}

/* Pagination */
body.inverted .pagination .page-link {
    color: #818cf8;
    border-color: var(--gray-700);
    background: var(--dark-surface);
}

body.inverted .pagination .page-link:hover {
    background: #667eea;
    color: #ffffff;
    border-color: #667eea;
}

body.inverted .pagination .page-item.active .page-link {
    background: #667eea;
    border-color: #667eea;
}

body.inverted .pagination .page-item.disabled .page-link {
    background: var(--dark-surface-light);
    color: var(--gray-600);
}

/* Select Elements in Filters */
body.inverted .invoice-filters-card select.form-control,
body.inverted .invoice-filters-card .form-control {
    background: var(--dark-surface-light);
    border-color: var(--gray-700);
    color: var(--dark-text);
}

body.inverted .invoice-filters-card select.form-control:focus,
body.inverted .invoice-filters-card .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.2);
}

/* Validation Messages */
body.inverted .text-danger {
    color: #f87171 !important;
}

body.inverted .alert-danger {
    background: rgba(248, 113, 113, 0.1);
    border-color: rgba(248, 113, 113, 0.3);
    color: #fca5a5;
}
