/* Dashboard Projets — styles */

:root {
    --sidebar-w: 240px;
}

/* ===== Reset & base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
    font-size: 15px;
    color: #1a1a2e;
    background: #f0f2f5;
    min-height: 100vh;
}

a {
    color: #4361ee;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ===== Flash messages ===== */
.flash-messages {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 380px;
}

.flash {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    animation: slideIn 0.25s ease;
}

.flash-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

.flash-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.flash-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

.flash-warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

/* ===== Auth pages ===== */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-card {
    background: #fff;
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.auth-card--wide {
    max-width: 560px;
}

.auth-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1a1a2e;
    text-align: center;
    margin-bottom: 0.4rem;
}

.auth-subtitle {
    font-size: 0.9rem;
    color: #6b7280;
    text-align: center;
    margin-bottom: 2rem;
    line-height: 1.5;
}
.auth-step-hint {
    font-size: 0.78rem;
    color: #9ca3af;
    text-align: center;
    margin-top: 1.5rem;
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.4rem;
}

.form-control {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #1a1a2e;
    background: #fafafa;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.form-control:focus {
    border-color: #4361ee;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
    background: #fff;
}

.form-control-otp {
    text-align: center;
    font-size: 1.6rem;
    letter-spacing: 0.4em;
    font-variant-numeric: tabular-nums;
}

.field-error {
    display: block;
    font-size: 0.8rem;
    color: #ef4444;
    margin-top: 0.3rem;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1.25rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: #4361ee;
    color: #fff;
}

.btn-primary:hover {
    background: #3451d1;
}

.btn-full {
    width: 100%;
    margin-top: 0.5rem;
}

/* ===== Auth footer ===== */
.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

/* ===== TOTP setup ===== */
.totp-setup {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.totp-qr img {
    border-radius: 8px;
    border: 3px solid #e5e7eb;
    display: block;
}

.totp-manual {
    text-align: center;
}

.totp-manual-label {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 0.4rem;
}

.totp-secret {
    display: inline-block;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.4rem 0.75rem;
    font-size: 0.95rem;
    letter-spacing: 0.1em;
    color: #374151;
    word-break: break-all;
}

/* ===== App layout ===== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: linear-gradient(175deg, #111f38 0%, #0d1426 50%, #111f38 100%);
    color: #cbd5e1;
    font-family: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 200;
    transition: transform 0.25s ease;
    border-radius: 0 18px 18px 0;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        4px 0 32px rgba(0, 0, 0, 0.6);
}

.sidebar-orb {
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    z-index: 0;
}
.sidebar-orb--teal {
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(45, 212, 191, 0.15) 0%, transparent 65%);
    top: -80px;
    right: -80px;
}
.sidebar-orb--indigo {
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, transparent 65%);
    bottom: 140px;
    left: -50px;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 1.2rem 1rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    z-index: 10;
}

/* App switcher */
.app-switcher-btn {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex: 1;
    min-width: 0;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.3rem 0.4rem;
    border-radius: 10px;
    color: #cbd5e1;
    transition: background 0.2s;
}

.app-switcher-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.app-switcher-grid-icon {
    flex-shrink: 0;
    color: #94a3b8;
}

.app-switcher-app-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #2dd4bf 0%, #6366f1 100%);
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 4px 14px rgba(45, 212, 191, 0.3);
}

.app-switcher-titles {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.05rem;
}

.app-switcher-sub {
    font-size: 0.65rem;
    color: #64748b;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.app-switcher-label {
    font-family: 'Syne', sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    color: #e2e8f0;
    text-align: left;
    letter-spacing: 0.01em;
}

.app-switcher-chevron {
    flex-shrink: 0;
    color: #64748b;
    transition: transform 0.2s;
}

.app-switcher-popup.is-open ~ * .app-switcher-chevron,
#appSwitcherPopup.is-open + * .app-switcher-chevron { transform: rotate(180deg); }

.app-switcher-btn[aria-expanded="true"] .app-switcher-chevron { transform: rotate(180deg); }

.app-switcher-popup {
    display: none;
    position: fixed;
    background: #0b1628;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    padding: 0.35rem;
    min-width: 180px;
}

.app-switcher-popup.is-open {
    display: block;
}

.app-switcher-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.65rem;
    border-radius: 7px;
    color: #94a3b8;
    text-decoration: none;
    transition: background 0.13s, color 0.13s;
}

.app-switcher-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #f1f5f9;
    text-decoration: none;
}

.app-switcher-item.is-active {
    background: linear-gradient(135deg, rgba(45, 212, 191, 0.12), rgba(99, 102, 241, 0.12));
    color: #f1f5f9;
}

.app-switcher-item-icon {
    font-size: 1rem;
    line-height: 1;
    flex-shrink: 0;
}
.app-switcher-app-icon--logo {
    background: rgba(255, 255, 255, 0.07);
    box-shadow: none;
    padding: 4px;
    overflow: hidden;
}
.app-switcher-app-icon .app-switcher-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 7px;
    display: block;
}
.app-switcher-item-icon .app-switcher-logo-img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    border-radius: 4px;
    display: block;
}

.app-switcher-item-name {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 500;
}

.app-switcher-check {
    color: #2dd4bf;
    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
}

.sidebar-brand:hover { text-decoration: none; }

.sidebar-brand-icon {
    width: 35px;
    height: 35px;
    flex-shrink: 0;
    object-fit: contain;
    border-radius: 6px;
}

.sidebar-brand-text {
    font-weight: 700;
    font-size: 1.05rem;
    color: #f1f5f9;
}

/* Sidebar nav */
.sidebar-nav {
    flex: 1;
    padding: 16px 14px 0;
    overflow-y: auto;
    position: relative;
    z-index: 1;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 1rem;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.sidebar-nav-link:hover {
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.05);
    text-decoration: none;
}

.sidebar-nav-link.is-active {
    color: #f1f5f9;
    border-left-color: #4361ee;
    background: rgba(67, 97, 238, 0.12);
}

.sidebar-nav-icon {
    font-size: 1rem;
    width: 1.1rem;
    text-align: center;
    flex-shrink: 0;
}

/* Bouton Nouveau projet + Accueil */
.sidebar-new-project-wrap {
    padding: 0 0 22px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-home-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: #64748b;
    text-decoration: none;
    transition: all 0.25s;
}

.sidebar-home-btn:hover {
    border-color: rgba(45, 212, 191, 0.3);
    color: #2dd4bf;
    box-shadow: 0 0 16px rgba(45, 212, 191, 0.12);
    text-decoration: none;
}

.sidebar-new-project-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    flex: 1;
    height: 42px;
    padding: 0 0.75rem;
    background: linear-gradient(135deg, rgba(45, 212, 191, 0.12), rgba(99, 102, 241, 0.12));
    color: #5eead4;
    border: 1px solid rgba(45, 212, 191, 0.25);
    border-radius: 12px;
    font-family: 'Figtree', sans-serif;
    font-size: 0.83rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.01em;
    transition: all 0.25s;
}

.sidebar-new-project-btn:hover {
    background: linear-gradient(135deg, rgba(45, 212, 191, 0.22), rgba(99, 102, 241, 0.22));
    box-shadow: 0 0 20px rgba(45, 212, 191, 0.12);
}

.sidebar-new-project-btn:active {
    background: linear-gradient(135deg, rgba(45, 212, 191, 0.3), rgba(99, 102, 241, 0.3));
}

/* Sidebar sections */
.sidebar-section {
    margin-top: 1.25rem;
}

.sidebar-section-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0 4px 10px;
    margin-top: 4px;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.15s;
}

.sidebar-section-btn:hover .sidebar-section-label { color: #94a3b8; }

.sidebar-section-arrow {
    font-size: 7px;
    color: #334155;
    transition: transform 0.2s ease;
    display: inline-block;
    flex-shrink: 0;
    margin-right: 4px;
}

.sidebar-section-btn[aria-expanded="true"] .sidebar-section-arrow {
    transform: rotate(90deg);
}

.sidebar-section-label {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #64748b;
}

.sidebar-section-count {
    background: linear-gradient(135deg, rgba(45, 212, 191, 0.2), rgba(99, 102, 241, 0.2));
    border: 1px solid rgba(45, 212, 191, 0.2);
    border-radius: 20px;
    font-size: 10px;
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    padding: 2px 7px;
    color: #2dd4bf;
    flex-shrink: 0;
}

.sidebar-section-items {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.25s ease;
}

.sidebar-section-items.is-open {
    max-height: 600px;
}

.sidebar-project-link {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 11px 13px;
    cursor: grab;
    color: #94a3b8;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
    margin: 0 0.5rem 8px;
    border-radius: 12px;
    transition: all 0.2s;
}

.sidebar-project-link:hover {
    color: #e2e8f0;
    background: rgba(45, 212, 191, 0.05);
    border-color: rgba(45, 212, 191, 0.15);
    transform: translateX(3px);
    text-decoration: none;
}

.sidebar-project-link.is-active {
    background: rgba(45, 212, 191, 0.07);
    border-color: rgba(45, 212, 191, 0.55);
    box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.2), 0 0 12px rgba(45, 212, 191, 0.12);
}

.sidebar-project-link.is-active .sidebar-project-name {
    color: #e2e8f0;
}
.sidebar-drag-ghost {
    opacity: 0.4;
}
.sidebar-drag-chosen {
    cursor: grabbing;
    background: rgba(255, 255, 255, 0.1) !important;
}

.sidebar-project-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 8px;
}

.sidebar-project-name {
    font-size: 12.5px;
    font-weight: 500;
    color: #cbd5e1;
    line-height: 1.35;
    word-break: break-word;
}

.sidebar-project-track {
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 1px;
    overflow: hidden;
}

.sidebar-project-fill {
    height: 100%;
    background: linear-gradient(90deg, #2dd4bf, #6366f1);
    border-radius: 1px;
    transition: width 0.3s ease;
}

.sidebar-project-link.is-active .sidebar-project-fill {
    background: linear-gradient(90deg, #2dd4bf, #6366f1);
    box-shadow: 0 0 8px rgba(45, 212, 191, 0.4);
}

.sidebar-project-fill.is-done {
    background: #5eead4;
    box-shadow: none;
}

.sidebar-project-pct {
    font-size: 10px;
    font-family: 'Space Mono', monospace;
    color: #94a3b8;
    flex-shrink: 0;
    margin-left: 6px;
    text-align: right;
}

.sidebar-project-link.is-active .sidebar-project-pct {
    color: #2dd4bf;
}

.sidebar-project-link.is-done .sidebar-project-pct {
    color: #14b8a6;
}

.sidebar-empty {
    display: block;
    padding: 0.35rem 1rem 0.35rem 2.1rem;
    color: #7c8fa6;
    font-size: 0.8rem;
    font-style: italic;
}

/* Sidebar footer */
.sidebar-footer {
    padding: 0.9rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    z-index: 1;
    background: rgba(8, 13, 28, 0.85);
    backdrop-filter: blur(10px);
}

/* Avatar picker */
.avatar-picker {
    position: absolute;
    bottom: calc(100% + 0.4rem);
    left: 0.75rem;
    background: #0b1628;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 0.5rem;
    display: none;
    box-shadow: 0 -8px 32px rgba(0,0,0,0.6);
    z-index: 200;
}
.avatar-picker.is-open { display: block; }

.avatar-picker-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.2rem;
}

.avatar-option {
    width: 36px;
    height: 36px;
    border-radius: 7px;
    border: 2px solid transparent;
    background: transparent;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s;
}
.avatar-option:hover { background: rgba(255,255,255,0.1); }
.avatar-option.is-selected { border-color: #2dd4bf; background: rgba(45,212,191,0.15); }

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 0.55rem 0.7rem;
}

.sidebar-user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #2dd4bf, #6366f1);
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    cursor: pointer;
    transition: box-shadow 0.15s;
    box-shadow: 0 4px 12px rgba(45, 212, 191, 0.3);
}
.sidebar-user-avatar:hover {
    box-shadow: 0 4px 16px rgba(45, 212, 191, 0.5);
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 13px;
    font-weight: 500;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.sidebar-actions {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    flex-shrink: 0;
}

.sidebar-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.sidebar-action-btn:hover {
    background: rgba(45, 212, 191, 0.1);
    color: #2dd4bf;
    text-decoration: none;
}

/* Sidebar resize handle */
.sidebar-resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    height: 100%;
    cursor: col-resize;
    z-index: 200;
    background: transparent;
    transition: background 0.15s;
}

.sidebar-resize-handle:hover,
.sidebar-resize-handle.is-resizing {
    background: rgba(45, 212, 191, 0.3);
}

/* ===== Main wrapper & topbar ===== */
.main-wrapper {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
}

.topbar {
    height: 52px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 0.75rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
}

.topbar-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: #6b7280;
    border-radius: 1px;
}

.topbar-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #1a1a2e;
    flex: 1;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.main-content {
    flex: 1;
    padding: 1.75rem 2rem;
}

/* ===== Mobile overlay ===== */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 150;
}

.sidebar-overlay.is-visible {
    display: block;
}

