/* /assets/css/components.css */

/* ============================================
   BOUTONS BASE
   ============================================ */

/* ============================================
   BOUTONS BASE
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    text-decoration: none;
    white-space: nowrap;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background-color: var(--zebra-brown);
    color: var(--zebra-white);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--zebra-brown-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: transparent;
    color: var(--zebra-brown);
    border-color: var(--zebra-brown);
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--zebra-brown);
    color: var(--zebra-white);
}

.btn-ghost {
    background-color: transparent;
    color: var(--zebra-brown);
}

.btn-ghost:hover:not(:disabled) {
    background-color: rgba(115, 73, 63, 0.08);
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: var(--text-sm);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: var(--text-lg);
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.875rem;
    color: var(--zebra-slate);
}

.btn-icon:hover {
    border-color: var(--zebra-brown);
    color: var(--zebra-brown);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-icon.danger:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #dc2626;
}

.btn-icon.btn-sm {
    width: 28px;
    height: 28px;
    padding: 0;
}

.btn-icon.btn-sm svg {
    width: 16px;
    height: 16px;
}

.btn-icon svg {
    display: block;
    width: 1.25rem;
    height: 1.25rem;
    stroke: currentColor;
    stroke-width: 2;
}

/* Button Groups */
.actions-group,
.btn-group {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

/* ============================================
   FORM UI KIT
   ============================================ */

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--zebra-dark);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    background: var(--zebra-white);
    transition: all 0.2s ease;
    color: var(--zebra-dark);
    font-family: var(--font-body);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--color-text-muted);
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
    border-color: var(--color-border-hover);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--zebra-brown);
    box-shadow: 0 0 0 4px rgba(115, 73, 63, 0.1);
}

/* Specifics */
.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.editor-textarea {
    min-height: 500px;
    font-family: 'Courier New', Courier, monospace;
    /* Monospace for better editing */
    line-height: 1.6;
}

.form-hint {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.75rem;
    color: var(--color-text-secondary);
}

/* Checkbox & Radio */
.form-check {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.9375rem;
    color: var(--zebra-dark);
    user-select: none;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--color-border);
    border-radius: 4px;
    background: var(--zebra-white);
    cursor: pointer;
    position: relative;
    transition: all var(--transition-fast);
    display: grid;
    place-content: center;
    margin: 0;
}

.form-check input[type="radio"] {
    border-radius: 50%;
}

.form-check input[type="checkbox"]:checked,
.form-check input[type="radio"]:checked {
    background-color: var(--zebra-brown);
    border-color: var(--zebra-brown);
}

.form-check input[type="checkbox"]::before {
    content: "";
    width: 0.65rem;
    height: 0.65rem;
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    box-shadow: inset 1em 1em var(--zebra-white);
    background-color: CanvasText;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.form-check input[type="checkbox"]:checked::before {
    transform: scale(1);
}

.form-check input[type="radio"]::before {
    content: "";
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    box-shadow: inset 1em 1em var(--zebra-white);
}

.form-check input[type="radio"]:checked::before {
    transform: scale(1);
}

.form-check input:focus-visible {
    outline: 2px solid var(--zebra-brown);
    outline-offset: 2px;
}

.form-check:hover input {
    border-color: var(--zebra-brown-light);
}

/* Checkbox Chips (for Advanced Targeting) */
.checkbox-chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.checkbox-chip {
    cursor: pointer;
    user-select: none;
}

.checkbox-chip input {
    display: none;
}

.checkbox-chip span {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--zebra-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--zebra-slate);
    transition: all var(--transition-base);
}

.checkbox-chip:hover span {
    border-color: var(--zebra-brown-light);
    background: rgba(115, 73, 63, 0.02);
}

.checkbox-chip input:checked+span {
    background: var(--zebra-brown);
    border-color: var(--zebra-brown);
    color: var(--zebra-white);
    box-shadow: var(--shadow-sm);
}

/* Form Checkbox Wrapper (Generic) */
.form-checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.form-checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--color-border);
    border-radius: 4px;
    background: var(--zebra-white);
    cursor: pointer;
    position: relative;
    transition: all var(--transition-fast);
    display: grid;
    place-content: center;
}

.form-checkbox input[type="checkbox"]:checked {
    background-color: var(--zebra-brown);
    border-color: var(--zebra-brown);
}

