/* ===== FOPinnovations — Design System ===== */

:root {
    --primary: #2563EB;
    --primary-dark: #1D4ED8;
    --primary-light: #DBEAFE;
    --bg: #F8FAFC;
    --bg-light: #F1F5F9;
    --surface: #FFFFFF;
    --border: #E2E8F0;
    --text: #1E293B;
    --text-light: #64748B;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
code {
    background: var(--bg);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85em;
    color: var(--primary-dark);
}

/* ===== Navbar ===== */
.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    overflow: hidden;
}
.navbar-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    height: 56px;
    gap: 2rem;
}
.navbar-brand {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    white-space: nowrap;
}
.brand-icon { color: var(--primary); font-size: 1.25rem; }
.brand-logo { height: 36px; width: auto; max-width: 120px; object-fit: contain; border-radius: 6px; flex-shrink: 0; }
.version-tag {
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--text-light);
    background: var(--bg);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    letter-spacing: 0.02em;
    vertical-align: middle;
}
.brand-icon-lg { color: var(--primary); font-size: 2.5rem; display: block; margin-bottom: 0.5rem; }
.navbar-links { display: flex; gap: 0.25rem; flex: 1; }
.nav-link {
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    color: var(--text-light);
    font-size: 0.9rem;
    transition: all 0.15s;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.nav-link:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.nav-link.active { background: var(--primary-light); color: var(--primary-dark); font-weight: 500; }
.nav-icon { font-size: 1rem; }
.navbar-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}
.user-name { font-size: 0.875rem; color: var(--text-light); }

/* ===== Main Content ===== */
.main-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.5rem;
}
.page-container { }
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

/* ===== Cards ===== */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
}
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}
.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    transition: all 0.2s;
    text-decoration: none;
    color: var(--text);
    display: block;
}
.project-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); text-decoration: none; }
.project-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.project-card-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.5rem; }
.project-card-desc { font-size: 0.875rem; color: var(--text-light); margin-bottom: 0.75rem; }
.project-card-meta { display: flex; gap: 1rem; font-size: 0.8rem; color: var(--text-light); margin-bottom: 0.75rem; }

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    white-space: nowrap;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); color: white; text-decoration: none; }
.btn-ghost { background: transparent; color: var(--text-light); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #DC2626; }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.8rem; }
.btn-full { width: 100%; justify-content: center; padding: 0.65rem; }
.btn-danger-text { color: var(--danger); }
.btn-danger-text:hover { background: #FEE2E2; }

/* ===== Forms ===== */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.3rem; color: var(--text); }
.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.15s;
}
.form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.form-input-sm { width: auto; padding: 0.3rem 0.5rem; font-size: 0.8rem; }
.form-input-xs { width: auto; padding: 0.2rem 0.4rem; font-size: 0.75rem; min-width: 90px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-actions { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 1.5rem; }
textarea.form-input { resize: vertical; min-height: 80px; }

/* ===== Filter Bar ===== */
.filter-bar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.filter-form { display: contents; }
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: var(--text-light);
    cursor: pointer;
}

/* ===== Badges ===== */
.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}
.badge-success { background: var(--success); }
.badge-warning { background: var(--warning); }
.badge-danger { background: var(--danger); }
.spec-badge {
    display: inline-block;
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    margin: 0.15rem;
}

