:root {
  --color-primary: #1A1A1A;
  --color-secondary: #6366F1;
  --color-success: #10B981;
  --color-warning: #F59E0B;
  --color-error: #EF4444;

  --color-background: #FFFFFF;
  --color-surface-1: #F9FAFB;
  --color-surface-2: #F3F4F6;
  --color-border: #E5E7EB;
  --color-primary-light: rgba(26, 26, 26, 0.05);

  --color-text-primary: #111827;
  --color-text-secondary: #6B7280;
  --color-text-muted: #9CA3AF;

  --font-family-primary: 'Roboto', sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.5rem;
  --font-size-2xl: 2rem;

  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;

  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

  --border-radius-sm: 0.25rem;
  --border-radius-md: 0.375rem;
  --border-radius-lg: 0.5rem;
  --border-radius-xl: 0.75rem;
  --border-radius-full: 9999px;
}

* {
  box-sizing: border-box;
}

body {
    font-family: var(--font-family-primary);
    background-color: var(--color-background);
    color: var(--color-text-primary);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

.content {
    max-width: 95vw;
    margin: 0 auto;
}

h1 {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-2xl);
    font-weight: 700;
    text-align: center;
    color: var(--color-text-primary);
    margin: var(--spacing-xl) 0;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

h2 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--color-text-primary);
    margin: var(--spacing-lg) 0 var(--spacing-md) 0;
    letter-spacing: -0.025em;
    line-height: 1.3;
}

h3 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--color-text-primary);
    margin: var(--spacing-md) 0 var(--spacing-sm) 0;
    letter-spacing: -0.025em;
    line-height: 1.4;
}

a,
a:visited {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

a:hover {
    color: var(--color-secondary);
    text-decoration: underline;
}

a:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.tag {
    display: inline-block;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-full);
    text-align: center;
    white-space: nowrap;
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-sm);
    font-weight: 500;
    background-color: var(--color-surface-1);
    color: var(--color-text-primary);
    transition: all 0.2s ease-in-out;
}

.tag:hover {
    transform: translateY(-1px);
}

.has-background-orange-light {
    background-color: var(--color-primary-light);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.tag-success {
    background-color: var(--color-success);
    color: white;
    border-color: var(--color-success);
}

.tag-warning {
    background-color: var(--color-warning);
    color: var(--color-text-primary);
    border-color: var(--color-warning);
}

.tag-info {
    background-color: var(--color-secondary);
    color: white;
    border-color: var(--color-secondary);
}

.dashboard-header-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: var(--spacing-lg);
    padding: 0 var(--spacing-md);
}


input[type=text],
input[type=number],
input[type=date],
select,
textarea {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-base);
    background-color: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--color-text-primary);
    transition: all 0.2s ease-in-out;
}

input[type=text]:focus,
input[type=number]:focus,
input[type=date]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    background-color: white;
}

input[type=text]:hover,
input[type=number]:hover,
input[type=date]:hover,
select:hover,
textarea:hover {
    border-color: var(--color-text-secondary);
}

.has-currency {
    text-align: right;
}

.table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--spacing-lg);
    background-color: white;
    font-size: var(--font-size-sm);

    border-radius: var(--border-radius-lg);
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.table th,
.table td {
    padding: var(--spacing-md);
    vertical-align: middle;
    border-bottom: 1px solid #E9ECEF;
    text-align: left;
    transition: all 0.2s ease-in-out;
}

.table tbody tr {
    background-color: white;
}

.table tbody tr:hover {
    background-color: var(--color-surface-1);
}

.table tbody tr:nth-child(even) {
    background-color: #FAFBFC;
}

.table th {
    background-color: #F1F3F4;
    color: var(--color-text-primary);
    font-weight: 600;
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid var(--color-border);
}

.table-pin-rows {
    overflow-x: auto;
    max-width: 100%;
}

.table-pin-rows table {
    min-width: 800px;
}

