/* ============================================
   GMS - Gryb Management System
   Modern Dashboard Template
   ============================================ */

:root {
    /* Sidebar (used as-is on the login backdrop; app shell overrides via body.theme-light) */
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --sidebar-bg: #3d4148;
    --sidebar-text: #a7abb3;
    --sidebar-text-hover: #f1f5f9;
    --sidebar-active: #7cb92c;
    --sidebar-border: rgba(255, 255, 255, 0.08);

    /* Main */
    --bg: #f3f6f1;
    --surface: #ffffff;
    --surface-hover: #f8faf6;
    --border: #e3e7e0;
    --border-strong: #cbd3c5;

    /* Text */
    --text: #2c2f35;
    --text-secondary: #5b5f66;
    --text-muted: #96999f;

    /* Brand — Armada green */
    --primary: #7cb92c;
    --primary-hover: #669c22;
    --primary-light: rgba(124, 185, 44, 0.12);

    /* Misc */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; border: none; background: none; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, h5, h6 { margin: 0; }

/* ============================================
   APP SHELL — Full screen layout
   ============================================ */
.app-shell {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
    transition: width var(--transition), min-width var(--transition);
    overflow: hidden;
}

/* Collapsed state */
.sidebar.collapsed {
    width: var(--sidebar-collapsed);
    min-width: var(--sidebar-collapsed);
}

.sidebar-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
    min-width: 0;
}

.brand-logo-wrap {
    height: auto;
    flex-shrink: 0;
    width: 100%;
}

.brand-logo {
    height: auto;
    width: 100%;
    max-width: 200px;
    border-radius: var(--radius-md);
    object-fit: contain;
}

.brand-logo-fallback {
    display: none;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    place-items: center;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
    font-size: 20px;
}
}

.brand-text h1 {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.03em;
}

.brand-text p {
    margin: 2px 0 0;
    font-size: 11px;
    color: var(--sidebar-text);
}

.sidebar-collapse-btn {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}
.sidebar-collapse-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Collapsed: hide text, center icons */
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .sidebar-user-info {
    opacity: 0;
    width: 0;
    overflow: hidden;
}
.sidebar.collapsed .sidebar-collapse-btn i {
    transform: rotate(180deg);
}
.sidebar.collapsed .sidebar-header {
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 8px 12px;
}
.sidebar.collapsed .brand {
    justify-content: center;
}
.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 10px;
}
.sidebar.collapsed .nav-link i {
    margin: 0;
}
.sidebar.collapsed .sidebar-user {
    justify-content: center;
    padding: 12px 8px;
}
.sidebar.collapsed .icon-btn-ghost {
    display: none;
}
.sidebar.collapsed .nav-group {
    padding: 0 8px;
}

/* Sidebar nav */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 0;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}
.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.nav-group {
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-section-title {
    display: block;
    color: var(--sidebar-text);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 11px;
    font-weight: 600;
    padding: 16px 12px 8px;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity var(--transition);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: var(--radius-md);
    color: var(--sidebar-text);
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 2px;
    transition: var(--transition);
    white-space: nowrap;
    overflow: hidden;
}

.nav-link i {
    font-size: 18px;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--sidebar-text-hover);
}

.nav-link.active {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}

.nav-group-parent {
    width: 100%;
    cursor: pointer;
    border: none;
    background: none;
    text-align: left;
}
.nav-group-parent.active-group {
    color: var(--sidebar-text-hover);
}
.nav-group-caret {
    margin-left: auto;
    font-size: 13px !important;
    width: auto !important;
    flex-shrink: 0;
    transition: transform var(--transition);
}
.nav-group-parent[aria-expanded="true"] .nav-group-caret {
    transform: rotate(180deg);
}
.nav-submenu {
    max-height: 0;
    overflow: hidden;
    padding-left: 20px;
    transition: max-height var(--transition);
}
.nav-submenu.open {
    max-height: 400px;
}
.nav-sublink {
    font-size: 13px;
    padding: 7px 12px;
}
.nav-sublink i {
    font-size: 15px;
}

/* Sidebar repliee : les sous-menus deviennent des volets flottants au survol */
.sidebar.collapsed .nav-group-caret,
.sidebar.collapsed .nav-section-title {
    display: none;
}
.sidebar.collapsed .nav-group {
    position: relative;
}
.sidebar.collapsed .nav-submenu {
    max-height: none;
    padding-left: 0;
    display: none;
    position: absolute;
    left: 100%;
    top: 0;
    min-width: 200px;
    background: var(--sidebar-bg);
    border: 1px solid var(--sidebar-border);
    border-radius: var(--radius-md);
    padding: 6px;
    box-shadow: var(--shadow-lg);
    z-index: 50;
}
.sidebar.collapsed .nav-group-parent:hover + .nav-submenu,
.sidebar.collapsed .nav-submenu:hover {
    display: block;
}

/* Sidebar footer */
.sidebar-mobile-tools {
    display: none;
}
.sidebar-mobile-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.sidebar-mobile-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.sidebar-mobile-select {
    width: 100%;
    padding: 8px 10px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text);
}
.sidebar.collapsed .sidebar-mobile-tools {
    display: none !important;
}

.sidebar-footer {
    border-top: 1px solid var(--sidebar-border);
    padding: 12px;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-md);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 13px;
    color: #fff;
    background: var(--primary);
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity var(--transition);
}
.sidebar-user-info strong {
    display: block;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}
.sidebar-user-info span {
    color: var(--sidebar-text);
    font-size: 11px;
}

.icon-btn-ghost {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}
.icon-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */
.main-wrap {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left var(--transition);
    min-width: 0;
    max-width: calc(100vw - var(--sidebar-width));
    overflow-x: hidden;
}

body.sidebar-collapsed .main-wrap {
    margin-left: var(--sidebar-collapsed);
    max-width: calc(100vw - var(--sidebar-collapsed));
}

.main-content {
    flex: 1;
    padding: 0 32px 32px;
    min-width: 0;
}

/* ============================================
   TOPBAR
   ============================================ */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 32px;
    background: transparent;
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(241, 245, 249, 0.85);
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-left #sidebarToggle {
    display: none;
}

.topbar-logo {
    display: none;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}
.breadcrumb-item { color: var(--text-muted); }
.breadcrumb-item.current { color: var(--text); font-weight: 600; }
.breadcrumb-sep { font-size: 12px; color: var(--text-muted); }

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0 14px;
    min-width: 240px;
    transition: var(--transition);
}
.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.search-box i {
    color: var(--text-muted);
    font-size: 16px;
}
.search-box input {
    width: 100%;
    padding: 9px 0;
    outline: none;
    color: var(--text);
    font-size: 13px;
}
.search-box input::placeholder {
    color: var(--text-muted);
}

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--surface);
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
    position: relative;
}
.icon-btn:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
}
.notif-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    border: 2px solid var(--surface);
}

/* ============================================
   LANG SWITCH
   ============================================ */
.lang-switch {
    display: flex;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.lang-btn {
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
    line-height: 1;
}
.lang-btn:hover {
    color: var(--text);
    background: var(--surface-hover);
}
.lang-btn.active {
    background: var(--primary);
    color: #fff;
}

/* Company selector */
.company-selector select {
    padding: 7px 28px 7px 10px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    transition: var(--transition);
}
.company-selector select:hover {
    border-color: var(--primary);
}
.company-selector select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.company-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    border-radius: var(--radius-md);
    background: var(--primary);
    color: #fff;
}

/* ============================================
   PAGE HEADER
   ============================================ */
.page-header {
    margin-bottom: 28px;
}
.page-header h2 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text);
}
.page-header p {
    margin: 6px 0 0;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.5;
}

/* ============================================
   MODULE CARDS (Home page)
   ============================================ */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.module-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.module-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--module-color, var(--primary));
    opacity: 0;
    transition: var(--transition);
}
.module-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.module-card:hover::before {
    opacity: 1;
}
.module-card.disabled {
    opacity: 0.55;
    cursor: default;
}
.module-card.disabled:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--border);
}

