:root {
  --bg: #f7f8fa;
  --bg-main: #eff5ff;
  --card: #fff;
  --accent: #2b7aef;
  --muted: #888;
  --blue: #1e8ed6;
  --bg-grey: #e5f2ff;
  --bg-green: #91ee91;
  --bg-red: #fb7d7d;
  --border-radius-card: 16px;
}
* {
  box-sizing: border-box;
}
body {
  font-family: "Segoe UI", Roboto, sans-serif;
  background: var(--bg-main);
  margin: 0;
  color: #333;
}
h1 {
  font-size: 20px;
  margin: 0;
}

/* header {
  display: flex;
  align-items: center;
  color: white;
  justify-content: space-between;
  padding: 18px 22px;
  background: linear-gradient(90deg, #303030, #4b71c9);
  border-bottom: 1px solid rgb(0 0 0 / 4%);
}
header h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 500;
}
header .top-actions, header .page-title {
  display: flex;
  gap: 12px;
  align-items: center;
}
.chip {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 4px 10px;
  border-radius: 18px;
  background: rgb(255 255 255 / 20%);
  border: 1px solid #e7efff;
  font-size: 1rem;
  color: #fff !important;
  text-decoration: none;
}
.subtitle {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 1.6rem;
}
header .subtitle {
  color: #fff;
} */

header {
  display: flex;
  align-items: center;
  color: white;
  justify-content: space-between;
  padding: 18px 22px;
  background: linear-gradient(90deg, #303030, #4b71c9);
  border-bottom: 1px solid rgb(0 0 0 / 4%);
  flex-wrap: wrap;
  gap: 14px;
}
header h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 500;
}
header .top-actions,
header .page-title,
header .header-user {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* ---------- Bloc utilisateur connecté ---------- */

header .header-user {
  gap: 20px;
}

header .header-user .user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

header .header-user .avatar {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 50%;
  background: rgb(255 255 255 / 16%);
  border: 1px solid rgb(255 255 255 / 30%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  color: #fff;
}

header .header-user .user-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
  line-height: 1.35;
}

header .header-user .muted {
  font-size: 0.78rem;
  color: rgb(255 255 255 / 68%);
  line-height: 1.35;
}

/* ---------- Boutons de l'en-tête ---------- */

header .header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

header .header-actions .btn,
header .header-actions .btn-outline {
  font-size: 0.85rem;
  padding: 7px 16px 9px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

header .header-actions .btn {
  background: #fff;
  color: #303030;
  border: 1px solid #fff;
}
header .header-actions .btn:hover {
  background: rgb(255 255 255 / 85%);
}

header .header-actions .btn-outline {
  background: transparent;
  color: #fff;
  border: 1px solid rgb(255 255 255 / 40%);
}
header .header-actions .btn-outline:hover {
  background: rgb(255 255 255 / 12%);
  border-color: rgb(255 255 255 / 70%);
}

.chip {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 4px 10px;
  border-radius: 18px;
  background: rgb(255 255 255 / 20%);
  border: 1px solid #e7efff;
  font-size: 1rem;
  color: #fff !important;
  text-decoration: none;
}
.subtitle {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 1.6rem;
}
header .subtitle {
  color: #fff;
}

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
  header {
    padding: 14px 16px;
  }
  header .header-user {
    width: 100%;
    justify-content: space-between;
    gap: 12px;
  }
  header .header-user .muted {
    display: none;
  }
  header .header-actions .btn-outline {
    padding: 7px 12px;
  }
  header .page-title {
    display:none;
  }
}

main {
  padding: 25px;
  max-width: 1200px;
  margin: 20px auto;
}
section {
  max-width: 900px;
  margin: 1rem auto;
  background: white;
  padding: 2rem;
  border-radius: 14px;
  box-shadow: 0 2px 6px rgb(0 0 0 / 10%);
}
h2 {
  border-left: 4px solid #007bff;
  padding-left: 8px;
  margin: 0 0 0.6rem;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}
.form-grid .full {
  grid-column: 1 / -1;
}
input,
textarea,
select,
button {
  width: 100%;
  font-size: 1rem;
  padding: 0.6rem;
  border-radius: 7px;
  border: 1px solid #ccc;
}
button {
  cursor: pointer;
}
button.primary {
  background: #007bff;
  color: white;
  border: none;
  transition: background 0.2s;
}
button.primary:hover {
  background: #0062d6;
}
.actions {
  margin-top: 1rem;
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}
.info-auto-save {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: #555;
}
footer {
  text-align: center;
  margin: 3rem 0 1rem;
  color: #666;
}
#createError,
#loginError {
  background-color: red;
  border-radius: 8px;
  line-height: 1.4;
  color: #fff;
  display: none;
  text-align: center;
}
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.card {
  background: #fff;
  padding: 20px 25px;
  border-radius: var(--border-radius-card, 16px);
  box-shadow: 0 3px 12px rgb(0 0 0 / 8%);
  margin-bottom: 25px;
}
.card h2 {
  margin-bottom: 15px;
}