/* ===== Tables ===== */
.table-container { overflow-x: auto; margin-top: 1rem; }
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.table th {
    text-align: left;
    padding: 0.75rem;
    border-bottom: 2px solid var(--border);
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.table tbody tr:hover { background: var(--bg); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.clickable-row { cursor: pointer; transition: background 0.15s; }
.clickable-row:hover { background: var(--primary-light); }
.row-warning { background: #FFFBEB; }
.row-warning:hover { background: #FEF3C7 !important; }
.row-completed { background: #F0FDF4; opacity: 0.7; }
.row-completed:hover { background: #DCFCE7 !important; }

/* ===== Progress Bar ===== */
.progress-bar-container {
    background: var(--bg);
    border-radius: 20px;
    height: 6px;
    overflow: hidden;
}
.progress-bar {
    background: var(--primary);
    height: 100%;
    border-radius: 20px;
    transition: width 0.3s;
    min-width: 2px;
}

/* ===== Tasks ===== */
.task-add-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.task-add-form .form-input { flex: 1; min-width: 180px; }
.task-group { margin-bottom: 1.25rem; }
.task-group-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.5rem;
}
.task-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 0.35rem;
    background: var(--surface);
    gap: 0.75rem;
    flex-wrap: wrap;
}
.task-item:hover { background: var(--bg); }
.task-late { border-left: 3px solid var(--danger); }
.task-info { display: flex; align-items: center; gap: 0.5rem; flex: 1; flex-wrap: wrap; }
.task-title { font-weight: 500; }
.task-actions { display: flex; align-items: center; gap: 0.35rem; }
.priority-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ===== Files ===== */
.file-upload-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.file-list { margin-top: 1rem; }
.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
    gap: 0.5rem;
    flex-wrap: wrap;
}
.file-info { display: flex; align-items: center; gap: 0.5rem; flex: 1; }
.file-icon { font-size: 1.25rem; }
.file-name { font-weight: 500; }
.file-meta { display: flex; align-items: center; gap: 0.5rem; }

/* ===== Product Detail ===== */
.product-detail {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    margin-top: 1.5rem;
}
.product-detail-image img {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}
.product-image-placeholder {
    width: 100%;
    aspect-ratio: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
}
.product-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
}
.product-thumb-placeholder {
    width: 48px;
    height: 48px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}
.detail-item {}
.detail-label { display: block; font-size: 0.8rem; color: var(--text-light); margin-bottom: 0.15rem; }
.detail-value { font-weight: 500; }
.price-main { font-size: 1.25rem; color: var(--primary-dark); }

/* ===== KPI Cards (Product Dashboard) ===== */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-top: 1.25rem;
}
.kpi-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    text-align: center;
    transition: box-shadow 0.15s;
}
.kpi-card:hover { box-shadow: var(--shadow-md); }
.kpi-card--stock {
    border-color: var(--success);
    border-width: 2px;
}
.kpi-card--stock-warning {
    border-color: var(--warning);
    border-width: 2px;
}
.kpi-card--primary {
    border-left: 3px solid var(--primary);
}
.kpi-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.25rem;
}
.kpi-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}
.kpi-value--lg {
    font-size: 2rem;
}
.kpi-value--primary { color: var(--primary-dark); }
.kpi-value--success { color: #059669; }
.kpi-value--warning { color: #D97706; }
.kpi-value--danger { color: var(--danger); }
.kpi-sub {
    display: block;
    font-size: 0.7rem;
    color: var(--text-light);
    margin-top: 0.15rem;
}

/* ===== Utilities ===== */
.section-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 1rem; }
.text-sm { font-size: 0.8rem; }
.text-light { color: var(--text-light); }
.text-danger { color: var(--danger); }
.text-link { color: var(--text-light); font-size: 0.875rem; }
.text-link:hover { color: var(--primary); }
.flex-gap { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.avatar-chip {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}
.empty-state { text-align: center; padding: 3rem; grid-column: 1 / -1; }

/* ===== Login ===== */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1E293B 0%, #334155 100%);
}
.login-container { width: 100%; max-width: 400px; padding: 1.5rem; }
.login-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.login-header { text-align: center; margin-bottom: 2rem; }
.login-logo { max-height: 80px; max-width: 200px; object-fit: contain; margin-bottom: 0.75rem; border-radius: 8px; }
.login-header h1 { font-size: 1.5rem; margin-bottom: 0.25rem; }
.login-subtitle { color: var(--text-light); font-size: 0.9rem; }
.login-form .form-group { margin-bottom: 1.25rem; }

/* ===== Alerts ===== */
.messages-container { margin-bottom: 1rem; }
.alert {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.alert-success { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }
.alert-error { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.alert-warning { background: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; }
.alert-info { background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }
.alert-close { background: none; border: none; cursor: pointer; font-size: 1.25rem; color: inherit; opacity: 0.6; }
.alert-close:hover { opacity: 1; }

/* ===== Modal ===== */
.modal-overlay {
    display: none;
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--surface);
    border-radius: 12px;
    padding: 2rem;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.modal h2 { margin: 0 0 1.5rem 0; font-size: 1.25rem; }

/* ===== Hamburger Menu Button ===== */
.navbar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background 0.15s;
}
.navbar-toggle:hover { background: var(--bg); }
.navbar-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text);
    margin: 4px 0;
    border-radius: 2px;
    transition: all 0.3s;
}
.navbar-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
.navbar-toggle.active span:nth-child(2) { opacity: 0; }
.navbar-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(4px, -4px); }

