/* Modern CSS Variables and Design System */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --background: hsl(0 0% 100%);
    --foreground: hsl(222.2 84% 4.9%);
    --card: hsl(0 0% 100%);
    --card-foreground: hsl(222.2 84% 4.9%);
    --primary: hsl(222.2 47.4% 11.2%);
    --primary-foreground: hsl(210 40% 98%);
    --secondary: hsl(210 40% 96.1%);
    --secondary-foreground: hsl(222.2 47.4% 11.2%);
    --muted: hsl(210 40% 96.1%);
    --muted-foreground: hsl(215.4 16.3% 46.9%);
    --accent: hsl(210 40% 96.1%);
    --accent-foreground: hsl(222.2 47.4% 11.2%);
    --destructive: hsl(0 84.2% 60.2%);
    --destructive-foreground: hsl(210 40% 98%);
    --border: hsl(214.3 31.8% 91.4%);
    --input: hsl(214.3 31.8% 91.4%);
    --ring: hsl(222.2 84% 4.9%);
    --radius: 0.5rem;
    --success: hsl(142 76% 36%);
    --warning: hsl(38 92% 50%);
    --info: hsl(215, 91%, 57%);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", sans-serif;
    background-color: #fafafa;
    color: var(--foreground);
    line-height: 1.5;
}

.app-container {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: 240px;
    background: var(--card);
    border-right: 1px solid var(--border);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    font-weight: 600;
    font-size: 1.125rem;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-item {
    padding: 0.5rem 0.75rem;
    border-radius: calc(var(--radius) - 2px);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

.nav-item:hover {
    background: var(--secondary);
    color: var(--foreground);
}

.nav-item.active {
    background: var(--secondary);
    color: var(--foreground);
    font-weight: 500;
}

.nav-icon {
    width: 1rem;
    height: 1rem;
    opacity: 0.7;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

.header {
    margin-bottom: 2rem;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

h1 {
    font-size: 1.875rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.header-description {
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    cursor: pointer;
    gap: 0.5rem;
}

.btn:disabled {
    background: var(--muted);
    color: var(--muted-foreground);
    cursor: not-allowed;
    border-color: var(--border);
}

.btn-primary {
    background: var(--primary);
    color: var(--primary-foreground);
}

.btn-primary:hover:not(:disabled) {
    background: hsl(222.2 47.4% 15%);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--secondary-foreground);
    border-color: var(--border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--accent);
}

.btn-icon {
    padding: 0.5rem;
    background: transparent;
    border: none;
}

.btn-icon:hover {
    background: var(--accent);
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    margin-bottom: 1.5rem;
}

.card-header {
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.card-description {
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.table-container {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

.table-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.table-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.table-title {
    font-weight: 600;
}

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

th {
    text-align: left;
    font-weight: 500;
    font-size: 0.75rem;
    color: var(--muted-foreground);
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--muted);
    text-transform: uppercase;
}

td {
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover {
    background: var(--accent);
}

.no-results-row td {
    text-align: center;
    color: var(--muted-foreground);
    padding: 2rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background: hsl(142 76% 94%);
    color: var(--success);
}

.badge-warning {
    background: hsl(38 92% 95%);
    color: hsl(32 95% 44%);
}

.badge-destructive {
    background: hsl(0 84.2% 95%);
    color: var(--destructive);
}

.badge-info {
    background: hsl(210 90% 95%);
    color: var(--info);
}

.badge-default {
    background: var(--secondary);
    color: var(--secondary-foreground);
}

.checkbox-cell {
    width: 40px;
    text-align: center;
}

input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    border-radius: calc(var(--radius) - 4px);
    border: 1px solid var(--border);
    cursor: pointer;
}

input[type="search"] {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.875rem;
    min-width: 250px;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.modal-backdrop.active {
    display: flex;
}

.modal {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--muted-foreground);
}

select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.875rem;
    background: var(--card);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
}

.tabs {
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.tab-list {
    display: flex;
    gap: 1.5rem;
}

.tab-trigger {
    padding: 0.75rem 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--muted-foreground);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    background: none;
    border: none;
}

.tab-trigger:hover {
    color: var(--foreground);
}

.tab-trigger.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

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

.loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--border);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Auth page styles */
.auth-card {
    max-width: 400px;
    margin: 3rem auto;
    padding: 2rem;
    background-color: var(--card);
    border-radius: var(--radius);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.auth-card h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    border-bottom: none;
    padding-bottom: 0;
}

.auth-switch {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--muted-foreground);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    box-sizing: border-box;
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--foreground);
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 2px);
}

.form-control:focus {
    border-color: var(--primary);
    outline: 0;
}

.alert {
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
}

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

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

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

/* Responsive design */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        order: 2;
    }
    
    .main-content {
        order: 1;
        height: auto;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .header-top {
        flex-direction: column;
        align-items: stretch;
    }
    
    .header-actions {
        margin-top: 1rem;
    }
}

