/* ========== Checklist ========== */

.checklist-group {
    margin-bottom: 16px;
}

.checklist-group-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(42, 42, 58, 0.5);
}

.checklist-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}

.checklist-item.checked label {
    color: var(--text-muted);
    text-decoration: line-through;
}

.checklist-item label {
    font-size: 0.9rem;
    cursor: pointer;
    flex: 1;
}

.checklist-item .required {
    color: var(--warning);
    font-size: 0.75rem;
    font-weight: 600;
}

.checklist-item.important {
    background: rgba(255, 170, 0, 0.1);
    border-left: 3px solid #ffaa00;
    padding-left: 8px;
    border-radius: 0;
}

.checklist-item.important label {
    color: #ffaa00;
    font-weight: 600;
}

.checklist-item.important.checked label {
    color: var(--text-muted);
}

.checklist-item.critical {
    background: rgba(220, 40, 40, 0.1);
    border-left: 3px solid #dc2828;
    padding-left: 8px;
    border-radius: 0;
}

.checklist-item.critical label {
    color: #dc2828;
    font-weight: 600;
}

.checklist-item.critical.checked label {
    color: var(--text-muted);
}

.checklist-progress {
    margin-bottom: 16px;
}

.checklist-progress-bar {
    height: 8px;
    background: var(--bg-card);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}

.checklist-progress-fill {
    height: 100%;
    background: linear-gradient(to right, var(--accent), var(--success));
    border-radius: 3px;
    transition: width 0.3s;
}

.checklist-progress-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.checklist-empty {
    text-align: center;
    padding: 48px 24px;
    background: var(--bg-input);
    border: 1px dashed var(--border-subtle);
    border-radius: var(--radius-md);
    margin-top: 16px;
}
.checklist-empty p {
    color: var(--text-muted);
    margin: 0 0 16px 0;
    font-size: 0.9rem;
}

.gear-empty {
    text-align: center;
    padding: 48px 24px;
    background: var(--bg-input);
    border: 1px dashed var(--border-subtle);
    border-radius: var(--radius-md);
    margin: 16px 0;
}
.gear-empty p {
    color: var(--text-primary);
    margin: 0 0 8px 0;
    font-size: 0.95rem;
    line-height: 1.5;
}
.gear-empty .gear-empty-sub {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 8px;
}

.checklist-group-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
}

.checklist-group.done .checklist-group-title {
    color: #4caf50;
}

/* ---- Mode édition checklist ---- */

.checklist-edit-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.checklist-edit-section-title {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 6px 10px;
    outline: none;
}

.checklist-edit-section-title:focus {
    border-color: var(--accent);
}

.checklist-edit-btns {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

.btn-icon-sm {
    background: none;
    border: 1px solid var(--border-subtle);
    border-radius: 3px;
    color: var(--text-secondary);
    font-size: 0.7rem;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}

.btn-icon-sm:hover {
    background: var(--accent-bg-strong);
    color: var(--accent);
}

.cl-delete-section:hover,
.cl-delete-item:hover {
    background: rgba(217, 74, 74, 0.15) !important;
    color: var(--danger) !important;
}

.checklist-edit-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px !important;
}

.checklist-edit-label {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.82rem;
    padding: 6px 10px;
    outline: none;
    min-width: 0;
}

.checklist-edit-label:focus {
    border-color: var(--accent);
}

.cl-flag-cycle {
    background: none;
    border: 1px solid var(--border-subtle);
    border-radius: 3px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    opacity: 0.4;
    flex-shrink: 0;
    transition: opacity 0.15s;
}
.cl-flag-cycle:hover { opacity: 0.7; }
.cl-flag-cycle.state-critical {
    opacity: 1;
    color: var(--danger);
    background: rgba(217, 74, 74, 0.15);
    border-color: var(--danger);
}
.cl-flag-cycle.state-important {
    opacity: 1;
    color: var(--warning);
    background: rgba(217, 168, 74, 0.15);
    border-color: var(--warning);
}

.cl-arrows {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex-shrink: 0;
}
.cl-arrows .btn-icon-sm {
    width: 28px;
    height: 22px;
    font-size: 0.65rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cl-arrow-placeholder {
    width: 24px;
    height: 14px;
    display: block;
}

.cl-flag {
    background: none;
    border: 1px solid var(--border-subtle);
    border-radius: 3px;
    font-size: 0.75rem;
    width: 28px;
    height: 28px;
    cursor: pointer;
    opacity: 0.3;
    transition: opacity 0.15s;
}

.cl-flag:hover {
    opacity: 0.7;
}

.cl-flag.active {
    opacity: 1;
}

.cl-flag-critical {
    color: var(--danger);
}

.cl-flag-critical.active {
    background: rgba(217, 74, 74, 0.15);
    border-color: var(--danger);
}

.cl-flag-important {
    color: var(--warning);
}

.cl-flag-important.active {
    background: rgba(217, 168, 74, 0.15);
    border-color: var(--warning);
}

.cl-add-item {
    margin: 4px 0 0;
    font-size: 0.8rem !important;
    padding: 6px 12px !important;
    width: 100%;
}

#checklist-edit-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    margin-top: 4px;
}

.checklist-edit-hint {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-style: italic;
    text-align: center;
    padding: var(--space-4) var(--space-3);
    margin: 0;
}

#checklist-add-section {
    width: 100%;
}

#checklist-edit-toggle {
    font-size: 1.2rem;
    padding: 4px 8px;
}

#gear-edit-toggle,
#checklist-edit-toggle {
    border-radius: var(--radius);
    transition: background 0.15s;
}

#gear-edit-toggle:hover,
#checklist-edit-toggle:hover {
    background: rgba(138, 104, 255, 0.08);
}

.checklist-legend {
    background: rgba(138, 104, 255, 0.06);
    border: 1px solid rgba(138, 104, 255, 0.2);
    border-radius: var(--radius);
    padding: var(--space-3);
    font-size: 0.82rem;
}

.checklist-legend-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: 4px;
}

.checklist-legend-title {
    color: var(--text-secondary);
    font-weight: 500;
}

.cl-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 100px;
    justify-content: flex-start;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.2;
    box-sizing: border-box;
}

.cl-legend-icon {
    display: inline-block;
    width: 1.1em;
    text-align: center;
    font-size: 0.95rem;
    line-height: 1;
}

.cl-legend-critical {
    background: rgba(231, 76, 60, 0.12);
    color: var(--danger);
    border: 1px solid rgba(231, 76, 60, 0.35);
}

.cl-legend-important {
    background: rgba(217, 168, 74, 0.12);
    color: var(--warning);
    border: 1px solid rgba(217, 168, 74, 0.35);
}

.checklist-legend-hint {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-style: italic;
}

.checklist-restore-btn {
    width: 100%;
    background: rgba(217, 168, 74, 0.1);
    color: var(--warning);
    border: 1px solid var(--warning);
    font-weight: 500;
}

.checklist-restore-btn:hover {
    background: rgba(217, 168, 74, 0.2);
}

.btn-link {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.82rem;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    padding: 4px 8px;
    font-family: inherit;
}

.btn-link:hover {
    color: var(--accent);
}

.checklist-progress-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-2);
    margin-top: 4px;
    flex-wrap: wrap;
}

#cl-new-session {
    font-size: 0.78rem;
}