/* ===== Responsive — Tablet (max-width: 1024px) ===== */
@media (max-width: 1024px) {
    .navbar-inner { gap: 1rem; }
    .nav-link { padding: 0.4rem 0.6rem; font-size: 0.85rem; }
    .card-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
    .product-detail { grid-template-columns: 240px 1fr; gap: 1.5rem; }
}

/* ===== Responsive — Mobile (max-width: 768px) ===== */
@media (max-width: 768px) {
    /* Navbar — hamburger menu */
    .navbar-inner {
        padding: 0 1rem;
        flex-wrap: wrap;
        height: auto;
        min-height: 56px;
    }
    .navbar-toggle { display: block; order: -1; }
    .navbar-brand { flex: 1; order: 0; }
    .navbar-user { order: 1; }
    .user-name { display: none; }
    .navbar-links {
        display: none;
        flex-direction: column;
        width: 100%;
        order: 3;
        padding: 0.5rem 0;
        border-top: 1px solid var(--border);
        gap: 0.15rem;
    }
    .navbar-links.open { display: flex; }
    .nav-link {
        padding: 0.6rem 0.75rem;
        font-size: 0.9rem;
        border-radius: 6px;
    }

    /* Layout */
    .main-content { padding: 1rem; }
    .page-header { flex-direction: column; align-items: stretch; }
    .page-title { font-size: 1.25rem; }

    /* Cards */
    .card-grid { grid-template-columns: 1fr; }

    /* Product */
    .product-detail { grid-template-columns: 1fr; gap: 1rem; }
    .product-detail-image { max-width: 250px; }
    .detail-grid { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
    .kpi-row { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.5rem; }

    /* Forms */
    .form-row { grid-template-columns: 1fr; }
    .filter-bar { flex-direction: column; align-items: stretch; }
    .filter-bar .form-input { width: 100%; }
    .filter-bar .btn { width: 100%; justify-content: center; }

    /* Tasks */
    .task-add-form { flex-direction: column; align-items: stretch; }
    .task-add-form .form-input { width: 100%; min-width: unset; }
    .task-add-form .btn { width: 100%; justify-content: center; }
    .task-item { flex-direction: column; align-items: flex-start; }
    .task-actions { width: 100%; justify-content: flex-end; }

    /* Files */
    .file-upload-form { flex-direction: column; align-items: stretch; }
    .file-upload-form .form-input { width: 100%; }
    .file-upload-form .btn { width: 100%; justify-content: center; }
    .file-item { flex-direction: column; align-items: flex-start; gap: 0.35rem; }
    .file-meta { width: 100%; justify-content: space-between; }

    /* Tables — horizontal scroll with hint */
    .table { font-size: 0.8rem; }
    .table th, .table td { padding: 0.5rem; }

    /* Calendar */
    .calendar-header { flex-direction: column; align-items: stretch; }
    .ical-box { flex-direction: column; align-items: stretch; }
    .ical-box code { font-size: 0.7rem; }

    /* Modal */
    .modal { margin: 1rem; padding: 1.5rem; max-height: 90vh; overflow-y: auto; }
}

/* ===== Responsive — Small phones (max-width: 480px) ===== */
@media (max-width: 480px) {
    .main-content { padding: 0.75rem; }
    .page-title { font-size: 1.1rem; }
    .card { padding: 1rem; }
    .detail-grid { grid-template-columns: 1fr; }
    .kpi-row { grid-template-columns: repeat(2, 1fr); }
    .product-detail-image { max-width: 100%; }
    .btn { padding: 0.45rem 0.75rem; font-size: 0.8rem; }
    .project-card { padding: 1rem; }
    .project-card-meta { flex-direction: column; gap: 0.25rem; }
    .section-title { font-size: 1rem; }
    .login-card { padding: 1.5rem; }
}

/* ===== Nomenclature / BOM Tree ===== */
.nomenclature-tree {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.nomenclature-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border);
    gap: 0.5rem;
    flex-wrap: wrap;
}
.nomenclature-item:last-child { border-bottom: none; }
.nomenclature-item:hover { background: var(--bg); }
.nomenclature-item[data-type="operation"] { background: #FFFBEB; }
.nomenclature-item[data-type="operation"]:hover { background: #FEF3C7; }
.nomenclature-info {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 1;
    min-width: 0;
}
.nomenclature-icon { font-size: 1rem; flex-shrink: 0; }
.nomenclature-expand { font-size: 0.7rem; color: var(--text-light); flex-shrink: 0; }
.nomenclature-name { font-weight: 500; }
a.nomenclature-name { color: var(--primary); text-decoration: none; }
a.nomenclature-name:hover { text-decoration: underline; }
.nomenclature-cost {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}
.nomenclature-total {
    padding: 0.75rem;
    text-align: right;
    border-top: 2px solid var(--border);
    background: var(--bg);
    border-radius: 0 0 var(--radius) var(--radius);
    font-size: 1.05rem;
}
.btn-danger-text { color: var(--danger); }
.btn-danger-text:hover { background: #FEF2F2; }
.badge-info { background: var(--primary-light); color: var(--primary-dark); }
.badge-relance { background: #E0F2F1; color: #00695C; }
.badge-sans-reponse { background: #FFF8E1; color: #F57F17; }
.badge-site { background: #E8F5E9; color: #2E7D32; }

/* Statut selector (devis) */
.statut-selector {
    position: relative;
    display: inline-block;
}
.statut-selector .statut-current {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.8rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    border: 2px solid transparent;
    transition: border-color 0.15s, box-shadow 0.15s;
    user-select: none;
}
.statut-selector .statut-current:hover {
    border-color: var(--border);
    box-shadow: var(--shadow);
}
.statut-selector .statut-current .chevron {
    font-size: 0.7rem;
    transition: transform 0.15s;
    margin-left: 0.2rem;
}
.statut-selector.open .statut-current .chevron {
    transform: rotate(180deg);
}
.statut-selector .statut-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    z-index: 50;
    min-width: 200px;
    overflow: hidden;
}
.statut-selector.open .statut-dropdown {
    display: block;
}
.statut-dropdown .statut-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.9rem;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.1s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    color: var(--text);
}
.statut-dropdown .statut-option:hover {
    background: var(--bg-light);
}
.statut-dropdown .statut-option.active {
    background: var(--primary-light);
    font-weight: 600;
}
.statut-dropdown .statut-option .statut-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.statut-dropdown .statut-separator {
    border-top: 1px solid var(--border);
    margin: 0.2rem 0;
}
.badge-type-assemblage { background: #d5e8f5; color: #333; }
.badge-type-fabrication { background: #e8d5f5; color: #333; }
.badge-type-impression_3d { background: #FFF3E0; color: #E65100; }
.badge-type-post_traitement { background: #E8EAF6; color: #283593; }
.badge-type-decoupe { background: #FBE9E7; color: #BF360C; }
.badge-type-peinture { background: #F3E5F5; color: #6A1B9A; }
.badge-type-autre { background: #ECEFF1; color: #455A64; }

/* Fichiers d'action */
.action-fichiers { margin-bottom: 0.5rem; }
.fichier-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    font-size: 0.85rem;
}
.fichier-icon { font-size: 1rem; flex-shrink: 0; }
.fichier-link { color: var(--primary); }
.fichier-link:hover { text-decoration: underline; }

/* Niveaux d'indentation nomenclature */
.nomenclature-level-0 { }
.nomenclature-level-1 { padding-left: 2rem; }
.nomenclature-level-2 { padding-left: 3.5rem; }
.nomenclature-level-3 { padding-left: 5rem; }
.nomenclature-level-4 { padding-left: 6.5rem; }

/* Responsive nomenclature */
@media (max-width: 768px) {
    .nomenclature-item { flex-direction: column; align-items: flex-start; }
    .nomenclature-cost { width: 100%; justify-content: flex-end; }
    .nomenclature-level-1 { padding-left: 1rem; }
    .nomenclature-level-2 { padding-left: 1.75rem; }
    .nomenclature-level-3 { padding-left: 2.5rem; }
    .nomenclature-level-4 { padding-left: 3.25rem; }
}