.form-checkbox input[type="checkbox"]::before {
    content: "";
    width: 0.65rem;
    height: 0.65rem;
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    box-shadow: inset 1em 1em var(--zebra-white);
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.form-checkbox input[type="checkbox"]:checked::before {
    transform: scale(1);
}

.form-checkbox label {
    cursor: pointer;
    font-size: 0.9375rem;
    color: var(--zebra-dark);
}

/* ============================================
   TOM SELECT (Multiple Select)
   ============================================ */

.ts-wrapper.multi .ts-control {
    padding: 0.5rem 0.75rem;
    min-height: 46px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background-color: var(--zebra-white);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    transition: all var(--transition-base);
    box-shadow: none;
}

.ts-wrapper.multi.focus .ts-control {
    border-color: var(--zebra-brown);
    box-shadow: 0 0 0 4px rgba(115, 73, 63, 0.1);
    outline: none;
}

/* Specificity boost for items */
.ts-wrapper.multi .ts-control .item,
.ts-wrapper.multi.has-items .ts-control .item {
    background-color: var(--zebra-brown) !important;
    background-image: none !important;
    color: var(--zebra-white) !important;
    border: none !important;
    border-radius: var(--radius-full) !important;
    padding: 2px 12px !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    margin: 0 4px 4px 0 !important;
    box-shadow: var(--shadow-xs) !important;
}

.ts-wrapper.multi .ts-control .item .remove {
    color: var(--zebra-white) !important;
    opacity: 0.7 !important;
    font-size: 14px !important;
    line-height: 1 !important;
    border: none !important;
    padding: 0 2px !important;
}

.ts-wrapper.multi .ts-control .item .remove:hover {
    opacity: 1;
    background: transparent;
}

.ts-wrapper.multi .ts-control>input {
    font-family: var(--font-body);
    font-size: 0.9375rem;
}

.ts-dropdown {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    margin-top: 8px;
    z-index: var(--z-dropdown);
    overflow: hidden;
}

.ts-dropdown .option {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    transition: background var(--transition-fast);
}

.ts-dropdown .active {
    background-color: rgba(115, 73, 63, 0.05);
    color: var(--zebra-brown);
}

.ts-dropdown .option.selected {
    background-color: rgba(115, 73, 63, 0.1);
    color: var(--zebra-brown);
    font-weight: 600;
}

/* Internal Checkboxes in Tom Select dropdown */
.ts-dropdown .option input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 1.125rem;
    height: 1.125rem;
    border: 2px solid var(--color-border);
    border-radius: 4px;
    background: var(--zebra-white);
    margin-right: 10px;
    display: inline-grid;
    place-content: center;
    vertical-align: middle;
    transition: all var(--transition-fast);
}

.ts-dropdown .option input[type="checkbox"]:checked {
    background-color: var(--zebra-brown);
    border-color: var(--zebra-brown);
}

.ts-dropdown .option input[type="checkbox"]::before {
    content: "";
    width: 0.55rem;
    height: 0.55rem;
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    box-shadow: inset 1em 1em var(--zebra-white);
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.ts-dropdown .option input[type="checkbox"]:checked::before {
    transform: scale(1);
}

/* ============================================
   CARDS
   ============================================ */

.card {
    background-color: var(--zebra-white);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--zebra-bg);
}

.card-title {
    font-family: var(--font-title);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--zebra-brown);
    margin: 0;
}

/* ============================================
   ADMIN SECTIONS
   ============================================ */

.admin-section {
    background: var(--zebra-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.admin-section-header {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--color-border);
    background: var(--zebra-bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-section-header h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--zebra-dark);
}

/* ============================================
   MODALS
   ============================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.modal {
    background: var(--zebra-white);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 900px;
    /* Increased from 600px */
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    overflow: hidden;
}

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

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

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--zebra-brown);
}

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


/* Modal Close Button */
.modal-close {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--zebra-secondary);
    padding: var(--space-xs);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background-color: var(--zebra-gray-light);
    color: var(--zebra-error);
}

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

/* ============================================
   TABLES
   ============================================ */

.table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    padding: 1px;
    /* Slight padding or keep strict border radius */
    /* Often better to rely on internal table padding, but parent container might need margin */
    /* The user said "collé aux bord du container parent". Let's add padding to admin-section-body if it exists or just modify table-container usage */
}