/* .user-info {
  display: flex;
  gap: 12px;
  align-items: center;
} */
.avatar {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  background: linear-gradient(135deg, #e6f0ff, #f2f9ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--accent);
}
.muted {
  color: var(--muted);
  font-size: 13px;
}
.prod-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.prod-card {
  padding: 12px;
  border-radius: var(--border-radius-card, 16px);
  border: 1px solid #d6e5fd;
  background: #fff;
}
.prod-title {
  font-weight: 700;
  margin-bottom: 6px;
  font-size: 1.5em;
}
.show-item {
  border-top: 1px solid #d6e5fd;
  padding-top: 10px;
  margin-top: 10px;
}
.show-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}
.meta {
  font-size: 13px;
  color: var(--muted);
}
.btn {
  display: inline-block;
  padding: 6px 12px 8px;
  border-radius: 7px;
  text-decoration: none;
  background: var(--accent);
  color: #fff;
  font-weight: 400;
  font-size: 0.8rem;
  transition: .2s;
}
.btn:disabled {
  background-color: #9bade7 !important;
  cursor:default;
}
.btn-outline {
  background: transparent;
  color: var(--accent);
  transition:.2s;
  border: 1px solid #d6e5fd;
}
.btn-outline:hover {
  background: var(--bg-main);
}
.btn-primary {
  background: #4b71c9;
  color: white;
  padding: 0.8rem 1.4rem;
  border-radius: 8px;
  border: none;
  font-size: 1rem;
  cursor: pointer;
}
.btn-primary:hover,
.btn:hover {
  background: #4b6bb5;
}
.btn-red {
  background: #dc3545;
}
.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}
.grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.kpi {
  background: var(--bg-main);
  border: 1px solid #d6e5fd;
  padding: 3px 8px 5px;
  border-radius: 8px;
  font-size: 13px;
}
.highlight-box {
  border-radius: 12px;
  border: 2px solid #3861bc;
  padding: 15px;
  background-color: #f8f9fa;
  margin: 15px 0;
  box-shadow: 0 2px 4px rgb(0 0 0 / 10%);
}

/*
.account-section {
  max-width: 720px;
  margin: 2rem auto;
  background: #fff;
  padding: 2rem 2.2rem;
  border-radius: 14px;
  box-shadow: 0 2px 6px rgb(0 0 0 / 12%);
  font-family: Inter, Arial, sans-serif;
}
*/

.form-group {
  margin-bottom: 1.3rem;
}

label {
  font-weight: 600;
  margin-bottom: 0.4rem;
  display: block;
}

input,
textarea,
select {
  width: 100%;
  padding: 0.7rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  font-family: "Segoe UI", Roboto, sans-serif;
}

textarea {
  resize: vertical;
}

textarea.autoHeight {
  overflow-y: auto;
  max-height: 500px;
}

.error {
  margin-top: 0.3rem;
  color: #d00000;
  font-size: 0.9rem;
}

.info {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.85rem;
  color: #777;
}

