/* ========================================
   LAYOUT
   ======================================== */

/* Prevent horizontal overflow */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

/* Page Layout */
.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Header */
.header {
    padding: 16px 0;
    border-bottom: 1px solid var(--color-border);
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--color-text);
    flex-shrink: 0;
}

.header-logo img {
    width: 50px;
    height: 50px;
}

.header-logo span {
    font-weight: 600;
    font-size: 1.1rem;
}

.header-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    order: 0;
    gap: 4px;
}

.header-nav a {
    color: var(--color-text);
    text-decoration: underline;
    font-size: 0.9rem;
}

.breadcrumb-separator {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    padding: 0 8px;
}

.breadcrumb-active {
    color: var(--color-text);
    font-size: 0.9rem;
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-shrink: 0;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--color-text);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 500;
    flex-shrink: 0;
}

/* Main Content */
.main-content {
    padding: 40px 0;
    flex: 1;
}

/* Section */
.section {
    padding: 24px 0;
    border-bottom: 1px solid var(--color-border);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 24px;
    margin-bottom: 24px;
}

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

.section-title {
    font-size: 1.25rem;
    font-weight: 400;
    margin-bottom: 24px;
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 24px;
}

/* User Info */
.user-info {
    display: grid;
    gap: 16px;
}

.user-info-row {
    display: flex;
    gap: 48px;
}

.user-info-item {
    min-width: 200px;
}

.user-info-item strong {
    font-weight: 700;
}

/* Action Card */
.action-card {
    display: flex;
    align-items: flex-start;
    gap: 24px;
}

.action-description {
    color: var(--color-text);
    font-size: 0.95rem;
    line-height: 1.6;
    max-width: 300px;
}

/* Footer */
.footer {
    padding: 40px 0;
    text-align: center;
    border-top: 1px solid var(--color-border);
    margin-top: auto;
}

.footer-about {
    font-size: 1rem;
    color: var(--color-text);
    margin-bottom: 16px;
}

.footer-about a {
    color: var(--color-text);
    text-decoration: none;
}

.footer-about a:hover {
    text-decoration: underline;
}

.footer-links {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 24px;
}

.footer-links a {
    color: var(--color-text-muted);
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

.footer-links span {
    margin: 0 8px;
}

.footer-logo img {
    width: 60px;
    height: auto;
}

/* ========================================
   COMPONENTS
   ======================================== */

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

.page-header-actions {
    display: flex;
    gap: 12px;
}

.page-title {
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--color-text);
    margin: 0;
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th {
    text-align: left;
    padding: 12px 8px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--color-border);
}

.data-table td {
    padding: 12px 8px;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background-color: #f9f9f9;
}

.data-table a {
    color: var(--color-link);
    text-decoration: none;
}

.data-table a:hover {
    text-decoration: underline;
}

.data-table input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.empty-cell {
    text-align: center;
    color: var(--color-text-muted);
    font-style: italic;
}

/* Table Actions */
.table-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.table-actions a,
.table-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: color 0.2s ease;
}

.table-actions a:hover,
.table-actions button:hover {
    color: var(--color-text);
    text-decoration: none;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-muted);
}

.empty-state p {
    margin-bottom: 24px;
}

/* Form Section */
.form-section {
    max-width: 800px;
}

.form-title {
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--color-text);
    margin: 0 0 8px 0;
}

.form-subtitle {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin: 0 0 24px 0;
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group > label {
    font-size: 0.6rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: -9px;
    background-color: var(--color-text);
    color: white;
    padding: 3px 8px;
    display: inline-block;
    width: 190px;
    z-index: 1;
    margin-left: 20px;
}

.form-group input,
.form-group select {
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 0.9rem;
    width: 100%;
    box-sizing: border-box;
}

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

.form-group input:disabled {
    background-color: #f5f5f5;
    color: var(--color-text-muted);
}

.form-group .form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group .form-check input[type="checkbox"] {
    width: auto;
}

/* Form Actions */
.form-actions {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--color-border);
}

.form-actions .btn-action {
    min-width: 200px;
    padding: 14px 32px;
    font-size: 1rem;
    text-align: center;
}

.btn-cancel {
    color: var(--color-text);
    text-decoration: none;
    font-size: 1rem;
    padding: 14px 32px;
}

.btn-cancel:hover {
    text-decoration: underline;
}

/* Multi-Select Component */
.form-group select.select-multiple {
    display: none !important;
}