/* Remove old styles and add new clean design */

/* Page Header */
.page-header {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.page-header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
}

.page-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-not_started { background: var(--secondary); color: var(--secondary-foreground); }
.status-importing, .status-calculating, .status-invoicing { 
    background: hsl(215 90% 95%); 
    color: hsl(215 91% 57%); 
}
.status-completed { background: hsl(142 76% 94%); color: hsl(142 76% 36%); }

.progress-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.progress-bar {
    width: 100px;
    height: 6px;
    background: var(--border);
    border-radius: 9999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: hsl(215 91% 57%);
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.stats-row {
    display: flex;
    gap: 2rem;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--foreground);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.page-header-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* Selection Bar */
.selection-bar {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    z-index: 50;
    opacity: 0;
    transition: all 0.3s ease;
}

.selection-bar.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.selection-bar-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
}

.selection-info {
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

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

/* Tabs */
.tabs-container {
    margin-bottom: 1.5rem;
}

.tabs-list {
    display: flex;
    border-bottom: 1px solid var(--border);
}

.tab-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: none;
    background: none;
    color: var(--muted-foreground);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab-button:hover {
    color: var(--foreground);
}

.tab-button.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Data Tables */
.data-table-container {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.data-table-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--muted)/50;
}

.search-container {
    display: flex;
    align-items: center;
}

.search-input-wrapper {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted-foreground);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 40px;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.875rem;
    background: var(--background);
    transition: border-color 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
}

.data-table-wrapper {
    overflow-x: auto;
}

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

.data-table th {
    background: var(--muted)/30;
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}

.data-row:hover {
    background: var(--muted)/30;
}

.select-column {
    width: 48px;
    text-align: center;
}

.numeric-column,
.numeric-cell {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.actions-column {
    width: 80px;
    text-align: center;
}

.sortable-column {
    cursor: pointer;
    user-select: none;
    position: relative;
}

.sortable-column:hover {
    background: var(--muted)/50;
}

.sortable-column::after {
    content: '';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    opacity: 0.3;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M7 11l5-5 5 5M7 13l5 5 5-5'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.sortable-column[data-order="asc"]::after,
.sortable-column[data-order="desc"]::after {
    opacity: 1;
}

.sortable-column[data-order="desc"]::after {
    transform: translateY(-50%) rotate(180deg);
}

/* Table Cells */
.org-cell,
.contact-cell {
    font-weight: 500;
}

.date-cell {
    color: var(--muted-foreground);
    font-size: 0.8125rem;
}

.font-medium {
    font-weight: 500;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.75rem;
    font-weight: 500;
}

.status-success { background: hsl(142 76% 94%); color: hsl(142 76% 36%); }
.status-default { background: var(--secondary); color: var(--secondary-foreground); }
.status-syncing { background: hsl(215 90% 95%); color: hsl(215 91% 57%); }
.status-synced { background: hsl(142 76% 94%); color: hsl(142 76% 36%); }
.status-failed { background: hsl(0 84.2% 95%); color: hsl(0 84.2% 60.2%); }

/* Empty States */
.empty-row td {
    padding: 0;
    border: none;
}

.empty-state {
    padding: 4rem 2rem;
    text-align: center;
}

.empty-icon {
    margin: 0 auto 1rem;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 1.125rem;
    font-weight: 500;
    margin: 0 0 0.5rem 0;
}

.empty-state p {
    color: var(--muted-foreground);
    margin: 0 0 1.5rem 0;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.2s;
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.modal-close-btn {
    padding: 0.5rem;
    border: none;
    background: none;
    color: var(--muted-foreground);
    cursor: pointer;
    border-radius: calc(var(--radius) - 4px);
    transition: background 0.2s;
}

.modal-close-btn:hover {
    background: var(--muted);
}

.modal-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
}

/* Forms */
.form-section {
    margin-bottom: 1.5rem;
}

.form-section:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.form-field {
    margin-top: 1rem;
}

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

.form-input,
.form-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
}

.radio-group,
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

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

.radio-label,
.checkbox-label {
    font-size: 0.875rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--primary-foreground);
}

