/* Agenda — calendrier équipe */

.agenda-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
    align-items: start;
}

@media (max-width: 960px) {
    .agenda-workspace {
        grid-template-columns: 1fr;
    }
}

.agenda-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.agenda-toolbar-left,
.agenda-toolbar-right {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.agenda-month-label {
    font-size: 1.15rem;
    font-weight: 650;
    color: #111827;
    min-width: 160px;
}

.agenda-btn {
    border: 1px solid #d1d5db;
    background: #fff;
    color: #111827;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.875rem;
    cursor: pointer;
}

.agenda-btn:hover {
    background: #f3f4f6;
}

.agenda-btn-primary {
    background: #111827;
    color: #fff;
    border-color: #111827;
}

.agenda-btn-primary:hover {
    background: #374151;
}

.agenda-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.agenda-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #fff;
    font-size: 0.8rem;
    cursor: pointer;
}

.agenda-filter-chip input {
    accent-color: #111827;
}

.agenda-calendar {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.agenda-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.agenda-weekday {
    padding: 8px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
}

.agenda-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.agenda-day {
    min-height: 92px;
    border-right: 1px solid #f3f4f6;
    border-bottom: 1px solid #f3f4f6;
    padding: 6px;
    vertical-align: top;
}

.agenda-day:nth-child(7n) {
    border-right: none;
}

.agenda-day.is-outside {
    background: #fafafa;
    opacity: 0.65;
}

.agenda-day.is-today .agenda-day-num {
    background: #111827;
    color: #fff;
}

.agenda-range {
    height: 10px;
    margin: 2px 0 4px;
    background: var(--range-color, #6366f1);
    opacity: 0.9;
    border-radius: 0;
}

.agenda-range.is-start::after {
    content: attr(data-label);
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    color: #4338ca;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.agenda-range:not(.is-start)::after {
    content: attr(data-label);
    display: block;
    font-size: 0.55rem;
    color: #6366f1;
    margin-top: 1px;
    line-height: 1;
    opacity: 0.75;
}

.agenda-range.is-start {
    border-radius: 4px 0 0 4px;
    margin-left: 2px;
    position: relative;
}

.agenda-range.is-end {
    border-radius: 0 4px 4px 0;
    margin-right: 2px;
}

.agenda-range.is-single {
    border-radius: 4px;
}

.agenda-range:not(.is-start) {
    margin-left: -1px;
    margin-right: -1px;
}

.agenda-day-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.agenda-event {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    border-radius: 4px;
    padding: 3px 6px;
    margin-bottom: 3px;
    font-size: 0.7rem;
    line-height: 1.25;
    color: #111827;
    cursor: pointer;
    background: #e5e7eb;
}

.agenda-event:hover {
    filter: brightness(0.95);
}

.agenda-side {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    padding: 14px;
}

.agenda-side h3 {
    margin: 0 0 10px;
    font-size: 0.95rem;
}

.agenda-upcoming {
    list-style: none;
    margin: 0;
    padding: 0;
}

.agenda-upcoming li {
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.82rem;
}

.agenda-upcoming li:last-child {
    border-bottom: none;
}

.agenda-upcoming-kind {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 2px;
}

.agenda-form {
    margin-top: 16px;
    display: grid;
    gap: 8px;
}

.agenda-form label {
    font-size: 0.8rem;
    color: #374151;
    display: grid;
    gap: 4px;
}

.agenda-form input,
.agenda-form textarea,
.agenda-form select {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 0.875rem;
}

.agenda-form textarea {
    min-height: 72px;
    resize: vertical;
}

.agenda-status {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 8px;
}

.agenda-status.is-error {
    color: #b91c1c;
}

.agenda-status.is-ok {
    color: #047857;
}

/* Timeline Gantt — une ligne par commission */

.agenda-build-timeline {
    margin-bottom: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: linear-gradient(180deg, #fafbff 0%, #fff 100%);
    padding: 12px 14px 10px;
}

.agenda-build-timeline-head {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.8rem;
    color: #6b7280;
}

.agenda-build-timeline-head strong {
    color: #111827;
    font-size: 0.9rem;
}

.agenda-build-clear {
    margin-left: auto;
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.75rem;
    cursor: pointer;
}

.agenda-build-axis {
    display: flex;
    margin-left: 156px;
    margin-right: 116px;
    gap: 0;
    margin-bottom: 4px;
}

.agenda-build-axis-day {
    flex: 1;
    text-align: center;
    font-size: 0.62rem;
    color: #9ca3af;
}

.agenda-build-axis-day.is-today {
    color: #111827;
    font-weight: 700;
}

.agenda-build-rows {
    display: grid;
    gap: 6px;
}

.agenda-build-row {
    display: grid;
    grid-template-columns: 12px 132px minmax(0, 1fr) 108px;
    gap: 8px;
    align-items: center;
    width: 100%;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    padding: 4px 6px;
    cursor: pointer;
    text-align: left;
}

.agenda-build-row:hover {
    background: #f8fafc;
    border-color: #e5e7eb;
}

.agenda-build-row.is-focused {
    background: #f5f3ff;
    border-color: #c4b5fd;
    box-shadow: 0 0 0 1px #ddd6fe inset;
}

.agenda-build-row.is-dimmed {
    opacity: 0.38;
}

.agenda-build-row-swatch,
.agenda-build-legend-swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.agenda-build-row-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agenda-build-row-track {
    position: relative;
    height: 22px;
    background: #f3f4f6;
    border-radius: 6px;
    overflow: hidden;
}

.agenda-build-bar {
    position: absolute;
    top: 3px;
    bottom: 3px;
    border-radius: 4px;
    min-width: 4px;
    display: flex;
    align-items: center;
    padding: 0 6px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.agenda-build-bar-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

.agenda-build-today-marker {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #111827;
    opacity: 0.35;
    transform: translateX(-1px);
    pointer-events: none;
}

.agenda-build-row-range {
    font-size: 0.72rem;
    color: #6b7280;
    white-space: nowrap;
}

.agenda-build-legend-wrap h3 {
    margin-bottom: 4px;
}

.agenda-build-legend-hint {
    margin: 0 0 10px;
    font-size: 0.72rem;
    color: #9ca3af;
}

.agenda-build-legend {
    display: grid;
    gap: 6px;
    margin-bottom: 14px;
}

.agenda-build-legend-item {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    padding: 8px 10px;
    cursor: pointer;
    text-align: left;
}

.agenda-build-legend-item:hover {
    background: #f9fafb;
}

.agenda-build-legend-item.is-focused {
    border-color: #a78bfa;
    background: #f5f3ff;
}

.agenda-build-legend-item.is-dimmed {
    opacity: 0.4;
}

.agenda-build-legend-body {
    display: grid;
    gap: 2px;
    font-size: 0.78rem;
    min-width: 0;
}

.agenda-build-legend-body strong {
    font-size: 0.82rem;
    color: #111827;
}

.agenda-build-legend-body span {
    color: #6b7280;
}

.agenda-build-legend-sub {
    color: #4b5563 !important;
}

.agenda-build-detail-card {
    border: 1px solid #e5e7eb;
    border-left-width: 4px;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 14px;
    background: #fafafa;
}

.agenda-build-detail-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: flex-start;
}

.agenda-build-detail-head strong {
    font-size: 0.9rem;
}

.agenda-build-detail-close {
    border: none;
    background: transparent;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    color: #6b7280;
}

.agenda-build-detail-meta {
    font-size: 0.78rem;
    color: #4b5563;
    margin-top: 4px;
}

.agenda-day-build-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-bottom: 5px;
    min-height: 8px;
}

.agenda-day-build-tick {
    flex: 1 1 8px;
    min-width: 8px;
    max-width: 100%;
    height: 6px;
    border: none;
    border-radius: 3px;
    padding: 0;
    cursor: pointer;
}

.agenda-day-build-tick.is-focused {
    height: 8px;
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px currentColor;
}

.agenda-day-build-tick.is-dimmed {
    opacity: 0.25;
}

.agenda-upcoming-swatch {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    margin-right: 6px;
    vertical-align: middle;
}

@media (max-width: 960px) {
    .agenda-build-row {
        grid-template-columns: 12px 1fr;
        grid-template-rows: auto auto;
    }

    .agenda-build-row-name {
        grid-column: 2;
    }

    .agenda-build-row-track {
        grid-column: 1 / -1;
    }

    .agenda-build-row-range {
        grid-column: 1 / -1;
        padding-left: 20px;
    }

    .agenda-build-axis {
        margin-left: 0;
        margin-right: 0;
    }
}