.multi-select-wrapper {
    position: relative;
    width: 100%;
}

.multi-select-trigger {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.multi-select-trigger:hover {
    border-color: #999;
}

.multi-select-wrapper.open .multi-select-trigger {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px var(--color-primary);
}

.multi-select-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.multi-select-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    background: #f0f0f0;
    border-radius: 3px;
    font-size: 0.8rem;
    color: var(--color-text);
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.multi-select-placeholder {
    color: #999;
    font-size: 0.9rem;
}

.multi-select-arrow {
    margin-left: 8px;
    color: #999;
    transition: transform 0.15s ease;
    flex-shrink: 0;
}

.multi-select-wrapper.open .multi-select-arrow {
    transform: rotate(180deg);
}

.multi-select-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    max-height: 240px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.multi-select-wrapper.open .multi-select-dropdown {
    display: block;
}

.multi-select-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: normal;
    text-transform: none;
    letter-spacing: normal;
    margin: 0;
    color: var(--color-text);
    background: #fff;
    border-bottom: 1px solid #f5f5f5;
    transition: background-color 0.1s ease;
}

.multi-select-option:last-child {
    border-bottom: none;
}

.multi-select-option:hover {
    background: #f8f9fa;
}

.multi-select-option.selected {
    background: #f0f7ff;
}

.multi-select-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--color-primary);
    flex-shrink: 0;
}

.multi-select-option span {
    flex: 1;
    color: var(--color-text);
}

.underline {
    text-decoration: underline;
}

.mt-16 {
    margin-top: 16px;
}

.w-100 {
    width: 100%;
}

/* Form Errors */
.form-group .error {
    color: #dc2626;
    font-size: 0.8rem;
    margin-top: 4px;
}