.btn-primary:hover {
    background: hsl(222.2 47.4% 15%);
}

.btn-outline {
    background: var(--background);
    color: var(--foreground);
    border-color: var(--border);
}

.btn-outline:hover {
    background: var(--muted);
}

.btn-ghost {
    background: transparent;
    color: var(--muted-foreground);
}

.btn-ghost:hover {
    background: var(--muted);
    color: var(--foreground);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-icon {
    padding: 0.5rem;
    background: transparent;
    border: none;
    color: var(--muted-foreground);
    border-radius: calc(var(--radius) - 4px);
}

.btn-icon:hover {
    background: var(--muted);
    color: var(--foreground);
}

/* Utilities */
.hidden {
    display: none !important;
}

.tab-content {
    display: none;
}

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

/* Toast */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    padding: 1rem;
    min-width: 300px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--muted-foreground);
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: calc(var(--radius) - 4px);
}

.toast-close:hover {
    background: var(--muted);
}

.toast-success { border-left: 4px solid hsl(142 76% 36%); }
.toast-error { border-left: 4px solid hsl(0 84.2% 60.2%); }
.toast-info { border-left: 4px solid hsl(215 91% 57%); }

/* Loading */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

.loading-text {
    color: white;
    font-size: 0.875rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .page-header-content {
        flex-direction: column;
        align-items: stretch;
    }
    
    .stats-row {
        justify-content: space-between;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .data-table-wrapper {
        overflow-x: scroll;
    }
}

/* Dashboard Specific Styles */
.page-description {
    color: var(--muted-foreground);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.year-selector {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    min-width: 120px;
}

.year-selector .form-label {
    margin: 0;
    font-size: 0.75rem;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.year-selector .form-select {
    padding: 0.375rem 2rem 0.375rem 0.75rem;
    font-size: 0.875rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 2px);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
}

.monthly-runs-container {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.monthly-runs-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--muted)/30;
}

.monthly-runs-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
}

.monthly-runs-description {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    margin: 0;
}

/* LIST STYLES */
.monthly-runs-list {
    padding: 0;
}

.monthly-run-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background-color 0.2s;
}

.monthly-run-item:last-child {
    border-bottom: none;
}

.monthly-run-item:hover {
    background: var(--secondary);
}

.run-item-main {
    flex: 1;
    min-width: 0;
}

.month-name {
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
    color: var(--foreground);
}

.run-item-aside {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-shrink: 0;
    margin-left: 1rem;
}

.run-item-aside .status-badge {
    min-width: 90px;
    text-align: center;
    justify-content: center;
}

.run-item-action-icon {
    color: var(--muted-foreground);
    opacity: 0.5;
    transition: all 0.2s;
}

.monthly-run-item:hover .run-item-action-icon {
    opacity: 1;
    transform: translateX(2px);
    color: var(--primary);
}

/* Status badge variants for dashboard */
.status-badge.status-importing,
.status-badge.status-calculating,
.status-badge.status-invoicing {
    background: hsl(215 90% 95%);
    color: hsl(215 91% 57%);
}

.status-badge.status-failed {
    background: hsl(0 84.2% 95%);
    color: hsl(0 84.2% 60.2%);
}

/* Empty state for dashboard list */
.monthly-runs-list .empty-state {
    padding: 4rem 2rem;
    text-align: center;
}
.monthly-runs-list .empty-state .empty-icon {
    margin: 0 auto 1rem;
    opacity: 0.3;
}
.monthly-runs-list .empty-state h3 {
    font-size: 1.125rem;
    font-weight: 500;
    margin: 0 0 0.5rem 0;
}
.monthly-runs-list .empty-state p {
    color: var(--muted-foreground);
    margin: 0;
}

/* Responsive dashboard */
@media (max-width: 768px) {
    .monthly-runs-header {
        padding: 1rem;
    }
    .monthly-run-item {
        padding: 1rem;
        flex-wrap: wrap;
    }
    .run-item-main {
        flex-basis: 100%;
        margin-bottom: 0.5rem;
    }
    .run-item-aside {
        flex-basis: 100%;
        justify-content: space-between;
        margin-left: 0;
    }
    .run-item-action-icon {
        opacity: 1;
    }
    .page-header-content {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    .year-selector {
        align-self: flex-start;
    }
}