.rgpd-block {
  background: #f7f7f7;
  padding: 1rem;
  border-radius: 10px;
  margin: 1rem 0;
  font-size: 0.9rem;
  color: #444;
}

.rgpd-block p {
  margin: 0;
}

.back-link {
  font-size: 0.9rem;
  color: #007bff;
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

.prod-container {
  max-width: 850px;
  margin: 0 auto;
}
.title {
  font-size: 27px;
  font-weight: 700;
  margin-bottom: 10px;
}
.intro {
  font-size: 16px;
  margin-bottom: 25px;
}

/* --- FORMS --- */
.event-form label {
  margin-top: 10px;
  display: block;
  font-weight: 600;
}
.event-form input,
.event-form textarea {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
  margin-top: 3px;
}
.thumb {
  width: 150px;
  margin-top: 10px;
  border-radius: 8px;
}

.mt-20 {
  margin-top: 20px;
}

.char-counter {
  font-size: 0.75em;
  color: #666;
  margin-top: 4px;
  margin-bottom: 12px;
  text-align: right;
}
.char-counter.warning {
  color: #ff9800;
  font-weight: bold;
}
.char-counter.error {
  color: #f44336;
  font-weight: bold;
}
.file-version-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.file-input {
    flex: 4;
}

.version-input {
    flex: 1;
    height: 46px;
}

.file-upload-container{
    background:#fafafa;
    padding:12px;
    border-radius:10px;
    border:1px solid #eee;
}

.remove-file{
    background:none;
    border:none;
    color:#999;
    cursor:pointer;
    font-size:16px;
    width:20px;
}

.remove-file:hover{
    color:#e74c3c;
}

.tabs-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 20px;
  justify-content: center;
}

.tab-btn {
  background: #eee;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 8px 14px;
  cursor: pointer;
  transition: 0.12s;
  font-weight: 500;
  width:auto;
  flex: 1 1 auto;
  text-align: center;
  max-width: 400px;
}

.tab-btn:hover {
  background: #ddd;
}

.tab-btn.active {
  background: #4b71c9;
  color: white;
  border-color: #1e9ff2;
}

.btn-add-file{
    margin-top:6px;
    background:#f3f6ff;
    border:1px dashed #5a7cff;
    color:#5a7cff;
    padding:6px 10px;
    border-radius:8px;
    cursor:pointer;
}

.btn-add-file:hover{
    background:#e8edff;
}

.existing-files {
  padding: 8px 16px 14px;
  border-radius:12px;
  background-color:var(--bg-main);
  border: 1px solid #d6e5fd;
  margin-bottom:10px;
  font-size:90%;
}
.existing-files p, .existing-files ul {
  margin: 0;
}
.delete-file-container {
    display: inline-block;
    opacity: 0;
    transition: opacity 0.3s;
    margin-left: 10px;
    color: #f44;
    font-weight: bold;
}

li:hover .delete-file-container {
    opacity: 1;
}

.delete-file {
    text-decoration: none;
    cursor: pointer;
}
.alert {
  text-align:center;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 6px;
}
.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
}
.alert-warning {
    color: #4b71c9;
    background-color: #ffecd5;
    border: 1px solid #bccbed;
}
.alert-info {
    color: #4b71c9;
    background-color: #e8f0fe;
    border: 1px solid #bccbed;
}

.text-highlight {
    padding: 2px 10px;
    border: 1px solid #bbb;
    border-radius: 10px;
    background-color: var(--bg-grey);
    font-size: 10px;
}

.text-highlight.green {
  background-color: var(--bg-green);
  color: #333;
}

.text-highlight.blue {
  background-color: var(--blue);
  color: #fff;
}