/* Alert Messages */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.alert-error {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.alert-success {
    background-color: #f0fdf4;
    color: #059669;
    border: 1px solid #bbf7d0;
}

.alert-info {
    background-color: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

/* Buttons */
.btn-outline {
    display: inline-block;
    padding: 10px 20px;
    background-color: transparent;
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-outline:hover {
    background-color: var(--color-text);
    color: white;
    text-decoration: none;
}

.btn-primary {
    display: inline-block;
    padding: 14px 24px;
    background-color: var(--color-text);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

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

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

.btn-danger {
    display: inline-block;
    padding: 14px 24px;
    background-color: #dc2626;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-danger:hover {
    background-color: #b91c1c;
}

.btn-action,
button.btn-action {
    display: inline-block;
    padding: 12px 24px;
    background-color: var(--color-primary);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-action:hover,
button.btn-action:hover {
    background-color: var(--color-primary-hover);
    color: white;
    text-decoration: none;
}

.btn-logout {
    display: inline-block;
    padding: 8px 16px;
    background-color: transparent;
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 0.85rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background-color: var(--color-text);
    color: white;
    text-decoration: none;
}

/* Filters */
.filters {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filters-label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-chip {
    display: inline-block;
    padding: 6px 16px;
    background-color: transparent;
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    font-size: 0.85rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-chip:hover,
.filter-chip.active {
    background-color: var(--color-text);
    color: white;
    text-decoration: none;
}

/* Filters container */
.filters-container {
    margin-bottom: 24px;
}

.filters-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background-color: white;
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    width: 100%;
    justify-content: center;
    transition: all 0.2s ease;
}

.filters-toggle:hover {
    background-color: var(--color-surface);
}

.filters-toggle-arrow {
    transition: transform 0.2s ease;
}

.filters-toggle.open .filters-toggle-arrow {
    transform: rotate(180deg);
}

/* Multi-select filters row */
.filters-row {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 120px;
}

/* Filters actions (buttons side by side) */
.filters-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.filter-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 0.875rem;
    background-color: white;
    color: var(--color-text);
    min-width: 140px;
    max-width: 180px;
    height: 38px;
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.filter-select[multiple] {
    height: auto;
    min-height: 38px;
    max-height: 100px;
}

.filter-input {
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 0.875rem;
    background-color: white;
    color: var(--color-text);
    width: 100px;
    height: 38px;
}

.filter-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.filter-input::placeholder {
    color: var(--color-text-muted);
}

.btn-filter-clear {
    padding: 8px 16px;
    background-color: transparent;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    height: 38px;
    transition: all 0.2s ease;
}

.btn-filter-clear:hover {
    background-color: var(--color-surface);
    color: var(--color-text);
}

.btn-filter {
    padding: 8px 16px;
    background-color: var(--color-primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    height: 38px;
    transition: all 0.2s ease;
}

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

.filters-form {
    margin-bottom: 0;
}

.filters-form .filter-label {
    display: block;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 24px;
    padding: 16px 0;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    background-color: white;
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.pagination-link:hover {
    background-color: var(--color-surface);
    border-color: var(--color-text-muted);
    text-decoration: none;
}

.pagination-link.active {
    background-color: var(--color-text);
    color: white;
    border-color: var(--color-text);
}

.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.page-subtitle {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--color-text-muted);
}

/* Status Badges */
.status {
    font-size: 0.85rem;
    font-style: italic;
}

.status-draft {
    color: #121212;
}

.status-submitted {
    color: #eb6b24;
}

.status-validated {
    color: #059669;
}

.status-en-attente {
    color: var(--color-text-muted);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.modal {
    background: white;
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--color-text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--color-text);
}

.modal-header {
    padding: 32px 32px 0;
    text-align: center;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 500;
    margin: 0 0 8px;
    color: var(--color-text);
}

.modal-subtitle {
    font-size: 0.875rem;
    color: #dc2626;
    margin: 0;
}

.modal-body {
    padding: 24px 32px 32px;
}

/* Modal Form Actions Override */
.modal-body .form-actions {
    border-top: none;
    padding-top: 0;
}

/* Submission Page Styles */
.submission-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--color-border);
}

.submission-title {
    font-size: 1.25rem;
    font-weight: 500;
    margin: 0 0 8px;
}

.submission-subtitle {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.submission-status {
    text-align: right;
}

.submission-content {
    padding: 24px 0;
}

.submission-info {
    background: #f9f9f9;
    padding: 24px;
    border-radius: 8px;
    margin: 24px 0;
}

.submission-info p {
    margin: 8px 0;
}

.submission-actions {
    margin-top: 32px;
}

/* ========================================
   LOGIN PAGE
   ======================================== */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.login-logo {
    margin-bottom: 40px;
}

.login-logo img {
    width: 180px;
    height: auto;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    margin-bottom: 32px;
}

.login-form {
    text-align: left;
}

.login-form .form-group {
    margin-bottom: 20px;
    position: relative;
}

.login-form .form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 1rem;
    color: var(--color-text);
    background: var(--color-background);
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

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

.login-form .form-group input::placeholder {
    color: #999;
}

.btn-submit {
    width: 100%;
    padding: 14px 24px;
    background-color: var(--color-primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-top: 12px;
}

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

.login-footer {
    margin-top: 24px;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.login-footer a {
    color: var(--color-link);
    font-weight: 500;
}

/* ========================================
   DYNAMIC FORM STYLES
   ======================================== */

/* Submission Form Header */
.submission-form-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    padding-bottom: 16px;
}

.submission-form-header-left {
    flex: 1;
}

.submission-form-title-row {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 8px;
}

.submission-form-title {
    font-size: 1.25rem;
    font-weight: 500;
    margin: 0;
    color: var(--color-text);
}

.save-and-quit {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.save-and-quit:hover {
    color: var(--color-text);
    text-decoration: underline;
}

a.save-and-quit:hover {
    text-decoration: underline;
}

.submission-form-context {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin: 0;
}

.submission-form-header-right {
    text-align: right;
}

.submission-form-progress {
    font-size: 1rem;
    font-style: italic;
    margin-bottom: 4px;
}

.progress-count {
    color: var(--color-text);
}

.progress-count.complete {
    color: #059669;
}

.progress-status {
    color: var(--color-text-muted);
}

.submission-form-hint {
    font-size: 0.85rem;
    color: #dc2626;
    margin: 0;
}

/* Form Tabs */
.form-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    overflow: hidden;
}

.form-tab {
    flex: 1;
    padding: 16px 20px;
    background: white;
    border: none;
    border-right: 1px solid var(--color-border);
    cursor: pointer;
    text-align: left;
    transition: background-color 0.2s ease;
}

.form-tab:last-child {
    border-right: none;
}

.form-tab:hover {
    background-color: #f9f9f9;
}

.form-tab.active {
    background-color: #f5f5f5;
    border-bottom: 2px solid var(--color-text);
}

.tab-name {
    display: block;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 4px;
}

.tab-progress {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.tab-progress.complete {
    color: #059669;
}

.tab-progress .check-icon {
    stroke: #059669;
}

/* Section Validation Message */
.section-validation-message {
    margin-bottom: 24px;
}

.validation-success,
.validation-error {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.validation-success svg,
.validation-error svg {
    flex-shrink: 0;
}

.validation-success {
    background-color: #f0fdf4;
    color: #059669;
    border: 1px solid #bbf7d0;
}

.validation-error {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* Form Section Content */
.form-section-content {
    display: none;
}

.form-section-content.active {
    display: block;
}

/* Dynamic Field Row */
.dynamic-field-row {
    display: flex;
    align-items: flex-start;
    padding: 20px 0;
    border-bottom: 1px solid var(--color-border);
}

.dynamic-field-row:first-child {
    border-top: 1px solid var(--color-border);
}

.dynamic-field-label {
    width: 200px;
    min-width: 200px;
    font-size: 0.95rem;
    color: var(--color-text);
    padding-top: 8px;
}

.dynamic-field-label.error {
    color: #dc2626;
}

.dynamic-field-input {
    flex: 1;
}

.dynamic-field-input input,
.dynamic-field-input select,
.dynamic-field-input textarea {
    width: 100%;
    max-width: 400px;
    padding: 10px 14px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--color-text);
}

.dynamic-field-input input:focus,
.dynamic-field-input select:focus,
.dynamic-field-input textarea:focus {
    outline: none;
    border-color: var(--color-text);
}

.dynamic-field-input input.error,
.dynamic-field-input select.error,
.dynamic-field-input textarea.error {
    border-color: #dc2626;
    background-color: #fef2f2;
}

.dynamic-field-input .field-error {
    color: #dc2626;
    font-size: 0.85rem;
    margin-top: 6px;
}

/* Custom value field */
.custom-value-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.custom-value-label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.custom-value-input {
    flex: 1;
    max-width: 300px;
}

/* Radio Pills (style boutons) */
.radio-pills,
.checkbox-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.radio-pill,
.checkbox-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--color-text);
    transition: all 0.2s ease;
    user-select: none;
}

.radio-pill:hover,
.checkbox-pill:hover {
    border-color: var(--color-text);
}

.radio-pill.selected,
.checkbox-pill.selected {
    border-color: var(--color-text);
    font-weight: 500;
}

.radio-pill-input,
.checkbox-pill-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.radio-pill-label,
.checkbox-pill-label {
    cursor: pointer;
}

/* Disabled form controls */
.form-control:disabled,
.form-select:disabled,
input:disabled,
select:disabled,
textarea:disabled {
    background-color: var(--color-surface);
    color: var(--color-text-muted);
    cursor: not-allowed;
    opacity: 0.7;
}

.radio-pill:has(input:disabled),
.checkbox-pill:has(input:disabled) {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.radio-pill:has(input:disabled) .radio-pill-label,
.checkbox-pill:has(input:disabled) .checkbox-pill-label {
    cursor: not-allowed;
}

/* Form locked state */
.dynamic-form.form-locked .dynamic-field-input {
    opacity: 0.7;
}

/* Form Bottom Actions */
.form-bottom-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
    padding: 32px 0;
    margin-top: 24px;
}

.btn-submit-validation {
    padding: 14px 24px;
    background-color: #666666;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-submit-validation:hover:not(.disabled) {
    background-color: var(--color-text);
}

.btn-submit-validation.disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.btn-validate {
    padding: 14px 24px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-validate:hover {
    background-color: #218838;
}

.btn-save {
    padding: 14px 24px;
    background-color: var(--color-text);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

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

.form-locked-message {
    color: var(--color-text-muted);
    font-style: italic;
}

.submit-form {
    display: inline;
}

/* Modal Warning Styles */
.modal-warning {
    color: #dc2626;
    font-size: 0.95rem;
    margin-bottom: 16px;
    text-align: center;
}

.modal-warning-strong {
    color: #dc2626;
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 24px;
    text-align: center;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-actions .btn-primary,
.modal-actions .btn-danger,
.modal-actions .btn-outline {
    width: 100%;
    text-align: center;
}

.modal-actions form {
    width: 100%;
}

/* ========================================
   RESPONSIVE
   ======================================== */

/* Large screens and up */
@media (min-width: 768px) {
    .header-row {
        flex-wrap: nowrap;
    }

    .header-nav {
        flex: 1;
    }
}

/* Medium screens */
@media (max-width: 991px) {
    .page-header {
        gap: 12px;
    }

    .page-title {
        font-size: 1rem;
    }
}

/* Small screens */
@media (max-width: 767px) {
    .header {
        padding: 12px 0;
    }

    .header-row {
        flex-wrap: wrap;
    }

    .header-logo {
        order: 1;
    }

    .header-nav {
        order: 3;
        width: 100%;
        justify-content: flex-start;
        padding-top: 12px;
        margin-top: 12px;
        border-top: 1px solid var(--color-border);
    }

    .header-actions {
        order: 2;
        margin-left: auto;
    }

    .header-logo span {
        font-size: 0.95rem;
    }

    .user-avatar {
        width: 36px;
        height: 36px;
        font-size: 0.8rem;
    }

    .main-content {
        padding: 24px 0;
    }

    .page-header {
        flex-wrap: nowrap;
        gap: 8px;
    }

    .page-title {
        font-size: 1rem;
        flex: 1;
        min-width: 0;
    }

    .page-header .btn-outline {
        padding: 8px 12px;
        font-size: 0.8rem;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Tables responsive */
    .data-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table th,
    .data-table td {
        white-space: nowrap;
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    /* Two column layout stacked */
    .col-6 {
        margin-bottom: 24px;
    }

    /* Form fields */
    .dynamic-field-row {
        flex-direction: column;
        gap: 8px;
    }

    .dynamic-field-label {
        width: 100%;
        text-align: left;
    }

    .dynamic-field-input {
        width: 100%;
    }

    /* Form bottom actions */
    .form-bottom-actions {
        flex-direction: column;
        gap: 12px;
    }

    .form-bottom-actions button {
        width: 100%;
    }

    /* Form tabs */
    .form-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
    }

    .form-tab {
        flex: 0 0 auto;
        font-size: 0.85rem;
        padding: 10px 16px;
    }

    /* Modal */
    .modal {
        width: 95%;
        max-width: none;
        margin: 16px;
    }

    /* Filters toggle on mobile */
    .filters-toggle {
        display: flex;
        margin-bottom: 12px;
    }

    .filters-form {
        display: none;
        padding: 16px;
        background-color: var(--color-surface);
        border-radius: 8px;
        margin-bottom: 16px;
    }

    .filters-form.open {
        display: block;
    }

    .filters-row {
        gap: 12px;
    }

    .filter-group {
        min-width: 100px;
        flex: 1 1 calc(50% - 6px);
    }

    .filter-select {
        min-width: 0;
        max-width: none;
        width: 100%;
    }

    .filter-input {
        width: 100%;
    }

    .filters-actions {
        margin-top: 16px;
    }

    .filters-actions .btn-filter,
    .filters-actions .btn-filter-clear {
        flex: 1;
    }

    /* Pagination responsive */
    .pagination {
        flex-wrap: wrap;
        gap: 6px;
    }

    .pagination-link {
        min-width: 32px;
        height: 32px;
        padding: 0 8px;
        font-size: 0.8rem;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .header-logo span {
        display: none;
    }

    .btn-action,
    button.btn-action {
        padding: 10px 16px;
        font-size: 0.85rem;
    }

    .filters {
        flex-wrap: wrap;
    }

    .filter-chip {
        font-size: 0.8rem;
        padding: 6px 12px;
    }

    /* Filters row extra small screens */
    .filter-group {
        flex: 1 1 100%;
    }

    .filter-select,
    .filter-input {
        width: 100%;
        max-width: none;
        min-width: 0;
    }

    /* Pagination extra small */
    .pagination-ellipsis {
        display: none;
    }

    /* Prevent text overflow */
    .table-actions {
        white-space: nowrap;
    }
}

/* ========================================
   EXPORT UI
   ======================================== */

/* Checkbox column */
.col-checkbox {
    width: 40px;
    text-align: center;
}

/* Actions button */
.btn-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: var(--color-text);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

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

.btn-actions-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background-color: white;
    color: var(--color-text);
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Per-row export button */
.btn-export-single {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: color 0.2s ease;
}

.btn-export-single:hover {
    color: var(--color-text);
}

/* Export download button (green) */
.btn-export-download {
    display: inline-block;
    padding: 14px 24px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-export-download:hover:not(:disabled) {
    background-color: #218838;
}

.btn-export-download:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* Export select */
.export-select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.export-select:focus {
    outline: none;
    border-color: var(--color-text);
}

/* Selected row highlight */
.data-table tbody tr.row-selected {
    background-color: #f0f7ff;
}

img {
    max-width: 100%;
    height: auto;
}