/* Let's add a specific rule for admin-section body */
.admin-section .table-container {
    margin: var(--space-lg);
    width: calc(100% - var(--space-lg) * 2);
    border: 1px solid var(--color-border);
    /* Move border here if needed */
}

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

.table th {
    text-align: left;
    padding: 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--zebra-slate);
    background: var(--zebra-bg);
    border-bottom: 1px solid var(--color-border);
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--zebra-bg);
    color: var(--zebra-dark);
}

.table tr:hover {
    background-color: rgba(115, 73, 63, 0.02);
}

/* ============================================
   BADGES
   ============================================ */

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

.badge-draft {
    background: #fef3c7;
    color: #92400e;
}

.badge-published,
.badge-validated {
    background: #dcfce7;
    color: #166534;
}

.badge-sent {
    background: #e0f2fe;
    color: #075985;
}

.badge-archived {
    background: #f1f5f9;
    color: #475569;
}

/* Targeting specific badges (pill style) */
.badge-pill {
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    margin: 2px;
}

.badge-blue {
    background-color: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #dbeafe;
}

.badge-purple {
    background-color: #faf5ff;
    color: #7e22ce;
    border: 1px solid #f3e8ff;
}

.badge-green {
    background-color: #f0fdf4;
    color: #15803d;
    border: 1px solid #dcfce7;
}

.badge-orange {
    background-color: #fff7ed;
    color: #c2410c;
    border: 1px solid #ffedd5;
}

/* ============================================
   DASHBOARD / TOOL CARDS
   ============================================ */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-lg);
    margin: var(--space-lg) 0;
}

.tool-card {
    background: var(--zebra-white);
    border-radius: var(--radius-lg);
    padding: var(--space-xl) var(--space-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: all var(--transition-base);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: var(--shadow-sm);
    height: 100%;
    position: relative;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--zebra-brown-light);
}

.tool-card.disabled {
    opacity: 0.6;
    pointer-events: none;
    filter: grayscale(1);
}

.tool-icon {
    width: 80px;
    height: 80px;
    background: rgba(115, 73, 63, 0.05);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-lg);
    color: var(--zebra-brown);
    transition: transform var(--transition-fast);
}

.tool-card:hover .tool-icon {
    transform: scale(1.05);
    background: rgba(115, 73, 63, 0.1);
}

.tool-icon svg {
    width: 40px;
    height: 40px;
    stroke-width: 1.5;
}

.tool-title {
    font-family: var(--font-title);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    color: var(--zebra-brown);
}

.tool-description {
    font-size: 0.9375rem;
    color: var(--zebra-slate);
    line-height: 1.6;
    margin-bottom: var(--space-xl);
    flex-grow: 1;
}


/* ============================================
   NOTES & ALERTS
   ============================================ */

.note-box {
    background-color: #fffbeb;
    /* Amber-50 equivalent for note feel */
    border: 1px solid #fcd34d;
    /* Amber-300 */
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
    color: #92400e;
    /* Amber-800 */
}

.note-title {
    font-family: var(--font-title);
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: var(--space-xs);
    color: #92400e;
}

.note-list {
    margin: 0;
    padding-left: 1.25rem;
    list-style-type: disc;
}

.note-list li {
    margin-bottom: 0.25rem;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.note-list code {
    background: rgba(255, 255, 255, 0.5);
    padding: 2px 4px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.85em;
    color: #b45309;
}

/* ============================================
   SIGNATURE CARDS
   ============================================ */

.signature-card {
    background: var(--zebra-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.signature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--zebra-brown-light);
}

.signature-card h3 {
    font-family: var(--font-title);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--zebra-brown);
    margin-bottom: var(--space-sm);
}

.signature-card .meta {
    margin-bottom: var(--space-md);
    font-size: 0.875rem;
    color: var(--zebra-slate);
    flex-grow: 1;
}