/* ===== Status badges ===== */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
    font-size: 0.74rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.status-not-started  { background: #f1f5f9; color: #64748b; }
.status-in-progress  { background: #dbeafe; color: #1d4ed8; }
.status-in-cours     { background: #dbeafe; color: #1d4ed8; }
.status-on-hold      { background: #fef3c7; color: #92400e; }
.status-completed    { background: #d1fae5; color: #065f46; }
.status-archived     { background: #f1f5f9; color: #475569; }
.status-todo         { background: #f1f5f9; color: #6b7280; }
.status-waiting      { background: #fef3c7; color: #92400e; }
.status-planned      { background: #ede9fe; color: #5b21b6; }
.status-done         { background: #d1fae5; color: #065f46; }
.status-overdue      { background: #fee2e2; color: #991b1b; }

.todo-status-badge   { align-self: flex-start; }

/* ===== Buttons (extensions) ===== */
.btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.825rem;
}

.btn-secondary {
    background: #f1f5f9;
    color: #374151;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

/* ===== Card ===== */
.card {
    background: #fff;
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    border: 1px solid #e5e7eb;
}

#homeTodoCard,
#homeAgendaCard {
    border-top: 3px solid #2dd4bf;
}

/* ===== Section header ===== */
.section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1a1a2e;
}

.section-subtitle {
    font-size: 0.78rem;
    color: #9ca3af;
    margin-top: 0.1rem;
}

/* ===== Progress bar ===== */
.progress-bar {
    height: 5px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    margin: 0.75rem 0 0.4rem;
}

.progress-fill {
    height: 100%;
    border-radius: 3px;
    background: #4361ee;
    transition: width 0.4s ease;
}

.progress-fill.is-done {
    background: #10b981;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #9ca3af;
}

/* ===== Spacing utility ===== */
.mb-section {
    margin-bottom: 1.5rem;
}

/* ===== Section separator ===== */
.section-sep {
    border: none;
    border-top: 1px solid #cbd5e1;
    margin: 0 0 1.75rem;
}

/* ===== Home brand header ===== */
.home-brand-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem 0 1rem;
    margin-bottom: 0.5rem;
}

.home-brand-logo {
    width: 38px;
    height: 38px;
    object-fit: contain;
    border-radius: 8px;
    flex-shrink: 0;
}

.home-brand-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.02em;
}

@media (min-width: 769px) {
    .home-brand-header { width: 90%; margin-left: auto; margin-right: auto; }
}

/* ===== Bouton Dates clés ===== */
.btn-key-dates {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #dc2626;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    border-radius: 5px;
    transition: background 0.15s;
    line-height: 1.4;
}
.btn-key-dates:hover { background: #fef2f2; }

/* ===== Modale Dates clés ===== */
.key-dates-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 820;
}
.key-dates-overlay.is-visible { display: block; }

.key-dates-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.96);
    width: 500px;
    max-width: calc(100vw - 2rem);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    z-index: 821;
    display: flex;
    flex-direction: column;
    max-height: 72vh;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s, transform 0.15s;
}
.key-dates-modal.is-open {
    opacity: 1;
    pointer-events: all;
    transform: translate(-50%, -50%) scale(1);
}
.key-dates-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.25rem 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
    gap: 0.5rem;
}
.key-dates-modal-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1a1a2e;
}
.key-dates-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #6b7280;
    font-size: 1rem;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    transition: background 0.1s;
    line-height: 1;
}
.key-dates-close:hover { background: #f1f5f9; }

.key-dates-body {
    overflow-y: auto;
    flex: 1;
    padding: 0.4rem 0;
}
.keydate-header-add-btn {
    background: none;
    border: 1.5px solid #d1d5db;
    border-radius: 5px;
    color: #4361ee;
    font-size: 1.1rem;
    line-height: 1;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.1s, border-color 0.1s;
    flex-shrink: 0;
}
.keydate-header-add-btn:hover { background: #eff6ff; border-color: #4361ee; }

.key-dates-add-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding: 0.6rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
    flex-wrap: wrap;
    flex-shrink: 0;
}
.key-dates-add-form .form-control { font-size: 0.82rem; }

/* ── Items de la liste ── */
.keydate-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 1.25rem;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.1s;
}
.keydate-item:last-child { border-bottom: none; }
.keydate-item.is-task { cursor: pointer; }
.keydate-item.is-task:hover { background: #f8fafc; }
.keydate-item.is-past { opacity: 0.42; }
/* Key dates customs (non-task) : hauteur réduite + fond rouge pastelle */
.keydate-item:not(.is-task) {
    padding: 0.28rem 1.25rem;
    background: #fff5f5;
}
.keydate-item:not(.is-task).is-past { background: #fff5f5; }

.keydate-date-block {
    width: 38px;
    text-align: center;
    flex-shrink: 0;
}
.keydate-date-day {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1;
    color: #4361ee;
}
.keydate-date-month {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: #9ca3af;
    letter-spacing: 0.04em;
}
.keydate-item.is-past .keydate-date-day { color: #9ca3af; }

.keydate-item-info {
    flex: 1;
    min-width: 0;
}
.keydate-item-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.keydate-item-sub {
    font-size: 0.72rem;
    color: #6b7280;
    margin-top: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.keydate-type-badge {
    font-size: 0.62rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}
.keydate-type-task { background: #f1f5f9; color: #475569; }
.keydate-type-key  { background: #fecaca; color: #7f1d1d; font-size: 0.6rem; padding: 0.12rem 0.4rem; font-weight: 700; }

.keydate-delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    font-size: 0.8rem;
    padding: 0.2rem 0.35rem;
    border-radius: 3px;
    flex-shrink: 0;
    transition: color 0.1s, background 0.1s, opacity 0.15s;
    line-height: 1;
    opacity: 0;
    pointer-events: none;
}
.keydate-item:hover .keydate-delete-btn { opacity: 1; pointer-events: auto; }
.keydate-delete-btn:hover { color: #ef4444; background: #fef2f2; }

.keydate-separator {
    padding: 0.3rem 1.25rem;
    font-size: 0.68rem;
    color: #9ca3af;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}

/* ===== Bandeau temps non notés Freshdesk ===== */
.unnoticed-wrap {
    position: relative;
    margin-bottom: 1rem;
}
.unnoticed-wrap .unnoticed-banner { margin-bottom: 0; }
.unnoticed-banner {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    background: #fffbeb;
    border: 1.5px solid #fde68a;
    border-radius: 10px;
    padding: 0.65rem 1rem;
    font-size: 0.875rem;
    color: #92400e;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, border-color 0.15s;
}
.unnoticed-banner:hover { background: #fef3c7; border-color: #fcd34d; }

.unnoticed-modal {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    z-index: 200;
    overflow: hidden;
}
.unnoticed-modal.is-open { display: block; }
.unnoticed-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #6b7280;
    border-bottom: 1px solid #f3f4f6;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.unnoticed-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    font-size: 0.85rem;
    padding: 2px 5px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}
.unnoticed-modal-close:hover { color: #374151; background: #f3f4f6; }
.unnoticed-modal-body { padding: 0.4rem 0; }
.unnoticed-project-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    text-decoration: none;
    transition: background 0.12s;
    gap: 1rem;
}
.unnoticed-project-row:hover { background: #f9fafb; }
.unnoticed-project-title {
    font-size: 0.875rem;
    color: #1e293b;
    font-weight: 500;
}
.unnoticed-project-count {
    font-size: 0.78rem;
    font-weight: 600;
    color: #b45309;
    background: #fef3c7;
    border-radius: 6px;
    padding: 1px 8px;
    white-space: nowrap;
}

/* ===== Overdue block ===== */
.overdue-block {
    background: #fff5f5;
    border: 1.5px solid #fca5a5;
    border-radius: 10px;
    padding: 1rem 1.25rem;
}

.overdue-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #dc2626;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.overdue-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.overdue-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    background: #fff5f5;
    border-radius: 8px;
    border: 1px solid #fca5a5;
    font-size: 0.85rem;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: filter 0.15s, box-shadow 0.15s;
}

.overdue-item:hover {
    filter: brightness(0.96);
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    text-decoration: none;
    color: inherit;
}

.overdue-date {
    width: 38px;
    text-align: center;
    flex-shrink: 0;
}

.overdue-date-day {
    font-size: 1.15rem;
    font-weight: 700;
    color: #dc2626;
    line-height: 1;
}

.overdue-date-month {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: #ef4444;
    letter-spacing: 0.04em;
}

.overdue-item-info {
    flex: 1;
    min-width: 0;
}

.overdue-item-title {
    font-weight: 600;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.overdue-item-meta {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== Home grid ===== */
.home-view-toggle {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1rem;
}
.home-view-btn {
    padding: 0.3rem 0.9rem;
    border-radius: 20px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.home-view-btn:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}
.home-view-btn.is-active {
    background: #dbeafe;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.home-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}
.home-grid--single {
    grid-template-columns: 1fr;
}
.home-grid > * {
    min-width: 0;
}

.home-col {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ===== To-Do list ===== */
.todo-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.todo-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.55rem 0.6rem 0.55rem 1rem;
    border-radius: 7px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    transition: background 0.15s, border-color 0.15s;
    cursor: pointer;
}

.todo-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.todo-item.is-done {
    opacity: 0.55;
}

.todo-check {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: #10b981;
    font-weight: 700;
    transition: border-color 0.15s, background 0.15s;
    flex-shrink: 0;
}

.todo-check.is-checked {
    background: #10b981;
    border-color: #10b981;
    color: #fff;
}

.todo-body {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.todo-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.todo-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1a1a2e;
    word-break: break-word;
}

.todo-item.is-done .todo-title {
    text-decoration: line-through;
    color: #9ca3af;
}

.todo-desc {
    font-size: 0.75rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.todo-item .agenda-date.is-overdue .agenda-date-day,
.todo-item .agenda-date.is-overdue .agenda-date-month {
    color: #dc2626;
}

.todo-archive {
    background: none;
    border: none;
    color: #cbd5e1;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    transition: color 0.15s;
}

.todo-archive svg {
    width: 14px;
    height: 14px;
}

.todo-archive:hover {
    color: #64748b;
}

.todo-delete {
    background: none;
    border: none;
    color: #cbd5e1;
    cursor: pointer;
    font-size: 0.75rem;
    padding: 2px 4px;
    border-radius: 3px;
    flex-shrink: 0;
    line-height: 1;
    margin-top: 1px;
    transition: color 0.15s;
}

.todo-delete:hover {
    color: #ef4444;
}

/* Bouton '+' d'ouverture du modal */
.todo-open-btn {
    width: 30px;
    height: 30px;
    min-width: 30px;
    background: #4361ee;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 400;
    transition: background 0.15s, transform 0.1s;
    flex-shrink: 0;
}

.todo-open-btn:hover {
    background: #3451d1;
}

.todo-open-btn:active {
    transform: scale(0.94);
}

/* Modal To-Do */
.todo-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 500;
    align-items: center;
    justify-content: center;
}

.todo-modal-overlay.is-open {
    display: flex;
}

.todo-modal {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    width: 420px;
    max-width: calc(100vw - 2rem);
    max-height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.todo-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.todo-modal-title {
    font-weight: 700;
    font-size: 1rem;
    color: #1a1a2e;
}

.todo-modal-close {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.todo-modal-close:hover {
    color: #ef4444;
    background: #fee2e2;
}

.todo-modal-body {
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.todo-modal-body .form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0;
}

.todo-modal-body textarea {
    resize: vertical;
    min-height: 70px;
}

#editTodoDesc {
    resize: none;
    overflow: hidden;
    min-height: 0;
}

.todo-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem 1rem;
    border-top: 1px solid #e5e7eb;
}

.todo-edit-footer {
    justify-content: space-between;
}


/* ===== Reminder list ===== */
.reminder-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.reminder-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    background: #fffbeb;
    border-radius: 8px;
    border-left: 3px solid #f59e0b;
    font-size: 0.85rem;
}

.reminder-icon {
    flex-shrink: 0;
    font-size: 1rem;
}

.reminder-ack-btn {
    display: none;
    width: 28px;
    height: 28px;
    min-width: 28px;
    background: #10b981;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    padding: 5px;
    flex-shrink: 0;
    transition: background 0.15s, transform 0.1s;
}

.reminder-ack-btn:hover {
    background: #059669;
    transform: scale(1.08);
}

.reminder-ack-btn svg {
    width: 100%;
    height: 100%;
    display: block;
}

.reminder-item:hover .reminder-icon {
    display: none;
}

.reminder-item:hover .reminder-ack-btn {
    display: flex;
}

.reminder-item-info {
    flex: 1;
    min-width: 0;
}

.reminder-item-title {
    font-weight: 600;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reminder-item-meta {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.1rem;
}

/* ===== Modale création tâche ===== */
.task-create-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 750;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.task-create-overlay.is-visible { opacity: 1; pointer-events: auto; }

.task-create-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.97);
    z-index: 751;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.18);
    width: 500px;
    max-width: calc(100vw - 2rem);
    max-height: calc(100vh - 4rem);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
}
.task-create-modal.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}
.task-create-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
    font-size: 0.95rem;
    color: #1a1a2e;
    flex-shrink: 0;
}
.task-create-body {
    padding: 1.25rem;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}
.task-create-footer {
    padding: 0.85rem 1.25rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* ===== Agenda list ===== */
.agenda-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.agenda-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    font-size: 0.85rem;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: filter 0.15s, box-shadow 0.15s;
}

.agenda-item:hover {
    filter: brightness(0.96);
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    text-decoration: none;
    color: inherit;
}

.agenda-item--today {
    background: #fff7ed;
    border-color: #fed7aa;
}

.todo-item--today {
    background: #fff7ed;
    border-color: #fed7aa;
}

.todo-item--today:hover {
    background: #ffedd5;
    border-color: #fdba74;
}

.agenda-label-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 5px;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0.01em;
}

.agenda-label-todo {
    background: #dbeafe;
    color: #1d4ed8;
}

.agenda-label-echeance {
    background: #f3e8ee;
    color: #7c1f45;
}

.agenda-label-badge + .agenda-label-badge {
    margin-left: 4px;
}

.agenda-label-keydate {
    background: #f3e8ee;
    color: #7c1f45;
}

.agenda-overdue-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #dc2626;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    flex-shrink: 0;
}

.agenda-date {
    width: 38px;
    text-align: center;
    flex-shrink: 0;
}

.agenda-date-day {
    font-size: 1.15rem;
    font-weight: 700;
    color: #4361ee;
    line-height: 1;
}

.agenda-date-month {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: #9ca3af;
    letter-spacing: 0.04em;
}

.agenda-date--today .agenda-date-day {
    font-size: 0.8rem;
    line-height: 2;
    color: #92400e;
}

.agenda-date--demain .agenda-date-day {
    font-size: 0.8rem;
    line-height: 2;
    color: #4361ee;
}

.agenda-item-info {
    flex: 1;
    min-width: 0;
}

.agenda-item-title {
    font-weight: 600;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agenda-item-sub {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== Project cards ===== */
.project-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.project-card {
    display: block;
    background: #fff;
    border-radius: 10px;
    padding: 1rem 1.1rem;
    border: 1px solid #e5e7eb;
    text-decoration: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.project-card:hover {
    border-color: #c7d2fe;
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.1);
    text-decoration: none;
}

.project-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.project-card-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: #1a1a2e;
    flex: 1;
}

.project-card-desc {
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.project-card-meta {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.4rem;
}

/* ===== Empty state ===== */
.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: #9ca3af;
}

.empty-state-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    display: block;
}

.empty-state-text {
    font-size: 0.875rem;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .home-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        --sidebar-w: 360px;
        transform: translateX(-100%);
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .main-wrapper {
        margin-left: 0;
    }

    .topbar-toggle {
        display: flex;
    }

    .main-content {
        padding: 1rem;
    }
}

/* =============================================================
   VUE PROJET
   ============================================================= */

/* En-tête projet */
.project-header {
    position: relative;
}

.project-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.project-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Bouton crayon (visible au survol du bandeau) */
.project-edit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, background 0.15s, color 0.15s;
    flex-shrink: 0;
}
.project-header:hover .project-edit-btn { opacity: 1; }
.project-edit-btn:hover { background: #f1f5f9; color: #1e293b; }

/* Bouton partage (même style que project-edit-btn, visible au survol) */
.project-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, background 0.15s, color 0.15s;
    flex-shrink: 0;
}
.project-header:hover .project-share-btn { opacity: 1; }
.project-share-btn:hover { background: #eff6ff; color: #4361ee; border-color: #bfdbfe; }

.project-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #1a1a2e;
    margin: 0;
}

/* Badge statut projet (avec point coloré) */
.project-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.22rem 0.65rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1.5px solid currentColor;
    white-space: nowrap;
    flex-shrink: 0;
}
.project-status::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}
.project-status.status-not-started { color: #64748b; background: #f8fafc; }
.project-status.status-in-progress { color: #2563eb; background: #eff6ff; }
.project-status.status-on-hold     { color: #d97706; background: #fffbeb; }
.project-status.status-completed   { color: #059669; background: #f0fdf4; }
.project-status.status-archived    { color: #475569; background: #f1f5f9; }

.project-desc {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.project-header-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: flex-start;
    justify-content: flex-end;
    flex-shrink: 0;
}

.project-date-chip {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.7rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #64748b;
}

.date-chip-label {
    display: block;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #94a3b8;
    line-height: 1;
}

.date-chip-value {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.3;
    white-space: nowrap;
}

/* ===== Phase block ===== */
.phases-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

@media (min-width: 769px) {
    .phases-list { width: 90%; margin: 0 auto; }
    .overdue-block { width: 90%; margin-left: auto; margin-right: auto; }
    .unnoticed-wrap { width: 90%; margin-left: auto; margin-right: auto; }
    .add-phase-area { width: 90%; margin-left: auto; margin-right: auto; }
}

.phase-block {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    border-top: 3px solid var(--phase-color, #6c757d);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    overflow: hidden;
}

.phase-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    user-select: none;
}

.phase-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.phase-title-text {
    font-weight: 700;
    font-size: 0.95rem;
    color: #1a1a2e;
    flex: 1;
    outline: none;
    border-radius: 4px;
    padding: 2px 4px;
    min-width: 60px;
}

.phase-title-text:focus {
    background: #f0f4ff;
    box-shadow: 0 0 0 2px #c7d2fe;
}

.phase-header-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.meta-chip {
    font-size: 0.72rem;
    color: #9ca3af;
    background: #f1f5f9;
    padding: 0.15rem 0.4rem;
    border-radius: 12px;
    white-space: nowrap;
}

.phase-actions {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
}

.phase-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 2px 4px;
    border-radius: 4px;
    color: #9ca3af;
    transition: color 0.15s, background 0.15s;
    line-height: 1;
}

.phase-action-btn:hover {
    color: #374151;
    background: #e5e7eb;
}

.phase-title-text {
    cursor: pointer;
    user-select: none;
}


/* Boutons d'action : cachés par défaut, visibles au survol */
.phase-actions {
    opacity: 0;
    transition: opacity 0.15s;
    margin-left: 0.25rem;
}
.phase-header:hover .phase-actions { opacity: 1; }

/* Collapse */
.phase-block.is-collapsed .task-list,
.phase-block.is-collapsed .quick-add-wrapper,
.phase-block.is-collapsed .phase-progress-bar {
    display: none;
}

/* Palette de couleurs (inline dans les modales) */
.color-palette-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.4rem;
}
.color-swatch {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.1s, border-color 0.1s, box-shadow 0.1s;
}
.color-swatch:hover { transform: scale(1.12); box-shadow: 0 2px 8px rgba(0,0,0,0.18); }
.color-swatch.is-active { border-color: #1e293b; box-shadow: 0 0 0 3px rgba(30,41,59,0.15); }

/* ── Modales de confirmation ── */
.confirm-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 900;
}
.confirm-overlay.is-visible { display: block; }

.confirm-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -48%) scale(0.97);
    width: 400px;
    max-width: 95vw;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    z-index: 901;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}
.confirm-modal.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.confirm-modal-body {
    padding: 1.5rem 1.5rem 1rem;
    font-size: 0.95rem;
    color: #1e293b;
    line-height: 1.5;
}

.confirm-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid #f0f0f0;
}

.confirm-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.confirm-modal-title {
    font-weight: 700;
    font-size: 1rem;
    color: #1a1a2e;
}

.confirm-modal-close {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.confirm-modal-close:hover {
    color: #ef4444;
    background: #fee2e2;
}

/* Variante avec saisie obligatoire (phase / projet) */
.confirm-typed-hint {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0.75rem 0 0.4rem;
}
.confirm-typed-hint strong { color: #ef4444; }

.phase-color-input { display: none; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
}

/* Phase progress */
.phase-progress-bar {
    height: 3px;
    background: #f3f4f6;
    overflow: hidden;
}

.phase-progress-fill {
    height: 100%;
    background: #4361ee;
    transition: width 0.4s ease;
}

.phase-progress-fill.is-done { background: #10b981; }

/* ===== Task list ===== */
.task-list {
    padding: 0.25rem 0;
    min-height: 8px;
}

/* Drag ghost */
.sortable-ghost { opacity: 0.35; }
.sortable-drag   { opacity: 0.9; box-shadow: 0 4px 16px rgba(0,0,0,0.15); }

/* Task item */
.task-item {
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.1s;
}

.task-item:last-child { border-bottom: none; }
.task-item:hover { background: #f8fafc; }

.task-item.is-overdue { background: #fff5f5; }
.task-item.is-overdue:hover { background: #fee2e2; }
.task-item.is-done { opacity: 0.7; }

.task-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.5rem 0.5rem 1.5rem;
    min-height: 40px;
    cursor: pointer;
}

/* Checkbox tâche */
.task-check {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    background: #fff;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    color: #fff;
    transition: border-color 0.15s, background 0.15s;
}

.task-check:hover { border-color: #4361ee; }

.task-check.is-checked {
    background: #10b981;
    border-color: #10b981;
    color: #fff;
}

.task-check-sm {
    width: 15px;
    height: 15px;
    font-size: 0.5rem;
}

/* Titre tâche */
.task-title {
    flex: 0 1 auto;
    font-size: 0.875rem;
    color: #1a1a2e;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.is-done-text {
    text-decoration: line-through;
    color: #10b981;
}

/* Badges tâche */
.task-badges {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
    margin-left: auto;
}

.task-badge { font-size: 0.75rem; }
.badge-overdue { color: #ef4444; }

.task-due {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    font-weight: 500;
    color: #64748b;
    background: #f1f5f9;
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
}

.task-due.is-overdue-text {
    color: #ef4444;
    background: #fef2f2;
    font-weight: 600;
}

.task-realization {
    font-size: 0.72rem;
    color: #16a34a;
    font-weight: 500;
    white-space: nowrap;
}

.task-time-chip {
    font-size: 0.72rem;
    color: #7c8fa6;
    font-weight: 500;
    background: #f1f5f9;
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
}

.phase-time-chip {
    color: #7c8fa6;
    font-weight: 600;
}

.task-stakeholders {
    font-size: 0.72rem;
    color: #9ca3af;
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Bouton ouvrir panneau */
.task-open-panel {
    background: none;
    border: none;
    cursor: pointer;
    color: #cbd5e1;
    font-size: 0.9rem;
    padding: 2px 5px;
    border-radius: 4px;
    flex-shrink: 0;
    transition: color 0.15s, background 0.15s;
    line-height: 1;
}

.task-open-panel:hover {
    color: #4361ee;
    background: #eff2ff;
}

/* Sous-tâches dans la liste principale */
.subtask-list {
    border-left: 2px solid #e8ecf1;
    margin-left: 2rem;
}
.subtask-list.is-hidden { display: none; }

/* Bouton toggle sous-tâches */
.subtask-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.15rem 0.4rem;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}
.subtask-toggle:hover { background: #e2e8f0; color: #374151; }
.subtask-toggle-icon { transition: transform 0.2s; }
.subtask-toggle.is-collapsed .subtask-toggle-icon { transform: rotate(-90deg); }

/* Quick add task */
.quick-add-wrapper {
    padding: 0.5rem 0.75rem;
    border-top: 1px dashed #e5e7eb;
}

.quick-add-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.4rem;
}

.quick-task-input { font-size: 0.875rem; }

.btn-add-task {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 0.825rem;
    cursor: pointer;
    padding: 0.2rem 0 0.2rem 1.5rem;
    transition: color 0.15s;
}

.btn-add-task:hover { color: #4361ee; }

/* Add phase */
.add-phase-area {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.add-phase-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #fff;
    border-radius: 10px;
    border: 1px dashed #c7d2fe;
}

#newPhaseColor {
    width: 36px;
    height: 36px;
    padding: 2px;
    border: 1.5px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
}

/* =============================================================
   PANNEAU TÂCHE (slide-in depuis la droite)
   ============================================================= */

.task-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -48%) scale(0.97);
    width: 600px;
    max-width: 95vw;
    max-height: 88vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.22);
    z-index: 601;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.task-panel.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.task-panel-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 600;
}

.task-panel-overlay.is-visible { display: block; }

.task-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.task-panel-heading {
    font-weight: 700;
    font-size: 0.9rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.task-panel-close {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: #9ca3af;
    padding: 4px 6px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.task-panel-close:hover { color: #374151; background: #f3f4f6; }

.task-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.1rem;
}

.task-panel-loading {
    text-align: center;
    padding: 3rem;
    color: #9ca3af;
    font-size: 0.875rem;
}

/* ===== Panel form ===== */
.panel-field {
    margin-bottom: 0.9rem;
}

.panel-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.3rem;
}

.panel-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.9rem;
}

.panel-textarea {
    resize: none;
    min-height: 64px;
    overflow: hidden;
}

.panel-type-select {
    appearance: none;
    -webkit-appearance: none;
    border: none !important;
    border-radius: 20px !important;
    font-size: 0.74rem !important;
    font-weight: 600 !important;
    padding: 0.2rem 1.4rem 0.2rem 0.55rem !important;
    cursor: pointer;
    width: auto;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='currentColor' opacity='.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.45rem center;
}
.panel-type-select.type-none    { background-color: #f1f5f9; color: #6b7280; }
.panel-type-select.type-meeting,
.panel-type-select.type-on-site,
.panel-type-select.type-remote  { background-color: #ede9fe; color: #5b21b6; }

.panel-status-select {
    appearance: none;
    -webkit-appearance: none;
    border: none !important;
    border-radius: 20px !important;
    font-size: 0.74rem !important;
    font-weight: 600 !important;
    padding: 0.2rem 1.4rem 0.2rem 0.55rem !important;
    cursor: pointer;
    width: auto;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='currentColor' opacity='.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.45rem center;
}
.panel-status-select.status-todo        { background-color: #f1f5f9; color: #6b7280; }
.panel-status-select.status-in-progress { background-color: #dbeafe; color: #1d4ed8; }
.panel-status-select.status-waiting     { background-color: #fef3c7; color: #92400e; }
.panel-status-select.status-planned     { background-color: #ede9fe; color: #5b21b6; }
.panel-status-select.status-done        { background-color: #d1fae5; color: #065f46; }

.panel-divider {
    border: none;
    border-top: 1px solid #f0f0f0;
    margin: 1rem 0;
}

.panel-section {
    margin-bottom: 0.5rem;
}

.panel-section-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.panel-section-badge {
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.72rem;
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
}

.panel-hint {
    font-size: 0.8rem;
    color: #9ca3af;
    margin: 0.25rem 0;
}

.panel-save-btn {
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
}

.panel-danger {
    text-align: center;
}

.parent-task-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.3rem 0.55rem;
    font-size: 0.82rem;
    color: #374151;
    max-width: 100%;
}
.parent-task-chip-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.parent-task-unlink {
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    font-size: 0.75rem;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}
.parent-task-unlink:hover { color: #ef4444; }
.parent-select-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.4rem;
}

.btn-danger {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

.btn-danger:hover {
    background: #fecaca;
}

/* ── Intervenants : chips (affichage dans le panneau) ── */
.panel-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}

.panel-label-row .panel-label {
    margin-bottom: 0;
}

.btn-sh-edit {
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    font-size: 0.75rem;
    color: #6b7280;
    padding: 2px 8px;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}
.btn-sh-edit:hover { border-color: #4361ee; color: #4361ee; }

/* ── Section intervenants du projet ── */
.project-sh-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.project-sh-label {
    font-size: 0.72rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.sh-avatars {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.sh-avatar-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.65rem;
    cursor: pointer;
    padding: 0.35rem 0.6rem;
    border-radius: 8px;
    transition: background 0.15s;
}
.sh-avatar-card:hover { background: rgba(0,0,0,0.05); }

.sh-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e8ecf1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: box-shadow 0.15s;
}
.sh-avatar-card:hover .sh-avatar {
    box-shadow: 0 0 0 3px rgba(0,0,0,0.12);
}

.sh-avatar-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.sh-avatar-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.sh-avatar-role {
    font-size: 0.7rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.sh-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.sh-chip {
    display: flex;
    flex-direction: column;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.sh-chip:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.sh-chip-name {
    font-weight: 600;
    color: #1e293b;
}

.sh-chip-role {
    font-size: 0.75rem;
    color: #6b7280;
}

/* ── Modale intervenants ── */
.sh-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 700;
}
.sh-modal-overlay.is-visible { display: block; }

.sh-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -48%) scale(0.97);
    width: 700px;
    max-width: 96vw;
    max-height: 85vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    z-index: 701;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.sh-modal.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.sh-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.sh-modal-title {
    font-weight: 700;
    font-size: 1rem;
    color: #1e293b;
}

.sh-modal-close {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: #9ca3af;
    padding: 4px 6px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}
.sh-modal-close:hover { color: #374151; background: #f3f4f6; }

.sh-modal-body {
    display: flex;
    gap: 0;
    flex: 1;
    overflow: hidden;
    padding: 1rem;
    gap: 0.75rem;
}

.sh-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sh-col-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.sh-list {
    flex: 1;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sh-list-item {
    display: flex;
    flex-direction: column;
    padding: 0.45rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.12s;
    border: 1px solid transparent;
}
.sh-list-item:hover { background: #f8fafc; }
.sh-list-item.is-selected {
    background: #eff2ff;
    border-color: #4361ee;
}

.sh-list-item-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1e293b;
}

.sh-list-item-role {
    font-size: 0.75rem;
    color: #9ca3af;
}

.sh-list-item-input {
    margin-top: 0.35rem;
    font-size: 0.78rem;
    padding: 3px 7px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    color: #374151;
    background: #fff;
    width: 100%;
}
.sh-list-item-input:focus { outline: none; border-color: #4361ee; }

.sh-arrows {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.sh-arrow-btn {
    background: #f1f5f9;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    width: 34px;
    height: 34px;
    cursor: pointer;
    font-size: 1rem;
    color: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.sh-arrow-btn:hover { background: #4361ee; border-color: #4361ee; color: #fff; }

.sh-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
}

/* ── Bouton icône générique ── */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
    cursor: pointer;
    color: #64748b;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-icon:hover { background: #e2e8f0; color: #1e293b; border-color: #cbd5e1; }
.btn-icon.is-active { background: #4361ee; color: #fff; border-color: #4361ee; }
.btn-icon-danger { color: #ef4444; }
.btn-icon-danger:hover { background: #fee2e2; color: #dc2626; border-color: #fca5a5; }

/* ── Modale info intervenant ── */
.sh-info-modal { width: 420px; }

.sh-info-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.3;
}

.sh-info-subtitle {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 0.2rem;
}

.sh-info-fields {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin-top: 1rem;
}

.sh-info-field {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 0.4rem;
    align-items: baseline;
}

.sh-info-field-label {
    font-size: 0.72rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-top: 0.05rem;
}

.sh-info-field-value {
    font-size: 0.88rem;
    color: #334155;
    word-break: break-word;
}

.sh-info-field-value a {
    color: #3b82f6;
    text-decoration: none;
}
.sh-info-field-value a:hover { text-decoration: underline; }

.sh-info-field-desc { align-items: flex-start; }

/* ── Mode édition modale info ── */
.sh-info-input {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 4px 8px;
    background: #f8fafc;
    color: #1e293b;
    font-size: 0.88rem;
    width: 100%;
    transition: border-color 0.15s, background 0.15s;
}
.sh-info-input:focus {
    outline: none;
    border-color: #4361ee;
    background: #fff;
}
.sh-info-input-name {
    font-size: 1.1rem;
    font-weight: 700;
}
textarea.sh-info-input { resize: vertical; }

/* ── Modale création intervenant ── */
.sh-create-modal { width: 420px; }
.sh-create-fields {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.sh-create-field label {
    display: block;
    font-size: 0.78rem;
    color: #6b7280;
    margin-bottom: 0.2rem;
}

/* Sous-tâches dans le panneau */
.subtask-panel-list {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 0.5rem;
}

.subtask-panel-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
}

.subtask-drag-handle {
    cursor: grab;
    color: #64748b;
    font-size: 1rem;
    line-height: 1;
    padding: 0 2px;
    user-select: none;
    flex-shrink: 0;
}
.subtask-drag-handle:hover { color: #94a3b8; }

/* ── Journal des temps ── */
.timelog-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 559;
}
.timelog-overlay.is-visible { display: block; }

.timelog-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -48%) scale(0.97);
    width: 620px;
    max-width: 96vw;
    max-height: 80vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.22);
    z-index: 560;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.timelog-modal.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}
.timelog-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}
.timelog-title {
    font-weight: 700;
    font-size: 1rem;
    color: #1e293b;
}
.timelog-total {
    font-size: 0.85rem;
    color: #6366f1;
    font-weight: 600;
    background: #eef2ff;
    border-radius: 6px;
    padding: 2px 8px;
}
.timelog-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: #9ca3af;
    padding: 4px 6px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}
.timelog-close:hover { color: #374151; background: #f3f4f6; }
.timelog-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}
.timelog-loading {
    padding: 2rem;
    text-align: center;
    color: #94a3b8;
    font-size: 0.9rem;
}
.timelog-empty {
    padding: 2rem;
    text-align: center;
    color: #94a3b8;
    font-size: 0.9rem;
}
.timelog-row {
    display: grid;
    grid-template-columns: 90px 1fr auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 1.25rem;
    border-bottom: 1px solid #f8f9fa;
    cursor: pointer;
    transition: background 0.12s;
}
.timelog-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.3rem;
}
.timelog-row:last-child { border-bottom: none; }
.timelog-row:hover { background: #f8fafc; }
.timelog-date {
    font-size: 0.8rem;
    color: #64748b;
    white-space: nowrap;
}
.timelog-task {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}
.timelog-task-title {
    font-size: 0.875rem;
    color: #1e293b;
    font-weight: 500;
    word-break: break-word;
}
.timelog-type-badge {
    display: inline-block;
    align-self: flex-start;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    letter-spacing: 0.03em;
    margin-bottom: 2px;
}
.timelog-type--meeting  { background: #ede9fe; color: #6d28d9; }
.timelog-type--on_site  { background: #fef3c7; color: #b45309; }
.timelog-type--remote   { background: #e0f2fe; color: #0369a1; }
.timelog-note {
    font-size: 0.75rem;
    color: #64748b;
    font-style: italic;
    margin-top: 1px;
}
.timelog-duration {
    font-size: 0.85rem;
    font-weight: 600;
    color: #6366f1;
    white-space: nowrap;
}
.timelog-noted-btn {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #94a3b8;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.timelog-noted-btn:hover {
    background: #f1f5f9;
    color: #64748b;
    border-color: #cbd5e1;
}
.timelog-noted-btn.is-noted {
    background: #f0fdf4;
    color: #16a34a;
    border-color: #bbf7d0;
}
.timelog-noted-btn.is-noted:hover {
    background: #dcfce7;
}

.subtask-title {
    flex: 1;
}

.subtask-quick-add {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

/* Entrées de temps dans le panneau */
.time-entries-list {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 0.6rem;
}

.time-entry-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    padding: 0.3rem 0.4rem;
    background: #f8fafc;
    border-radius: 6px;
}

.time-entry-date { color: #6b7280; flex-shrink: 0; }

.time-entry-duration {
    font-weight: 700;
    color: #1a1a2e;
    flex-shrink: 0;
}

.time-entry-note {
    flex: 1;
    color: #9ca3af;
    word-break: break-word;
}

.time-entry-delete {
    background: none;
    border: none;
    color: #d1d5db;
    cursor: pointer;
    font-size: 0.7rem;
    padding: 2px;
    transition: color 0.15s;
    flex-shrink: 0;
}

.time-entry-delete:hover { color: #ef4444; }

.time-add-form {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    font-size: 0.8rem;
}

.form-control-sm {
    padding: 0.35rem 0.5rem;
    font-size: 0.8rem;
}

/* Commentaires dans le panneau */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

.comment-item {
    background: #f8fafc;
    border-radius: 8px;
    padding: 0.5rem 0.6rem;
    position: relative;
}

.comment-meta {
    font-size: 0.72rem;
    color: #9ca3af;
    margin-bottom: 0.25rem;
}

.comment-content {
    font-size: 0.85rem;
    color: #374151;
    white-space: pre-wrap;
}

.comment-delete {
    position: absolute;
    top: 4px;
    right: 6px;
    background: none;
    border: none;
    color: #d1d5db;
    cursor: pointer;
    font-size: 0.65rem;
    transition: color 0.15s;
}

.comment-delete:hover { color: #ef4444; }

.comment-add-form {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

/* =============================================================
   Animation ===== */
@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* =============================================================
   Sidebar — Corbeille ===== */
.sidebar-trash-wrap {
    padding: 0 0.75rem 0.5rem;
}
.sidebar-trash-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.6rem;
    border-radius: 7px;
    color: #94a3b8;
    font-size: 0.8rem;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.sidebar-trash-link:hover {
    background: #f1f5f9;
    color: #64748b;
}
.sidebar-trash-count {
    margin-left: auto;
    background: #e2e8f0;
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 999px;
    padding: 0.1rem 0.45rem;
    min-width: 1.2rem;
    text-align: center;
}

/* =============================================================
   Toast undo ===== */
.undo-toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: #1e293b;
    color: #f1f5f9;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1100;
    animation: slideIn 0.25s ease;
    min-width: 260px;
}
.undo-toast-message {
    flex: 1;
    font-size: 0.875rem;
}
.undo-toast-btn {
    background: #4361ee;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.3rem 0.75rem;
    cursor: pointer;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: background 0.15s;
}
.undo-toast-btn:hover {
    background: #3451d1;
}
.undo-toast-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: #4361ee;
    border-radius: 0 0 10px 10px;
    width: 100%;
    transform-origin: left;
    animation: toastProgress var(--toast-duration, 8s) linear forwards;
}
@keyframes toastProgress {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}
.undo-toast.is-hiding {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* ===== Onglets vue projet ===== */
.view-tabs {
    display: flex;
    flex-direction: column;
    gap: 3px;
    align-self: flex-start;
    flex-shrink: 0;
}
.view-tab {
    width: 28px;
    height: 28px;
    background: rgba(255,255,255,0.6);
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    padding: 0;
}
.view-tab:hover  { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }
.view-tab.is-active { background: #dbeafe; color: #3b82f6; border-color: #bfdbfe; }

/* ===== Gantt ===== */
.gantt-wrap  { padding: 0; overflow-x: auto; }
.gantt-empty { padding: 3rem 1.5rem; text-align: center; color: #94a3b8; font-size: 0.9rem; margin: 0; }
.gantt-container { display: flex; flex-direction: column; min-width: 600px; }
.gantt-row {
    display: grid;
    grid-template-columns: 220px 1fr;
    border-bottom: 1px solid #f1f5f9;
    min-height: 34px;
    align-items: center;
}
.gantt-task-row { cursor: pointer; }
.gantt-task-row:hover { background: #f8fafc; }
.gantt-header-row {
    background: #f8fafc;
    min-height: 40px;
    position: sticky;
    top: 0;
    z-index: 2;
    border-bottom: 2px solid #e2e8f0;
}
.gantt-phase-row { background: #f1f5f9; }
.gantt-label-cell {
    padding: 0 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.82rem;
}
.gantt-header-label {
    font-size: 0.73rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.gantt-phase-row .gantt-label-cell {
    font-weight: 600;
    font-size: 0.8rem;
    color: #475569;
    display: flex;
    align-items: center;
}
.gantt-task-label { color: #334155; padding-left: 1.75rem; }
.gantt-task-label.is-done { color: #94a3b8; text-decoration: line-through; }
.gantt-phase-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.5rem;
    flex-shrink: 0;
}
.gantt-bar-cell  { position: relative; overflow: hidden; height: 100%; }
.gantt-bar-track { position: relative; width: 100%; height: 34px; }
.gantt-bar {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 14px;
    border-radius: 6px;
    min-width: 6px;
    opacity: 0.82;
    transition: opacity 0.15s;
}
.gantt-task-row:hover .gantt-bar { opacity: 1; }
.gantt-months   { position: relative; height: 40px; }
.gantt-month-label {
    position: absolute;
    font-size: 0.71rem;
    font-weight: 600;
    color: #64748b;
    top: 50%;
    transform: translateY(-50%);
    padding-left: 8px;
    white-space: nowrap;
    border-left: 1px solid #e2e8f0;
    overflow: hidden;
}

/* ===== Notes du projet ===== */
.project-notes-card {
    padding: 1rem 1.25rem;
    margin-top: 3rem;
}
.project-notes-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
}
.project-notes-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.project-notes-status {
    font-size: 0.72rem;
    color: transparent;
    transition: color 0.2s;
}
.project-notes-status.is-saved { color: #16a34a; }
.project-notes-status.is-error { color: #ef4444; }
.notes-toolbar {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.3rem 0.5rem;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
}
.notes-tool-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: none;
    cursor: pointer;
    font-size: 0.85rem;
    color: #374151;
    transition: background 0.12s, border-color 0.12s;
}
.notes-tool-btn:hover { background: #e5e7eb; border-color: #d1d5db; }
.notes-tool-btn.is-active { background: #ede9fe; border-color: #6366f1; color: #6366f1; }
.notes-toolbar-sep {
    width: 1px;
    height: 18px;
    background: #d1d5db;
    margin: 0 0.2rem;
}
.notes-block-btn {
    width: 34px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.project-notes-editor {
    min-height: 8rem;
    resize: vertical;
    overflow: auto;
    border: 1px solid #e5e7eb;
    border-radius: 0 0 6px 6px;
    padding: 0.55rem 0.75rem;
    font-size: 0.85rem;
    font-family: inherit;
    line-height: 1.55;
    color: #374151;
    background: #fafafa;
    box-sizing: border-box;
    transition: border-color 0.15s, background 0.15s;
    outline: none;
}
.project-notes-editor:focus {
    border-color: #6366f1;
    background: #fff;
}

.project-notes-editor:empty::before {
    content: attr(data-placeholder);
    color: #9ca3af;
    pointer-events: none;
}
.project-notes-editor h1 { font-size: 1.9rem;  font-weight: 800; margin: 0.7rem 0 0.4rem;  line-height: 1.2;  color: #111827; border-bottom: 2px solid #e5e7eb; padding-bottom: 0.2rem; }
.project-notes-editor h2 { font-size: 1.35rem; font-weight: 700; margin: 0.6rem 0 0.4rem;  line-height: 1.25; color: #1f2937; border-bottom: 1px solid #e5e7eb; padding-bottom: 0.2rem; }
.project-notes-editor h3 { font-size: 1.0rem;  font-weight: 700; margin: 0.5rem 0 0.4rem;  line-height: 1.3;  color: #374151; font-style: italic; border-bottom: 1px dashed #e5e7eb; padding-bottom: 0.2rem; }

/* ===== Graphique camembert — temps par type ===== */
.project-chart-section {
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    width: 70%;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    justify-content: center;
}
.chart-donut-wrap {
    display: flex;
    align-items: center;
    gap: 3rem;
}
.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}
.chart-legend-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.chart-legend-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}
.chart-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}
.chart-legend-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
}
.chart-legend-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f172a;
}
.chart-legend-pct {
    font-size: 0.82rem;
    color: #94a3b8;
    text-align: right;
}
.chart-legend-bar {
    width: 200px;
    flex-shrink: 0;
    height: 5px;
    background: #f1f5f9;
    border-radius: 99px;
    overflow: hidden;
}
.chart-legend-bar-fill {
    height: 100%;
    border-radius: 99px;
    opacity: 0.75;
}

/* ===== Window Controls Overlay (PWA) ===== */
@media (display-mode: window-controls-overlay) {
    /* Sidebar header remonte dans la zone titre */
    .sidebar-header {
        padding-top: calc(env(titlebar-area-height, 0px) + 0.85rem);
        -webkit-app-region: drag;
        app-region: drag;
    }
    .sidebar-brand {
        -webkit-app-region: no-drag;
        app-region: no-drag;
    }

    /* Topbar s'étend dans la zone titre */
    .topbar {
        height: calc(52px + env(titlebar-area-height, 0px));
        padding-top: env(titlebar-area-height, 0px);
        -webkit-app-region: drag;
        app-region: drag;
    }
    .topbar-toggle,
    .topbar-title,
    .topbar-actions {
        -webkit-app-region: no-drag;
        app-region: no-drag;
    }
}
.project-notes-editor p  { margin: 0.15rem 0; }

/* ===== Launcher (page d'accueil applications) ===== */
.launcher-page {
    min-height: 100vh;
    background: linear-gradient(175deg, #111f38 0%, #0d1426 50%, #111f38 100%);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}
.launcher-orb {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(80px);
    opacity: 0.18;
}
.launcher-orb--teal {
    width: 520px;
    height: 520px;
    background: radial-gradient(circle, #2dd4bf 0%, transparent 70%);
    top: -160px;
    right: -120px;
}
.launcher-orb--indigo {
    width: 460px;
    height: 460px;
    background: radial-gradient(circle, #6366f1 0%, transparent 70%);
    bottom: -140px;
    left: -100px;
}
.launcher-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    z-index: 2;
}
.launcher-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.launcher-brand-logo {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    object-fit: contain;
}
.launcher-brand-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}
.launcher-brand-name {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: #e2e8f0;
    letter-spacing: 0.01em;
}
.launcher-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.launcher-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}
.launcher-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, #2dd4bf, #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    user-select: none;
    transition: opacity 0.15s;
}
.launcher-avatar:hover { opacity: 0.85; }
.launcher-avatar-picker {
    position: absolute;
    top: calc(100% + 0.4rem);
    left: 0;
    background: #0b1628;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 0.5rem;
    display: none;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
    z-index: 200;
}
.launcher-avatar-picker.is-open { display: block; }
.launcher-username {
    font-size: 0.85rem;
    color: #94a3b8;
}
.launcher-logout-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
    border-radius: 7px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.launcher-logout-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.18);
}
.launcher-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    margin-top: -62px;
    position: relative;
    z-index: 2;
}
.launcher-headline {
    text-align: center;
    margin-bottom: 3rem;
}
.launcher-headline h1 {
    font-family: 'Syne', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 0.4rem;
}
.launcher-headline p {
    font-size: 0.95rem;
    color: #64748b;
}
.launcher-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    justify-content: center;
}
.launcher-tile {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1.75rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.2s;
    cursor: pointer;
    position: relative;
    width: 280px;
    overflow: hidden;
}
.launcher-tile::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(45, 212, 191, 0.06), rgba(99, 102, 241, 0.06));
    opacity: 0;
    transition: opacity 0.2s;
}
.launcher-tile:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(45, 212, 191, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(45, 212, 191, 0.1);
    text-decoration: none;
}
.launcher-tile:hover::before {
    opacity: 1;
}
.launcher-tile--soon {
    opacity: 0.45;
    cursor: default;
    pointer-events: none;
}
.launcher-tile--soon:hover {
    transform: none;
    box-shadow: none;
    border-color: rgba(255, 255, 255, 0.08);
}
.launcher-tile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.launcher-tile-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}
.launcher-tile-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.launcher-tile-icon--gradient {
    background: linear-gradient(135deg, #2dd4bf, #6366f1);
    font-size: 1.5rem;
}
.launcher-tile-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.launcher-tile-badge--active {
    background: rgba(45, 212, 191, 0.15);
    color: #2dd4bf;
    border: 1px solid rgba(45, 212, 191, 0.3);
}
.launcher-tile-badge--soon {
    background: rgba(148, 163, 184, 0.12);
    color: #64748b;
    border: 1px solid rgba(148, 163, 184, 0.2);
}
.launcher-tile-name {
    font-family: 'Syne', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #e2e8f0;
    display: block;
}
.launcher-tile-desc {
    font-size: 0.82rem;
    color: #64748b;
    line-height: 1.5;
    display: block;
    margin-top: 0.2rem;
}
.launcher-tile-footer {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: #2dd4bf;
    margin-top: auto;
}
.launcher-tile--soon .launcher-tile-footer {
    color: #475569;
}

/* ═══════════════════════════════════════════════════════════════
   BORNE ÉLECTRIQUE
═══════════════════════════════════════════════════════════════ */
/* Layout global */
.borne-layout {
    min-height: 100vh;
    background: linear-gradient(175deg, #111f38 0%, #0d1426 50%, #111f38 100%);
    display: flex;
    flex-direction: column;
}

/* Header */
.borne-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 1.5rem;
    height: 52px;
    background: #070b18;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 50;
}
.borne-header-left {
    display: flex;
    align-items: center;
    gap: 4px;
}
.borne-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.borne-hdr-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    color: #64748b;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    transition: color 0.15s, background 0.15s;
}
.borne-hdr-btn:hover {
    color: #e2e8f0;
    background: rgba(255,255,255,0.07);
}
.borne-hdr-sep {
    display: inline-block;
    width: 1px;
    height: 18px;
    background: rgba(255,255,255,0.12);
    margin: 0 8px;
}
.borne-hdr-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: #e2e8f0;
    letter-spacing: -0.01em;
}

/* Main content */
.borne-main {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.borne-page {
    padding: 1.25rem 1.5rem 3rem;
    width: 100%;
    max-width: 1100px;
}

/* Topbar actions */
.borne-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Car dropdown */
.borne-car-dropdown { position: relative; }
.borne-car-trigger {
    display: flex; align-items: center; gap: 10px;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px; padding: 7px 12px 7px 10px;
    cursor: pointer; transition: border-color 0.15s;
    min-width: 180px; color: #e2e8f0; font-family: inherit; font-size: 0.85rem;
}
.borne-car-trigger:hover { border-color: rgba(45,212,191,0.3); }
.borne-car-trigger.open { border-color: rgba(45,212,191,0.5); }
.borne-car-logo-wrap {
    width: 30px; height: 30px; border-radius: 8px;
    background: rgba(45,212,191,0.1);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    color: #2dd4bf;
}
.borne-car-trigger-text { flex: 1; text-align: left; }
.borne-car-trigger-label { font-size: 0.68rem; color: #64748b; display: block; line-height: 1; margin-bottom: 2px; }
.borne-car-trigger-name { font-size: 0.85rem; font-weight: 500; color: #e2e8f0; }
.borne-car-chevron { color: #64748b; transition: transform 0.2s; flex-shrink: 0; }
.borne-car-trigger.open .borne-car-chevron { transform: rotate(180deg); }

.borne-car-menu {
    display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0; min-width: 220px;
    background: #0f172a; border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    overflow: hidden; z-index: 200;
}
.borne-car-menu.open { display: block; }
.borne-car-menu-inner { max-height: 240px; overflow-y: auto; }
.borne-car-option {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; cursor: pointer; transition: background 0.1s; color: #94a3b8;
}
.borne-car-option:hover { background: rgba(255,255,255,0.05); color: #e2e8f0; }
.borne-car-option.selected { background: rgba(45,212,191,0.08); color: #2dd4bf; }
.borne-car-opt-icon { flex-shrink: 0; }
.borne-car-opt-model { font-size: 0.85rem; font-weight: 500; }
.borne-car-opt-check { margin-left: auto; color: #2dd4bf; flex-shrink: 0; }
.borne-car-menu-sep { height: 1px; background: rgba(255,255,255,0.07); margin: 0; }
.borne-car-menu-add {
    display: block; width: 100%; padding: 10px 14px; text-align: left;
    background: none; border: none; color: #2dd4bf; font-family: inherit;
    font-size: 0.82rem; cursor: pointer; transition: background 0.1s;
}
.borne-car-menu-add:hover { background: rgba(45,212,191,0.06); }

/* Buttons */
.borne-add-session-btn {
    display: flex; align-items: center; gap: 6px;
    background: rgba(45,212,191,0.12); color: #2dd4bf;
    border: 1px solid rgba(45,212,191,0.25); border-radius: 8px;
    padding: 7px 14px; font-family: inherit; font-size: 0.82rem; font-weight: 500;
    cursor: pointer; transition: background 0.15s;
}
.borne-add-session-btn:hover { background: rgba(45,212,191,0.2); }

.borne-upload-btn {
    display: flex; align-items: center; gap: 6px;
    background: #1D9E75; color: #fff;
    border: none; border-radius: 8px; padding: 7px 14px;
    font-family: inherit; font-size: 0.82rem; font-weight: 500;
    cursor: pointer; transition: background 0.15s;
}
.borne-upload-btn:hover { background: #0F6E56; }

.borne-payments-btn {
    display: flex; align-items: center; gap: 6px;
    background: #ea580c; color: #fff;
    border: none; border-radius: 8px; padding: 7px 14px;
    font-family: inherit; font-size: 0.82rem; font-weight: 500;
    cursor: pointer; transition: background 0.15s;
}
.borne-payments-btn:hover { background: #c2410c; }

/* Modale paiements */
.borne-pay-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.45); z-index: 900;
}
.borne-pay-overlay.is-open { display: block; }

.borne-pay-modal {
    position: fixed; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: min(900px, 96vw); max-height: 85vh;
    background: #fff; border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    z-index: 901; display: none; flex-direction: column;
    overflow: hidden;
}
.borne-pay-modal.is-open { display: flex; }

.borne-pay-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.25rem; border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}
.borne-pay-title { font-weight: 700; font-size: 1rem; }

.borne-pay-body {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0;
    overflow: hidden; flex: 1;
}
.borne-pay-col {
    padding: 1.25rem; overflow-y: auto;
    display: flex; flex-direction: column; gap: 0.75rem;
}
.borne-pay-col:first-child { border-right: 1px solid #e5e7eb; }

.borne-pay-col-header {
    display: flex; align-items: center; justify-content: space-between;
    padding-bottom: 0.5rem; border-bottom: 2px solid #e5e7eb;
}
.borne-pay-col-title {
    font-weight: 700; font-size: 0.9rem;
}
.borne-pay-col-title--electris  { color: #ea580c; }
.borne-pay-col-header:has(.borne-pay-col-title--electris) { border-color: #ea580c; }
.borne-pay-col-title--jeanbeno  { color: #6366f1; }
.borne-pay-col-header:has(.borne-pay-col-title--jeanbeno) { border-color: #6366f1; }

.borne-pay-toggle-btn {
    width: 24px; height: 24px; border-radius: 6px; border: 1px solid #d1d5db;
    background: none; font-size: 1.1rem; line-height: 1; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    color: #6b7280;
}
.borne-pay-toggle-btn--electris.is-active,
.borne-pay-toggle-btn--electris:hover { background: #ea580c; color: #fff; border-color: #ea580c; }
.borne-pay-toggle-btn--jeanbeno.is-active,
.borne-pay-toggle-btn--jeanbeno:hover { background: #6366f1; color: #fff; border-color: #6366f1; }

.borne-pay-form { display: flex; flex-direction: column; gap: 0.5rem; }
.borne-pay-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.borne-pay-add-btn {
    align-self: flex-start; font-size: 0.8rem; padding: 5px 12px;
    border: none; border-radius: 6px; cursor: pointer; color: #fff; font-weight: 500;
    transition: background 0.15s;
}
.borne-pay-add-btn--electris { background: #ea580c; }
.borne-pay-add-btn--electris:hover { background: #c2410c; }
.borne-pay-add-btn--jeanbeno { background: #6366f1; }
.borne-pay-add-btn--jeanbeno:hover { background: #4f46e5; }

.borne-pay-list { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.borne-pay-empty { font-size: 0.82rem; color: #94a3b8; padding: 0.5rem 0; }
.borne-pay-item {
    display: flex; align-items: center; gap: 0.75rem;
    background: #f8fafc; border-radius: 8px; padding: 8px 10px;
    border: 1px solid #e5e7eb;
}
.borne-pay-item-date {
    font-size: 0.75rem; color: #64748b; font-family: 'Space Mono', monospace;
    white-space: nowrap; flex-shrink: 0; width: 80px;
}
.borne-pay-item-amount {
    font-weight: 700; font-size: 0.88rem; color: #1e293b;
    white-space: nowrap; flex-shrink: 0; width: 70px; text-align: right;
}
.borne-pay-item-com { flex: 1; font-size: 0.8rem; color: #475569; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.borne-pay-confirm {
    display: none; align-items: center; gap: 0.5rem; margin-left: auto;
}
.borne-pay-confirm-yes {
    background: #ef4444; color: #fff; border: none; border-radius: 6px;
    padding: 3px 10px; font-size: 0.78rem; font-weight: 600; cursor: pointer;
    transition: background 0.15s;
}
.borne-pay-confirm-yes:hover { background: #dc2626; }
.borne-pay-confirm-no {
    background: none; border: 1px solid #d1d5db; border-radius: 6px;
    padding: 3px 10px; font-size: 0.78rem; color: #64748b; cursor: pointer;
    transition: background 0.15s;
}
.borne-pay-confirm-no:hover { background: #f1f5f9; }

.borne-pay-total {
    font-weight: 700; font-size: 0.85rem; color: #1e293b;
    padding-top: 0.5rem; border-top: 1px solid #e5e7eb; text-align: right;
}

/* Period tabs */
.borne-period-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 1.25rem; }
.borne-tab {
    padding: 6px 14px; border-radius: 99px;
    border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.04);
    font-family: inherit; font-size: 0.8rem; font-weight: 500;
    color: #94a3b8; cursor: pointer; transition: all 0.15s;
}
.borne-tab:hover { border-color: rgba(45,212,191,0.3); color: #e2e8f0; }
.borne-tab.active { background: #1D9E75; color: #fff; border-color: #1D9E75; }

/* Custom range */
.borne-custom-range {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin-bottom: 1.25rem;
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px; padding: 10px 16px;
}
.borne-custom-range label { font-size: 0.8rem; color: #94a3b8; }
.borne-custom-range input[type="date"] {
    padding: 5px 10px; border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px; background: rgba(255,255,255,0.05);
    color: #e2e8f0; font-family: 'Space Mono', monospace; font-size: 0.8rem; outline: none;
}
.borne-custom-range input[type="date"]:focus { border-color: #1D9E75; }
.borne-apply-btn {
    padding: 5px 14px; background: #1D9E75; color: #fff;
    border: none; border-radius: 8px; font-family: inherit;
    font-size: 0.8rem; font-weight: 500; cursor: pointer;
}
.borne-apply-btn:hover { background: #0F6E56; }

/* Metrics */
.borne-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 1.25rem; }
.borne-metric {
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px; padding: 1rem 1.1rem; position: relative;
}
.borne-metric-icon {
    float: right; width: 30px; height: 30px; border-radius: 8px;
    background: rgba(29,158,117,0.15); display: flex; align-items: center; justify-content: center;
    color: #1D9E75; margin-top: -2px;
}
.borne-metric-label { font-size: 0.68rem; font-weight: 500; color: #64748b; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
.borne-metric-value { font-size: 1.55rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1; color: #e2e8f0; }
.borne-metric-value small { font-size: 0.95rem; font-weight: 400; }
.borne-metric-value.accent { color: #1D9E75; }
.borne-metric-sub { font-size: 0.72rem; color: #64748b; margin-top: 5px; font-family: 'Space Mono', monospace; }

/* Two col */
.borne-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 1.25rem; }
@media (max-width: 680px) { .borne-two-col { grid-template-columns: 1fr; } }

.borne-card {
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px; padding: 1rem 1.1rem;
}
.borne-card-title { font-size: 0.72rem; font-weight: 500; color: #64748b; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.85rem; }

/* Table */
.borne-table-wrap {
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px; overflow: hidden;
}
.borne-table-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 13px 18px 11px; border-bottom: 1px solid rgba(255,255,255,0.07);
}
.borne-table-head-title { font-size: 0.82rem; font-weight: 600; color: #e2e8f0; }
.borne-table-count {
    font-size: 0.72rem; color: #64748b;
    background: rgba(255,255,255,0.06); border-radius: 99px; padding: 3px 10px;
}
.borne-table { width: 100%; border-collapse: collapse; }
.borne-table thead th {
    padding: 9px 18px; text-align: left;
    font-size: 0.68rem; font-weight: 500; color: #64748b;
    text-transform: uppercase; letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    background: rgba(255,255,255,0.02);
}
.borne-table tbody td {
    padding: 11px 18px; font-size: 0.83rem;
    border-bottom: 1px solid rgba(255,255,255,0.05); color: #cbd5e1;
}
.borne-table tbody tr:last-child td { border-bottom: none; }
.borne-table tbody tr:hover td { background: rgba(255,255,255,0.03); }
.borne-dt { font-family: 'Space Mono', monospace; font-size: 0.76rem; color: #94a3b8; }
.borne-dur {
    display: inline-flex; align-items: center;
    background: rgba(255,255,255,0.07); border-radius: 6px;
    padding: 2px 8px; font-family: 'Space Mono', monospace; font-size: 0.73rem; color: #94a3b8;
}
.borne-kw { font-weight: 600; color: #1D9E75; }
.borne-cost-rate { font-size: 0.7rem; color: #64748b; font-family: 'Space Mono', monospace; display: block; margin-top: 1px; }
.borne-badge { font-family: 'Space Mono', monospace; font-size: 0.7rem; color: #94a3b8; letter-spacing: 0.03em; }
.borne-power { font-weight: 600; color: #6366f1; font-size: 0.82rem; }
@keyframes borneSpinner { to { transform: rotate(360deg); } }
.borne-del-btn {
    background: none; border: none; color: #64748b; cursor: pointer; font-size: 0.8rem;
    padding: 3px 6px; border-radius: 4px; transition: color 0.15s, background 0.15s;
}
.borne-del-btn:hover { color: #ef4444; background: rgba(239,68,68,0.1); }
.borne-empty { padding: 3rem; text-align: center; color: #64748b; font-size: 0.85rem; }
.borne-empty-state {
    grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center;
    gap: 0.75rem; padding: 2rem; text-align: center; color: #64748b;
}
.borne-empty-state p { font-size: 0.85rem; }

/* Toast */
.borne-toast {
    position: fixed; bottom: 24px; right: 24px;
    background: #1e293b; color: #e2e8f0; border: 1px solid rgba(255,255,255,0.12);
    padding: 10px 18px; border-radius: 10px;
    font-size: 0.84rem; font-weight: 500;
    opacity: 0; transform: translateY(8px);
    transition: all 0.2s; pointer-events: none; z-index: 1200;
}
.borne-toast.show { opacity: 1; transform: translateY(0); }
.borne-toast.success { background: #1D9E75; color: #fff; border-color: #1D9E75; }

/* ═══════════════════════════════════════════════════════════════
   INVENTAIRE
═══════════════════════════════════════════════════════════════ */
.inventaire-layout {
  --bg: #0F1117;
  --bg2: #161820;
  --surface: #1C1F2E;
  --surface2: #232638;
  --surface3: #2A2D42;
  --border: rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.13);
  --text: #F0F2FF;
  --text2: #8B90B8;
  --text3: #565A7A;
  --orange: #F97316;
  --orange-light: rgba(249,115,22,0.12);
  --orange-glow: rgba(249,115,22,0.25);
  --yellow: #FBBF24;
  --accent: #6366F1;
  --accent-light: rgba(99,102,241,0.15);
  --success: #10B981;
  --success-bg: rgba(16,185,129,0.12);
  --danger: #F43F5E;
  --danger-bg: rgba(244,63,94,0.12);
  --warning: #F59E0B;
  --warning-bg: rgba(245,158,11,0.12);
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  font-family: 'Plus Jakarta Sans', 'Figtree', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
}

/* Sidebar */
.inventaire-layout .inv-sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: 240px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.inventaire-layout .inv-sidebar-logo {
  padding: 16px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.inventaire-layout .inv-logo-truck {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, #FBBF24 0%, #F97316 100%);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(249,115,22,0.4);
}

.inventaire-layout .inv-logo-truck svg { width: 28px; height: 28px; }

.inventaire-layout .inv-logo-text {
  font-size: 16px; font-weight: 700; letter-spacing: -0.4px;
  color: var(--text); flex: 1;
}

.inventaire-layout .inv-logo-btn {
  width: 28px; height: 28px;
  border-radius: var(--radius);
  background: transparent;
  border: 1.5px solid var(--border2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
  color: var(--text3);
  padding: 0;
  text-decoration: none;
}

.inventaire-layout .inv-logo-btn:hover {
  background: var(--orange-light);
  border-color: var(--orange);
  color: var(--orange);
}

.inventaire-layout .inv-nav { padding: 14px 10px; flex: 1; }

.inventaire-layout .inv-nav-section-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text3);
  padding: 10px 12px 5px;
}

.inventaire-layout .inv-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius);
  cursor: pointer; color: var(--text2);
  font-size: 13.5px; font-weight: 500;
  transition: all 0.15s; margin-bottom: 2px;
  user-select: none; position: relative;
}

.inventaire-layout .inv-nav-item:hover { background: var(--surface); color: var(--text); }
.inventaire-layout .inv-nav-item.active { background: var(--orange-light); color: var(--orange); }

.inventaire-layout .inv-nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 3px; background: var(--orange); border-radius: 0 3px 3px 0;
}

.inventaire-layout .inv-nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }

.inventaire-layout .inv-nav-badge {
  margin-left: auto; background: var(--surface3);
  color: var(--text2); border-radius: 20px;
  padding: 2px 8px; font-size: 11px; font-weight: 600;
}

.inventaire-layout .inv-nav-item.active .inv-nav-badge { background: var(--orange); color: white; }

.inventaire-layout .inv-sidebar-footer { padding: 14px 16px; border-top: 1px solid var(--border); }

.inventaire-layout .inv-sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius); cursor: pointer;
}

.inventaire-layout .inv-sidebar-user:hover { background: var(--surface); }

.inventaire-layout .inv-user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, #818CF8 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: white; flex-shrink: 0;
}

.inventaire-layout .inv-user-name { font-size: 12.5px; font-weight: 600; color: var(--text); }
.inventaire-layout .inv-user-role { font-size: 11px; color: var(--text3); }

/* Main */
.inventaire-layout .inv-main {
  margin-left: 240px;
  min-height: 100vh;
  padding: 28px 32px;
  flex: 1;
}

.inventaire-layout .inv-topbar {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 28px;
}

.inventaire-layout .inv-page-title { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; color: var(--text); }
.inventaire-layout .inv-page-subtitle { font-size: 13px; color: var(--text3); margin-top: 3px; }
.inventaire-layout .inv-topbar-actions { display: flex; gap: 8px; align-items: center; }

/* Buttons */
.inventaire-layout .inv-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius);
  font-size: 13px; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; transition: all 0.15s;
  font-family: 'Plus Jakarta Sans', 'Figtree', sans-serif;
  white-space: nowrap; text-decoration: none;
}

.inventaire-layout .inv-btn svg { width: 14px; height: 14px; }

.inventaire-layout .inv-btn-primary {
  background: linear-gradient(135deg, #F97316, #FBBF24);
  color: #1A0800; border: none;
  box-shadow: 0 2px 12px rgba(249,115,22,0.35);
}

.inventaire-layout .inv-btn-primary:hover { box-shadow: 0 4px 20px rgba(249,115,22,0.5); transform: translateY(-1px); }
.inventaire-layout .inv-btn-secondary { background: var(--surface2); color: var(--text2); border-color: var(--border2); }
.inventaire-layout .inv-btn-secondary:hover { background: var(--surface3); color: var(--text); }
.inventaire-layout .inv-btn-ghost { background: transparent; color: var(--text2); border-color: transparent; padding: 8px 10px; }
.inventaire-layout .inv-btn-ghost:hover { background: var(--surface2); color: var(--text); }
.inventaire-layout .inv-btn-sell { background: var(--success-bg); color: var(--success); border: 1px solid rgba(16,185,129,0.25); padding: 5px 12px; font-size: 12px; }
.inventaire-layout .inv-btn-sell:hover { background: rgba(16,185,129,0.2); }

/* KPI */
.inventaire-layout .inv-kpi-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 28px; }

.inventaire-layout .inv-kpi-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 20px;
  position: relative; overflow: hidden;
}

.inventaire-layout .inv-kpi-card::after {
  content: ''; position: absolute; top: 0; right: 0;
  width: 60px; height: 60px; border-radius: 0 var(--radius-lg) 0 60px; opacity: 0.07;
}

.inventaire-layout .inv-kpi-card.c-orange::after { background: var(--orange); }
.inventaire-layout .inv-kpi-card.c-green::after  { background: var(--success); }
.inventaire-layout .inv-kpi-card.c-purple::after { background: var(--accent); }
.inventaire-layout .inv-kpi-card.c-yellow::after { background: var(--yellow); }

.inventaire-layout .inv-kpi-icon { width: 36px; height: 36px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.inventaire-layout .inv-kpi-icon svg { width: 18px; height: 18px; }
.inventaire-layout .inv-kpi-icon.orange { background: var(--orange-light); color: var(--orange); }
.inventaire-layout .inv-kpi-icon.green  { background: var(--success-bg); color: var(--success); }
.inventaire-layout .inv-kpi-icon.purple { background: var(--accent-light); color: var(--accent); }
.inventaire-layout .inv-kpi-icon.yellow { background: rgba(251,191,36,0.12); color: var(--yellow); }

.inventaire-layout .inv-kpi-label { font-size: 12px; font-weight: 600; color: var(--text3); letter-spacing: 0.03em; text-transform: uppercase; margin-bottom: 6px; }
.inventaire-layout .inv-kpi-value { font-size: 24px; font-weight: 700; letter-spacing: -0.8px; color: var(--text); line-height: 1; font-family: 'JetBrains Mono', 'Space Mono', monospace; }
.inventaire-layout .inv-kpi-sub { font-size: 11.5px; color: var(--text3); margin-top: 8px; display: flex; align-items: center; gap: 5px; }
.inventaire-layout .inv-kpi-trend { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 4px; }
.inventaire-layout .trend-up   { background: var(--success-bg); color: var(--success); }
.inventaire-layout .trend-down { background: var(--danger-bg);  color: var(--danger); }

/* Panels */
.inventaire-layout .inv-panels { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; margin-bottom: 18px; }
.inventaire-layout .inv-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.inventaire-layout .inv-panel-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.inventaire-layout .inv-panel-title { font-size: 14px; font-weight: 700; color: var(--text); letter-spacing: -0.2px; display: flex; align-items: center; gap: 8px; }

/* Tabs */
.inventaire-layout .inv-tabs { display: flex; padding: 0 20px; border-bottom: 1px solid var(--border); background: var(--bg2); gap: 2px; }
.inventaire-layout .inv-tab { padding: 11px 14px; font-size: 13px; font-weight: 500; color: var(--text3); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all 0.15s; white-space: nowrap; }
.inventaire-layout .inv-tab:hover { color: var(--text2); }
.inventaire-layout .inv-tab.active { color: var(--orange); border-bottom-color: var(--orange); font-weight: 600; }

/* Table */
.inventaire-layout .inv-table { width: 100%; border-collapse: collapse; }
.inventaire-layout .inv-table th { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text3); text-align: left; padding: 11px 20px; background: var(--bg2); border-bottom: 1px solid var(--border); }
.inventaire-layout .inv-table td { padding: 12px 20px; border-bottom: 1px solid var(--border); color: var(--text); font-size: 13.5px; vertical-align: middle; }
.inventaire-layout .inv-table tr:last-child td { border-bottom: none; }
.inventaire-layout .inv-table tr:hover td { background: rgba(255,255,255,0.02); }
.inventaire-layout .inv-product-name { font-weight: 600; color: var(--text); margin-bottom: 2px; }
.inventaire-layout .inv-product-ref  { font-size: 11.5px; color: var(--text3); font-family: 'JetBrains Mono', 'Space Mono', monospace; }

/* Badges */
.inventaire-layout .inv-badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 5px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.inventaire-layout .inv-badge-blue   { background: rgba(99,102,241,0.15); color: #818CF8; }
.inventaire-layout .inv-badge-green  { background: var(--success-bg); color: var(--success); }
.inventaire-layout .inv-badge-red    { background: var(--danger-bg);  color: var(--danger); }
.inventaire-layout .inv-badge-gray   { background: var(--surface2); color: var(--text2); border: 1px solid var(--border2); }
.inventaire-layout .inv-mono { font-family: 'JetBrains Mono', 'Space Mono', monospace; font-size: 13px; }

/* Movements */
.inventaire-layout .inv-movement-row { display: flex; align-items: center; gap: 12px; padding: 11px 20px; border-bottom: 1px solid var(--border); }
.inventaire-layout .inv-movement-row:last-child { border-bottom: none; }
.inventaire-layout .inv-mvt-icon { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.inventaire-layout .inv-mvt-in  { background: var(--success-bg); color: var(--success); }
.inventaire-layout .inv-mvt-out { background: var(--danger-bg);  color: var(--danger); }
.inventaire-layout .inv-mvt-icon svg { width: 13px; height: 13px; }
.inventaire-layout .inv-mvt-info { flex: 1; min-width: 0; }
.inventaire-layout .inv-mvt-title { font-size: 13px; font-weight: 600; margin-bottom: 1px; }
.inventaire-layout .inv-mvt-sub   { font-size: 11.5px; color: var(--text3); font-family: 'JetBrains Mono', 'Space Mono', monospace; }
.inventaire-layout .inv-mvt-amount { font-family: 'JetBrains Mono', 'Space Mono', monospace; font-size: 13.5px; font-weight: 600; text-align: right; }
.inventaire-layout .inv-mvt-amount.credit { color: var(--success); }
.inventaire-layout .inv-mvt-amount.debit  { color: var(--danger); }

/* Chart */
.inventaire-layout .inv-chart-bars { padding: 16px 20px 0; display: flex; align-items: flex-end; gap: 8px; height: 100px; overflow: hidden; }
.inventaire-layout .inv-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.inventaire-layout .inv-bar-wrap { width: 100%; display: flex; flex-direction: column; gap: 2px; justify-content: flex-end; flex: 1; min-height: 0; overflow: hidden; }
.inventaire-layout .inv-bar-in  { width: 100%; border-radius: 4px 4px 0 0; background: rgba(16,185,129,0.35); border-top: 2px solid var(--success); }
.inventaire-layout .inv-bar-out { width: 100%; border-radius: 4px 4px 0 0; background: rgba(244,63,94,0.28);  border-top: 2px solid var(--danger); }
.inventaire-layout .inv-bar-label { font-size: 10px; color: var(--text3); text-align: center; font-weight: 600; letter-spacing: 0.03em; flex-shrink: 0; }
.inventaire-layout .inv-chart-legend { display: flex; gap: 16px; padding: 4px 20px 16px; }
.inventaire-layout .inv-legend-item { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text3); }
.inventaire-layout .inv-legend-dot { width: 8px; height: 8px; border-radius: 2px; }
.inventaire-layout .inv-legend-dot.in  { background: var(--success); }
.inventaire-layout .inv-legend-dot.out { background: var(--danger); }

/* Modals */
.inventaire-layout .inv-modal-backdrop { display: none; position: fixed; inset: 0; background: rgba(5,5,10,0.75); backdrop-filter: blur(4px); z-index: 200; align-items: center; justify-content: center; }
.inventaire-layout .inv-modal-backdrop.open { display: flex; }
.inventaire-layout .inv-modal { background: var(--surface); border: 1px solid var(--border2); border-radius: var(--radius-xl); width: 560px; max-width: calc(100vw - 40px); max-height: calc(100vh - 60px); overflow-y: auto; animation: inv-slideUp 0.2s ease; }

@keyframes inv-slideUp {
  from { transform: translateY(14px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.inventaire-layout .inv-modal-header { padding: 20px 24px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.inventaire-layout .inv-modal-title { font-size: 16px; font-weight: 700; letter-spacing: -0.3px; }
.inventaire-layout .inv-modal-close { width: 30px; height: 30px; border-radius: var(--radius); background: var(--surface2); border: 1px solid var(--border); cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text2); font-size: 16px; line-height: 1; }
.inventaire-layout .inv-modal-close:hover { background: var(--surface3); color: var(--text); }
.inventaire-layout .inv-modal-body   { padding: 22px 24px; }
.inventaire-layout .inv-modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

/* Forms */
.inventaire-layout .inv-form-group { margin-bottom: 16px; }
.inventaire-layout .inv-form-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text2); margin-bottom: 7px; letter-spacing: 0.01em; }
.inventaire-layout .inv-form-required { color: var(--orange); margin-left: 2px; }
.inventaire-layout .inv-form-input,
.inventaire-layout .inv-form-select { width: 100%; border: 1px solid var(--border2); background: var(--bg2); border-radius: var(--radius); padding: 9px 13px; font-size: 13.5px; font-family: 'Plus Jakarta Sans', 'Figtree', sans-serif; color: var(--text); outline: none; transition: border-color 0.15s, box-shadow 0.15s; }
.inventaire-layout .inv-form-input::placeholder { color: var(--text3); }
.inventaire-layout .inv-form-input:focus,
.inventaire-layout .inv-form-select:focus { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-glow); background: var(--surface); }
.inventaire-layout .inv-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.inventaire-layout .inv-form-hint { font-size: 11.5px; color: var(--text3); margin-top: 5px; }
.inventaire-layout .inv-section-divider { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text3); padding: 14px 0 10px; border-top: 1px solid var(--border); margin-top: 6px; }
.inventaire-layout .inv-sell-item-info { background: var(--bg2); border: 1px solid var(--border2); border-radius: var(--radius-lg); padding: 14px 16px; margin-bottom: 22px; display: flex; align-items: center; gap: 14px; }
.inventaire-layout .inv-sell-icon { width: 42px; height: 42px; background: var(--orange-light); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--orange); }
.inventaire-layout .inv-sell-icon svg { width: 20px; height: 20px; }
.inventaire-layout .inv-sell-info-title { font-weight: 700; font-size: 14px; color: var(--text); }
.inventaire-layout .inv-sell-info-meta  { font-size: 12px; color: var(--text3); margin-top: 3px; }
.inventaire-layout .inv-sell-info-meta strong { color: var(--orange); }

/* Category tabs */
.inventaire-layout .inv-cat-tabs-wrap { margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.inventaire-layout .inv-cat-tabs-wrap::-webkit-scrollbar { display: none; }
.inventaire-layout .inv-cat-tabs { display: flex; gap: 6px; padding-bottom: 2px; white-space: nowrap; }
.inventaire-layout .inv-cat-tab { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); color: var(--text2); font-size: 13px; font-weight: 500; font-family: 'Plus Jakarta Sans', 'Figtree', sans-serif; cursor: pointer; transition: all 0.15s; white-space: nowrap; }
.inventaire-layout .inv-cat-tab svg { width: 14px; height: 14px; flex-shrink: 0; }
.inventaire-layout .inv-cat-tab:hover { background: var(--surface2); color: var(--text); border-color: var(--border2); }
.inventaire-layout .inv-cat-tab.active { background: var(--orange-light); color: var(--orange); border-color: rgba(249,115,22,0.3); font-weight: 600; }
.inventaire-layout .inv-cat-count { background: var(--surface3); color: var(--text3); border-radius: 20px; padding: 1px 7px; font-size: 11px; font-weight: 700; }
.inventaire-layout .inv-cat-tab.active .inv-cat-count { background: var(--orange); color: white; }

/* Product grid */
.inventaire-layout .inv-product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 14px; }
.inventaire-layout .inv-product-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; cursor: pointer; transition: all 0.18s; display: flex; flex-direction: column; gap: 10px; position: relative; overflow: hidden; }
.inventaire-layout .inv-product-tile::before { content: ''; position: absolute; inset: 0; border-radius: var(--radius-lg); border: 1px solid transparent; transition: border-color 0.18s; pointer-events: none; }
.inventaire-layout .inv-product-tile:hover { background: var(--surface2); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.25); }
.inventaire-layout .inv-product-tile:hover::before { border-color: var(--orange); }
.inventaire-layout .inv-product-tile.tile-hidden { display: none !important; }

/* Category colour system */
.inventaire-layout .cat-laptop   { --cat-bg: rgba(99,102,241,0.14);  --cat-fg: #818CF8; }
.inventaire-layout .cat-screen   { --cat-bg: rgba(45,212,191,0.12);  --cat-fg: #2DD4BF; }
.inventaire-layout .cat-network  { --cat-bg: rgba(249,115,22,0.12);  --cat-fg: #F97316; }
.inventaire-layout .cat-printer  { --cat-bg: rgba(139,92,246,0.12);  --cat-fg: #A78BFA; }
.inventaire-layout .cat-mouse    { --cat-bg: rgba(16,185,129,0.12);  --cat-fg: #10B981; }
.inventaire-layout .cat-keyboard { --cat-bg: rgba(251,191,36,0.12);  --cat-fg: #FBBF24; }

.inventaire-layout .inv-tile-icon { width: 40px; height: 40px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--cat-bg); color: var(--cat-fg); }
.inventaire-layout .inv-tile-icon svg { width: 20px; height: 20px; }
.inventaire-layout .inv-tile-cat-strip { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin: -18px -18px 12px -18px; padding: 7px 14px; background: var(--cat-bg); border-radius: var(--radius-lg) var(--radius-lg) 0 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.inventaire-layout .inv-tile-cat-strip svg { width: 13px; height: 13px; color: var(--cat-fg); flex-shrink: 0; }
.inventaire-layout .inv-tile-cat-label { font-size: 11.5px; font-weight: 700; color: var(--cat-fg); letter-spacing: 0.04em; text-transform: uppercase; flex: 1; }
.inventaire-layout .inv-tile-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.inventaire-layout .inv-tile-sell-price { flex: 1; display: flex; flex-direction: column; }
.inventaire-layout .inv-tile-sell-price-val { font-family: 'JetBrains Mono', 'Space Mono', monospace; font-size: 16px; font-weight: 700; color: var(--text); letter-spacing: -0.5px; line-height: 1; }
.inventaire-layout .inv-tile-sell-price-label { font-size: 10px; color: var(--text3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 3px; }
.inventaire-layout .inv-tile-status { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px; letter-spacing: 0.02em; flex-shrink: 0; align-self: flex-start; }
.inventaire-layout .status-ok   { background: rgba(16,185,129,0.12); color: #10B981; }
.inventaire-layout .status-warn { background: rgba(245,158,11,0.12);  color: #F59E0B; }
.inventaire-layout .status-out  { background: rgba(244,63,94,0.12);   color: #F43F5E; }
.inventaire-layout .inv-tile-name { font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.35; letter-spacing: -0.2px; }
.inventaire-layout .inv-tile-ref  { font-size: 11px; color: var(--text3); font-family: 'JetBrains Mono', 'Space Mono', monospace; margin-top: 2px; }
.inventaire-layout .inv-tile-photo { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; margin-top: 12px; height: 90px; background: var(--surface3); border-radius: var(--radius); border: 1px dashed var(--border); color: var(--text3); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; overflow: hidden; }
.inventaire-layout .inv-tile-photo svg { width: 22px; height: 22px; opacity: 0.45; }
.inventaire-layout .inv-tile-photo.has-photo { background: transparent; border-color: transparent; padding: 0; }
.inventaire-layout .inv-tile-photo img { max-height: 90px; max-width: 100%; width: auto; height: auto; border-radius: var(--radius); display: block; object-fit: contain; }

/* Products list view */
.inventaire-layout .inv-plist { padding: 0 24px 24px; }
.inventaire-layout .inv-plist-row { display: flex; align-items: center; gap: 16px; padding: 12px 16px; background: var(--surface); border-radius: var(--radius-lg); margin-bottom: 8px; border: 1px solid var(--border); transition: border-color 0.15s; }
.inventaire-layout .inv-plist-row:hover { border-color: rgba(249,115,22,0.3); }
.inventaire-layout .inv-plist-photo-cell { flex-shrink: 0; }
.inventaire-layout .inv-plist-photo-wrap { position: relative; width: 80px; height: 56px; border-radius: var(--radius); overflow: hidden; background: var(--surface3); border: 1px dashed var(--border); display: flex; align-items: center; justify-content: center; }
.inventaire-layout .inv-plist-photo-wrap.has-photo { background: transparent; border-style: solid; }
.inventaire-layout .inv-plist-thumb { width: 100%; height: 100%; object-fit: contain; display: block; }
.inventaire-layout .inv-plist-no-photo { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.inventaire-layout .inv-plist-edit-cell { flex-shrink: 0; }
.inventaire-layout .inv-plist-edit-btn { background: var(--surface3); border: 1px solid var(--border); color: var(--text3); border-radius: var(--radius); padding: 6px 10px; cursor: pointer; display: flex; align-items: center; transition: color 0.15s, border-color 0.15s; }
.inventaire-layout .inv-plist-edit-btn:hover { color: var(--orange); border-color: rgba(249,115,22,0.4); }
.inventaire-layout .inv-plist-icon-cell { flex-shrink: 0; }
.inventaire-layout .inv-plist-info-cell { flex: 1; min-width: 0; }
.inventaire-layout .inv-plist-name { font-size: 14px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inventaire-layout .inv-plist-ref { font-size: 11px; color: var(--text3); font-family: 'JetBrains Mono', 'Space Mono', monospace; margin-top: 2px; }
.inventaire-layout .inv-plist-cat-cell { flex-shrink: 0; width: 110px; }
.inventaire-layout .inv-plist-cat { font-size: 12px; font-weight: 600; color: var(--text2); background: var(--surface3); border-radius: 4px; padding: 3px 8px; }
.inventaire-layout .inv-plist-stock-cell { flex-shrink: 0; width: 130px; display: flex; flex-direction: column; gap: 5px; }
.inventaire-layout .inv-plist-count { font-size: 13px; font-weight: 700; color: var(--text); font-family: 'JetBrains Mono', 'Space Mono', monospace; }
.inventaire-layout .inv-plist-price-cell { flex-shrink: 0; width: 120px; display: flex; flex-direction: column; }
.inventaire-layout .inv-plist-price { font-size: 14px; font-weight: 700; color: var(--text); font-family: 'JetBrains Mono', 'Space Mono', monospace; }
.inventaire-layout .inv-plist-price-label { font-size: 10px; color: var(--text3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; }
.inventaire-layout .inv-plist-row { cursor: pointer; }

/* Product detail page (sub-view within view-products) */
.inventaire-layout .inv-pdetail-header { display: flex; align-items: flex-start; gap: 20px; padding: 20px 24px; background: var(--bg2); border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.inventaire-layout .inv-pdetail-photo { width: 120px; height: 84px; border-radius: var(--radius); overflow: hidden; background: var(--surface3); border: 1px solid var(--border); flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.inventaire-layout .inv-pdetail-meta { flex: 1; }
.inventaire-layout .inv-pdetail-meta-name { font-size: 18px; font-weight: 800; color: var(--text); letter-spacing: -0.3px; line-height: 1.2; }
.inventaire-layout .inv-pdetail-meta-ref { font-size: 12px; color: var(--text3); font-family: 'JetBrains Mono', 'Space Mono', monospace; margin-top: 5px; }
.inventaire-layout .inv-pdetail-stats { display: flex; gap: 0; flex-shrink: 0; }
.inventaire-layout .inv-pdetail-stat { text-align: right; padding: 0 20px; border-left: 1px solid var(--border); }
.inventaire-layout .inv-pdetail-stat-val { font-size: 19px; font-weight: 700; color: var(--text); font-family: 'JetBrains Mono', 'Space Mono', monospace; line-height: 1; }
.inventaire-layout .inv-pdetail-stat-label { font-size: 10px; color: var(--text3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 3px; }
.inventaire-layout .inv-pdetail-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 0 24px 32px; }
.inventaire-layout .inv-pdetail-col-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text3); margin-bottom: 10px; padding: 0 2px; }
.inventaire-layout .inv-pdetail-txn-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 6px; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.inventaire-layout .inv-pdetail-txn-row:hover { border-color: rgba(249,115,22,0.35); background: rgba(249,115,22,0.03); }
.inventaire-layout .inv-pdetail-txn-badge { flex-shrink: 0; }
.inventaire-layout .inv-pdetail-txn-info { flex: 1; min-width: 0; }
.inventaire-layout .inv-pdetail-txn-main { font-size: 13px; font-weight: 700; color: var(--text); font-family: 'JetBrains Mono', 'Space Mono', monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inventaire-layout .inv-pdetail-txn-sub { font-size: 11.5px; color: var(--text3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inventaire-layout .inv-pdetail-txn-price { font-size: 13px; font-weight: 700; color: var(--text); font-family: 'JetBrains Mono', 'Space Mono', monospace; flex-shrink: 0; text-align: right; }
.inventaire-layout .inv-pdetail-txn-price-sell { color: var(--text); }
.inventaire-layout .inv-pdetail-txn-margin { display: block; font-size: 11px; font-weight: 700; color: #10B981; font-family: 'JetBrains Mono', 'Space Mono', monospace; }
.inventaire-layout .inv-pdetail-empty { padding: 24px 12px; text-align: center; color: var(--text3); font-size: 13px; background: var(--surface); border-radius: var(--radius); border: 1px dashed var(--border); }

/* Transaction detail modal */
.inventaire-layout .inv-txn-detail-grid { display: flex; flex-direction: column; gap: 0; }
.inventaire-layout .inv-txn-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.inventaire-layout .inv-txn-row:last-child { border-bottom: none; }
.inventaire-layout .inv-txn-label { font-size: 12px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: 0.04em; }
.inventaire-layout .inv-txn-val { font-size: 13.5px; font-weight: 700; color: var(--text); text-align: right; }
.inventaire-layout .inv-txn-val.inv-mono { font-family: 'JetBrains Mono', 'Space Mono', monospace; }
.inventaire-layout .inv-txn-price { font-size: 16px; color: var(--orange); }
.inventaire-layout .inv-txn-margin { color: #10B981; }

/* Product edit modal — photo zone */
.inventaire-layout .inv-edit-photo-zone { position: relative; width: 100%; height: 150px; background: var(--surface3); border-radius: var(--radius); border: 1px dashed var(--border); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; cursor: pointer; overflow: hidden; transition: border-color 0.15s; margin-bottom: 16px; }
.inventaire-layout .inv-edit-photo-zone:hover { border-color: rgba(249,115,22,0.45); }
.inventaire-layout .inv-edit-photo-zone.has-photo { background: transparent; border-style: solid; }
.inventaire-layout .inv-edit-photo-hint { font-size: 11px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: 0.05em; }
.inventaire-layout .inv-edit-photo-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; color: #fff; opacity: 0; transition: opacity 0.15s; }
.inventaire-layout .inv-edit-photo-zone:hover .inv-edit-photo-overlay { opacity: 1; }

.inventaire-layout .inv-toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(12px); background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: 13.5px; font-weight: 600; padding: 10px 20px; border-radius: var(--radius-lg); box-shadow: 0 4px 24px rgba(0,0,0,0.35); opacity: 0; transition: opacity 0.2s, transform 0.2s; pointer-events: none; z-index: 1200; white-space: nowrap; }
.inventaire-layout .inv-toast.inv-toast-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.inventaire-layout .inv-toast.inv-toast-success { border-color: rgba(16,185,129,0.4); color: #10B981; }
.inventaire-layout .inv-toast.inv-toast-error   { border-color: rgba(244,63,94,0.4);  color: #F43F5E; }
.inventaire-layout .inv-tile-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.inventaire-layout .inv-tile-value-block { display: flex; flex-direction: column; }
.inventaire-layout .inv-tile-value-val { font-family: 'JetBrains Mono', 'Space Mono', monospace; font-size: 17px; font-weight: 700; color: var(--text); letter-spacing: -0.5px; line-height: 1; }
.inventaire-layout .inv-tile-value-val.zero { color: var(--text3); }
.inventaire-layout .inv-tile-value-label { font-size: 10px; color: var(--text3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 3px; }
.inventaire-layout .inv-tile-count-pill { display: flex; flex-direction: column; align-items: center; background: var(--surface3); border-radius: var(--radius); padding: 6px 14px; min-width: 52px; }
.inventaire-layout .inv-tile-count-num { font-family: 'JetBrains Mono', 'Space Mono', monospace; font-size: 18px; font-weight: 700; color: var(--text); line-height: 1; }
.inventaire-layout .inv-tile-count-num.zero { color: var(--text3); }
.inventaire-layout .inv-tile-count-label { font-size: 9.5px; color: var(--text3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 2px; }

/* Product detail modal */
.inventaire-layout .inv-modal-lg { width: 680px; }
.inventaire-layout .inv-pd-header-info { display: flex; align-items: center; gap: 14px; padding: 16px 24px; background: var(--bg2); border-bottom: 1px solid var(--border); }
.inventaire-layout .inv-pd-icon { width: 44px; height: 44px; border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--cat-bg); color: var(--cat-fg); }
.inventaire-layout .inv-pd-icon svg { width: 22px; height: 22px; }
.inventaire-layout .inv-pd-title { font-size: 15px; font-weight: 700; color: var(--text); }
.inventaire-layout .inv-pd-ref   { font-size: 12px; color: var(--text3); font-family: 'JetBrains Mono', 'Space Mono', monospace; margin-top: 2px; }
.inventaire-layout .inv-pd-stats { display: flex; gap: 0; flex: 1; justify-content: flex-end; }
.inventaire-layout .inv-pd-stat  { text-align: right; padding: 0 16px; border-left: 1px solid var(--border); }
.inventaire-layout .inv-pd-stat-val   { font-size: 17px; font-weight: 700; color: var(--text); font-family: 'JetBrains Mono', 'Space Mono', monospace; }
.inventaire-layout .inv-pd-stat-label { font-size: 10.5px; color: var(--text3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; margin-top: 1px; }
.inventaire-layout .inv-pd-item { display: flex; align-items: center; gap: 14px; padding: 13px 24px; border-bottom: 1px solid var(--border); transition: background 0.1s; }
.inventaire-layout .inv-pd-item:last-child { border-bottom: none; }
.inventaire-layout .inv-pd-item:hover { background: rgba(255,255,255,0.02); }
.inventaire-layout .inv-pd-item-num { width: 24px; height: 24px; border-radius: 50%; background: var(--surface2); border: 1px solid var(--border2); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--text3); flex-shrink: 0; }
.inventaire-layout .inv-pd-item-info { flex: 1; min-width: 0; }
.inventaire-layout .inv-pd-item-sn-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.inventaire-layout .inv-pd-sn-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text3); background: var(--surface3); padding: 2px 7px; border-radius: 4px; flex-shrink: 0; }
.inventaire-layout .inv-pd-sn-val { font-family: 'JetBrains Mono', 'Space Mono', monospace; font-size: 13px; font-weight: 600; color: var(--text); letter-spacing: 0.02em; }
.inventaire-layout .inv-pd-item-meta { font-size: 11.5px; color: var(--text3); display: flex; flex-wrap: wrap; gap: 10px; }
.inventaire-layout .inv-pd-item-meta span { display: flex; align-items: center; gap: 4px; }
.inventaire-layout .inv-pd-item-meta strong { color: var(--text2); font-weight: 500; }
.inventaire-layout .inv-pd-item-price { text-align: right; flex-shrink: 0; }
.inventaire-layout .inv-pd-price-val   { font-family: 'JetBrains Mono', 'Space Mono', monospace; font-size: 14px; font-weight: 700; color: var(--text); }
.inventaire-layout .inv-pd-price-label { font-size: 10.5px; color: var(--text3); margin-top: 1px; }

/* Scrollbar */
.inventaire-layout ::-webkit-scrollbar       { width: 5px; height: 5px; }
.inventaire-layout ::-webkit-scrollbar-track  { background: transparent; }
.inventaire-layout ::-webkit-scrollbar-thumb  { background: var(--surface3); border-radius: 3px; }
.inventaire-layout ::-webkit-scrollbar-thumb:hover { background: var(--text3); }
.borne-toast.error { background: #7f1d1d; color: #fca5a5; border-color: rgba(239,68,68,0.3); }

/* Inventaire — Year switcher */
.inventaire-layout .inv-year-switcher { position: relative; }

.inventaire-layout .inv-year-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px; border-radius: var(--radius);
  background: var(--surface2); border: 1px solid var(--border2);
  color: var(--text2); font-size: 13px; font-weight: 600;
  font-family: 'Plus Jakarta Sans', 'Figtree', sans-serif;
  cursor: pointer; transition: all 0.15s;
}

.inventaire-layout .inv-year-btn:hover { background: var(--surface3); color: var(--text); }

.inventaire-layout #inv-dash-year-btn {
  background: var(--orange-light); color: var(--orange);
  border-color: rgba(249,115,22,0.3); font-weight: 700; letter-spacing: 0.03em;
}
.inventaire-layout #inv-dash-year-btn:hover { background: rgba(249,115,22,0.2); color: var(--orange); }

.inventaire-layout .inv-year-dropdown {
  display: none; position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35); min-width: 100px; z-index: 50;
}

.inventaire-layout .inv-year-dropdown.open { display: block; }

.inventaire-layout .inv-year-option {
  display: block; width: 100%; padding: 9px 16px;
  text-align: left; background: transparent; border: none;
  color: var(--text2); font-size: 13px; font-weight: 500;
  font-family: 'Plus Jakarta Sans', 'Figtree', sans-serif;
  cursor: pointer; transition: background 0.12s;
}

.inventaire-layout .inv-year-option:hover { background: var(--surface3); color: var(--text); }
.inventaire-layout .inv-year-option.active { color: var(--orange); font-weight: 700; background: var(--orange-light); }

/* ── Multi-item rows (modals vente/achat) ── */
.inventaire-layout .inv-mitem-header {
  display: grid; grid-template-columns: 1fr 1fr 110px 32px;
  gap: 8px; padding: 0 0 6px; margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
  color: var(--text3); font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
}
.inventaire-layout .inv-mitem-row {
  display: grid; grid-template-columns: 1fr 1fr 110px 32px;
  gap: 8px; align-items: center; margin-bottom: 8px;
}
.inventaire-layout .inv-mitem-remove-btn {
  width: 32px; height: 32px; flex-shrink: 0;
  border: 1px solid var(--border); background: transparent;
  color: var(--text3); border-radius: var(--radius);
  cursor: pointer; font-size: 16px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.15s, border-color 0.15s;
}
.inventaire-layout .inv-mitem-remove-btn:hover { color: #F43F5E; border-color: rgba(244,63,94,0.4); }
/* Achat modal : 5 colonnes (Qté | Produit | N° série | Prix | ×) */
#inv-modal-multi-achat .inv-mitem-header,
#inv-modal-multi-achat .inv-mitem-row { grid-template-columns: 60px 1fr 1fr 110px 32px; }
.inventaire-layout .inv-add-row-btn {
  margin-top: 6px; font-size: 12.5px; color: var(--text3); gap: 5px;
  padding: 6px 10px; border: 1px dashed var(--border);
}
.inventaire-layout .inv-add-row-btn:hover { color: var(--text); border-color: var(--border2); background: var(--surface2); }

/* ── Barre recherche mouvements ── */
.inventaire-layout .inv-mvt-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.inventaire-layout .inv-mvt-search-wrap .inv-form-input {
  padding-left: 34px;
  padding-right: 28px;
  width: 260px;
  font-size: 13px;
  height: 34px;
}
.inventaire-layout .inv-mvt-search-clear {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: var(--text3);
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  padding: 0 2px;
}
.inventaire-layout .inv-mvt-search-clear:hover { color: var(--text); }

/* ── Liste produits ── */
.inventaire-layout .inv-plist { margin: 0; }
.inventaire-layout .inv-plist-row {
  display: grid;
  grid-template-columns: 52px 1fr 160px 130px 120px 40px;
  align-items: center;
  gap: 0 14px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
}
.inventaire-layout .inv-plist-row:hover { background: var(--surface2); }
.inventaire-layout .inv-plist-photo-cell { display: flex; align-items: center; justify-content: center; }
.inventaire-layout .inv-plist-photo-wrap {
  width: 40px; height: 40px; border-radius: 8px;
  background: var(--surface2); border: 1px solid var(--border);
  overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.inventaire-layout .inv-plist-thumb { width: 100%; height: 100%; object-fit: cover; }
.inventaire-layout .inv-plist-no-photo { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.inventaire-layout .inv-plist-icon-cell { display: flex; align-items: center; justify-content: center; }
.inventaire-layout .inv-plist-info-cell { min-width: 0; }
.inventaire-layout .inv-plist-name { font-weight: 600; font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inventaire-layout .inv-plist-ref { font-size: 12px; color: var(--text3); margin-top: 2px; font-family: 'JetBrains Mono', 'Space Mono', monospace; }
.inventaire-layout .inv-plist-cat-cell { display: flex; align-items: center; }
.inventaire-layout .inv-plist-cat { font-size: 12px; color: var(--text2); background: var(--surface2); border: 1px solid var(--border); border-radius: 6px; padding: 2px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.inventaire-layout .inv-plist-stock-cell { display: flex; flex-direction: column; gap: 3px; }
.inventaire-layout .inv-plist-count { font-size: 13px; font-weight: 600; color: var(--text); }
.inventaire-layout .inv-plist-price-cell { display: flex; flex-direction: column; gap: 2px; }
.inventaire-layout .inv-plist-price { font-size: 14px; font-weight: 600; color: var(--text); }
.inventaire-layout .inv-plist-price-label { font-size: 11px; color: var(--text3); }
.inventaire-layout .inv-plist-edit-cell { display: flex; justify-content: flex-end; }

/* ── Fournisseurs ── */
.inventaire-layout .inv-sup-list-wrap { margin: 0; }
.inventaire-layout .inv-sup-list-header {
  display: grid; grid-template-columns: 2fr 2fr 1.2fr 120px 40px;
  gap: 12px; padding: 0 16px 10px; margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
  color: var(--text3); font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
}
.inventaire-layout .inv-sup-row {
  display: grid; grid-template-columns: 2fr 2fr 1.2fr 120px 40px;
  gap: 12px; align-items: center;
  padding: 14px 16px; border-radius: var(--radius-lg);
  cursor: pointer; transition: background 0.12s;
  border-bottom: 1px solid var(--border);
}
.inventaire-layout .inv-sup-row:hover { background: var(--surface2); }
.inventaire-layout .inv-sup-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.inventaire-layout .inv-sup-avatar {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; letter-spacing: 0.02em;
}
.inventaire-layout .inv-sup-name { font-weight: 600; font-size: 14px; color: var(--text); }
.inventaire-layout .inv-sup-cat { font-size: 12px; color: var(--text3); margin-top: 2px; }
.inventaire-layout .inv-sup-contact-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.inventaire-layout .inv-sup-contact-name  { font-size: 13px; font-weight: 500; color: var(--text2); }
.inventaire-layout .inv-sup-contact-email { font-size: 12px; color: var(--text3); }
.inventaire-layout .inv-sup-contact-phone { font-size: 12px; color: var(--text3); }
.inventaire-layout .inv-sup-vat-cell { color: var(--text2); font-size: 13px; }
.inventaire-layout .inv-sup-count-cell { display: flex; align-items: center; gap: 4px; }
.inventaire-layout .inv-sup-count-badge {
  background: var(--orange-light); color: var(--orange);
  border: 1px solid rgba(249,115,22,0.25);
  font-weight: 700; font-size: 13px; padding: 1px 8px; border-radius: 20px;
}
.inventaire-layout .inv-sup-count-label { font-size: 12px; color: var(--text3); }
.inventaire-layout .inv-sup-actions-cell { display: flex; justify-content: flex-end; }
.inventaire-layout .inv-lot-card {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border);
  cursor: pointer; transition: background 0.15s, box-shadow 0.15s;
  user-select: none;
}
.inventaire-layout .inv-lot-card:hover {
  background: var(--surface2); box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

/* =============================================================
   PROJETS — BARRE MOBILE PERSISTANTE
   ============================================================= */

/* Barre de navigation mobile (remplace topbar sur les pages sans topbar) */
.proj-mobile-bar {
    display: none; /* masquée sur desktop */
    align-items: center;
    gap: 0.75rem;
    height: 52px;
    background: linear-gradient(175deg, #111f38 0%, #0d1426 50%, #111f38 100%);
    padding: 0 1rem;
    position: sticky;
    top: 0;
    z-index: 300;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.proj-mobile-bar-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 9px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s;
}
.proj-mobile-bar-btn:hover { background: rgba(255,255,255,0.12); }
.proj-mobile-bar-btn span {
    display: block;
    width: 16px;
    height: 2px;
    background: #e2e8f0;
    border-radius: 1px;
}

.proj-mobile-bar-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #e2e8f0;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.proj-mobile-bar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Bouton flottant legacy (masqué par défaut, inutilisé) */
.mobile-menu-btn { display: none; }

/* =============================================================
   PROJETS — MOBILE RESPONSIVE
   ============================================================= */

@media (max-width: 768px) {

    /* ── Barre mobile visible ── */
    .proj-mobile-bar { display: flex; }

    /* ── Sidebar : z-index élevé pour couvrir la barre mobile ── */
    .sidebar { z-index: 350; }
    .sidebar-overlay { z-index: 340; }

    /* ── Contenu principal ── */
    .main-content { padding: 1rem 1rem 2rem; }

    /* ── Home page ── */
    .unnoticed-wrap { width: 100%; }
    .overdue-block,
    .card.mb-section { margin-bottom: 1rem; }
    .home-grid { gap: 1rem; }

    /* ── En-tête projet ── */
    .project-header-top {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    .project-title {
        font-size: 1.15rem;
        line-height: 1.3;
    }
    .project-title-row { flex-wrap: wrap; gap: 0.4rem; }
    .project-header-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; }

    /* ── Onglets vue ── */
    .view-tabs { display: flex; gap: 0.35rem; flex-wrap: wrap; }
    .view-tab[data-tab="gantt"] { display: none; }
    #tabGantt { display: none !important; }

    /* ── Phases ── */
    .phase-header { flex-wrap: wrap; gap: 0.4rem; }
    .phase-header-meta { flex-wrap: wrap; gap: 0.3rem; }

    /* ── Tâches : espaces tactiles ── */
    .task-item { padding: 0.5rem 0; }
    .task-row { flex-wrap: wrap; gap: 0.35rem; align-items: flex-start; }
    .task-check { width: 26px; height: 26px; flex-shrink: 0; }
    .task-title { font-size: 0.88rem; }
    .task-badges { width: 100%; display: flex; flex-wrap: wrap; gap: 0.25rem; }
    .task-stakeholders { display: none; }

    /* ── Panneau tâche : plein écran ── */
    .task-panel {
        inset: 0 !important;
        width: auto !important;
        max-width: none !important;
        height: auto !important;
        max-height: none !important;
        transform: translateY(40px) !important;
        border-radius: 0 !important;
    }
    .task-panel.is-open { transform: translateY(0) !important; }

    /* ── Modales ── */
    .confirm-modal {
        width: calc(100vw - 2rem) !important;
        max-width: none !important;
    }

    /* ── Intervenants ── */
    .sh-avatars { flex-wrap: wrap; gap: 0.5rem; }

    /* ── Notes ── */
    .project-notes-card { margin-top: 1rem; }
    .notes-toolbar { flex-wrap: wrap; gap: 2px; }

    /* ── Graphique ── */
    .project-chart-section { margin-top: 0.5rem; }

    /* ── Ajout phase ── */
    .add-phase-form > div:first-child { flex-wrap: wrap; gap: 0.5rem; }
    .add-phase-form input[type="text"] { max-width: 100% !important; }

    /* ── Overdue items ── */
    .overdue-item { flex-wrap: wrap; gap: 0.4rem; }
}

/* ===== Quick Notes (Post-IT temps non imputés) ===== */
#quickNotesCard { border-top: 3px solid #f59e0b; }

.qn-form {
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 14px;
}
.qn-time-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.qn-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #6b7280;
    white-space: nowrap;
}
.qn-time-inputs {
    display: flex;
    align-items: center;
    gap: 4px;
}
.qn-time-input {
    width: 52px;
    background: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #1a1a2e;
    font-size: 0.88rem;
    padding: 5px 8px;
    text-align: center;
    font-family: inherit;
}
.qn-time-input:focus { outline: none; border-color: #4361ee; box-shadow: 0 0 0 2px rgba(67,97,238,.15); }
.qn-time-sep { font-size: 0.82rem; color: #9ca3af; }
.qn-note-input {
    width: 100%;
    background: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #1a1a2e;
    font-size: 0.88rem;
    padding: 7px 10px;
    resize: vertical;
    min-height: 64px;
    font-family: inherit;
    margin-bottom: 8px;
}
.qn-note-input:focus { outline: none; border-color: #4361ee; box-shadow: 0 0 0 2px rgba(67,97,238,.15); }
.qn-form-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
.qn-btn-cancel {
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #6b7280;
    font-size: 0.82rem;
    padding: 5px 12px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}
.qn-btn-cancel:hover { background: #f3f4f6; }
.qn-btn-submit {
    background: #4361ee;
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 5px 16px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}
.qn-btn-submit:hover { background: #3451d1; }
.qn-btn-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.qn-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.qn-empty { color: #9ca3af; font-size: 0.84rem; text-align: center; padding: 14px 0; grid-column: 1 / -1; }

.qn-item {
    background: rgba(245, 158, 11, 0.05);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-left: 3px solid #f59e0b;
    border-radius: 8px;
    padding: 10px 12px;
    min-height: 110px;
    display: flex;
    flex-direction: column;
}
.qn-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 5px;
}
.qn-item-time {
    font-size: 0.8rem;
    font-weight: 700;
    color: #d97706;
}
.qn-item-date { font-size: 0.72rem; color: #9ca3af; }
.qn-item-note {
    font-size: 0.86rem;
    color: #374151;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    flex: 1;
}
.qn-item-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}
.qn-del {
    background: none;
    border: none;
    cursor: pointer;
    color: #d1d5db;
    padding: 3px 5px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: color 0.15s;
}
.qn-del:hover { color: #ef4444; }
.qn-del svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.qn-confirm {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(245, 158, 11, 0.2);
}
.qn-confirm span { font-size: 0.78rem; color: #6b7280; flex: 1; }
.qn-confirm-cancel {
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    color: #6b7280;
    font-size: 0.75rem;
    padding: 3px 8px;
    cursor: pointer;
    font-family: inherit;
}
.qn-confirm-ok {
    background: #ef4444;
    border: none;
    border-radius: 5px;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 9px;
    cursor: pointer;
    font-family: inherit;
}

/* ═══════════════════════════════════════════════════
   LACTO-FERMENTATION
   ═══════════════════════════════════════════════════ */

.lacto-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #f4f7f1;
    font-family: 'Figtree', sans-serif;
}

/* ── Header ── */
.lacto-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    height: 52px;
    background: #fff;
    border-bottom: 1px solid #d8e8d2;
    position: sticky;
    top: 0;
    z-index: 100;
}
.lacto-header-left  { display: flex; align-items: center; gap: 10px; flex: 1; }
.lacto-header-right { display: flex; align-items: center; gap: 8px; flex: 1; justify-content: flex-end; }
.lacto-hdr-btn {
    display: flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 7px;
    color: #5c7a50; text-decoration: none;
    transition: background .15s;
}
.lacto-hdr-btn:hover { background: #e8f0e4; }
.lacto-hdr-sep { width: 1px; height: 18px; background: #d0e0c8; }
.lacto-hdr-title { font-size: 0.95rem; font-weight: 600; color: #2d4a2a; }

/* ── Nav ── */
.lacto-nav { display: flex; gap: 2px; }
.lacto-nav-link {
    padding: 5px 14px; border-radius: 6px;
    font-size: 0.85rem; font-weight: 500;
    color: #6b7280; text-decoration: none;
    transition: background .15s, color .15s;
}
.lacto-nav-link:hover { background: #e8f0e4; color: #2d4a2a; }
.lacto-nav-link.is-active { background: #4a7c59; color: #fff; }

/* ── Buttons ── */
.lacto-btn-primary, .lacto-btn-secondary {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; border-radius: 7px;
    font-size: 0.83rem; font-weight: 600;
    text-decoration: none; cursor: pointer;
    border: none; font-family: inherit;
    transition: background .15s, transform .1s;
}
.lacto-btn-primary  { background: #4a7c59; color: #fff; }
.lacto-btn-primary:hover  { background: #3d6849; }
.lacto-btn-secondary { background: #f0f4ee; color: #4a7c59; border: 1px solid #c8dcc0; }
.lacto-btn-secondary:hover { background: #e2eddc; }

/* ── Flash ── */
.lacto-flash {
    margin: 12px 20px 0;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
}
.lacto-flash--error { background: #fef2f2; color: #b91c1c; border: 1px solid #fca5a5; }

/* ── Main & Page ── */
.lacto-main { padding: 20px; max-width: 860px; margin: 0 auto; width: 100%; }
.lacto-page { display: flex; flex-direction: column; gap: 28px; }

/* ── Sections ── */
.lacto-section { background: #fff; border-radius: 12px; border: 1px solid #d8e8d2; overflow: hidden; }
.lacto-section--archive { background: #f9faf8; border-color: #e0e8db; }
.lacto-section-header {
    display: flex; align-items: center; gap: 8px;
    padding: 14px 18px;
    font-size: 0.88rem; font-weight: 700;
    border-bottom: 1px solid #e4ede0;
    cursor: default;
}
.lacto-section-header--ambiance { color: #92600a; background: #fffbeb; border-bottom-color: #fde68a; }
.lacto-section-header--cave     { color: #3730a3; background: #eef2ff; border-bottom-color: #c7d2fe; }
.lacto-section-header--recipe   { color: #2d4a2a; background: #f2f7f0; }
.lacto-section-header--termine  { color: #6b7280; background: #f9fafb; border-bottom-color: #e5e7eb; list-style: none; }
.lacto-section-header--termine::-webkit-details-marker { display: none; }
.lacto-count {
    margin-left: auto;
    background: rgba(0,0,0,.08);
    color: inherit;
    border-radius: 20px;
    padding: 1px 8px;
    font-size: 0.78rem;
}
.lacto-count--grey { background: #e5e7eb; color: #6b7280; }

/* ── Cards ── */
.lacto-cards { display: flex; flex-direction: column; gap: 0; }
.lacto-cards--archive { padding: 6px 0; }
.lacto-empty { padding: 20px 18px; color: #9ca3af; font-size: 0.88rem; margin: 0; }
.lacto-link { color: #4a7c59; text-decoration: underline; }

.lacto-card {
    padding: 14px 18px;
    border-bottom: 1px solid #eef3ec;
    transition: background .12s;
}
.lacto-card:last-child { border-bottom: none; }
.lacto-card:hover { background: #fafcf9; }
.lacto-card--ambiance:hover { background: #fffdf4; }
.lacto-card--cave:hover     { background: #f8f9ff; }
.lacto-card--termine { opacity: .75; }

.lacto-card-top {
    display: flex; align-items: flex-start;
    justify-content: space-between; gap: 12px;
}
.lacto-card-info { display: flex; flex-direction: column; gap: 2px; }
.lacto-card-name { font-size: 0.95rem; font-weight: 600; color: #1a2e18; }
.lacto-card-recipe { font-size: 0.78rem; color: #6b7280; }
.lacto-card-meta { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.lacto-card-notes { margin: 6px 0 0; font-size: 0.81rem; color: #6b7280; white-space: pre-wrap; }

/* ── Badges ── */
.lacto-badge {
    display: inline-flex; align-items: center;
    padding: 2px 8px; border-radius: 20px;
    font-size: 0.74rem; font-weight: 600;
}
.lacto-badge--container { background: #e8f0e4; color: #3d6849; }
.lacto-badge--weight    { background: #fef3c7; color: #92600a; }
.lacto-badge--days      { background: #dbeafe; color: #1e40af; }
.lacto-badge--uses      { background: #f3f4f6; color: #6b7280; }
.lacto-badge--reussi    { background: #dcfce7; color: #166534; font-weight: 600; }
.lacto-badge--echec     { background: #fef2f2; color: #b91c1c; font-weight: 600; }

/* ── Action buttons ── */
.lacto-card-actions {
    display: flex; align-items: center; gap: 6px;
    margin-top: 10px; flex-wrap: wrap;
}
.lacto-action-btn {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px; border-radius: 6px;
    font-size: 0.78rem; font-weight: 500;
    cursor: pointer; border: none;
    font-family: inherit; text-decoration: none;
    transition: background .12s;
}
.lacto-action-btn--reussi { background: #dcfce7; color: #166534; }
.lacto-action-btn--reussi:hover { background: #bbf7d0; }
.lacto-action-btn--echec  { background: #fef2f2; color: #b91c1c; }
.lacto-action-btn--echec:hover  { background: #fee2e2; }
.lacto-action-btn--edit   { background: #f0f4ee; color: #4a7c59; }
.lacto-action-btn--edit:hover   { background: #e2eddc; }
.lacto-action-btn--delete { background: #fef2f2; color: #b91c1c; }
.lacto-action-btn--delete:hover { background: #fee2e2; }
.lacto-action-btn--reopen { background: #f0f4ee; color: #4a7c59; font-size: 0.77rem; }

/* ── Recipe list ── */
.lacto-recipe-list { display: flex; flex-direction: column; }
.lacto-recipe-card {
    padding: 14px 18px;
    border-bottom: 1px solid #eef3ec;
    text-align: left;
}
.lacto-recipe-card--clickable {
    width: 100%; background: none; border: none; border-bottom: 1px solid #eef3ec;
    cursor: pointer; font-family: inherit; transition: background .15s;
}
.lacto-recipe-card--clickable:hover { background: #f6faf4; }
.lacto-recipe-card--clickable:last-child { border-bottom: none; }
.lacto-recipe-card:last-child { border-bottom: none; }
.lacto-recipe-card-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.lacto-recipe-name { font-size: 0.95rem; font-weight: 600; color: #1a2e18; }
.lacto-recipe-meta { display: flex; gap: 5px; }
.lacto-recipe-desc { font-size: 0.82rem; color: #6b7280; margin: 0 0 8px; }
/* Modal recette */
.lacto-modal--recipe { max-height: 85vh; overflow-y: auto; }
.lacto-recipe-modal-desc { font-size: 0.88rem; color: #4b5563; margin: 0 0 16px; font-style: italic; }
.lacto-recipe-modal-section { margin-top: 16px; }
.lacto-recipe-modal-section-title { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #6b7280; margin: 0 0 6px; }
.lacto-recipe-modal-pre { font-family: inherit; font-size: 0.85rem; color: #1a2e18; white-space: pre-wrap; margin: 0; line-height: 1.6; }

/* ── Form page ── */
.lacto-form-page { max-width: 640px; }
.lacto-form-title {
    font-size: 1.15rem; font-weight: 700;
    color: #1a2e18; margin: 0 0 24px;
}
.lacto-form { display: flex; flex-direction: column; gap: 18px; }
.lacto-form-row { display: flex; gap: 14px; }
.lacto-form-row .lacto-form-group { flex: 1; }
.lacto-form-group { display: flex; flex-direction: column; gap: 5px; }
.lacto-label { font-size: 0.84rem; font-weight: 600; color: #374151; }
.lacto-required { color: #b91c1c; }
.lacto-input, .lacto-select, .lacto-textarea {
    padding: 8px 11px; border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 0.87rem; font-family: inherit; color: #111827;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.lacto-input:focus, .lacto-select:focus, .lacto-textarea:focus {
    outline: none; border-color: #4a7c59;
    box-shadow: 0 0 0 3px rgba(74,124,89,.12);
}
.lacto-textarea { resize: vertical; line-height: 1.5; }

/* ── Radio buttons ── */
.lacto-radio-group { display: flex; gap: 10px; flex-wrap: wrap; }
.lacto-radio { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.lacto-radio input[type="radio"] { accent-color: #4a7c59; width: 15px; height: 15px; cursor: pointer; }
.lacto-radio-label {
    padding: 5px 14px; border-radius: 20px;
    font-size: 0.83rem; font-weight: 500;
    border: 1.5px solid transparent; cursor: pointer;
    transition: background .12s;
}
.lacto-radio-label--ambiance { background: #fffbeb; color: #92600a; border-color: #fde68a; }
.lacto-radio-label--cave     { background: #eef2ff; color: #3730a3; border-color: #c7d2fe; }
.lacto-radio input[type="radio"]:checked + .lacto-radio-label--ambiance { background: #fef3c7; border-color: #f59e0b; }
.lacto-radio input[type="radio"]:checked + .lacto-radio-label--cave     { background: #e0e7ff; border-color: #6366f1; }

/* ── Form actions ── */
.lacto-form-actions {
    display: flex; gap: 10px; justify-content: flex-end;
    padding-top: 4px; margin-top: 4px;
}
.lacto-form-danger {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid #fee2e2;
    display: flex;
    justify-content: flex-end;
}
.lacto-btn-danger {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; border-radius: 7px; border: 1px solid #fecaca;
    background: #fef2f2; color: #b91c1c;
    font-size: 0.82rem; font-weight: 500; cursor: pointer;
    text-decoration: none; transition: background 0.15s;
}
.lacto-btn-danger:hover { background: #fee2e2; }

/* ── Tile grid ── */
.lacto-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 14px;
    padding: 16px 18px 18px;
}
.lacto-tiles--archive { padding-top: 10px; }

.lacto-tile {
    aspect-ratio: 1;
    background: #fff;
    border: 1.5px solid #d8e8d2;
    border-radius: 14px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 10px 8px 10px;
    transition: transform .15s, box-shadow .15s, border-color .15s;
    position: relative;
    overflow: hidden;
    font-family: inherit;
    gap: 4px;
}
.lacto-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(74,124,89,.16);
    border-color: #4a7c59;
}
.lacto-tile--ambiance { border-top: 3px solid #f59e0b; }
.lacto-tile--cave     { border-top: 3px solid #6366f1; }
.lacto-tile--termine  { opacity: .6; filter: grayscale(.4); }
.lacto-tile--archive  { opacity: .6; filter: grayscale(.4); }

.lacto-tile-id {
    position: absolute;
    top: 7px;
    right: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 50px;
    background: #374151;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
}

.lacto-tile-img-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 0;
    padding: 4px 6px 0;
}
.lacto-tile-img {
    max-width: 80%;
    max-height: 100%;
    object-fit: contain;
}
.lacto-tile-img--default { opacity: .5; }

.lacto-tile-name {
    font-size: 0.76rem;
    font-weight: 700;
    color: #1a2e18;
    text-align: center;
    line-height: 1.25;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    width: 100%;
}
.lacto-tile-days {
    font-size: 0.68rem;
    color: #6b7280;
    font-weight: 500;
}
.lacto-tile-days--done { color: #4a7c59; }
.lacto-tile-status { font-weight: 600; }
.lacto-tile-status--reussi { color: #166534; }
.lacto-tile-status--echec  { color: #b91c1c; }

/* ── Modal ── */
.lacto-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10,20,10,.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
    padding: 16px;
}
.lacto-modal-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}
.lacto-modal {
    background: #fff;
    border-radius: 18px;
    padding: 28px 24px 22px;
    max-width: 400px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(.93) translateY(12px);
    transition: transform .22s cubic-bezier(.34,1.3,.64,1);
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.lacto-modal-overlay.is-open .lacto-modal {
    transform: scale(1) translateY(0);
}
.lacto-modal-close {
    position: absolute;
    top: 14px; right: 16px;
    width: 30px; height: 30px;
    border-radius: 50%;
    border: none;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .12s;
}
.lacto-modal-close:hover { background: #e5e7eb; }

.lacto-modal-img-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
    height: 140px;
}
.lacto-modal-img {
    max-height: 100%;
    max-width: 60%;
    object-fit: contain;
}
.lacto-modal-name {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a2e18;
    margin: 0 0 10px;
}
.lacto-modal-name .lacto-tile-id {
    position: static;
    flex-shrink: 0;
}
.lacto-modal-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 14px;
}
.lacto-modal-details {
    margin: 0 0 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.lacto-modal-dl-row {
    display: flex;
    gap: 8px;
    font-size: 0.85rem;
}
.lacto-modal-dl-row dt {
    color: #6b7280;
    font-weight: 500;
    min-width: 90px;
}
.lacto-modal-dl-row dd {
    color: #1a2e18;
    font-weight: 600;
    margin: 0;
}
.lacto-modal-notes {
    background: #f4f7f1;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.83rem;
    color: #4b5563;
    margin: 0 0 16px;
    white-space: pre-wrap;
    line-height: 1.5;
}
.lacto-modal-actions {
    text-align: center;
    padding-top: 12px;
    border-top: 1px solid #eef3ec;
}
.lacto-modal-actions .lacto-action-btn {
    margin: 3px;
}

/* ── Image gallery ── */
.lacto-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    padding: 2px 0;
}
.lacto-gallery-loading,
.lacto-gallery-empty {
    color: #9ca3af;
    font-size: 0.85rem;
    margin: 0;
    grid-column: 1/-1;
}
.lacto-gallery-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 6px 8px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: #fafafa;
    cursor: pointer;
    font-family: inherit;
    transition: border-color .12s, background .12s;
}
.lacto-gallery-item:hover { border-color: #4a7c59; background: #f2f7f0; }
.lacto-gallery-item.is-selected { border-color: #4a7c59; background: #e8f0e4; box-shadow: 0 0 0 3px rgba(74,124,89,.15); }
.lacto-gallery-item img {
    width: 60px; height: 60px;
    object-fit: contain;
}
.lacto-gallery-item span {
    font-size: 0.72rem;
    font-weight: 500;
    color: #374151;
    text-align: center;
    line-height: 1.25;
    word-break: break-word;
}
.lacto-gallery-none-img {
    width: 60px; height: 60px;
    display: flex; align-items: center; justify-content: center;
}

@media (max-width: 600px) {
    .lacto-main { padding: 12px; }
    .lacto-form-row { flex-direction: column; gap: 12px; }
    .lacto-tiles { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
    .lacto-modal { padding: 20px 16px 16px; }
}
