/* RKInvoice Multi-Tenant Styles */
:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #f9fafb;
    --card-bg: #ffffff;
    --text-color: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    color: var(--text-color);
    background: var(--bg-color);
    line-height: 1.6;
}

/* Screen Management */
.screen {
    display: none !important;
}

.screen.active {
    display: block !important;
}

/* Login & Register Screens */
#loginScreen,
#registerScreen {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

/* Only show flex when active */
#loginScreen.active,
#registerScreen.active {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 2rem;
}

.logo {
    text-align: center;
    color: white;
    margin-bottom: 2rem;
}

.logo h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.logo p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.login-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.login-card h2 {
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.demo-info {
    margin-top: 2rem;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 8px;
    font-size: 0.9rem;
}

.demo-info h4 {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.demo-info p {
    margin: 0.25rem 0;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="date"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.form-row .flex-1 { flex: 1; }
.form-row .flex-2 { flex: 2; }

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-small.btn-tiny {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    min-width: auto;
}

.btn-remove {
    background: var(--danger-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* App Layout */
.app-header {
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-left h1 {
    font-size: 1.5rem;
}

.tenant-badge {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-name {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Navigation */
.app-nav {
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 0 2rem;
    display: flex;
    gap: 0.5rem;
}

.nav-item {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.nav-item:hover {
    background: var(--bg-color);
}

.nav-item.active {
    border-bottom-color: var(--primary-color);
    color: var(--primary-color);
}

/* Main Content */
.app-content {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.view-header h2 {
    font-size: 2rem;
}

/* Statistics view */
.statistics-content {
    padding: 1rem 0;
}
.statistics-section {
    margin-bottom: 2rem;
}
.statistics-section h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}
.statistics-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.statistics-table th,
.statistics-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
.statistics-table th {
    font-weight: 600;
    background: var(--bg-color);
}
.table-responsive {
    overflow-x: auto;
}

.statistics-charts {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 100%;
    max-width: 100%;
}
.statistics-chart-section {
    width: 100%;
    max-width: 100%;
}
.statistics-chart-section h3 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
    color: var(--text-secondary);
}
.statistics-chart-section .table-responsive {
    width: 100%;
    max-width: 100%;
}
.chart-container {
    position: relative;
    height: 280px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.filters {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.filters select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

/* Compact pagination arrows in header */
.compact-pagination {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    margin-left: 0.5rem;
}

.btn-pagination-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--card-bg);
    color: var(--text-color);
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}

.btn-pagination-arrow:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-pagination-arrow:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: var(--bg-color);
}

/* Invoice list month navigation (havi nézet) */
.invoice-month-nav {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.invoice-month-nav select {
    padding: 0.25rem 0.5rem;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-color);
}
.invoice-month-nav .btn-pagination-arrow {
    padding: 0.25rem 0.5rem;
}

/* Invoice List */
.invoices-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.invoices-list.compact-mode {
    display: block;
    grid-template-columns: none;
    gap: 0;
}

/* Compact Invoice List */
.invoices-compact-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.invoice-row-compact {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s, transform 0.1s;
    cursor: pointer;
}

.invoice-row-desktop {
    display: grid;
    grid-template-columns: 80px 150px 1fr 120px 120px 100px;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    align-items: center;
    font-size: 0.8rem;
    line-height: 1.2;
}

.invoice-row-mobile {
    display: none;
}

.invoice-row-compact:last-child {
    border-bottom: none;
}

.invoice-row-compact:hover {
    background-color: rgba(0, 0, 0, 0.05);
    transform: translateX(2px);
}

/* Color coding for invoice types */
.invoice-row-invoice {
    background-color: #f0fdf4; /* Light green */
    border-left: 4px solid #10b981; /* Green */
}

.invoice-row-proforma {
    background-color: #eff6ff; /* Light blue */
    border-left: 4px solid #3b82f6; /* Blue */
}

.invoice-row-storno {
    background-color: #fff7ed; /* Light orange */
    border-left: 4px solid #f97316; /* Orange */
}

.invoice-row-nav-status {
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-status-compact {
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 500;
    background-color: #e5e7eb;
    color: #374151;
    white-space: nowrap;
}

.nav-status-compact.nav-status-done {
    background-color: #d1fae5;
    color: #047857;
}

.invoice-row-number {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.invoice-row-buyer {
    color: var(--text-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8rem;
}

.invoice-row-date {
    color: var(--text-secondary);
    font-size: 0.8rem;
    white-space: nowrap;
}

.invoice-row-amount {
    font-weight: 600;
    color: var(--success-color);
    text-align: right;
    font-size: 0.8rem;
    white-space: nowrap;
}

.invoice-row-status {
    font-size: 0.7rem;
    padding: 0.15rem 0.35rem;
    border-radius: 6px;
    text-align: center;
    background-color: #e5e7eb;
    color: #374151;
    white-space: nowrap;
}


/* Responsive adjustments for compact view */
@media (max-width: 1200px) {
    .invoice-row-compact {
        grid-template-columns: 70px 120px 1fr 100px 100px 80px;
        gap: 0.5rem;
        padding: 0.35rem 0.5rem;
    }
    
    .invoice-row-number,
    .invoice-row-buyer,
    .invoice-row-date,
    .invoice-row-amount {
        font-size: 0.8rem;
    }
}

@media (max-width: 768px) {
    .invoice-row-desktop {
        display: none;
    }
    
    .invoice-row-mobile {
        display: block;
        padding: 0.15rem 0.4rem;
        font-size: 0.6rem;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .invoice-row-mobile .nav-status-compact {
        display: inline-block;
        padding: 0.05rem 0.2rem;
        margin-right: 0.25rem;
        vertical-align: middle;
        font-size: 0.55rem;
    }
    
    .invoice-mobile-number {
        font-weight: 600;
        margin-right: 0.25rem;
    }
    
    .invoice-mobile-buyer {
        margin-right: 0.25rem;
    }
    
    .invoice-mobile-date {
        color: var(--text-secondary);
        margin-right: 0.25rem;
    }
    
    .invoice-mobile-amount {
        font-weight: 600;
        color: var(--success-color);
    }
}

.invoice-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

.invoice-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.invoice-number {
    font-weight: 600;
    font-size: 1.1rem;
}

.invoice-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-draft { background: #e5e7eb; color: #374151; }
.status-submitted { background: #dbeafe; color: #1e40af; }
.status-done { background: #d1fae5; color: #047857; }
.status-failed { background: #fee2e2; color: #991b1b; }

.invoice-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.invoice-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.invoice-detail label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.invoice-detail .amount {
    font-weight: 600;
    color: var(--success-color);
    font-size: 1.1rem;
}

.transaction-id {
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.invoice-actions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Invoice Form */
.invoice-form {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.form-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.invoice-item {
    background: var(--bg-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.item-header h4 {
    color: var(--text-secondary);
}

.invoice-totals {
    background: var(--bg-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    font-size: 1.1rem;
}

.total-row.total-gross {
    font-weight: 600;
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 2px solid var(--border-color);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Pagination */
.pagination {
    margin-top: 2rem;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.page-info {
    color: var(--text-secondary);
}

/* Messages */
.tax-number-error {
    display: block;
    color: #991b1b;
    margin-top: 0.25rem;
}

.error-message {
    background: #fee2e2;
    color: #991b1b;
    padding: 1rem;
    border-radius: 6px;
    margin-top: 1rem;
}

.success-message {
    background: #d1fae5;
    color: #047857;
    padding: 1rem;
    border-radius: 6px;
    margin-top: 1rem;
}

/* Form sections for register */
.form-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h3 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    color: var(--text-color);
}

.form-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.9rem;
}

.form-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.form-footer a:hover {
    text-decoration: underline;
}

.loading {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
}

.empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 3rem;
    background: white;
    border-radius: 8px;
}

/* API View */
.api-content {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.api-info h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.api-info h3:first-child {
    margin-top: 0;
}

.code-block {
    background: #1f2937;
    color: #f9fafb;
    padding: 1rem;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    display: block;
    overflow-x: auto;
}

code {
    background: var(--bg-color);
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.note {
    background: #fef3c7;
    border-left: 4px solid var(--warning-color);
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 4px;
}

/* ==================== Customers ==================== */
.customers-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.customer-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s ease;
}

.customer-card:hover {
    box-shadow: var(--shadow-lg);
}

.customer-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.customer-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color);
}

.customer-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.customer-detail {
    display: flex;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.customer-detail label {
    color: var(--text-secondary);
    min-width: 80px;
}

.customer-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-weight: 500;
}

.badge-private {
    background: #dbeafe;
    color: #1e40af;
}

.search-input {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    min-width: 250px;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* ==================== Modal ==================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-content .modal-body {
    padding: 1.5rem;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.25rem;
    line-height: 1;
}

.modal-close:hover {
    color: var(--danger-color);
}

.modal-content form {
    padding: 1.5rem;
}

.modal-content .form-section h4 {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

/* Button variants */
.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

/* Responsive */
@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .app-nav {
        overflow-x: auto;
    }
    
    .invoices-list,
    .customers-list {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .filters {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .search-input {
        min-width: unset;
        width: 100%;
    }
    
    /* Invoice detail view - mobile optimizations */
    .invoice-detail-view {
        padding: 0.3rem;
    }
    
    .detail-section {
        margin-bottom: 1rem;
    }
    
    .detail-section h4 {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
        padding-bottom: 0.25rem;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .detail-grid label {
        font-size: 0.7rem;
    }
    
    .detail-grid span {
        font-size: 0.75rem;
    }
    
    /* Invoice items table - mobile */
    .invoice-items-table {
        font-size: 0.65rem;
    }
    
    .invoice-items-table th,
    .invoice-items-table td {
        padding: 0.25rem 0.15rem;
        font-size: 0.65rem;
    }
    
    .invoice-items-table th {
        font-size: 0.6rem;
        font-weight: 600;
    }
    
    /* NAV XML Response - mobile */
    .nav-xml-response {
        font-size: 0.5rem;
        padding: 0.5rem;
        max-height: 200px;
    }
    
    /* Modal adjustments for mobile - much narrower */
    .modal {
        padding: 0.05rem;
    }
    
    .modal-content {
        max-width: 92%;
        max-height: 98vh;
        border-radius: 4px;
    }
    
    .modal-content.modal-large {
        max-width: 92%;
    }
    
    .modal-header {
        padding: 0.3rem;
    }
    
    .modal-header h3 {
        font-size: 0.75rem;
    }
    
    .modal-body {
        padding: 0.3rem;
    }
    
    .invoice-detail-view {
        padding: 0.3rem;
    }
}

/* ==================== User Management ==================== */
.users-content {
    padding: 1.5rem;
}

.users-list {
    display: grid;
    gap: 1rem;
}

.user-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.2s;
}

.user-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.user-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.user-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    display: block;
    margin-bottom: 0.25rem;
}

.user-email {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: block;
}

.user-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.badge-admin {
    background: #dbeafe;
    color: #1e40af;
}

.badge-super_admin {
    background: #fef3c7;
    color: #92400e;
}

.badge-user {
    background: #e5e7eb;
    color: #374151;
}

.badge-active {
    background: #d1fae5;
    color: #047857;
}

.badge-inactive {
    background: #fee2e2;
    color: #991b1b;
}

.user-body {
    margin-bottom: 1rem;
}

.user-detail {
    display: flex;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.user-detail label {
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 120px;
}

.user-detail span {
    color: var(--text-color);
}

.user-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-danger:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

/* ==================== Settings View ==================== */
.settings-content {
    padding: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.settings-content .form-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.settings-content .form-section h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
    font-size: 1.1rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.settings-content .form-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.settings-content .form-actions {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* ==================== API Key Display ==================== */
.api-key-display {
    padding: 1.5rem;
    text-align: center;
}

.api-key-display p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.api-key-value {
    background: #f3f4f6;
    border: 2px dashed var(--primary-color);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    word-break: break-all;
    color: var(--text-color);
    font-weight: 600;
    user-select: all;
}

/* ==================== Invoice Detail View ==================== */
.invoice-detail-view {
    padding: 1.5rem;
}

.detail-section {
    margin-bottom: 2rem;
}

.detail-section h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.detail-grid > div {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-grid label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.detail-grid span {
    color: var(--text-color);
    font-size: 1rem;
}

/* NAV XML Response styling */
.nav-xml-response {
    font-size: 0.7rem;
    line-height: 1.4;
    background-color: #f5f5f5;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.75rem;
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
    font-family: 'Courier New', Courier, monospace;
    color: #333;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Invoice items table styling */
.invoice-items-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.invoice-items-table th,
.invoice-items-table td {
    padding: 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.invoice-items-table th {
    background-color: var(--bg-color);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.invoice-items-table tbody tr:hover {
    background-color: #f9fafb;
}

.invoice-items-table tfoot {
    font-weight: 600;
    background-color: var(--bg-color);
}

/* Invoice number link styling */
.invoice-link {
    color: var(--primary-color);
    text-decoration: underline;
    cursor: pointer;
    font-weight: 500;
    transition: color 0.2s;
}

.invoice-link:hover {
    color: var(--primary-dark);
    text-decoration: none;
}

/* Export modal */
.export-format-options {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.export-format-options label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: normal;
    cursor: pointer;
}

.export-months-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}

.export-months-checkboxes label {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: normal;
    cursor: pointer;
}

.export-progress-container {
    margin: 1rem 0;
}

.export-progress-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.export-progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.2s ease;
}

.export-progress-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.export-message {
    margin-top: 0.5rem;
    min-height: 1.25rem;
    font-size: 0.875rem;
}

.export-message.error {
    color: var(--danger-color);
}

.export-message.success {
    color: var(--success-color);
}