.text-highlight.red {
  background-color: var(--bg-red);
  color: #fff;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgb(255 255 255 / 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}

/* ===== Bloc équipe (Intendance) ===== */

.equipe-block {
    margin-top: 10px;
}

.equipe-block h3 {
    margin-bottom: 6px;
}

/* --- Table ---
#equipeTable {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 14px;
    font-size: 14px;
    border: 1px solid var(--color-border, #e4e4e7);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

#equipeTable thead th {
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--color-text-muted, #6b7280);
    background: var(--color-surface-muted, #f9fafb);
    padding: 10px 14px;
    border-bottom: 1px solid var(--color-border, #e4e4e7);
}

#equipeTable tbody td {
    padding: 10px 14px;
    color: var(--color-text, #1f2937);
    border-bottom: 1px solid var(--color-border-light, #f0f0f2);
    vertical-align: middle;
}

#equipeTable tbody tr:last-child td {
    border-bottom: none;
}

#equipeTable tbody tr {
    transition: background-color .15s ease;
}

#equipeTable tbody tr:hover {
    background: var(--color-surface-hover, #f7f8fa);
}

/* Colonne actions (édition/suppression) toujours alignée à droite, largeur fixe *
#equipeTable th:last-child,
#equipeTable td:last-child {
    text-align: right;
    white-space: nowrap;
    width: 70px;
}

/* --- Bouton "Ajouter une personne" --- *
#equipeAddBtn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    padding: 8px 16px;
    margin-top: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    background: var(--color-primary, #2563eb);
    border-radius: 8px;
    transition: background-color .15s ease, transform .1s ease;
}

#equipeAddBtn:hover {
    background: var(--color-primary-hover, #1d4ed8);
}

#equipeAddBtn:active {
    transform: scale(0.97);
}

/* --- Icônes édition / suppression --- */
.personnel-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 10px 0 4px;
    border: 1px solid var(--color-border, #e4e4e7);
    border-radius: 10px;
    background: #fff;
}

.personnel-table {
    min-width: 1080px;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
}

.personnel-table thead th {
    text-align: left;
    font-size: 12px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--color-text-muted, #6b7280);
    background: var(--color-surface-muted, #f9fafb);
    padding: 10px 8px;
    border-bottom: 1px solid var(--color-border, #e4e4e7);
}

.personnel-table tbody td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--color-border-light, #f0f0f2);
    vertical-align: middle;
}

.personnel-table tbody tr:last-child td {
    border-bottom: none;
}

.personnel-table tbody tr {
    transition: background-color .15s ease;
}

.personnel-table tbody tr:hover {
    background: var(--bg-main);
}

.personnel-table .col-num {
    width: 28px;
    text-align: center;
    color: var(--color-text-muted, #6b7280);
    font-size: 12px;
}

.personnel-table input[type="text"],
.personnel-table input[type="number"],
.personnel-table input[type="email"],
.personnel-table select {
    width: 100%;
    min-width: 90px;
    padding: 6px 8px;
    font-size: 13px;
    border: 1px solid #efefff;
    border-radius: 6px;
    background: #fff;
    box-sizing: border-box;
}

.personnel-table select {
    cursor: pointer;
}

.personnel-table input[type="text"]:focus,
.personnel-table select:focus {
    outline: none;
    border-color: var(--color-primary, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.personnel-table td:last-child {
    width: 32px;
    text-align: center;
}

.personnel-delete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    color: var(--color-text-muted, #6b7280);
    transition: background-color .15s ease, color .15s ease;
}

.personnel-delete-btn:hover {
    background: #fdecec;
    color: var(--color-font-red, #dc2626);
}

.personnel-toggle-link {
    margin-top: 8px;
    padding: 0 15px;
}

.personnel-toggle-link .span_link {
    color: var(--color-primary, #2563eb);
    font-size: 13px;
    text-decoration: underline;
    cursor: pointer;
}

.personnel-autocomplete {
    background: #fff;
    border: 1px solid var(--color-border, #e4e4e7);
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0,0,0,.12);
    max-height: 220px;
    overflow-y: auto;
    z-index: 3000;
}
.personnel-autocomplete-item {
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
}
.personnel-autocomplete-item:hover {
    background: var(--color-surface-hover, #f7f8fa);
}

/* ===== Table Personnel (Dashboard) ===== */

.personnel-dashboard-table {
    margin-top: 14px;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
    border: 1px solid var(--color-border, #e4e4e7);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.personnel-dashboard-table thead th {
    text-align: left;
    font-size: 12px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--color-text-muted, #6b7280);
    background: var(--color-surface-muted, #f9fafb);
    padding: 10px 14px;
    border-bottom: 1px solid var(--color-border, #e4e4e7);
}

.personnel-dashboard-table tbody td {
    padding: 10px 14px;
    color: var(--color-text, #1f2937);
    border-bottom: 1px solid var(--color-border-light, #f0f0f2);
    vertical-align: middle;
}

.personnel-dashboard-table tbody tr:last-child td {
    border-bottom: none;
}

.personnel-dashboard-table tbody tr.personnel-row {
    transition: background-color .15s ease;
}

.personnel-dashboard-table tbody tr.personnel-row:hover {
    background: var(--color-surface-hover, #f7f8fa);
}

.personnel-dashboard-table tr.personnel-row td:last-child {
    text-align: right;
    white-space: nowrap;
    /*width: 90px;*/
}

.personnel-dashboard-table th:last-child {
    text-align: right;
    white-space: nowrap;
    /*width: 90px;*/
}

/* Ligne du formulaire d'édition inline */
.personnel-dashboard-table tr.personnel-edit-row td {
    background: var(--color-surface-muted, #f9fafb);
    border-bottom: 1px solid var(--color-border, #e4e4e7);
}

.personnel-dashboard-table tr.personnel-edit-row form {
    max-width: 480px;
}

.personnel-dashboard-table tr.personnel-edit-row label {
    display: block;
    margin-top: 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted, #6b7280);
}

.personnel-dashboard-table tr.personnel-edit-row label:first-child {
    margin-top: 0;
}

.personnel-dashboard-table tr.personnel-edit-row input,
.personnel-dashboard-table tr.personnel-edit-row select,
.personnel-dashboard-table tr.personnel-edit-row textarea {
    width: 100%;
    margin-top: 4px;
    padding: 8px 10px;
    font-size: 14px;
    border: 1px solid var(--color-border, #e4e4e7);
    border-radius: 6px;
    background: #fff;
    box-sizing: border-box;
}

.personnel-dashboard-table tr.personnel-edit-row input:focus,
.personnel-dashboard-table tr.personnel-edit-row select:focus,
.personnel-dashboard-table tr.personnel-edit-row textarea:focus {
    outline: none;
    border-color: var(--color-primary, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

@media (max-width: 640px) {
    .personnel-dashboard-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .personnel-dashboard-table thead {
        display: none;
    }

    .personnel-dashboard-table tbody tr.personnel-row {
        display: flex;
        flex-wrap: wrap;
        gap: 4px 12px;
        padding: 10px 14px;
    }

    .personnel-dashboard-table tbody tr.personnel-row td {
        border: none;
        padding: 2px 0;
        flex: 1 1 auto;
    }

    .personnel-dashboard-table tbody tr.personnel-row td:first-child {
        flex-basis: 100%;
        font-weight: 600;
    }

    .personnel-dashboard-table tbody tr.personnel-row td:last-child {
        flex-basis: 100%;
        text-align: left;
        margin-top: 6px;
    }

    .personnel-table {
        min-width: 900px;
    }
    .personnel-table input[type="text"],
    .personnel-table select {
        font-size: 12px;
        padding: 5px 6px;
    }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}


/* --- RESPONSIVE --- */
@media (width <= 720px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  section {
	padding: 1rem;
  }
}

@media (width <= 600px) {
  main {
    padding: 10px;
    margin: 0;
  }
  .prod-container {
    padding: 0;
  }
  .card {
    padding: 15px;
  }
  .file-version-group {
      flex-direction: column;
      align-items: stretch;
  }

  .file-input,
  .version-input {
      width: 100%;
  }
}

@media (width <= 450px) {
  header .header-user .user-info {
    display:none;
  }
  header .header-user {
      justify-content: center;
  }
}