.module-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    display: grid;
    place-items: center;
    font-size: 22px;
    color: #fff;
}

.module-card h3 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.module-card p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
    flex: 1;
}

.module-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}
.module-badge.active {
    color: #10b981;
}
.module-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* ============================================
   METRIC CARDS
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 20px 24px;
    container-type: inline-size;
}
.stat-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.stat-value {
    font-size: clamp(20px, 9cqi, 32px);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    white-space: nowrap;
}
.stat-change {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #10b981;
}
.stat-change.negative {
    color: #ef4444;
}

/* Les grilles de KPI (.stats-grid, .kpi-grid) sont réparties par app.js (adaptKpiGrids) : colonnes égales qui remplissent toute la largeur,
   sans ligne orpheline. Ce qui suit n'est que le repli sans JavaScript. */
.dashboard-stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
}

.stat-card-widget {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    padding: 28px 20px 24px;
}
.stat-widget-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    border-radius: 50%;
    font-size: 18px;
    box-shadow: var(--shadow-sm);
}
.stat-widget-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}
.stat-card-widget .stat-label {
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 12px;
}
.stat-card-widget .stat-value { font-size: 34px; }
.stat-card-widget .stat-change { margin-top: 6px; }
.stat-submetric {
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}

/* ============================================
   PANELS
   ============================================ */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 24px;
}
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 16px;
    margin-bottom: 20px;
}
.panel-header h3 {
    font-size: 16px;
    font-weight: 700;
}
.panel-header p {
    margin: 4px 0 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.content-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: var(--radius-md);
    padding: 10px 18px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}
.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover {
    background: var(--primary-hover);
}
.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}
.btn-secondary:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
}

/* ============================================
   TABS
   ============================================ */
.tabs {
    display: flex;
    gap: 4px;
    background: var(--bg);
    border-radius: var(--radius-md);
    padding: 3px;
}
.tab {
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}
.tab:hover {
    color: var(--text);
}
.tab.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    min-height: 300px;
    display: grid;
    place-items: center;
    text-align: center;
    border: 2px dashed var(--border);
    border-radius: var(--radius-xl);
    color: var(--text-muted);
    padding: 40px;
    background: var(--surface);
}
.empty-state i {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 16px;
    display: block;
}
.empty-state h4 {
    color: var(--text);
    font-size: 18px;
    margin: 0 0 8px;
    font-weight: 700;
}
.empty-state p {
    color: var(--text-secondary);
    max-width: 400px;
}

/* ============================================
   TABLE
   ============================================ */
.table-clean {
    width: 100%;
    border-collapse: collapse;
}
.table-clean th,
.table-clean td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.table-clean th {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.table-clean tr:last-child td {
    border-bottom: none;
}

/* ============================================
   CHIP / BADGE
   ============================================ */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
}
.chip-success {
    background: #ecfdf5;
    color: #059669;
}
.chip-warning {
    background: #fffbeb;
    color: #d97706;
}
.chip-danger {
    background: #fef2f2;
    color: #dc2626;
}
.chip-info {
    background: #eff6ff;
    color: #2563eb;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .modules-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
    .content-grid {
        grid-template-columns: 1fr;
    }
    .main-content {
        padding: 0 20px 20px;
    }
    .topbar {
        padding: 12px 20px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition);
    }
    body.sidebar-open .sidebar {
        transform: translateX(0);
    }
    .main-wrap {
        margin-left: 0 !important;
        max-width: 100vw !important;
        width: 100%;
    }
    body.sidebar-collapsed .main-wrap {
        margin-left: 0 !important;
        max-width: 100vw !important;
    }
    .topbar-left #sidebarToggle {
        display: inline-grid;
    }
    .topbar-desktop-only {
        display: none !important;
    }
    .sidebar-mobile-tools {
        display: flex !important;
        flex-direction: column;
        gap: 10px;
        padding: 12px 16px;
        border-top: 1px solid var(--border);
        border-bottom: 1px solid var(--border);
    }
    .topbar-right {
        flex: 1 1 auto;
        min-width: 0;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .modules-grid {
        grid-template-columns: 1fr;
    }

    /* Tableaux : la balise <table> devient elle-même le conteneur de scroll horizontal
       -- corrige tous les .data-table du site d'un coup, sans wrapper par module. */
    .data-table {
        display: block;
        width: auto;
        max-width: none;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
    }
    .data-table th,
    .data-table td {
        padding: 8px 10px;
        font-size: 13px;
        white-space: nowrap;
    }

    /* Logo dans l'en-tête -- la sidebar (qui a aussi le logo) est hors-écran par défaut sur mobile. */
    .topbar-logo {
        display: block;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        height: 26px;
        width: auto;
    }
    .breadcrumb {
        display: none;
    }

    /* Modales plein écran, glissent depuis le bas -- plus facile à remplir au pouce
       qu'une petite boîte centrée. */
    .modal-backdrop {
        align-items: flex-end;
    }
    .modal {
        width: 100%;
        max-width: 100%;
        max-height: 92vh;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    }
}

/* ============================================
   SCROLLBAR (global)
   ============================================ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================
   OVERLAY for mobile sidebar
   ============================================ */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 40;
    backdrop-filter: blur(2px);
}
body.sidebar-open .sidebar-overlay {
    display: block;
}

/* ============================================
   THEME: LIGHT
   ============================================ */
body.theme-light {
    --sidebar-bg: #ffffff;
    --sidebar-text: #6b6f76;
    --sidebar-text-hover: #2c2f35;
    --sidebar-active: #7cb92c;
    --sidebar-border: #e3e7e0;
}
body.theme-light .sidebar {
    border-right: 1px solid var(--border);
}
body.theme-light .sidebar-user-info strong {
    color: var(--text);
}
body.theme-light .brand-logo-fallback {
    background: var(--primary);
    color: #fff;
}
body.theme-light .nav-link.active {
    background: var(--primary-light);
    color: var(--primary);
}
body.theme-light .avatar {
    background: var(--primary);
    color: #fff;
}
body.theme-light .nav-section-title {
    color: var(--text-muted);
}
body.theme-light .sidebar-collapse-btn {
    color: var(--text-muted);
}
body.theme-light .sidebar-collapse-btn:hover {
    background: var(--bg);
    color: var(--text);
}
body.theme-light .icon-btn-ghost {
    color: var(--text-muted);
}
body.theme-light .icon-btn-ghost:hover {
    background: var(--bg);
    color: var(--text);
}


/* ============================================
   LOGIN PAGE
   ============================================ */