.table input,
.table select,
.table textarea {
    width: 100%;
    font-size: var(--font-size-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    margin: 0;
    border-radius: var(--border-radius-sm);
    background-color: white;
    transition: all 0.2s ease-in-out;
}

.table input:focus,
.table select:focus,
.table textarea:focus {
    border-color: var(--color-secondary);
    outline: none;
}

.table input[type="text"] {
    max-width: 100px;
}
input[name$="-name"] {
    max-width: 300px !important;
}

.table input[type="number"] {
    max-width: 80px;
}

/* remove arrows in number fields */
.table  input[type="number"] {
    -moz-appearance: textfield; /* Firefox */
}

.table input[type="number"]::-webkit-outer-spin-button,
.table input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none; /* Chrome, Safari, Edge */
    margin: 0;
}

.table input[type="date"] {
    max-width: 110px;
}

.table select {
    max-width: 130px;
}

.table textarea {
    min-height: 40px;
    resize: vertical;
    overflow: hidden;
    transition: height 0.2s ease-out;
}

.table th a {
    text-decoration: none;
    color: inherit;
    display: block;
    width: 100%;
    padding: 0;
}

.table th a:hover {
    background-color: #e9ecef;
    color: #495057;
}

.table-actions {
    margin-bottom: var(--spacing-lg);
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    align-items: center;
    padding: var(--spacing-md);
    background-color: var(--color-surface-1);
    border-radius: var(--border-radius-md);
    border: 1px solid var(--color-border);
}

.search-input {
    display: flex;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    font-size: var(--font-size-sm);
    background-color: white;
    min-width: 200px;
    transition: border-color 0.2s ease-in-out;
}

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

.search-input::placeholder {
    color: var(--color-text-muted);
    font-style: italic;
}

.btn {
    display: inline-block;
    padding: var(--spacing-sm) var(--spacing-md);
    font-family: var(--font-family-primary);
    font-size: var(--font-size-sm);
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    background-color: white;
    color: var(--color-text-primary);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    letter-spacing: 0.025em;
}

.btn:hover {
    background-color: var(--color-surface-1);
    border-color: var(--color-secondary);
    color: var(--color-secondary);
}

.btn:focus {
    outline: none;
}

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

.btn-secondary:hover {
    background-color: #4F46E5;
    border-color: #4F46E5;
    color: white;
}
#statements-table th {
    cursor: pointer;
    user-select: none;
}

#statements-table th:hover {
    background-color: var(--color-surface-2);
}

#statements-table th::after {
    content: '↕';
    position: absolute;
    right: var(--spacing-sm);
    opacity: 0.5;
    font-size: var(--font-size-xs);
    color: white;
    font-weight: normal;
}

.action-to-do {
    background-color: #FFF8E1 !important;
    border-left: 4px solid var(--color-warning);
    position: relative;
}

.action-to-do:hover {
    background-color: #FFF3C4 !important;
}

.action-to-do td:first-child {
    position: relative;
    padding-left: calc(var(--spacing-md) + 24px);
}

.action-to-do td:first-child::before {
    content: '⚠️';
    position: absolute;
    left: var(--spacing-sm);
    top: 50%;
    transform: translateY(-50%);
    font-size: var(--font-size-sm);
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
    z-index: 1;
}

.table td:last-child {
    font-size: 0.75rem;
    color: #6c757d;
    font-style: italic;
    white-space: nowrap;
}

.messages {
    background-color: var(--color-surface-1);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-md) var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.messages .alert {
    margin: 0;
    padding: var(--spacing-sm) 0;
}

.messages .alert-success {
    color: var(--color-success);
    border-left: 4px solid var(--color-success);
    padding-left: var(--spacing-md);
}

.messages .alert-error {
    color: var(--color-error);
    border-left: 4px solid var(--color-error);
    padding-left: var(--spacing-md);
}

.messages .alert-warning {
    color: var(--color-warning);
    border-left: 4px solid var(--color-warning);
    padding-left: var(--spacing-md);
}

.header {
    background-color: var(--color-surface-1);
    border-bottom: 2px solid var(--color-border);
    margin-bottom: var(--spacing-lg);
}