.signature-card .meta div {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.signature-card .actions {
    margin-top: auto;
}

/* ============================================
   MODAL PREVIEW LAYOUT
   ============================================ */

.modal-content-wrapper {
    display: flex;
    height: 100%;
    min-height: 400px;
    overflow: hidden;
}

.modal-sidebar {
    width: 300px;
    flex-shrink: 0;
    background: var(--zebra-bg);
    border-right: 1px solid var(--color-border);
    padding: var(--space-lg);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.modal-sidebar h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--zebra-dark);
    margin-bottom: var(--space-md);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.modal-preview-area {
    flex-grow: 1;
    background: #f1f5f9;
    /* Slate 100 */
    padding: var(--space-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
}

/* Modals */
.modal {
    background: white;
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    width: 95%;
    /* Increased width */
    max-width: 1200px;
    /* Increased max-width */
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
}

.preview-frame {
    background: white;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-sm);
    padding: var(--space-lg);
    max-width: 100%;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   VISUALS GRID (Admin)
   ============================================ */

.visuals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.visual-item {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--color-border);
    aspect-ratio: 16/9;
    /* Enforce aspect ratio */
    background: var(--zebra-bg);
}

.visual-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Ensure image covers the area */
    display: block;
}

.delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--zebra-error);
    cursor: pointer;
    font-weight: bold;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

.delete-btn:hover {
    background: var(--zebra-error);
    color: white;
}

/* ============================================
   UPLOAD ZONE
   ============================================ */

.upload-zone {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-xl);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--zebra-bg);
}

.upload-zone:hover {
    border-color: var(--zebra-brown);
    background: rgba(115, 73, 63, 0.05);
}

.upload-zone input {
    display: none;
}

.upload-zone .icon {
    font-size: 2rem;
    margin-bottom: var(--space-sm);
    color: var(--zebra-slate);
}

/* ============================================
   STATES
   ============================================ */

.empty-state {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--zebra-slate);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--zebra-bg);
    margin: var(--space-xl) auto;
    max-width: 600px;
}

.loading {
    text-align: center;
    padding: var(--space-xl);
    color: var(--zebra-slate);
    font-style: italic;
}

/* ============================================
   REDACTION LOADER OVERLAY
   ============================================ */

.redaction-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.redaction-loader {
    width: 60px;
    height: 60px;
    border: 5px solid var(--zebra-bg);
    border-top: 5px solid var(--zebra-brown);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.redaction-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--zebra-brown);
    text-align: center;
}

.redaction-subtext {
    font-size: 0.9375rem;
    color: var(--zebra-secondary);
    margin-top: 8px;
    text-align: center;
}

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

    100% {
        transform: rotate(360deg);
    }
}

.badge-purple {
    background: #f3e8ff;
    color: #7e22ce;
    border: 1px solid #e9d5ff;
}

.status-select-mini {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid var(--color-border);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 4px center;
    background-size: 10px;
    padding-right: 18px;
}


.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--zebra-bg);
    border-top: 3px solid var(--zebra-brown);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}


/* ============================================
   EXPANDABLE ROWS (BRIEFS)
   ============================================ */

.expansion-toggle {
    transition: transform 0.2s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: var(--zebra-brown);
}

.expansion-toggle:hover {
    color: var(--zebra-orange);
}

.expansion-toggle.active {
    transform: rotate(90deg);
}

.expansion-row {
    background: var(--zebra-bg);
}

.expansion-row td {
    padding: 0 !important;
    border-bottom: 1px solid var(--color-border);
}

.expansion-content {
    padding: var(--space-md) var(--space-xl);
    border-left: 4px solid var(--zebra-brown);
}

.article-list-mini {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.article-item-mini {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    background: white;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    text-decoration: none;
    transition: all 0.2s ease;
}

.article-item-mini:hover {
    border-color: var(--zebra-brown);
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.article-version-badge {
    background: var(--zebra-bg);
    color: var(--zebra-brown);
    font-weight: bold;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
}

/* ============================================
   MODEL SELECTION (Premium)
   ============================================ */

.model-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-top: var(--space-md);
}

.model-item {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    padding: var(--space-lg);
    background: white;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.model-item:hover {
    border-color: var(--zebra-brown);
    background: var(--zebra-bg);
    transform: translateX(8px);
    box-shadow: var(--shadow-md);
}

.model-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: transparent;
    transition: background 0.3s ease;
}

.model-item:hover::before {
    background: var(--zebra-brown);
}

.model-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.model-info strong {
    font-size: 1.125rem;
    color: var(--zebra-dark);
}

.model-badge {
    padding: 6px 12px;
    background: #f3f4f6;
    color: #4b5563;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.model-badge.recommended {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}