.login-body {
    background: var(--sidebar-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.login-card {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: 40px 36px;
    box-shadow: var(--shadow-lg);
    width: 100%;
}

.login-header {
    text-align: center;
    margin-bottom: 24px;
}

.login-logo {
    margin: 0 auto 16px;
    text-align: center;
}
.login-logo img {
    width: auto;
    height: auto;
    max-width: 220px;
    max-height: 80px;
    object-fit: contain;
}
.login-logo-fallback {
    display: none;
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    place-items: center;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
    font-size: 26px;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.03em;
}
.login-header p {
    margin: 4px 0 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.login-footer {
    text-align: center;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.login-footer p {
    margin: 0;
    color: var(--text-muted);
    font-size: 12px;
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text);
    background: var(--surface);
    transition: var(--transition);
    outline: none;
}
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.input-icon {
    position: relative;
    display: flex;
    align-items: center;
}
.input-icon > i:first-child {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 16px;
    pointer-events: none;
}
.input-icon input {
    width: 100%;
    padding: 11px 14px 11px 42px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text);
    background: var(--surface);
    transition: var(--transition);
    outline: none;
}
.input-icon input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.input-icon input::placeholder {
    color: var(--text-muted);
}

.toggle-password {
    position: absolute;
    right: 8px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.toggle-password:hover {
    color: var(--text);
    background: var(--bg);
}

.btn-full {
    width: 100%;
    padding: 12px;
    font-size: 15px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
}
.alert i { font-size: 18px; flex-shrink: 0; }

.alert-danger {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}
.alert-success {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}
.alert-warning {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #fde68a;
}
.alert-info {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

/* ============================================
   ADMIN DATA TABLE
   ============================================ */
.admin-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.admin-toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.data-table th {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--bg);
    position: sticky;
    top: 0;
}
.data-table tr:hover td {
    background: var(--surface-hover);
}
.data-table tr:last-child td {
    border-bottom: none;
}

.table-actions {
    display: flex;
    gap: 4px;
}
.table-actions .btn {
    padding: 6px 10px;
    font-size: 12px;
}

/* ============================================
   MODAL
   ============================================ */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}
.modal-backdrop.active {
    display: flex;
}

.modal {
    background: var(--surface);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}
.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
}
.modal-body {
    padding: 24px;
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

/* ============================================
   ADMIN TABS (horizontal)
   ============================================ */
.admin-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 24px;
}
.admin-tab {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.admin-tab:hover {
    color: var(--text);
}
.admin-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ============================================
   PERMISSION GRID
   ============================================ */
.perm-grid {
    display: grid;
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.perm-grid-header,
.perm-grid-row {
    display: grid;
    grid-template-columns: 160px repeat(5, 1fr);
    gap: 1px;
}
.perm-grid-header > div {
    background: var(--bg);
    padding: 10px 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    text-align: center;
}
.perm-grid-header > div:first-child {
    text-align: left;
}
.perm-grid-row > div {
    background: var(--surface);
    padding: 10px 12px;
    text-align: center;
    font-size: 14px;
}
.perm-grid-row > div:first-child {
    font-weight: 600;
    text-align: left;
    font-size: 13px;
}

.perm-grid input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}
.perm-grid-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg);
    padding: 8px 12px;
}
.perm-grid-group-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}
.perm-grid-group-actions { display: flex; gap: 12px; }
.perm-grid-group-actions button {
    background: none;
    border: none;
    color: var(--primary-hover);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
}

/* ============================================
   BTN VARIANTS
   ============================================ */
.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}
.btn-danger {
    background: #ef4444;
    color: #fff;
}
.btn-danger:hover {
    background: #dc2626;
}

/* Recherche-en-tapant de series de rencontres (gmsSeriesTypeahead, assets/js/app.js) */
.pn-typeahead-results {
    display: none;
    position: relative;
    margin-top: 2px;
    max-height: 220px;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 20;
}
.pn-typeahead-row {
    padding: 6px 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.pn-typeahead-row:hover {
    background: var(--surface-hover);
}
.pn-typeahead-row strong {
    font-size: 13px;
}
.pn-typeahead-meta {
    font-size: 11px;
    color: var(--text-muted);
}
.btn-success {
    background: #10b981;
    color: #fff;
}
.btn-success:hover {
    background: #059669;
}
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: 6px 10px;
}
.btn-ghost:hover {
    background: var(--bg);
    color: var(--text);
}

/* ============================================
   MINI CALENDAR
   ============================================ */
.mini-cal-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.mini-cal-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.mini-cal-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    position: relative;
    cursor: default;
}
.mini-cal-day.empty {
    visibility: hidden;
}
.mini-cal-day.today span {
    background: var(--primary);
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 700;
}
.mini-cal-day.has-events {
    font-weight: 700;
    color: var(--text);
}
.mini-cal-dots {
    display: flex;
    gap: 3px;
    position: absolute;
    bottom: 2px;
}
.mini-cal-dots span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
}
.mini-cal-day.selected span {
    background: var(--sidebar-bg);
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 700;
}
.text-danger { color: #ef4444 !important; }

/* ============================================
   HOME GRID
   ============================================ */
.home-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    align-items: start;
}

.dashboard-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}
.dashboard-row .panel {
    flex: 1 1 320px;
    min-width: 0;
}

.dashboard-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}
.dashboard-shortcut {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 110px;
    padding: 16px 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    text-decoration: none;
    color: var(--text);
    text-align: center;
    transition: var(--transition);
}
.dashboard-shortcut:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px) scale(1.03);
}
.dashboard-shortcut-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    border-radius: 16px;
    font-size: 22px;
    box-shadow: var(--shadow-sm);
}
.dashboard-shortcut span {
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.25;
}

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

@media (max-width: 768px) {
    .main-content {
        padding: 0 12px 16px !important;
    }
    .page-header h2 {
        font-size: 22px;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr !important;
    }
    .dashboard-stats-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ============================================
   UTILITY
   ============================================ */
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.gap-2 { gap: 8px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ============================================
   SPLASH SCREEN (app launch)
   ============================================ */
.splash-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    opacity: 1;
    transition: opacity 0.4s ease;
}
.splash-logo img {
    width: 140px;
    height: 140px;
    object-fit: contain;
    border-radius: 28px;
    animation: splashPulse 1.2s ease-in-out infinite;
}
@keyframes splashPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}
.splash-screen.splash-hide {
    opacity: 0;
    pointer-events: none;
}
html.no-splash .splash-screen {
    display: none !important;
}

/* ============================================
   LOGIN PAGE — hero visual (Armada)
   ============================================ */
.login-container {
    max-width: 920px;
    flex-direction: row;
    align-items: stretch;
    gap: 0;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.login-container .login-card {
    box-shadow: none;
    border-radius: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 420px;
}
.login-visual {
    position: relative;
    flex: 1;
    min-width: 320px;
    display: none;
}
.login-visual > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.55);
}
.login-visual-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 40px;
    gap: 16px;
}
.login-visual-logo {
    max-width: 200px;
    height: auto;
}
.login-visual-overlay p {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    max-width: 320px;
    line-height: 1.4;
    margin: 0;
}
@media (min-width: 900px) {
    .login-visual { display: block; }
}

/* ============================================
   DONUT CHART (CSS conic-gradient, no JS lib)
   ============================================ */
.donut {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: conic-gradient(var(--donut-color, var(--primary)) calc(var(--donut-pct, 0) * 1%), var(--bg) 0);
    flex-shrink: 0;
}
.donut-inner {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: var(--surface);
    display: grid;
    place-items: center;
    text-align: center;
}
.donut-inner strong {
    font-size: 20px;
    font-weight: 800;
    line-height: 1.1;
}
.donut-inner span {
    font-size: 11px;
    color: var(--text-muted);
}

/* ============================================
   PROGRESS BAR
   ============================================ */
.progress-track {
    width: 100%;
    height: 8px;
    background: var(--bg);
    border-radius: 100px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: var(--progress-color, var(--primary));
    border-radius: 100px;
}

/* ============================================
   KANBAN-STYLE PIPELINE (Ventes)
   ============================================ */
