* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    background: #f3f4f6;
    color: #111827;
}

.app {
    display: flex;
    height: 100vh;
}

/* Sidebar gauche */
.sidebar {
    width: 210px;
    background: #111827;
    color: #e5e7eb;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar button {
    width: 100%;
    border: 0px;
    color: #e5e7eb;
    text-align: left;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 17px;
    background: #111827;
}

.sidebar-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-item {
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.nav-item.active {
    background: #2563eb;
    color: #f9fafb;
}

.nav-item:not(.active):hover {
    background: #1f2937;
}

.sidebar-footer {
    border-top: 1px solid #e5e7eb;
    margin-top: auto;
}

/* Contenu principal */
.main {
    flex: 1;
    display: flex;
    padding: 24px;
    gap: 24px;
}

.login-section {
    min-width: 400px;
    margin: auto;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    padding: 20px;
}

.login-section-title {
    font-size: 20px;
    margin-bottom: 16px;
}

.welcome-image-container {
    display: flex;
    justify-content: center;
}

.welcome-image {
    flex: none;
    /*width: 100%;*/
    max-width: 200px;
    max-height: 200px;
    margin: 20px auto 0;
    display: block;
}

.card {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    padding: 20px;
}

/* Colonne centrale : création QR */
.left-panel {
    position: relative;
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.left-panel h1 {
    font-size: 20px;
    margin-bottom: 8px;
}


.form-login form{
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-login form input {
    flex: auto;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 14px;
}

.form-login form button {
    flex: 1;
    border: none;
    color: #ffffff;
    border-radius: 8px;
    padding: 8px 18px;
    font-size: 14px;
    cursor: pointer;
}

.form-row input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px #2563eb22;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}

.form-row form {
    display: flex;
    gap: 10px;
}

.form-row label {
    font-size: 14px;
    color: #4b5563;
}
.form-row input[type="password"],
.form-row input[type="text"] {
    flex: auto;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 14px;
}
.form-row input[type="password"]:focus,
.form-row input[type="text"]:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px #2563eb22;
}

.form-row button,
.user-actions button {
    border: none;
    color: #ffffff;
    border-radius: 8px;
    padding: 8px 18px;
    font-size: 14px;
    cursor: pointer;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.canva-qr-code {
    width: 170px; 
    border: 1px solid #d1d5db; 
    border-radius: 6px; 
    padding: 10px; 
    background: #f9fafb;
}

.canva-qr-code-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.cancel-btn {
    background: #ef4444; 
}

.cancel-btn:hover {
    background: #b63333; 
}

.valid-btn {
    background: #10b981;
}

.valid-btn:hover {
    background: #059669;
}

.files-section-title {
    font-size: 14px;
    font-weight: 600;
    margin-top: 8px;
    margin-bottom: 4px;
}

/* PANNEAU SQL (maintenance superviseur) */

.sql-form {
    margin-bottom: 12px;
}

.sql-input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px;
    font-family: monospace;
    font-size: 13px;
    resize: vertical;
}

.sql-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.sql-error {
    border: 1px solid #ef4444;
    background: #fef2f2;
    color: #b63333;
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 12px;
    font-size: 13px;
    white-space: pre-wrap;
}

.sql-success {
    border: 1px solid #10b981;
    background: #ecfdf5;
    color: #059669;
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 12px;
    font-size: 13px;
}

.password-hint {
    margin-top: 12px;
    color: #6b7280;
    font-size: 12px;
    line-height: 1.4;
}

.user-actions {
    margin-bottom: 12px;
}

/* TABLE qr codes */

.qr-list {
    max-height: calc(100vh - 150px);
    overflow-y: auto;
    padding-right: 4px;
    margin-bottom: 20px;
}

/* TABLE fichiers sélectionnés */

.selected-files-list {
    max-height: calc(100vh - 480px);
    overflow-y: auto;
    padding-right: 4px;
    margin-bottom: 20px;
}

.selected-files {
    width: 100%;
    border-collapse: collapse;
}

.selected-files td {
    padding: 6px 4px;
    font-size: 14px;
}

.selected-files tr:nth-child(odd) {
    background: #f9fafb;
}

.selected-files button {
    border: none;
    background: #ef4444;
    color: #ffffff;
    border-radius: 999px;
    width: 22px;
    height: 22px;
    font-size: 14px;
    cursor: pointer;
    line-height: 1;
}

.file-icon {
    width: 40px;
    height: 40px;
    background: #2563eb;
    color: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    padding: 5px;
}

.file-icon.pdf {
    background: #ef4444;
}

.ext-cell {
    width: 50px;
    text-align: center;
}

.actions-cell {
    width: 30px;
    text-align: right;
}

.file-add-line {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.actions {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
}

.btn-primary {
    border: none;
    background: #2563eb;
    color: #ffffff;
    border-radius: 8px;
    padding: 8px 18px;
    font-size: 14px;
    cursor: pointer;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-primary.pause {
    background: #ebb625;
}

.btn-primary.pause:hover {
    background: #d8ac1d;
}

.btn-primary.delete {
    background: #ef4444;
}

.btn-primary.delete:hover {
    background: #b91c1c ;
}


/* Colonne droite : fichiers disponibles */
.right-panel {
    flex: 1.3;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.right-panel h2 {
    font-size: 16px;
    margin-bottom: 4px;
}

.search-row {
    /*display: flex;*/
    margin-bottom: 8px;
}

.search-row form
{
    display: flex;
    gap: 4px;
}

.search-row input {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 13px;
}

.right-list {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    padding-right: 4px;
}

/* TABLE fichiers disponibles */
.files-table {
    width: 100%;
    border-collapse: collapse;
}

.files-table td {
    padding: 6px 8px;
    font-size: 14px;
}

.files-table tr:nth-child(odd) {
    background: #f9fafb;
}

.files-table tr:hover {
    background: #eef2ff;
}

.files-table button {
    border: none;
    background: #2563eb;
    color: #ffffff;
    border-radius: 999px;
    width: 22px;
    height: 22px;
    font-size: 16px;
    cursor: pointer;
    line-height: 1;
}

.files-table button:hover {
    background: #1d4ed8;
}

.qr-table,
.selected-item-table,
.item-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 12px;
}

.qr-table,
.selected-item-table thead th, 
.item-table thead th {
  position: sticky; /* Rend l'élément "collant" */
  top: 0;          /* Le seuil où il se fixe (0 = haut du conteneur) */
  z-index: 10;     /* Pour s'assurer qu'il reste au-dessus des lignes du corps */
}

.qr-table th, td ,
.selected-item-table th, td ,
.item-table th, td {
    padding: 8px 10px;
    font-size: 14px;
    text-align: left;
}

.qr-table th,
.selected-item-table th,
.item-table th {
    background: #e5e7eb;
    font-weight: 600;
}

.qr-table tr:nth-child(odd) td, 
.selected-item-table tr:nth-child(odd) td, 
.item-table tr:nth-child(odd) td {
    background: #f9fafb;
}

.qr-table tr:hover td,
.item-table tr:hover td,
.selected-item-table tr:hover td {
    background: #eef2ff;
}

.item-table button {
    border: none;
    background: #2563eb;
    color: #ffffff;
    border-radius: 999px;
    width: 22px;
    height: 22px;
    font-size: 16px;
    cursor: pointer;
    line-height: 1;
}

.item-table button:hover {
    background: #1d4ed8;
}

.selected-item-table button {
    border: none;
    background: #ef4444;
    color: #ffffff;
    border-radius: 999px;
    width: 22px;
    height: 22px;
    font-size: 16px;
    cursor: pointer;
    line-height: 1;
}

.selected-item-table button:hover {
    background: #bb3535;
}

.close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #ef4444;
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: #b91c1c;
}

.link-btn {
    background: none;
    border: none;
    color: #0059b3;
    text-decoration: underline;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
}

.link-btn:hover {
    color: #003d80;
}