@config './tailwind.config.js';

@source "../../../../app/Filament/**/*";
@source "../../../../resources/views/filament/**/*";
@source "../../../../resources/views/components/**/*";
@source "../../../../resources/views/livewire/**/*";
@source "../../../../app/Livewire/**/*";

@font-face {
    font-family: 'Aptos';
    src: url('/fonts/aptos.woff2') format('woff2'),
         url('/fonts/aptos.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Aptos';
    src: url('/fonts/aptos-semibold.woff2') format('woff2'),
         url('/fonts/aptos-semibold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --er-font-sans: 'Aptos', ui-sans-serif, system-ui, sans-serif;
    --er-bg-light: #f3eee5;
    --er-surface-light: #fff;
    --er-text-light: #2d2a26;
    --er-border-light: #ddd6c8;
    --er-muted-light: #6b7280;
    --er-bg-dark: #17171c;
    --er-surface-dark: #1f2027;
    --er-text-dark: #f5f5f5;
    --er-border-dark: hsla(0, 0%, 100%, 0.08);
    --er-muted-dark: hsla(0, 0%, 100%, 0.7);
    --er-sidebar-bg: linear-gradient(180deg, #6b1735, #4f1127);
    --er-sidebar-hover: rgba(204, 40, 82, 0.28);
    --er-sidebar-active: hsla(0, 0%, 100%, 0.12);
    --er-sidebar-text: #fff;
    --er-sidebar-muted: hsla(0, 0%, 100%, 0.8);
    --er-primary: #8e1f3f;
    --er-primary-hover: #b41f4f;
    --er-radius-card: 16px;
    --er-radius-btn: 999px;
    --er-shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.fi-logo img,
.fi-sidebar .fi-logo,
.fi-sidebar-header img {
    max-height: 64px !important;
    width: auto !important;
    border-radius: 12px;
    display: block;
}

.fi-sidebar-header {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

html,
body,
.fi-body {
    font-family: var(--er-font-sans);
}

html:not(.dark),
html:not(.dark) body,
html:not(.dark) .fi-body,
html:not(.dark) .fi-layout {
    background: var(--er-bg-light);
    color: var(--er-text-light);
}

html:not(.dark) .fi-main {
    background: transparent;
}

html:not(.dark) .fi-topbar {
    background: linear-gradient(90deg, hsla(0, 0%, 100%, 0.96), hsla(39, 37%, 93%, 0.98));
    border-bottom: 1px solid var(--er-border-light);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

html:not(.dark) h1,
html:not(.dark) h2,
html:not(.dark) h3,
html:not(.dark) h4,
html:not(.dark) h5,
html:not(.dark) h6,
html:not(.dark) .fi-header-heading,
html:not(.dark) .fi-page-header-heading {
    color: var(--er-text-light) !important;
}

html.dark,
html.dark body,
html.dark .fi-body,
html.dark .fi-layout {
    background: var(--er-bg-dark);
    color: var(--er-text-dark);
}

html.dark .fi-main {
    background: transparent;
}

html.dark .fi-topbar {
    background: linear-gradient(90deg, rgba(20, 20, 24, 0.96), rgba(28, 29, 36, 0.98));
    border-bottom: 1px solid var(--er-border-dark);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

html.dark h1,
html.dark h2,
html.dark h3,
html.dark h4,
html.dark h5,
html.dark h6,
html.dark .fi-header-heading,
html.dark .fi-page-header-heading {
    color: var(--er-text-dark) !important;
}

.fi-card,
.fi-fo-section,
.fi-in-card,
.fi-section,
.fi-ta {
    border-radius: var(--er-radius-card);
    box-shadow: var(--er-shadow-soft);
}

html:not(.dark) .fi-card,
html:not(.dark) .fi-fo-section,
html:not(.dark) .fi-in-card,
html:not(.dark) .fi-section,
html:not(.dark) .fi-ta {
    background: var(--er-surface-light);
    border: 1px solid var(--er-border-light);
    color: var(--er-text-light);
}

html.dark .fi-card,
html.dark .fi-fo-section,
html.dark .fi-in-card,
html.dark .fi-section,
html.dark .fi-ta {
    background: var(--er-surface-dark);
    border: 1px solid var(--er-border-dark);
    color: var(--er-text-dark);
}

.fi-sidebar {
    background: var(--er-sidebar-bg) !important;
    color: var(--er-sidebar-text) !important;
    border-inline-end: 1px solid hsla(0, 0%, 100%, 0.08);
}

.fi-sidebar-header {
    background: transparent !important;
}

.fi-sidebar-nav {
    padding-top: 0.75rem;
}

.fi-sidebar,
.fi-sidebar *,
.fi-sidebar a,
.fi-sidebar button,
.fi-sidebar div,
.fi-sidebar span,
.fi-sidebar svg {
    color: var(--er-sidebar-text) !important;
}

.fi-sidebar-group-label {
    color: var(--er-sidebar-muted) !important;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    font-size: 0.78rem;
    margin-bottom: 0.35rem;
}

.fi-sidebar .fi-sidebar-group-button,
.fi-sidebar .fi-sidebar-item-button,
.fi-sidebar-item a {
    border-radius: 14px;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.fi-sidebar .fi-sidebar-group-button:hover,
.fi-sidebar .fi-sidebar-item-button:hover,
.fi-sidebar-item a:hover {
    background: var(--er-sidebar-hover) !important;
}

.fi-sidebar-item-active .fi-sidebar-item-button,
.fi-sidebar-item-active a {
    background: var(--er-sidebar-active) !important;
    box-shadow: inset 4px 0 0 var(--er-primary-hover);
}

.fi-sidebar .fi-icon-btn svg,
.fi-sidebar .fi-sidebar-group-icon,
.fi-sidebar .fi-sidebar-item-icon {
    color: #fff !important;
    opacity: 1 !important;
}

.fi-sidebar .fi-sidebar-group-button svg:last-child,
.fi-sidebar button[aria-expanded] svg:last-child {
    width: 1.2rem !important;
    height: 1.2rem !important;
    stroke-width: 2.35 !important;
}

html:not(.dark) .fi-ta-table thead th {
    background: #f3ede3;
}

html:not(.dark) .fi-ta-table tbody tr:nth-child(even) {
    background: #fbfaf7;
}

html:not(.dark) .fi-ta-table tbody tr:hover {
    background: #f5ede8;
}

html.dark .fi-ta-table thead th {
    background: hsla(0, 0%, 100%, 0.04);
}

html.dark .fi-ta-table tbody tr:nth-child(even) {
    background: hsla(0, 0%, 100%, 0.015);
}

html.dark .fi-ta-table tbody tr:hover {
    background: hsla(0, 0%, 100%, 0.04);
}

.fi-btn {
    border-radius: var(--er-radius-btn);
}

.er-topbar-user {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-right: 0.5rem;
    white-space: nowrap;
}

.er-topbar-user__text {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.1;
}

.er-topbar-user__name {
    font-size: 0.95rem;
    font-weight: 700;
}

.er-topbar-user__role {
    font-size: 0.75rem;
    opacity: 0.75;
}

html:not(.dark) .er-topbar-user__name,
html:not(.dark) .er-topbar-user__role {
    color: var(--er-text-light);
}

html.dark .er-topbar-user__name,
html.dark .er-topbar-user__role {
    color: var(--er-text-dark);
}

.fi-topbar .fi-dropdown-panel {
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

html:not(.dark) .fi-topbar .fi-dropdown-panel {
    background: #f4f1ec;
    border: 1px solid #d8d2c7;
}

html.dark .fi-topbar .fi-dropdown-panel {
    background: #1d1e24;
    border: 1px solid hsla(0, 0%, 100%, 0.08);
}

@media (max-width: 1024px) {
    .er-topbar-user {
        display: none;
    }
}

@media (max-width: 768px) {
    .fi-sidebar {
        box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
    }
}
/* =========================================================
   TABLEAUX FILAMENT — ACTIONS COMPACTES ET CELLULES LONGUES
   ========================================================= */

.fi-ta-table th:last-child,
.fi-ta-table td:last-child,
.fi-ta-actions-header-cell,
.fi-ta-actions-cell {
    position: sticky !important;
    right: 0 !important;
    z-index: 16 !important;
    background: inherit !important;
    box-shadow: -10px 0 18px rgba(15, 23, 42, 0.08);
}

.fi-ta-table thead th:last-child,
.fi-ta-actions-header-cell {
    z-index: 24 !important;
}

html:not(.dark) .fi-ta-table th:last-child,
html:not(.dark) .fi-ta-table td:last-child,
html:not(.dark) .fi-ta-actions-header-cell,
html:not(.dark) .fi-ta-actions-cell {
    background: #ffffff !important;
}

html:not(.dark) .fi-ta-table tbody tr:nth-child(even) td:last-child,
html:not(.dark) .fi-ta-table tbody tr:nth-child(even) .fi-ta-actions-cell {
    background: #fbfaf7 !important;
}

html:not(.dark) .fi-ta-table tbody tr:hover td:last-child,
html:not(.dark) .fi-ta-table tbody tr:hover .fi-ta-actions-cell {
    background: #f5ede8 !important;
}

html.dark .fi-ta-table th:last-child,
html.dark .fi-ta-table td:last-child,
html.dark .fi-ta-actions-header-cell,
html.dark .fi-ta-actions-cell {
    background: #18181b !important;
}

.er-table-cell-clamp-2,
.er-table-cell-clamp-2 .fi-ta-text,
.er-table-cell-clamp-2 .fi-ta-text-item,
.er-table-cell-clamp-2 .fi-ta-text-item-label {
    max-width: 100%;
}

.er-table-cell-clamp-2 .fi-ta-text-item-label,
.er-table-cell-clamp-2 > div,
.er-table-cell-clamp-2 span:not(.fi-badge) {
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.35;
}

.er-table-action-icon.fi-icon-btn,
.er-table-action-icon .fi-icon-btn,
.er-table-action-icon.fi-btn,
.er-table-action-icon .fi-btn,
.er-table-action-icon a,
.er-table-action-icon button {
    width: 2.25rem !important;
    height: 2.25rem !important;
    min-width: 2.25rem !important;
    border-radius: 0.7rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12) !important;
    border: 0 !important;
}

.er-table-action-icon svg,
.er-table-action-icon .fi-icon-btn svg,
.er-table-action-icon .fi-btn svg {
    width: 1.18rem !important;
    height: 1.18rem !important;
    stroke-width: 2.25 !important;
}

.er-table-action-view.fi-icon-btn,
.er-table-action-view .fi-icon-btn,
.er-table-action-view.fi-btn,
.er-table-action-view .fi-btn,
.er-table-action-view a,
.er-table-action-view button {
    background: #e11d48 !important;
    color: #ffffff !important;
}

.er-table-action-edit.fi-icon-btn,
.er-table-action-edit .fi-icon-btn,
.er-table-action-edit.fi-btn,
.er-table-action-edit .fi-btn,
.er-table-action-edit a,
.er-table-action-edit button {
    background: #1f2937 !important;
    color: #ffffff !important;
}

.er-table-action-delete.fi-icon-btn,
.er-table-action-delete .fi-icon-btn,
.er-table-action-delete.fi-btn,
.er-table-action-delete .fi-btn,
.er-table-action-delete a,
.er-table-action-delete button {
    background: #6b7280 !important;
    color: #ffffff !important;
}

.er-table-action-pill.fi-btn,
.er-table-action-pill .fi-btn,
.er-table-action-pill a,
.er-table-action-pill button {
    min-height: 2.2rem !important;
    border-radius: 0.7rem !important;
    padding: 0.48rem 0.72rem !important;
    gap: 0.35rem !important;
    font-size: 0.78rem !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.10) !important;
    border: 0 !important;
}

.er-table-action-pill svg,
.er-table-action-pill .fi-btn svg {
    width: 1rem !important;
    height: 1rem !important;
    stroke-width: 2.35 !important;
}


.er-table-action-green.fi-icon-btn,
.er-table-action-green .fi-icon-btn,
.er-table-action-green.fi-btn,
.er-table-action-green .fi-btn,
.er-table-action-green a,
.er-table-action-green button {
    background: #16a34a !important;
    color: #ffffff !important;
}
.er-table-action-orange.fi-icon-btn,
.er-table-action-orange .fi-icon-btn,
.er-table-action-orange.fi-btn,
.er-table-action-orange .fi-btn,
.er-table-action-orange a,
.er-table-action-orange button {
    background: #f97316 !important;
    color: #ffffff !important;
}


.er-table-action-icon:hover,
.er-table-action-icon .fi-icon-btn:hover,
.er-table-action-pill:hover,
.er-table-action-pill .fi-btn:hover {
    filter: brightness(0.96);
    transform: translateY(-1px);
}

.fi-ta-actions,
.fi-ta-actions-cell > div,
.fi-ta-actions-cell .fi-ta-actions {
    gap: 0.85rem !important;
    column-gap: 0.85rem !important;
    row-gap: 0.55rem !important;
    align-items: center !important;
}

.fi-ta-actions .fi-icon-btn,
.fi-ta-actions-cell .fi-icon-btn,
.fi-ta-actions .fi-btn,
.fi-ta-actions-cell .fi-btn {
    margin-inline: 0.08rem !important;
}							 
@media (max-width: 768px) {
    .er-table-action-pill.fi-btn,
    .er-table-action-pill .fi-btn,
    .er-table-action-pill a,
    .er-table-action-pill button {
        padding-inline: 0.55rem !important;
        font-size: 0.74rem !important;
    }
}

/* EasyRallye — badges tâches : statuts, priorités, types et mises à jour */
.er-task-badge,
.er-task-updates-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.5rem;
    padding: 0.2rem 0.55rem;
    border-radius: 0.45rem;
    border: 1px solid transparent;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
}

.er-task-badge--type-gray {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #374151;
}

.er-task-badge--status-new {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #b91c1c;
}

.er-task-badge--status-planned {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.er-task-badge--status-in-progress {
    background: #fde047;
    border-color: #eab308;
    color: #713f12;
}

.er-task-badge--status-validation {
    background: #dcfce7;
    border-color: #86efac;
    color: #15803d;
}

.er-task-badge--status-waiting {
    background: #111827;
    border-color: #030712;
    color: #ffffff;
}

.er-task-badge--status-review {
    background: #ffedd5;
    border-color: #fb923c;
    color: #c2410c;
}

.er-task-badge--status-done {
    background: #14532d;
    border-color: #052e16;
    color: #ffffff;
}

.er-task-badge--priority-high {
    background: #fb923c;
    border-color: #ea580c;
    color: #7c2d12;
}

.er-task-badge--priority-blocking {
    background: #dc2626;
    border-color: #991b1b;
    color: #ffffff;
}

.er-task-badge--priority-normal {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.er-task-badge--priority-low {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #6b7280;
}

.er-task-updates-badge {
    background: #ffe4e6;
    border-color: #fecdd3;
    color: #e11d48;
}

.er-task-updates-badge--unread {
    background: #e11d48;
    border-color: #be123c;
    color: #ffffff;
    box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.14);
}

html.dark .er-task-badge--type-gray,
html.dark .er-task-badge--priority-low {
    background: #374151;
    border-color: #4b5563;
    color: #e5e7eb;
}																				 