.pipeline-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: background-color 0.1s ease;
}
.pipeline-row:last-child { border-bottom: none; }
.pipeline-row-highlight {
    background: rgba(124, 185, 44, 0.14);
}
.pipeline-label {
    width: 130px;
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}
.pipeline-track {
    flex: 1;
    height: 22px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.pipeline-fill {
    height: 100%;
    background: var(--primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    padding-left: 8px;
}
.pipeline-fill span {
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}
.pipeline-value {
    width: 110px;
    flex-shrink: 0;
    text-align: right;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}
.pipeline-count {
    width: 90px;
    flex-shrink: 0;
    text-align: right;
    font-size: 12px;
    color: var(--text-muted);
}

/* ============================================
   WEEKLY GANTT (Planification)
   ============================================ */
.planif-week {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 8px;
    align-items: stretch;
}
.planif-week-header {
    display: contents;
}
.planif-week-header .planif-corner { grid-column: 1; }
.planif-days-header {
    grid-column: 2;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}
.planif-days-header > div {
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    padding-bottom: 6px;
}
.planif-row-label {
    display: flex;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    gap: 8px;
}
.planif-row-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.planif-row-track {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: 36px;
    gap: 4px;
    background: var(--bg);
    border-radius: var(--radius-md);
    padding: 4px;
}
.planif-bar {
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    padding: 0 8px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.planif-bar.st-a_planifier {
    background: repeating-linear-gradient(45deg, var(--border-strong), var(--border-strong) 4px, var(--surface) 4px, var(--surface) 8px);
    color: var(--text-secondary);
}
.planif-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 16px;
}
.planif-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}
.planif-legend-swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

/* ============================================
   MONTH CALENDAR (Agenda)
   ============================================ */
.cal-month-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 6px;
}
.cal-month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}
.cal-day-cell {
    min-height: 96px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 6px;
    background: var(--surface);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.cal-day-cell:hover { border-color: var(--primary); }
.cal-day-cell.other-month { opacity: 0.4; }
.cal-day-cell.today { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.cal-day-num { font-size: 12px; font-weight: 700; }
.cal-event-pill {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--primary);
    color: #fff;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* ============================================
   ORG CHART (Structure module — simple tree)
   ============================================ */
.org-tree {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding: 20px 0;
}
.org-level {
    display: flex;
    gap: 24px;
    position: relative;
    padding-top: 24px;
}
.org-level:first-child { padding-top: 0; }
.org-node {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px 16px;
    min-width: 160px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    position: relative;
}
.org-node-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 13px;
    margin: 0 auto 8px;
}
.org-node strong {
    display: block;
    font-size: 13px;
}
.org-node span {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}
.org-node.vacant {
    border-style: dashed;
    opacity: 0.7;
}
.org-children {
    display: flex;
    gap: 20px;
    padding-top: 24px;
    position: relative;
}
.org-children::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 1px;
    height: 24px;
    background: var(--border-strong);
}

/* ============================================
   PRODUCTION BOARD (Planification — cartes style DEXX)
   ============================================ */
.prod-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 24px 0 14px;
    font-size: 15px;
    font-weight: 700;
}
.prod-section-title:first-child { margin-top: 0; }
.prod-section-title .chip { font-weight: 700; }
.prod-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
}
.prod-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--prod-color, var(--primary));
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.prod-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}
.prod-card-model {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

/* ============================================
   RAMPES — Configurateur de rampes
   ============================================ */
.rampes-builder-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
    align-items: start;
}
@media (max-width: 1100px) {
    .rampes-builder-grid {
        grid-template-columns: 1fr;
    }
}
.rampes-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.svg-preview-wrap {
    background: var(--bg-secondary, #f8fafc);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 8px;
    min-height: 560px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    overflow: hidden;
}
.svg-preview-wrap:active {
    cursor: grabbing;
}
.svg-preview-wrap.draw-mode {
    cursor: crosshair;
}
.svg-preview-wrap svg {
    max-width: 100%;
    display: block;
    user-select: none;
}
.rampes-sidebar {
    position: sticky;
    top: 12px;
}
.seg-inspector {
    background: var(--bg-secondary, #f8fafc);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px;
    margin: 12px 0;
}
.seg-inspector-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.seg-list-table th, .seg-list-table td {
    padding: 5px 6px;
    font-size: 12.5px;
}
.seg-list-table tbody tr {
    cursor: pointer;
}
.seg-list-table tbody tr:hover {
    background: var(--bg-secondary, #f8fafc);
}
.seg-list-row-active {
    background: #e0f2fe !important;
}
.prod-card-client {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
}
.prod-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    font-size: 12px;
    color: var(--text-muted);
}
.prod-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}
.prod-card.expedie {
    opacity: 0.75;
}
.prod-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    padding: 24px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
}

/* ============================================
   WEEK BOARD (Planification — colonnes hebdomadaires)
   ============================================ */
.week-board {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 12px;
    align-items: flex-start;
}
.week-col {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 250px;
    min-width: 250px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    max-height: 640px;
}
.week-col.unscheduled {
    border-style: dashed;
}
.week-col-header {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.week-col-header.is-current {
    background: var(--primary-light);
}
.week-col-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
}
.week-col-range {
    font-size: 13px;
    font-weight: 600;
    margin-top: 2px;
}
.week-col-body {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
}
.week-col-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    padding: 16px 8px;
}
.filters-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    margin-bottom: 16px;
}
.filters-bar .form-group {
    margin-bottom: 0;
    min-width: 160px;
}

/* ============================================
   PLANIFICATION — Tableau fenêtre fixe (drag & drop)
   ============================================ */
body.page-fixed-board {
    height: 100vh;
    overflow: hidden;
}
body.page-fixed-board .main-wrap {
    height: 100vh;
    overflow: hidden;
}
body.page-fixed-board .main-content {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    padding-bottom: 16px;
}
.planif-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.planif-stats {
    display: flex;
    gap: 18px;
    padding: 0 16px;
    border-left: 2px solid var(--border);
}
.planif-stats .stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.1;
}
.planif-stats .stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}
.planif-stats .stat-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    margin-top: 2px;
}

.planif-board-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.planif-tableau-wrap {
    flex: 1;
    min-height: 0;
    overflow: auto;
}
.planif-tableau-wrap:fullscreen {
    background: var(--surface);
    padding: 16px;
}
.planif-fiche-panel { padding: 16px 20px; margin-bottom: 12px; }
.planif-fiche-panel .panel-header { margin-bottom: 12px; }
.planif-fiche-panel h3 { font-size: 15px; }
.planif-fiche-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px 14px;
}
.planif-fiche-grid .form-group { margin-bottom: 0; }
.planif-fiche-grid .form-group label { font-size: 11px; margin-bottom: 3px; }
.planif-fiche-grid .form-control { padding: 6px 8px; font-size: 13px; }
.planif-fiche-grid .f-autre { margin-top: 4px; }
.planif-fiche-grid .val { padding: 6px 8px; font-size: 13px; font-weight: 600; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md, 6px); color: var(--text); min-height: 32px; box-sizing: border-box; }
.options-empty-msg { grid-column: 1 / -1; padding: 20px; text-align: center; color: var(--text-secondary); font-size: 13px; background: var(--bg); border: 1px dashed var(--border); border-radius: var(--radius-lg); }
.options-checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; align-items: start; }
.options-cat-block { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
.options-cat-block-plain { border: none; box-shadow: none; background: transparent; border-radius: 0; }
.options-cat-block-plain:empty { display: none; }
.options-cat-title { background: var(--primary); color: #fff; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; padding: 10px 14px; }
.options-cat-items { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; max-height: 320px; overflow-y: auto; }
.options-item { display: flex; align-items: flex-start; gap: 9px; font-size: 12.5px; cursor: pointer; line-height: 1.4; padding: 2px 0; }
.options-item input { margin-top: 2px; flex-shrink: 0; }
.options-code { color: var(--text-secondary); font-size: 10px; }
.options-groupe { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 8px 10px; background: var(--bg); }
.options-groupe-label { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 6px; }
.options-item-radio { display: flex; align-items: flex-start; gap: 9px; font-size: 12.5px; cursor: pointer; line-height: 1.4; padding: 3px 0; }
.options-item-radio input { margin-top: 2px; flex-shrink: 0; }
.options-item-radio + .options-item-radio { margin-top: 2px; }
.options-rows { display: flex; flex-direction: column; gap: 10px; }
.quest-section { border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--surface); padding: 22px 24px; margin-bottom: 20px; }
.quest-section h3 { display: flex; align-items: center; gap: 10px; font-size: 16px; margin-bottom: 4px; }
.quest-section > p.quest-desc { color: var(--text-secondary); font-size: 12.5px; margin-bottom: 16px; }
.quest-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 18px; margin-bottom: 16px; }
.quest-subtitle { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-secondary); margin: 16px 0 10px; padding-top: 14px; border-top: 1px solid var(--border); }
.quest-subtitle:first-child { border-top: none; padding-top: 0; margin-top: 0; }