.header-content {
    max-width: 1380px;
    margin: 0 auto;
    padding: var(--spacing-md) var(--spacing-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.brand-title {
    font-size: var(--font-size-xl);
    font-weight: 800;
    color: var(--color-primary);
    margin: 0;
    text-align: left;
    letter-spacing: -0.025em;
}

.header-nav {
    display: flex;
    gap: var(--spacing-lg);
    align-items: center;
    flex-wrap: wrap;
}

.nav-link {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: var(--font-size-base);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius-md);
    transition: all 0.2s ease-in-out;
    position: relative;
}

.nav-link:hover {
    color: var(--color-primary);
    background-color: var(--color-surface-1);
    text-decoration: none;
}

.nav-link:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.nav-link-logout {
    color: var(--color-error);
    border: 1px solid var(--color-error);
}

.nav-link-logout:hover {
    background-color: var(--color-error);
    color: white;
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .header-nav {
        justify-content: center;
        gap: var(--spacing-md);
    }

    .nav-link {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: var(--font-size-sm);
    }
}

.dashboard {
    padding: var(--spacing-lg) 0;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--spacing-xl);
    max-width: 1200px;
    margin: 0 auto;
}

.dashboard-card {
    background-color: white;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: all 0.3s ease-in-out;
}

.factures-page .dashboard-card {
    overflow: visible;
}

.dashboard-card:hover {
    border-color: var(--color-secondary);
}

.card-header {
    background-color: var(--color-surface-1);
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--color-border);
}

.card-title {
    margin: 0;
    font-size: var(--font-size-lg);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.card-content {
    padding: var(--spacing-lg);
}

.card-description {
    color: var(--color-text-secondary);
    font-size: var(--font-size-base);
    margin: 0 0 var(--spacing-lg) 0;
    line-height: 1.5;
}

.card-info {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.info-label {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.info-value {
    color: var(--color-text-primary);
    font-weight: 600;
    font-size: var(--font-size-base);
}

.info-value-currency {
    color: var(--color-success);
    font-size: var(--font-size-lg);
    font-weight: 700;
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
        padding: 0 var(--spacing-md);
    }

    .card-info {
        flex-direction: column;
        align-items: flex-start;
    }
}

.dashboard-actions {
    margin-bottom: var(--spacing-xl);
}

.action-cards {
    display: flex;
    justify-content: center;
}

.action-card {
    background-color: white;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-lg);
}

.action-header {
    margin-bottom: var(--spacing-md);
    text-align: center;
}

.action-content {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.text-muted {
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
    margin-top: var(--spacing-sm);
}

.financial-charts {
    display: flex;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    background-color: white;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-lg);
}

.chart-main {
    flex: 3;
    min-height: 400px;
    position: relative;
}

.chart-main .chart-wrapper {
    height: 400px;
}

.chart-side {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.chart-container {
    flex: 1;
    min-height: 180px;
    position: relative;
}

.chart-wrapper {
    position: relative;
    height: 100%;
    width: 100%;
}

.financial-tables {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.financial-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.financial-table td {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--color-border);
}

.financial-table tr.highlight-row {
    background-color: var(--color-surface-1);
    font-weight: 600;
}

.financial-table tr.highlight-row.success {
    background-color: var(--color-success);
    color: white;
}

.financial-table tr.highlight-row.success td {
    border-color: rgba(255, 255, 255, 0.2);
}


@media (max-width: 1200px) {
    .financial-charts {
        flex-direction: column;
    }

    .chart-side {
        flex-direction: row;
        gap: var(--spacing-lg);
    }

    .chart-main .chart-wrapper {
        height: 350px;
    }
}

@media (max-width: 768px) {
    .dashboard {
        padding: var(--spacing-md) 0;
    }

    .financial-charts {
        padding: var(--spacing-md);
    }

    .financial-tables {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    .chart-side {
        flex-direction: column;
    }

    .chart-main .chart-wrapper {
        height: 300px;
    }

    .chart-container {
        min-height: 200px;
    }

    .action-content {
        flex-direction: column;
        text-align: center;
    }
}

.invoices-page,
.interessement-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-lg);
}

.factures-page {
    width: calc(100% * var(--spacing-md));
    margin: 0 auto;
}


.page-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
}

.page-header h1 {
    margin-bottom: var(--spacing-md);
}

.page-description {
    color: var(--color-text-secondary);
    font-size: var(--font-size-lg);
    margin: 0;
}

.section-description {
    color: var(--color-text-secondary);
    font-size: var(--font-size-base);
    margin-bottom: var(--spacing-lg);
    line-height: 1.6;
}

.invoices-section,
.drive-config-section,
.forecasting-section,
.participations-section {
    margin-bottom: var(--spacing-2xl);
}

