* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding: 20px;
    color: #333;
}

a {
    text-decoration: none;
    transition: all 0.3s;
}

button {
    cursor: pointer;
    border: none;
    transition: all 0.3s;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

h1 {
    color: #667eea;
    margin-bottom: 20px;
    text-align: center;
}

/* PAGE D'ACCUEIL */
.home-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.home-container {
    text-align: center;
    max-width: 500px;
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.home-container h1 {
    color: #333;
    font-size: 42px;
    margin-bottom: 15px;
}

.subtitle {
    color: #666;
    font-size: 18px;
    margin-bottom: 50px;
}

.buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.btn {
    padding: 40px 20px;
    background: white;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    font-size: 18px;
    color: #333;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.btn-icon {
    font-size: 50px;
}

.btn-scanner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-creator {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn:nth-child(3) {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.btn-manage {
    background: linear-gradient(135deg, #ffa751 0%, #ffe259 100%);
    color: #333;
}

/* CONTENEURS */
.container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.stock-container {
    max-width: 100%;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.result-container {
    max-width: 500px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    text-align: center;
}

/* SCANNER */
.scanner-body {
    background: #f5f5f5;
}

.info-box {
    background: #e7f3ff;
    border-left: 4px solid #667eea;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    text-align: center;
    color: #0066cc;
}

#reader {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 20px;
}

.product-info {
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
}

.info-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    min-width: 100px;
    color: #555;
}

.info-value {
    color: #333;
    flex: 1;
}

.scanner-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 20px;
}

.btn-remove, .btn-move {
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    border: none;
    transition: background 0.3s;
    width: 100%;
}

.btn-remove {
    background: #dc3545;
    color: white;
}

.btn-remove:hover {
    background: #c82333;
}

.btn-move {
    background: #ffc107;
    color: #333;
}

.btn-move:hover {
    background: #e0a800;
}

/* FORMULAIRES */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #555;
    font-size: 15px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input[disabled] {
    background: #f5f5f5;
}

.creator-form-group {
    margin-bottom: 20px;
}

.creator-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 15px;
}

.creator-form-group input,
.creator-form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
}

.creator-form-group input:focus,
.creator-form-group select:focus {
    outline: none;
    border-color: #f093fb;
}

.info-text {
    font-size: 13px;
    color: #999;
    margin-top: 8px;
}

/* ALERTES */
.alert {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 500;
}

.alert-success {
    background: #d4edda;
    border-left: 4px solid #28a745;
    color: #155724;
}

.alert-info {
    background: #d1ecf1;
    border-left: 4px solid #17a2b8;
    color: #0c5460;
}

.alert-error {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
    color: #721c24;
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

/* BOUTONS */
.btn-primary, .btn-back {
    background: #667eea;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    display: inline-block;
    text-align: center;
    transition: background 0.3s;
    text-decoration: none;
    margin-top: 20px;
}

.btn-primary:hover, .btn-back:hover {
    background: #5568d3;
}

.btn-secondary, .btn-cancel {
    background: #6c757d;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    display: inline-block;
    text-align: center;
    transition: background 0.3s;
    text-decoration: none;
}

.btn-secondary:hover, .btn-cancel:hover {
    background: #5a6268;
}

.btn-save, .btn-download, .btn-export {
    background: #28a745;
    color: white;
    padding: 12px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    width: 100%;
    transition: background 0.3s;
}

.btn-save:hover, .btn-download:hover, .btn-export:hover {
    background: #218838;
}

.btn-edit {
    background: #007bff;
    color: white;
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    margin-right: 5px;
}

.btn-edit:hover {
    background: #0056b3;
}

.btn-delete {
    background: #dc3545;
    color: white;
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

.btn-delete:hover {
    background: #c82333;
}

.btn-move-small {
    background: #ffc107;
    color: #333;
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
}

.btn-move-small:hover {
    background: #e0a800;
}

.search-btn {
    background: #667eea;
    color: white;
    padding: 12px 25px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.search-btn:hover {
    background: #5568d3;
}

/* CRÉATEUR QR */
.creator-body {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.creator-container {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    max-width: 450px;
    width: 100%;
}

.creator-container h1 {
    color: #333;
    font-size: 28px;
    margin-bottom: 10px;
}

#qrContainer {
    text-align: center;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #eee;
    display: none;
}

#qrContainer.show {
    display: block;
}

#qrCode {
    max-width: 280px;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.url-display {
    background: #f5f5f5;
    padding: 12px;
    border-radius: 6px;
    font-size: 12px;
    margin: 15px 0;
    word-break: break-all;
    color: #666;
    border-left: 4px solid #f093fb;
    display: none;
}

/* STOCK */
.stock-body {
    background: #f5f5f5;
}

.info-bar {
    text-align: center;
    color: #999;
    margin-bottom: 30px;
    font-size: 14px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 13px;
    opacity: 0.9;
}

.controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.search-group {
    display: flex;
    gap: 10px;
}

.search-group input {
    flex: 1;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
}

.search-group input:focus {
    outline: none;
    border-color: #667eea;
}

.sort-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.sort-group label {
    font-weight: 600;
    color: #555;
    white-space: nowrap;
}

select {
    flex: 1;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    background: white;
    cursor: pointer;
}

select:focus {
    outline: none;
    border-color: #667eea;
}

.table-wrapper {
    overflow-x: auto;
    margin-bottom: 30px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #667eea;
    color: white;
}

th {
    padding: 13px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

td {
    padding: 13px 16px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

tbody tr:hover {
    background: #f5f7ff;
}

tbody tr:nth-child(even) {
    background: #fafbff;
}

.id-cell {
    font-weight: 600;
    color: #667eea;
}

.action-cell {
    display: flex;
    gap: 8px;
}

.no-results {
    text-align: center;
    padding: 30px;
    color: #999;
}

.stock-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

/* GESTION DES RANGEMENTS */
.manage-section {
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
}

.manage-section h2 {
    color: #333;
    font-size: 22px;
    margin-bottom: 20px;
}

.manage-form {
    max-width: 600px;
}

.lieu-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.lieu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
    gap: 15px;
    flex-wrap: wrap;
}

.lieu-header h3 {
    color: #667eea;
    font-size: 20px;
    margin: 0;
}

.btn-delete-small {
    background: #dc3545;
    color: white;
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

.btn-delete-small:hover {
    background: #c82333;
}

.btn-delete:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

/* RÉSULTAT */
.result-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.result-alert {
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 30px;
    font-size: 18px;
    font-weight: 600;
}

.result-alert.alert-success {
    background: #d4edda;
    border-left: 4px solid #28a745;
    color: #155724;
}

.result-alert.alert-error {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
    color: #721c24;
}

.result-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.result-buttons a {
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: background 0.3s;
}

/* PAGE DE CONNEXION */
.login-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    max-width: 400px;
    width: 100%;
    text-align: center;
}

.login-container h1 {
    color: #333;
    font-size: 32px;
    margin-bottom: 10px;
}

.login-container .subtitle {
    color: #666;
    font-size: 14px;
    margin-bottom: 30px;
}

.login-form {
    text-align: left;
}

.login-form .form-group {
    margin-bottom: 18px;
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 10px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.login-footer {
    margin-top: 25px;
    font-size: 12px;
    color: #999;
}

/* BARRE UTILISATEUR (accueil) */
.user-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f5f5f5;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 25px;
    font-size: 14px;
    color: #555;
    flex-wrap: wrap;
    gap: 10px;
}

.btn-logout {
    background: #dc3545;
    color: white;
    padding: 8px 14px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: background 0.2s;
}

.btn-logout:hover {
    background: #c82333;
}

/* BADGES D'ÉTAT */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-stock {
    background: #d4edda;
    color: #155724;
    border: 1px solid #28a745;
}

.badge-temp {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
}

.badge-partiel {
    background: #cce5ff;
    color: #004085;
    border: 1px solid #007bff;
}

/* COLORATION DES LIGNES SELON L'ÉTAT */
tbody tr.row-instance-2 {
    background: #fffbf0 !important;
}

tbody tr.row-instance-2:hover {
    background: #fff3cd !important;
}

tbody tr.row-instance-3 {
    background: #f0f7ff !important;
}

tbody tr.row-instance-3:hover {
    background: #cce5ff !important;
}

/* BOUTON RETOUR STOCK */
.btn-return {
    background: #17a2b8;
    color: white;
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
}

.btn-return:hover {
    background: #138496;
}

/* MODES DE SORTIE (remove.php) */
.mode-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 10px;
}

.mode-option {
    display: grid;
    grid-template-columns: auto auto 1fr;
    grid-template-areas:
        "radio icon title"
        "radio icon desc";
    column-gap: 12px;
    align-items: center;
    padding: 14px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.mode-option:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.mode-option input[type="radio"] {
    grid-area: radio;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.mode-option:has(input[type="radio"]:checked) {
    border-color: #667eea;
    background: #eef0ff;
}

.mode-icon {
    grid-area: icon;
    font-size: 24px;
}

.mode-title {
    grid-area: title;
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.mode-desc {
    grid-area: desc;
    font-size: 13px;
    color: #777;
}

.qty-options {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.qty-options label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: 500;
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.main-body {
    background: #f0f2f5;
    padding: 0;
    min-height: 100vh;
}

.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    flex-wrap: nowrap;
    transition: transform 0.28s ease;
}
.navbar-hidden { transform: translateY(-100%); }

/* Conteneur brand + user (desktop : inline, mobile : ligne du haut) */
.navbar-top {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.navbar-brand {
    color: white;
    font-size: 20px;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 1px;
    white-space: nowrap;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 2px;
    list-style: none;
    flex-wrap: nowrap;
    margin: 0 15px;
    flex: 1;
    justify-content: center;
}

.navbar-item {
    position: relative;
}

.navbar-item a,
.navbar-item button {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    padding: 7px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    display: block;
}

.navbar-item a:hover,
.navbar-item button:hover,
.navbar-item a.active {
    background: rgba(255,255,255,0.2);
    color: white;
}

/* Dropdown */
.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.18);
    min-width: 160px;
    padding: 6px 0;
    z-index: 200;
}

/* Ouverture : JS (.open) OU hover souris desktop */
.dropdown-menu.open,
.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 9px 16px;
    color: #333;
    font-size: 14px;
    text-decoration: none;
    transition: background 0.15s;
    white-space: nowrap;
}

.dropdown-menu a:hover {
    background: #f0f2ff;
}

/* Badge alerte dans la nav */
.badge-alert {
    background: #dc3545;
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: 3px;
    vertical-align: top;
}

/* User bar */
.navbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,0.9);
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
}

.navbar-user small {
    opacity: 0.8;
}

/* Page content wrapper */
.page-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 25px 20px;
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.page-title {
    font-size: 26px;
    font-weight: 700;
    color: #333;
    margin: 0;
}

/* ============================================================
   SECTION TITLES
   ============================================================ */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

/* ============================================================
   DASHBOARD
   ============================================================ */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.dash-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(0,0,0,0.04);
}

.dash-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.dash-icon {
    font-size: 32px;
    width: 60px;
    height: 60px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dash-icon-blue   { background: #e8ecff; }
.dash-icon-green  { background: #e8f8ee; }
.dash-icon-orange { background: #fff3e0; }
.dash-icon-red    { background: #ffe8e8; }
.dash-icon-purple { background: #f3e8ff; }
.dash-icon-gray   { background: #f0f0f4; }

.dash-info h3 {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin-bottom: 2px;
    line-height: 1;
}

.dash-info p {
    color: #888;
    font-size: 13px;
    margin: 0;
}

/* === CAROUSEL PHOTOS === */
.photo-carousel {
    position: relative;
    width: 100%;
    max-width: 480px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
    user-select: none;
}
.carousel-viewport {
    overflow: hidden;
    height: 300px;
}
.carousel-track {
    display: flex;
    height: 100%;
    transition: transform 0.3s ease;
    will-change: transform;
}
.carousel-slide {
    min-width: 100%;
    height: 300px;
    object-fit: contain;
    background: #f0f0f0;
    display: block;
}
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.45);
    color: #fff;
    border: none;
    font-size: 28px;
    width: 38px;
    height: 52px;
    cursor: pointer;
    border-radius: 5px;
    z-index: 10;
    padding: 0;
    line-height: 1;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.carousel-btn:hover { background: rgba(0,0,0,0.72); }
.carousel-btn.prev { left: 7px; }
.carousel-btn.next { right: 7px; }
.carousel-count {
    position: absolute;
    bottom: 8px;
    right: 10px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    pointer-events: none;
}
.carousel-no-photo {
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    font-size: 14px;
    border: 2px dashed #ddd;
    border-radius: 10px;
    margin-bottom: 15px;
}

/* === GRILLE PHOTOS (formulaires) === */
.photos-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}
.photo-thumb {
    position: relative;
    width: 110px;
    height: 90px;
    border-radius: 7px;
    overflow: hidden;
    border: 2px solid #ddd;
    background: #f5f5f5;
}
.photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.photo-thumb.marked-delete {
    opacity: 0.3;
}
/* ── Sélection multiple / barre bulk ── */
.row-check { width:16px;height:16px;cursor:pointer;accent-color:#667eea; }
.th-check  { width:36px;text-align:center;padding:0 8px !important; }
.td-check  { text-align:center;padding:0 8px !important; }

.bulk-bar {
    position: fixed;
    bottom: 0;
    left: 0; right: 0;
    background: linear-gradient(90deg,#667eea,#764ba2);
    color: #fff;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    z-index: 600;
    box-shadow: 0 -4px 24px rgba(102,126,234,.45);
    /* Cachée hors écran tant qu'aucune machine n'est sélectionnée.
       translateY(100%) la décale de toute sa hauteur, donc elle reste
       totalement invisible même quand elle s'enroule sur plusieurs lignes. */
    transform: translateY(100%);
    visibility: hidden;
    transition: transform .25s ease, visibility .25s ease;
}
.bulk-bar.active { transform: translateY(0); visibility: visible; }
.bulk-count { font-weight:700;font-size:15px;white-space:nowrap;margin-right:4px; }
.bulk-bar select,
.bulk-bar input[type="text"] {
    padding:7px 10px;border-radius:5px;border:none;
    font-size:13px;background:rgba(255,255,255,.92);color:#333;min-width:150px;
}
.btn-bulk-apply {
    background:#fff;color:#667eea;border:none;padding:8px 18px;
    border-radius:5px;font-weight:700;cursor:pointer;white-space:nowrap;font-size:14px;
}
.btn-bulk-apply:hover { background:#f0f2ff; }
.btn-bulk-apply:disabled { opacity:.6;cursor:wait; }
.btn-bulk-clear {
    background:transparent;color:rgba(255,255,255,.85);
    border:1px solid rgba(255,255,255,.4);padding:7px 14px;
    border-radius:5px;cursor:pointer;white-space:nowrap;font-size:13px;
}
.btn-bulk-clear:hover { color:#fff;border-color:#fff; }
.btn-bulk-delete {
    background:rgba(220,53,69,.9);color:#fff;border:none;padding:8px 18px;
    border-radius:5px;font-weight:700;cursor:pointer;white-space:nowrap;font-size:14px;
}
.btn-bulk-delete:hover { background:#dc3545; }
.btn-bulk-export {
    background:rgba(29,111,66,.9);color:#fff;border:none;padding:8px 18px;
    border-radius:5px;font-weight:700;cursor:pointer;white-space:nowrap;font-size:14px;
}
.btn-bulk-export:hover { background:#1d6f42; }
body.bulk-active { padding-bottom:72px; }

/* ── Pictogrammes EPI : sélection (edit) ── */
.epi-cat-section {
    display: block;
    margin-top: 28px;
}
.epi-cat-section:first-child { margin-top: 12px; }
.epi-cat-title {
    display: block;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 12px;
    padding: 6px 10px;
    border-left: 4px solid currentColor;
    background: rgba(0,0,0,.04);
    border-radius: 0 6px 6px 0;
}
.epi-pick-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.epi-pick-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    cursor: pointer;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 5px;
    background: #fafafa;
    transition: border-color 0.15s, background 0.15s, transform 0.1s;
    box-sizing: border-box;
}
.epi-pick-item svg,
.epi-pick-item img { width: 100%; height: 100%; object-fit: contain; display: block; }
.epi-pick-item:hover {
    border-color: #667eea;
    background: #f0f2ff;
    transform: scale(1.08);
    z-index: 2;
}
.epi-pick-item.selected {
    border-color: #667eea;
    background: #eef0ff;
    box-shadow: 0 0 0 3px rgba(102,126,234,.3);
}
/* Coche verte sur les items sélectionnés */
.epi-pick-item.selected::after {
    content: '✓';
    position: absolute;
    top: -7px; right: -7px;
    width: 18px; height: 18px;
    background: #667eea;
    color: white;
    font-size: 11px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 18px;
    text-align: center;
}

/* ── Pictogrammes EPI : affichage (view) ── */
.epi-display-bar {
    display: flex;
    flex-wrap: wrap;
    width: fit-content;
    gap: 18px;
    padding: 12px 20px;
    background: #fff;
    border-radius: 10px;
    margin: 0 auto 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.epi-group { display: flex; flex-direction: column; gap: 6px; }
.epi-group-label {
    font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .5px;
}
.epi-group-icons { display: flex; flex-wrap: wrap; gap: 8px; }
.epi-icon-wrap {
    display: inline-block; width: 46px; height: 46px;
    cursor: help; border-radius: 6px; overflow: hidden;
}
.epi-icon-wrap svg,
.epi-icon-wrap img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* ── Pictogrammes EPI : sélection JS active ── */

/* Réorganisation photos par glisser-déposer */
.photo-thumb[draggable="true"] { cursor: grab; }
.photo-thumb[draggable="true"]:active { cursor: grabbing; }
.photo-thumb.dragging  { opacity: 0.35; }
.photo-thumb.drag-over { outline: 3px dashed #667eea; outline-offset: 2px; }
.photo-move-btn {
    position: absolute;
    bottom: 0;
    background: rgba(0,0,0,0.52);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 13px;
    padding: 3px 7px;
    line-height: 1;
    transition: background 0.15s;
}
.photo-move-btn.left  { left: 0;  border-radius: 0 5px 0 0; }
.photo-move-btn.right { right: 0; border-radius: 5px 0 0 0; }
.photo-move-btn:hover { background: rgba(102,126,234,0.9); }
.photo-thumb-del {
    position: absolute;
    top: 3px;
    right: 3px;
    background: rgba(220,53,69,0.88);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 16px;
    line-height: 22px;
    text-align: center;
    cursor: pointer;
    padding: 0;
    font-weight: bold;
}

/* Grid dashboard : 2 colonnes sur grand écran, 1 sinon */
.two-col-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 25px;
    margin-bottom: 25px;
}

/* ── Fiche machine : détails + QR code ── */
.machine-detail-row {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}
.machine-qr-block {
    text-align: center;
    flex-shrink: 0;
    width: 160px;
    padding-left: 20px;
    border-left: 2px solid #f0f0f0;
}
@media (max-width: 640px) {
    .machine-detail-row {
        flex-direction: column;
    }
    .machine-qr-block {
        width: 100%;
        padding-left: 0;
        border-left: none;
        border-top: 2px solid #f0f0f0;
        padding-top: 16px;
    }
}

/* Small button variant */
.btn-sm {
    padding: 7px 14px !important;
    font-size: 13px !important;
    margin-top: 0 !important;
}

/* ============================================================
   STATUS BADGES (statuts BDD)
   ============================================================ */
.status-en_service      { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.status-en_panne        { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.status-en_maintenance  { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.status-hors_service    { background: #e2e3e5; color: #383d41; border: 1px solid #d6d8db; }
.status-planifiee       { background: #cce5ff; color: #004085; border: 1px solid #b8daff; }
.status-en_cours        { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.status-terminee        { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.status-annulee         { background: #e2e3e5; color: #383d41; border: 1px solid #d6d8db; }
.status-disponible      { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.status-rupture         { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.status-commande        { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.status-obsolete        { background: #e2e3e5; color: #383d41; border: 1px solid #d6d8db; }
.status-active          { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.status-acquittee       { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.status-resolue         { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.status-basse           { background: #e8ecff; color: #2c3e7a; border: 1px solid #c5ceff; }
.status-moyenne         { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.status-haute           { background: #fde8d8; color: #7a3c00; border: 1px solid #f5c699; }
.status-critique        { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.status-admin           { background: #e8ecff; color: #2c3e7a; border: 1px solid #c5ceff; }
.status-technicien             { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.status-technicien_recherche   { background: #cce5ff; color: #004085; border: 1px solid #b8daff; }
.status-technicien_maintenance { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.status-operateur              { background: #e2e3e5; color: #383d41; border: 1px solid #d6d8db; }
.status-maintenance            { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }

/* ============================================================
   PHOTOS / UPLOADS
   ============================================================ */
.upload-preview {
    display: block;
    max-width: 420px;   /* jamais plus large que 420px */
    max-height: 280px;  /* jamais plus haute que 280px */
    width: auto;        /* largeur naturelle, plafonnée par max-width */
    height: auto;       /* hauteur proportionnelle */
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.12);
    background: #f5f5f5;
}

/* ============================================================
   RESPONSIVE — colonnes masquables
   ============================================================ */

/* Masquer sur tablette (< 1024px) */
@media (max-width: 1024px) {
    .hide-tablet { display: none !important; }

    .two-col-grid {
        grid-template-columns: 1fr;
    }

    /* Contrôles de recherche : 2 colonnes max */
    .controls[style*="grid-template-columns:1fr 1fr 1fr 1fr"],
    .controls[style*="grid-template-columns: 1fr 1fr 1fr 1fr"] {
        grid-template-columns: 1fr 1fr !important;
    }
    .controls[style*="grid-template-columns:1fr 1fr 1fr"],
    .controls[style*="grid-template-columns: 1fr 1fr 1fr"] {
        grid-template-columns: 1fr 1fr !important;
    }
}

/* Masquer sur mobile (< 768px) */
@media (max-width: 768px) {
    .hide-mobile  { display: none !important; }
    .hide-tablet  { display: none !important; }

    /* Nav mobile : colonne — navbar-top (brand+logout) puis menu en dessous */
    .navbar {
        flex-direction: column;
        height: auto;
        padding: 10px 12px 6px;
        align-items: stretch;
        gap: 0;
    }
    .navbar-top {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    .navbar-brand { font-size: 18px; }
    .navbar-user span { display: none; }
    .navbar-user .btn-logout {
        padding: 5px 11px;
        font-size: 12px;
    }
    .navbar-menu {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start;
        margin: 0;
        padding: 7px 0 2px;
        gap: 2px;
        border-top: 1px solid rgba(255,255,255,0.2);
        flex: none;
        width: 100%;
    }
    .navbar-item a,
    .navbar-item button {
        padding: 5px 9px;
        font-size: 12px;
    }

    /* Grilles */
    .two-col-grid,
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    /* Contrôles : 1 colonne */
    .controls,
    .controls[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    .buttons { grid-template-columns: 1fr; }

    /* Tableaux : scroll horizontal + texte plus petit */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    table { font-size: 12px; min-width: 400px; }
    th, td { padding: 8px 10px; }

    /* Actions en colonne */
    .action-cell {
        flex-direction: column;
        gap: 4px;
    }
    .action-cell .btn-edit,
    .action-cell .btn-delete,
    .action-cell .btn-return,
    .action-cell a,
    .action-cell button { width: 100%; text-align: center; }

    /* Page header : empile titre et boutons */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .page-title { font-size: 20px; }

    /* Grilles internes formulaires */
    div[style*="grid-template-columns:1fr 1fr"],
    div[style*="grid-template-columns: 1fr 1fr"] {
        display: block !important;
    }

    .stock-buttons  { flex-direction: column; }
    .result-buttons { grid-template-columns: 1fr; }
    .creator-container { padding: 20px; }

    .upload-preview { max-height: 200px; }
}

@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
    }

    .home-container {
        padding: 20px;
    }

    .creator-container {
        padding: 20px;
    }

    .stock-container {
        padding: 15px;
    }

    .result-container {
        padding: 20px;
    }
}
/* === MODAL MODIF RAPIDE === */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.52);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
}
.modal-overlay.open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}
.modal-box {
    background: #fff;
    border-radius: 14px;
    padding: 28px 30px 24px;
    max-width: 460px;
    width: 94%;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0,0,0,0.28);
    animation: modal-in 0.18s ease;
}
@keyframes modal-in {
    from { transform: scale(0.93); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 14px;
}
.modal-header h3 { margin: 0; color: #333; font-size: 17px; font-weight: 700; }
.modal-close {
    background: none;
    border: none;
    font-size: 26px;
    color: #bbb;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    transition: color 0.15s;
}
.modal-close:hover { color: #333; }
.btn-quick {
    background: #667eea;
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    display: inline-block;
}
.btn-quick:hover { background: #5568d3; }

/* === PAGE LIEUX === */
.lieux-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    margin-top: 20px;
}
.lieu-card {
    background: #fff;
    border: 2px solid #e8ecff;
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: #333;
}
.lieu-card .lieu-del {
    background: none;
    border: none;
    color: #dc3545;
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.btn-quick-sm {
    background: #667eea;
    color: #fff;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}
.btn-quick-sm:hover { background: #5568d3; }

/* === CALENDRIER === */
.cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.cal-nav h2 { font-size: 22px; color: #333; font-weight: 700; }
.cal-nav-btn {
    background: #667eea;
    color: white;
    padding: 8px 18px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 18px;
    transition: background 0.2s;
}
.cal-nav-btn:hover { background: #5568d3; }
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    background: #dee2f5;
    border-radius: 10px;
    overflow: hidden;
}
.cal-head {
    background: #667eea;
    color: white;
    text-align: center;
    padding: 10px 4px;
    font-weight: 700;
    font-size: 13px;
}
.cal-day {
    background: white;
    min-height: 100px;
    padding: 6px;
}
.cal-day.empty  { background: #f8f8fb; }
.cal-day.today  { background: #f0f3ff; }
.cal-day.today .cal-day-num { background: #667eea; color: white; border-radius: 50%; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; }
.cal-day-num { font-size: 13px; font-weight: 600; color: #555; margin-bottom: 4px; }
.cal-event {
    display: block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    margin-bottom: 2px;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
}
.cal-event.planifiee { background: #e8ecff; color: #667eea; }
.cal-event.en_cours  { background: #fff3cd; color: #856404; }
.cal-event.terminee  { background: #d4edda; color: #155724; }
.cal-event.annulee   { background: #f5f5f5; color: #aaa; text-decoration: line-through; }
.cal-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 16px;
}
.cal-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}
.cal-legend-dot {
    width: 14px;
    height: 14px;
    border-radius: 3px;
}

/* === GAMMES === */
.gamme-echeance-ok      { color: #28a745; font-weight: 600; }
.gamme-echeance-soon    { color: #ffc107; font-weight: 600; }
.gamme-echeance-late    { color: #dc3545; font-weight: 700; }
.gamme-echeance-none    { color: #aaa; }
.btn-launch {
    background: #28a745;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s;
}
.btn-launch:hover { background: #218838; }

/* ============================================================
   BANNIÈRE SCAN QR — visible tablette + mobile uniquement
   ============================================================ */
.mobile-qr-banner {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    padding: 18px 24px;
    border-radius: 14px;
    margin-bottom: 20px;
    font-weight: 700;
    font-size: 18px;
    box-shadow: 0 4px 20px rgba(102,126,234,0.35);
    transition: opacity 0.2s, transform 0.2s;
}
.mobile-qr-banner:hover { opacity: 0.92; color: white; transform: translateY(-2px); }
.mobile-qr-banner .qr-icon { font-size: 30px; line-height: 1; }
.mobile-qr-banner .qr-text { display: flex; flex-direction: column; gap: 2px; }
.mobile-qr-banner .qr-text small { font-size: 13px; font-weight: 400; opacity: 0.85; }

/* ============================================================
   COLONNES MASQUABLES AU RESPONSIVE
   ============================================================ */
/* Masquer sur tablette < 960px (colonnes secondaires) */
@media (max-width: 960px) {
    .mobile-qr-banner { display: flex; }
    th.col-tab-hide, td.col-tab-hide { display: none !important; }

    /* Table moins large = pas de scroll horizontal inutile */
    .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ============================================================
   LAYOUT CARTE — mobile < 640px
   ============================================================ */
@media (max-width: 640px) {

    /* Table → liste de cartes */
    .tbl-cards thead { display: none !important; }
    .tbl-cards.table-wrapper { overflow-x: visible; }
    .tbl-cards,
    .tbl-cards tbody { display: block; min-width: 0; }

    .tbl-cards tbody tr {
        display: block;
        border: 1px solid #e0e4f0;
        border-radius: 14px;
        margin-bottom: 14px;
        padding: 14px 16px;
        background: white;
        box-shadow: 0 2px 10px rgba(0,0,0,0.07);
        transition: box-shadow 0.2s;
    }
    .tbl-cards tbody tr:nth-child(even) { background: white; }
    .tbl-cards tbody tr:hover { box-shadow: 0 6px 18px rgba(102,126,234,0.14); }

    .tbl-cards td {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        padding: 5px 0;
        border: none;
        font-size: 14px;
    }
    .tbl-cards td::before {
        content: attr(data-label);
        flex-shrink: 0;
        min-width: 90px;
        font-weight: 600;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.4px;
        color: #999;
        padding-top: 3px;
    }

    /* Cacher : ID + colonnes sans label */
    .tbl-cards td.id-cell,
    .tbl-cards td[data-label=""] { display: none !important; }

    /* Nom : titre de carte en gras, sans préfixe */
    .tbl-cards td[data-label="Nom"] {
        font-size: 17px;
        font-weight: 700;
        padding-bottom: 10px;
        margin-bottom: 4px;
        border-bottom: 1px solid #f0f0f0;
        display: block;
    }
    .tbl-cards td[data-label="Nom"]::before { display: none; }
    .tbl-cards td[data-label="Nom"] a { color: #667eea; text-decoration: none; }

    /* Actions en ligne */
    .tbl-cards td.action-cell {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap;
        gap: 6px;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid #f0f0f0;
    }
    .tbl-cards td.action-cell::before { display: none; }
    .tbl-cards td.action-cell > a,
    .tbl-cards td.action-cell > button { flex: 1; min-width: 80px; text-align: center; width: auto !important; }
    .tbl-cards td.action-cell > form { flex: 1; min-width: 80px; }
    .tbl-cards td.action-cell > form button { width: 100%; }

    /* Ligne "aucun résultat" */
    .tbl-cards tr[data-lt-ignore] { display: block; text-align: center; box-shadow: none; border: 1px dashed #ddd; }
    .tbl-cards tr[data-lt-ignore] td { display: block; }
    .tbl-cards tr[data-lt-ignore] td::before { display: none; }

    /* LiveTable barre de recherche full-width */
    .lt-bar { flex-direction: column; align-items: stretch; }
    .lt-search { min-width: unset !important; }
}

/* ============================================================
   PRINT / PDF === */
@media print {
    .navbar, .page-header .btn-secondary, .page-header .btn-edit,
    .page-header .btn-primary, .btn-print, .no-print { display: none !important; }
    body { padding: 0; background: white; font-size: 12px; }
    .print-header { display: block !important; }
    .container { box-shadow: none; border: 1px solid #ddd; }
    a { color: inherit; text-decoration: none; }
}
.print-header { display: none; }
.btn-print {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}
.btn-print:hover { background: #545b62; }

/* ============================================================
   PAGE-ACTIONS — barre de boutons des pages view
   Corrige uniquement l'alignement vertical (margin-top btn-primary)
   ============================================================ */
.page-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.page-actions .btn-primary,
.page-actions .btn-back     { margin-top: 0; }
.page-actions > *           { display: inline-flex; align-items: center;
                              justify-content: center; text-decoration: none; }

@media (max-width: 768px) {
    .page-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
        gap: 8px;
    }
    .page-actions > * {
        margin-top: 0 !important;
        padding: 10px 8px !important;
        font-size: 13px !important;
        text-align: center;
        box-sizing: border-box;
    }
}