/* Configurateur (Créer une commande) -- style Servicentre : nav à gauche, cartes cliquables à droite. */
.configurateur-shell { display: flex; gap: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; min-height: 320px; }
.configurateur-nav { flex: 0 0 230px; background: var(--bg); border-right: 1px solid var(--border); overflow-y: auto; max-height: 520px; padding: 6px 0; }
.configurateur-nav-cat { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: #fff; background: var(--primary); padding: 8px 14px; margin-top: 10px; position: sticky; top: 0; z-index: 1; }
.configurateur-nav-cat:first-child { margin-top: 0; }
.configurateur-nav-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; text-align: left; background: none; border: none; border-left: 3px solid transparent; padding: 7px 14px; font-size: 12.5px; color: var(--text); cursor: pointer; }
.configurateur-nav-item:hover { background: var(--surface); }
.configurateur-nav-item.active { background: var(--surface); border-left-color: var(--primary); font-weight: 600; }
.configurateur-nav-item.has-value::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); flex-shrink: 0; }
.configurateur-panels { flex: 1; min-width: 0; padding: 18px; }
.configurateur-panel { display: none; }
.configurateur-panel.active { display: block; }
.configurateur-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.configurateur-card { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); cursor: pointer; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.configurateur-card:hover { border-color: var(--primary); }
.configurateur-card input { position: absolute; opacity: 0; pointer-events: none; }
.configurateur-card:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(124,185,44,0.25); background: var(--primary-tint, #f3f9ea); }
.configurateur-card-img { display: flex; align-items: center; justify-content: center; height: 90px; background: var(--bg); color: var(--text-secondary); overflow: hidden; }
.configurateur-card-img i { font-size: 22px; opacity: .5; }
.configurateur-card-img img { width: 100%; height: 100%; object-fit: cover; }
.configurateur-card-body { padding: 8px 10px 10px; }
.configurateur-card-titre { font-size: 12.5px; font-weight: 600; line-height: 1.3; }
.configurateur-card-code { font-size: 10.5px; color: var(--text-secondary); margin-top: 2px; }
.configurateur-card-prix { font-size: 11.5px; font-weight: 700; color: var(--primary); margin-top: 4px; }
.configurateur-card-aucune .configurateur-card-img { color: var(--text-secondary); }
@media (max-width: 768px) {
    .configurateur-shell { flex-direction: column; }
    .configurateur-nav { flex: none; display: flex; overflow-x: auto; overflow-y: visible; max-height: none; border-right: none; border-bottom: 1px solid var(--border); padding: 6px; gap: 2px; }
    .configurateur-nav-cat { flex: 0 0 auto; padding: 6px 8px 2px; }
    .configurateur-nav-item { flex: 0 0 auto; border-left: none; border-bottom: 3px solid transparent; white-space: nowrap; }
    .configurateur-nav-item.active { border-bottom-color: var(--primary); }
    .configurateur-cards { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}
.planif-tableau { font-size: 12px; }
.planif-tableau th, .planif-tableau td { padding: 4px 6px; }
.planif-tab-input {
    width: 100%;
    min-width: 90px;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 3px 5px;
    background: transparent;
    font-size: 12px;
}
.planif-tab-input:hover { border-color: var(--border); }
.planif-tab-input:focus { outline: none; border-color: var(--primary); background: var(--surface); }
.planif-tab-number { width: 70px; min-width: 70px; text-align: right; }
.planif-tab-bool { text-align: center; }
.planif-tab-calc { text-align: right; color: var(--text-secondary); font-weight: 600; white-space: nowrap; }
.planif-tab-sticky { position: sticky; left: 0; background: var(--surface); z-index: 1; }
.planif-tab-sticky-end { position: sticky; right: 0; background: var(--surface); text-align: center; }
.planif-tableau thead .planif-tab-sticky, .planif-tableau thead .planif-tab-sticky-end { background: var(--bg); z-index: 2; }
.planif-tableau-rollup { font-size: 10px; font-weight: 400; opacity: 0.8; margin-left: 10px; text-transform: none; }
.planif-weeks {
    flex: 1;
    min-height: 0;
    display: flex;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 10px;
    align-items: stretch;
}
.planif-week-col {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 270px;
    min-width: 270px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}
.planif-week-col.unscheduled {
    border-style: dashed;
    display: flex;
    flex-direction: column;
}
.planif-week-col.unscheduled .planif-zone {
    flex: 1;
}
.planif-week-header {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    flex-shrink: 0;
}
.planif-week-header.is-current {
    background: var(--primary-light);
    box-shadow: inset 0 -3px 0 var(--primary);
}
.planif-week-col:has(.planif-week-header.is-current) { border-color: var(--primary); }
.planif-week-col > .planif-week-header { display: block; padding: 16px 20px 14px; }
.planif-week-header .week-head-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 20px;
}
.planif-week-header .week-num {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.planif-week-header .week-now {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #fff;
    background: var(--primary);
    padding: 2px 9px;
    border-radius: 999px;
}
.planif-week-header .week-col-range {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.01em;
    margin-top: 2px;
}
.planif-week-header .week-head-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 6px;
    margin-top: 9px;
}
.planif-week-header .week-pill {
    font-size: 10.5px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--surface, #fff);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    margin-top: 0;
    opacity: 1;
}
.planif-week-header .week-pill b { color: var(--text, #1f2a1a); font-weight: 800; }
.planif-week-header.is-current .week-pill { border-color: transparent; }
.planif-zone {
    min-height: 0;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.planif-zone.zone-cours {
    flex: 2;
    border-bottom: 2px dashed var(--border);
    background: var(--bg);
}
.planif-zone.zone-expedie {
    flex: 1;
    background: var(--surface-hover);
}
.planif-zone-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    padding: 0 2px 2px;
}
.planif-zone-count {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1px 8px;
    font-size: 10px;
}

.planif-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--prod-color, var(--primary));
    border-radius: var(--radius-md);
    padding: 10px 12px 8px;
    transition: var(--transition);
}
.planif-card:hover {
    box-shadow: var(--shadow-md);
}
/* Mention "EN RETARD · cible jj/mm" : chantier dont la date cible est dépassée, regroupé dans la semaine en cours. */
.planif-badge-retard {
    padding: 1px 6px;
    font-weight: 800;
    letter-spacing: 0.02em;
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
}
/* Flotteurs : 3e tube (3T / 3T+), aile de performance (AP), ski locker (SL). */
.planif-tube-3t { background: #dbeafe; color: #1d4ed8; font-weight: 700; padding: 1px 7px; }
.planif-tube-opt { background: #ede9fe; color: #6d28d9; font-weight: 700; padding: 1px 7px; }
.planif-tableau tr.planif-ligne-retard td { background: #fee2e2; }
.planif-tableau tr.planif-ligne-retard td.planif-tab-sticky { background: #fee2e2; box-shadow: inset 5px 0 0 #dc2626; }
.planif-card-late {
    border-left-color: #dc2626;
    background: #fee2e2;
}
.planif-card-highlight {
    box-shadow: 0 0 0 2px var(--primary);
}
.planif-card-body {
    cursor: pointer;
}
.planif-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.planif-card-model {
    font-size: 13.5px;
    font-weight: 800;
    letter-spacing: -0.01em;
}
.planif-drag-handle {
    color: var(--text-muted);
    cursor: grab;
    font-size: 14px;
    padding: 0 2px;
    touch-action: none;
}
.planif-drag-handle:active {
    cursor: grabbing;
}
.planif-fiche-link {
    color: var(--border-strong, #cbd3c5);
    font-size: 13px;
    display: inline-flex;
    padding: 0 2px;
}
.planif-fiche-link:hover { color: var(--primary); }
.planif-fiche-link.has-fiche { color: var(--primary); }
.planif-week-rollup {
    font-size: 10px;
    opacity: 0.85;
    margin-top: 2px;
}
.planif-card-client {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-top: 2px;
}
.planif-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}
.planif-card-rollup {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}
.planif-rollup-dot {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--dot-color);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 0 0 2px var(--surface);
}
.planif-rollup-dot.en-retard {
    box-shadow: 0 0 0 2px #ef4444;
}
.planif-rollup-dot.rush {
    background: #ef4444;
    box-shadow: 0 0 0 2px #ef4444;
}
.planif-card.rush {
    border-left-color: #ef4444;
    background: #fef2f2;
}
/* Carte bloquée (BO) : fond rouge pâle + contour rouge, prime sur le rush/retard. */
.planif-card.planif-card-bloque {
    background: #fee2e2;
    border-color: #fca5a5;
    border-left-color: #ef4444;
}

/* Mode compact / masquage de zone (boutons de la barre d'outils Planification). */
.btn-secondary.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.planif-card-resume {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 10px;
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px dashed var(--border, #e3e8df);
}
.planif-card-resume b { font-weight: 700; color: var(--text-muted); }
.planif-card-resume .val-noir {
    background: #111827;
    color: #fff;
    font-weight: 800;
    padding: 0 6px;
    border-radius: 4px;
}
.planif-card-resume .paint-tag {
    font-size: 9.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0 6px;
    border-radius: 999px;
    margin-left: 4px;
}
.planif-tableau .paint-tag {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 1px 8px;
    border-radius: 999px;
}
.paint-aenvoyer { background: #fee2e2; color: #b91c1c; }
.paint-envoye { background: #fef3c7; color: #92400e; }
.paint-recu { background: #dcfce7; color: #166534; }
.planif-board-wrap.compact .planif-card-resume { display: none; }
.planif-card-bo { padding: 1px 6px; font-size: 10px; font-weight: 800; }
/* Carte resserrée : le no de job est gros, le statut principal n'apparaît qu'une fois (menu déroulant). */
.planif-card-job {
    display: inline;
    margin-right: auto;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--text, #1f2a1a);
}
.planif-card { padding: 7px 10px 7px; }
.planif-card-client { margin-top: 1px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; }
.planif-card-serie { font-size: 10.5px; font-weight: 500; color: var(--text-muted); }
.planif-card-meta { margin-top: 2px; }
.planif-card-resume { margin-top: 3px; padding-top: 3px; line-height: 1.35; }
.planif-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 5px; }
.planif-card-bottom .planif-card-rollup { margin-top: 0; }
.planif-card-bottom .planif-quick-status { max-width: 140px; margin-left: auto; }
.planif-card .planif-card-footer { margin-top: 5px; justify-content: flex-end; }
.planif-board-wrap.compact .planif-card { padding: 6px 10px 5px; }
.planif-board-wrap.compact .planif-card-client,
.planif-board-wrap.compact .planif-card-meta,
.planif-board-wrap.compact .planif-card-rollup,
.planif-board-wrap.compact .planif-progress,
.planif-board-wrap.compact .planif-week-rollup { display: none; }
.planif-board-wrap.hide-cours .zone-cours { display: none; }
.planif-board-wrap.hide-expedie .zone-expedie { display: none; }

/* Mode plein écran dédié (?focus=1) : pas de sidebar/topbar Armada. */
body.planif-focus .main-wrap { margin-left: 0; max-width: 100vw; }
body.planif-focus .main-content { padding-top: 18px; }
.planif-tableau-semaine-header {
    font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .02em;
    color: var(--text-muted); margin: 20px 0 8px; padding-bottom: 6px; border-bottom: 2px solid var(--border);
}
.planif-tableau-semaine-header.is-current { color: var(--primary); border-bottom-color: var(--primary); }
.planif-tableau-composants th { text-align: center; white-space: nowrap; }
.planif-tableau-composants th:first-child, .planif-tableau-composants th:nth-child(2), .planif-tableau-composants th:nth-child(3) { text-align: left; }
.planif-tableau-composants td.planif-composant-td { text-align: center; }
.planif-composant-cell {
    width: 28px; height: 28px; border-radius: 6px; border: 2px solid var(--border);
    background: #fff; cursor: pointer; font-weight: 700; color: #fff; line-height: 1;
}
.planif-composant-cell:hover { border-color: var(--primary); }
.planif-composant-cell.termine { background: #10b981; border-color: #10b981; }
.planif-composant-cell.non-requis { background: var(--bg-subtle, #f1f5f9); border-color: transparent; cursor: default; }
.planif-composant-cell.non-requis:hover { border-color: transparent; }
.planif-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-top: 8px;
}
.planif-status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 110px;
}
.planif-quick-status {
    font-size: 10px;
    padding: 2px 4px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    max-width: 100px;
    color: var(--text-secondary);
}
.planif-progress {
    height: 3px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 6px;
}
.planif-progress > span {
    display: block;
    height: 100%;
}
.planif-card.sortable-ghost {
    opacity: 0.35;
}
.planif-card.sortable-drag {
    box-shadow: var(--shadow-lg);
    transform: rotate(1.5deg);
}

@media (max-width: 768px) {
    body.page-fixed-board .main-content { padding: 0 16px 12px; }
    .planif-header { flex-direction: column; align-items: stretch; }
    .planif-stats { border-left: none; padding: 0; justify-content: flex-start; }
    .filters-bar .form-group { min-width: 130px; }
    .planif-card-meta { font-size: 10px; }
    .planif-quick-status { max-width: 90px; }

    /* Planification sur cellulaire : page qui défile normalement (plus de fenêtre fixe), une semaine à la fois
       (choisie avec la barre de planif-mobile.js), cartes pleine largeur. */
    body.page-fixed-board, body.page-fixed-board .main-wrap { height: auto; overflow: visible; }
    body.page-fixed-board .main-content { display: block; overflow: visible; }
    .planif-board-wrap { display: block; overflow: visible; }
    .planif-weeks { display: block; overflow: visible; padding-bottom: 24px; }
    .planif-week-col { width: 100%; min-width: 0; overflow: visible; margin-bottom: 12px; }
    .planif-weeks.mobile-mode .planif-week-col { display: none; margin-bottom: 0; }
    .planif-weeks.mobile-mode .planif-week-col.mobile-active { display: block; }
    .planif-week-col > .planif-week-header { padding: 12px 14px; }
    .planif-zone { overflow: visible; }
    .planif-zone.zone-cours, .planif-zone.zone-expedie { flex: none; }
    .planif-drag-handle { display: none; }
    .planif-card-model { font-size: 15px; }
    .planif-quick-status { max-width: none; }
    /* Outils de bureau inutiles sur téléphone (le glisser-déposer, le mode compact et le tableau). */
    /* Le choix de vue (cartes / Tableau) reste disponible sur tablette et cellulaire ; seuls le plein écran en nouvel onglet etc. sont masqués */
    body.page-fixed-board .admin-toolbar a[target="_blank"],
    #planifCompactBtn, #planifHideCoursBtn, #planifHideExpedieBtn, #planifFullscreenBtn { display: none; }
    .planif-mobile-bar {
        display: flex; gap: 8px; align-items: center;
        position: sticky; top: 0; z-index: 20;
        background: var(--surface); padding: 8px 0 10px; margin-bottom: 8px;
    }
    .planif-mobile-bar select { flex: 1; min-width: 0; font-weight: 600; }
    .planif-mobile-bar .btn { flex: 0 0 auto; padding: 10px 14px; }
}
.planif-mobile-bar { display: none; }
@media (max-width: 768px) { .planif-mobile-bar { display: flex; } }

/* ============================================
   PLANIFICATION — Admin (statuts / produits)
   ============================================ */
.admin-add-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 16px;
}
.admin-add-row .form-control {
    max-width: 340px;
}
.color-swatch-input {
    width: 40px;
    height: 36px;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: var(--surface);
}
.form-control-inline {
    display: inline-block;
    width: auto;
    min-width: 160px;
}
.module-admin-btn {
    flex-shrink: 0;
}

/* ============================================
   ÉTAT DES RÉSULTATS (dashboard)
   ============================================ */
.etat-kpis {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.etat-kpi {
    flex: 1;
    min-width: 160px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.etat-kpi .value {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
}
.etat-kpi .label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}
.table-scroll {
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.etat-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.etat-table th, .etat-table td {
    padding: 8px 12px;
    text-align: right;
    border-bottom: 1px solid var(--border);
}
.etat-table thead th {
    background: var(--bg);
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    position: sticky;
    top: 0;
}
.etat-year {
    display: block;
    font-size: 9px;
    opacity: 0.7;
    font-weight: 400;
    text-transform: none;
}
.etat-label-col {
    text-align: left;
    position: sticky;
    left: 0;
    background: var(--surface);
    min-width: 220px;
    z-index: 1;
}
.etat-table thead .etat-label-col {
    background: var(--bg);
    z-index: 2;
}
.etat-annual-col {
    background: var(--primary-light);
    font-weight: 700;
}
.etat-row-subtotal { background: var(--bg); font-weight: 600; }
.etat-row-emphase { font-weight: 800; }
.etat-row-emphase .etat-label-col { color: var(--primary); }
.etat-input {
    width: 100%;
    min-width: 118px;
    text-align: right;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 5px 7px;
    background: transparent;
    font-size: 13.5px;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}
.etat-input:hover { border-color: var(--border); }
.etat-input:focus { outline: none; border-color: var(--accent, var(--primary)); background: var(--surface); box-shadow: 0 0 0 2px var(--primary-light); text-align: left; }
.etat-input.etat-saving { background: var(--primary-light); }
.etat-input.etat-error { border-color: var(--danger, #e74c3c); }
.etat-value {
    display: block;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}
.etat-pct {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 1px;
}
.etat-row-group td {
    background: var(--bg);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    text-align: left;
    padding: 6px 10px;
    border-top: 2px solid var(--border);
}
.etat-row-group:first-child td { border-top: none; }

.etat-type-toggle {
    display: flex;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.etat-type-btn {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--surface);
}
.etat-type-btn.active {
    background: var(--primary);
    color: #fff;
}

.pl-period-pills {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.pl-period-pill {
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
}
.pl-period-pill:hover { border-color: var(--primary); color: var(--primary); }
.pl-period-pill.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.pl-table th, .pl-table td { text-align: right; }
.pl-pos { color: var(--success, #27ae60); }
.pl-neg { color: var(--danger, #e74c3c); }
.pl-spacer {
    width: 18px;
    min-width: 18px;
    background: var(--bg);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    padding: 0 !important;
}
.pl-table .etat-value { display: block; }

/* ============================================
   PLANIFICATION — tableaux : contenu centré sous les colonnes
   ============================================ */
.planif-tableau th, .planif-tableau td { text-align: center; vertical-align: middle; }
.planif-tableau.planif-tableau-centre th, .planif-tableau.planif-tableau-centre td { text-align: center; }
.planif-tableau .planif-tab-input, .planif-tableau .planif-tab-number { text-align: center; text-align-last: center; }
.planif-tableau .planif-tab-calc { text-align: center; }
.planif-tableau .etat-row-group td { text-align: left; }
.planif-tableau .etat-row-group.is-current td { color: var(--primary); }
.planif-tab-job { font-weight: 800; font-size: 13px; color: var(--text, #1f2a1a); text-decoration: none; }
.planif-tab-job:hover { color: var(--primary); }
.planif-tab-detail { min-width: 96px; max-width: 150px; }
.planif-tab-info { min-width: 220px; max-width: 360px; }

/* Tableau Meubles : tient dans la fenêtre (pas de défilement horizontal), une cellule par option. */
.planif-meu-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow-x: hidden; }
.planif-tableau.planif-tableau-meubles { table-layout: fixed; width: 100%; font-size: 11px; }
.planif-tableau-meubles th, .planif-tableau-meubles td { padding: 4px 3px; white-space: normal; overflow-wrap: anywhere; }
.planif-tableau-meubles thead th { font-size: 9px; line-height: 1.15; letter-spacing: 0; vertical-align: bottom; }
/* En-têtes : jamais de mot coupé au milieu (REMISAGE, BANQUETTE) ; seuls les espaces font un retour à la ligne. */
.planif-tableau-meubles thead th { overflow-wrap: normal; word-break: normal; hyphens: none; }
.planif-tableau-meubles thead th.planif-meu-c-opt { font-size: 8px; padding-left: 1px; padding-right: 1px; text-align: center; }
.planif-tableau-meubles .planif-meu-c-job { width: 6%; }
.planif-tableau-meubles .planif-meu-c-cli { width: 7%; }
.planif-tableau-meubles .planif-meu-c-mod { width: 4.5%; }
.planif-tableau-meubles .planif-meu-c-stat { width: 6.5%; }
.planif-tableau-meubles .planif-meu-c-coul { width: 10%; }
.planif-tableau-meubles .planif-meu-c-frame { width: 4%; }
.planif-tableau-meubles .planif-meu-c-opt { width: 4%; }
.planif-tableau-meubles .planif-meu-c-info { width: 13%; }
.planif-tableau-meubles .planif-meu-c-po { width: 3%; }
.planif-tableau-meubles .planif-meu-c-pont { width: 3.4%; }
.planif-tableau-meubles .planif-tab-input { min-width: 0; padding: 2px 3px; font-size: 11px; }
.planif-tableau-meubles .planif-meu-couleur { font-size: 10.5px; line-height: 1.2; }
.planif-tableau-meubles .planif-tab-sticky { position: static; }
.planif-opt-td { padding: 2px 1px 12px !important; text-align: center; vertical-align: middle; position: relative; }
/* Cases d'options : même look que la feuille de route Clôtures (case blanche, verte avec coche une fois faite, grisée si non requise).
   La précision du fichier (« avec snaps », « Clip salle Hab »...) s'affiche en petit sous la case. */
.planif-opt-cell {
    width: 28px; height: 28px; border-radius: 6px; border: 2px solid var(--border);
    background: #fff; cursor: pointer; font-weight: 700; font-size: 15px; color: #fff; line-height: 1; padding: 0;
}
.planif-opt-cell:hover { border-color: var(--primary); }
.planif-opt-cell.fait { background: #10b981; border-color: #10b981; }
.planif-opt-cell.non { background: var(--bg-subtle, #f1f5f9); border-color: transparent; cursor: default; }
.planif-opt-cell.non:hover { border-color: transparent; }
.planif-opt-cell:disabled { cursor: default; opacity: 0.85; }
.planif-opt-cell { display: block; margin: 0 auto; }
.planif-opt-note { position: absolute; left: 0; right: 0; bottom: 1px; font-size: 8.5px; line-height: 1; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
@media (hover: none) { .planif-opt-cell { width: 36px; height: 36px; font-size: 19px; } }.val-noir { background: #111827; color: #fff; font-weight: 800; padding: 1px 7px; border-radius: 4px; }
.planif-tableau tr.planif-ligne-bloque td { background: #fee2e2; }
.planif-tableau tr.planif-ligne-rush td { background: #fef2f2; }
.planif-tableau tr.planif-ligne-bloque td.planif-tab-sticky { background: #fee2e2; }
.planif-tableau tr.planif-ligne-rush td.planif-tab-sticky { background: #fef2f2; }

/* ============================================
   INDICATEURS PERSONNALISES (KPI) - modules/kpis, vue d'ensemble
   ============================================ */
.kpi-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; margin-bottom: 28px; }
.kpi-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; min-width: 0; position: relative; }
.kpi-card-head { display: flex; flex-direction: column; gap: 2px; padding-right: 64px; }
.kpi-card-head strong { font-size: 14px; }
.kpi-card-outils { position: absolute; top: 10px; right: 10px; display: flex; gap: 4px; }
.kpi-card-outils .icon-btn, .kpi-card-outils a, .kpi-card-outils button { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; border: 1px solid transparent; background: transparent; color: var(--text-muted); cursor: pointer; text-decoration: none; }
.kpi-card-outils .icon-btn:hover, .kpi-card-outils a:hover, .kpi-card-outils button:hover { background: var(--bg); color: var(--text); border-color: var(--border); }
.kpi-corps { min-height: 60px; }
.kpi-nombre { display: flex; flex-direction: column; gap: 4px; }
.kpi-nombre-valeur { font-size: clamp(26px, 3.4vw, 38px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.kpi-delta { font-size: 13px; font-weight: 700; }
.kpi-spark { margin-top: 6px; }
.kpi-vide { padding: 18px 4px; }
.kpi-legende { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; }
.kpi-leg { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 2px 0; cursor: pointer; color: var(--text); font: inherit; font-size: 12px; }
.kpi-leg.off { opacity: .4; text-decoration: line-through; }
.kpi-leg-pastille { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.kpi-tip { position: absolute; z-index: 5; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-sm, 0 2px 8px rgba(0,0,0,.12)); padding: 8px 10px; font-size: 12px; pointer-events: none; white-space: nowrap; }
.kpi-tip div { margin-top: 2px; }
.kpi-modeles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.kpi-modele { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-md, 8px); background: var(--surface); text-decoration: none; color: inherit; }
.kpi-modele:hover { border-color: var(--primary); }
.kpi-edit-grille { display: grid; grid-template-columns: minmax(320px, 440px) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 980px) { .kpi-edit-grille { grid-template-columns: 1fr; } }
.kpi-serie { border: 1px solid var(--border); border-radius: var(--radius-md, 8px); padding: 10px 12px; margin-bottom: 10px; background: var(--bg); }
.kpi-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.kpi-types label { border: 1px solid var(--border); border-radius: 8px; padding: 8px 6px; text-align: center; cursor: pointer; font-size: 12px; background: var(--surface); }
.kpi-types input { display: none; }
.kpi-types input:checked + span { color: var(--primary); font-weight: 800; }
.kpi-types label:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light, #e8f3d6); }.kpi-wrap { position: relative; display: flex; flex-direction: column; min-width: 0; }
.kpi-wrap > .kpi-card { flex: 1; }
/* ============================================
   TABLETTES ET ECRANS TACTILES (atelier) : texte lisible et cibles tactiles confortables, surtout en planification
   ============================================ */
@media (max-width: 768px) {
    .planif-card-meta { font-size: 13px; line-height: 1.4; }
    .planif-card-model { font-size: 17px; }
    .planif-badge-retard { font-size: 12px; padding: 3px 9px; }
    .planif-quick-status { min-height: 42px; font-size: 15px; padding: 6px 10px; }
    body.page-fixed-board .admin-toolbar .btn, body.page-fixed-board .planif-header .btn { min-height: 42px; font-size: 14px; padding: 9px 14px; }
    .planif-mobile-bar select { min-height: 44px; font-size: 15px; }
    .planif-mobile-bar .btn { min-height: 44px; min-width: 44px; }
}
@media (pointer: coarse) {
    .planif-quick-status { min-height: 40px; font-size: 14px; }
    .btn-sm { min-height: 38px; }
    .nav-link, .nav-sublink { min-height: 44px; }
}
@media (max-width: 768px) { .etat-type-btn { padding: 10px 16px; font-size: 14px; } .etat-type-toggle { align-self: flex-start; } }

/* ============================================
   PLANIFICATION : en-tête masquable (planif-entete.js) - plus de place pour le tableau, surtout sur tablette
   ============================================ */
.planif-entete-btn {
    position: fixed; top: 6px; right: 10px; z-index: 1200; width: 40px; height: 40px; border-radius: 50%;
    border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
    display: flex; align-items: center; justify-content: center; font-size: 18px; box-shadow: 0 2px 10px rgba(0, 0, 0, .2);
}
body.entete-masque .planif-entete-btn { background: var(--primary); border-color: transparent; color: #fff; }
body.entete-masque:not(.planif-focus) .main-wrap > .topbar,
body.entete-masque:not(.planif-focus) .main-content > .page-header,
body.entete-masque:not(.planif-focus) .main-content > .admin-toolbar,
body.entete-masque:not(.planif-focus) .main-content > .filters-bar { display: none !important; }
body.entete-masque:not(.planif-focus) .main-content { padding-top: 48px !important; }   /* laisse la place au bouton rond */
body:not(.entete-masque) .main-wrap > .topbar { padding-right: 60px; }
/* ============================================
   TABLETTE TACTILE (écran moyen, ex. 8,7 po) : barre latérale en tiroir (jamais fixée) pour donner toute la largeur au contenu.
   Le bouton menu du topbar (ou le bouton rond de la planification) l'ouvre ; toucher à côté la referme.
   ============================================ */
@media (pointer: coarse) and (max-width: 1200px) {
    .sidebar { transform: translateX(-100%); transition: transform var(--transition); box-shadow: none; }
    body.sidebar-open .sidebar { transform: translateX(0); box-shadow: 0 0 30px rgba(0, 0, 0, .25); }
    .sidebar-collapse-btn { display: none; }
    .main-wrap, body.sidebar-collapsed .main-wrap { margin-left: 0 !important; max-width: 100vw !important; width: 100%; }
    .topbar-left #sidebarToggle { display: inline-grid; }
    .nav-link, .nav-sublink { min-height: 46px; }
}
/* Titre de la page, toujours visible quand l'en-tête est masqué (planif-entete.js) */
.planif-titre-mini { display: none; }
body.entete-masque:not(.planif-focus) .main-content { position: relative; }
body.entete-masque:not(.planif-focus) .planif-titre-mini {
    display: flex; align-items: center; position: absolute; top: 0; left: 16px; right: 64px; height: 48px;
    font-size: 17px; font-weight: 800; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Tableaux de cases à cocher (Clôtures, Flotteurs) : plus gros au toucher, on balaye vers la droite au besoin */
@media (pointer: coarse) {
    table.planif-fit { font-size: 14px; }
    table.planif-fit th, table.planif-fit td { padding: 8px 8px; }
    table.planif-fit thead th { font-size: 12px; }
    table.planif-fit .planif-composant-cell { width: 38px; height: 38px; font-size: 19px; }
    table.planif-fit .planif-tab-input { font-size: 14px; min-height: 36px; }
    table.planif-fit .planif-tab-job { font-size: 15px; }
}
/* Feuille de route Clôtures : en-tête à deux niveaux (groupes Clôtures / Portes puis composantes). Les deux rangées restent collées en haut
   l'une sous l'autre au défilement (sans ça, la 2e recouvrait la 1re et les noms de groupes disparaissaient). */
.planif-tableau-composants thead tr.planif-thead-groupes th { height: 34px; box-sizing: border-box; padding-top: 0; padding-bottom: 0; line-height: 1.2; top: 0; z-index: 3; }
.planif-tableau-composants thead tr.planif-thead-composants th { height: 34px; box-sizing: border-box; padding-top: 0; padding-bottom: 0; line-height: 1.2; top: 34px; z-index: 3; }
.planif-tableau-composants thead th.planif-groupe-th { text-align: center; color: var(--text); font-weight: 800; letter-spacing: .06em; border-bottom: 1px solid var(--border); }
.planif-tableau-composants .planif-groupe-debut { border-left: 2px solid var(--border); }
.planif-tableau-composants thead tr.planif-thead-groupes th[rowspan] { vertical-align: middle; z-index: 4; }

/* Cartes terminées : couleur selon la facturation (vert = facturé, orange = à facturer, gris = inventaire) */
.planif-card.pf-facture { background: color-mix(in srgb, #10b981 10%, var(--surface)); }
.planif-card.pf-a_facturer { background: color-mix(in srgb, #f59e0b 9%, var(--surface)); }
.planif-card.pf-inventaire { background: color-mix(in srgb, #64748b 8%, var(--surface)); }
.pf-chip { font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 99px; white-space: nowrap; color: #fff; background: var(--prod-color); }

/* Dashboard : carte Produits finis (choix Armada / Consignes / Total) */
.pf-tabs { display: flex; gap: 4px; margin: 4px 0 6px; flex-wrap: wrap; }
.pf-tab { border: 1px solid var(--border); background: var(--surface); color: inherit; border-radius: 99px; padding: 2px 10px; font-size: 11px; font-weight: 600; cursor: pointer; }
.pf-tab.on { background: var(--primary-light); border-color: var(--primary); }