.connection-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
}

.drive-config-table {
    margin-bottom: var(--spacing-lg);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--color-border);
}


@media (max-width: 768px) {
    .invoices-page {
        padding: var(--spacing-md);
    }

    .connection-info {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md);
    }

    .form-actions {
        justify-content: center;
    }

}

.factures-page .table {
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

.factures-page .table th {
    background: var(--color-surface-2);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: var(--spacing-lg) var(--spacing-sm);
    white-space: nowrap;
    font-size: var(--font-size-xs);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--color-border);
}



.factures-page .table th:first-child {
    text-align: left;
    padding-left: var(--spacing-lg);
}

.factures-page .table th:last-child {
    padding-right: var(--spacing-lg);
}

.factures-page .table th:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 25%;
    height: 50%;
    width: 1px;
    background: var(--color-border);
    opacity: 0.5;
}

.factures-page .table td {
    border-bottom: 1px solid #F1F3F4;
    padding: 0.25rem 0;
    vertical-align: middle;
    text-align: center;
    transition: all 0.2s ease-in-out;
    position: relative;
}

.factures-page .table td:first-child {
    text-align: left;
    font-weight: 500;
    padding-left: var(--spacing-lg);
}

.factures-page .table td:last-child {
    padding-right: var(--spacing-lg);
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    font-style: italic;
}

.factures-page .table td:nth-child(2),
.factures-page .table td:nth-child(3),
.factures-page .table td:nth-child(4) {
    background-color: rgba(99, 102, 241, 0.02);
}

.factures-page .table td:nth-child(5),
.factures-page .table td:nth-child(6),
.factures-page .table td:nth-child(7) {
    background-color: rgba(16, 185, 129, 0.02);
}

.factures-page .table td:nth-child(n+8):nth-child(-n+10) {
    background-color: rgba(245, 158, 11, 0.02);
}

.factures-page .table input,
.factures-page .table select,
.factures-page .table textarea {
    font-size: var(--font-size-base);
    padding: var(--spacing-sm) var(--spacing-xs);
    border-radius: var(--border-radius-lg);
    width: 100%;
    background-color: white;
    transition: all 0.15s ease-out;
    font-weight: 500;
}

.factures-page .table input:focus,
.factures-page .table select:focus,
.factures-page .table textarea:focus {
    border-color: var(--color-secondary);
    background-color: #FEFEFF;
    transform: translateY(-1px);
    z-index: 10;
    position: relative;
}

.factures-page .table input:hover:not(:focus),
.factures-page .table select:hover:not(:focus),
.factures-page .table textarea:hover:not(:focus) {
    border-color: #CBD5E0;
    background-color: #F8FAFC;
}

.factures-page .table input[type="text"] {
    text-align: left;
    padding-left: var(--spacing-md);
}

.factures-page .table input[type="number"] {
    text-align: right;
    font-weight: 600;
    padding-right: var(--spacing-md);
    font-feature-settings: 'tnum';
}

.factures-page .table input[type="date"] {
    font-weight: 500;
    text-align: center;
    cursor: pointer;
}

.factures-page .table input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    padding: 2px;
    border-radius: var(--border-radius-sm);
}

.factures-page .table select {
    cursor: pointer;
    text-align: center;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 8px center;
    background-repeat: no-repeat;
    background-size: 16px;
}

.factures-page .table textarea,
.field-sizing-textarea {
    min-width: 280px;
    height: 40px;
    text-align: left;
    line-height: 1.5;
    overflow-y: auto;
    field-sizing: content!important;
    resize: both;
}

.factures-page .table input:invalid {
    border-color: var(--color-error);
}

.factures-page .table input:required:valid {
    border-color: var(--color-success);
}

/* Styles for fields with Django form errors */
.factures-page .table .errorlist {
    background-color: #FEE2E2;
    border: 1px solid var(--color-error);
    border-radius: var(--border-radius-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    margin: var(--spacing-xs) 0;
    font-size: var(--font-size-xs);
    color: var(--color-error);
    font-weight: 500;
}

.factures-page .table .errorlist li {
    list-style: none;
    margin: 0;
}

/* Highlight fields that have errors */
.factures-page .table input.error,
.factures-page .table select.error,
.factures-page .table textarea.error {
    border: 2px solid var(--color-error) !important;
    background-color: #FEE2E2 !important;
    animation: errorPulse 0.3s ease-in-out;
}

/* Animation for error fields */
@keyframes errorPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Error row styling */
.factures-page .table tr.error-row {
    background-color: #FEF2F2 !important;
    border-left: 4px solid var(--color-error);
}

.factures-page .table tr.error-row:hover {
    background-color: #FECACA !important;
}

.factures-page .table input::placeholder,
.factures-page .table textarea::placeholder {
    color: var(--color-text-muted);
    font-style: italic;
    opacity: 0.8;
}

.factures-page .table tbody tr {
    transition: all 0.3s ease-in-out;
}

.factures-page .table tbody tr:nth-child(even):not(.action-to-do) {
    background-color: #FAFBFC;
}

.factures-page .table tbody tr:hover:not(.action-to-do) {
    background-color: #F0F9FF;
}

.factures-page .table tbody tr:hover:not(.action-to-do) td {
    border-color: rgba(99, 102, 241, 0.2);
}

.factures-page .table tbody tr:focus-within {
    background-color: #FEF3C7;
    outline: 2px solid var(--color-warning);
    outline-offset: -2px;
}

.factures-page .action-to-do {
    background: linear-gradient(90deg, #FEF3CD 0%, #FFFBEB 100%) !important;
    border-left: 4px solid #F59E0B;
    position: relative;
}

.factures-page .action-to-do:hover {
    background: linear-gradient(90deg, #FED7AA 0%, #FEF3CD 100%) !important;
    transform: translateY(-1px);
}

.factures-page .action-to-do td:first-child::after {
    content: 'Action requise';
    position: absolute;
    right: var(--spacing-sm);
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--color-warning);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: var(--border-radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

/* Status select styling */
.factures-page .table select[value="paid"] {
    background-color: #DCFCE7;
    color: var(--color-success);
}

.factures-page .table select[value="pending"] {
    background-color: #FEF3C7;
    color: var(--color-warning);
}

.factures-page .table select[value="overdue"] {
    background-color: #FEE2E2;
    color: var(--color-error);
}

.factures-page .table select[value] {
    font-weight: 600;
}



.factures-page .table {
    width: 100%;
    table-layout: auto;
}


@media (max-width: 1600px) {
    .factures-page .table {
        min-width: 1500px;
    }

    .factures-page .table th,
    .factures-page .table td {
        padding: var(--spacing-sm) var(--spacing-xs);
        font-size: var(--font-size-xs);
    }

    .factures-page .table input,
    .factures-page .table select,
    .factures-page .table textarea {
        font-size: 14px;
        padding: 4px 6px;
        min-width: 70px;
    }
}

@media (max-width: 1400px) {
    .factures-page .table {
        min-width: 1400px;
    }

    .factures-page .table input,
    .factures-page .table select,
    .factures-page .table textarea {
        min-width: 60px;
    }
}

@media (max-width: 1200px) {
    .factures-page .table {
        min-width: 1300px;
    }

    .factures-page .table th {
        white-space: nowrap;
        font-size: 10px;
        padding: var(--spacing-sm) var(--spacing-xs);
    }
}

@media (max-width: 768px) {
    .factures-page .table {
        min-width: 800px;
        font-size: 11px;
    }

    .factures-page .table th {
        padding: var(--spacing-sm) 4px;
        font-size: 9px;
        letter-spacing: 0.3px;
    }

    .factures-page .table td {
        padding: var(--spacing-xs) 4px;
    }

    .factures-page .table input,
    .factures-page .table select,
    .factures-page .table textarea {
        font-size: 10px;
        padding: 2px 4px;
        min-width: 50px;
    }

}


.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--color-border);
    border-top: 2px solid var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

button:focus,
input:focus,
select:focus,
textarea:focus,
a:focus,
*:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

html {
    scroll-behavior: smooth;
}

::selection {
    background-color: var(--color-primary-light);
    color: var(--color-primary);
}

@media print {
    .header,
    .nav-link-logout,
    .table-actions {
        display: none !important;
    }

    .content {
        padding: 0;
        max-width: none;
    }

    .table {
        box-shadow: none;
        border: 1px solid var(--color-border);
    }
}
