/* Variables de thème */
:root{
  --brand-blue:#2f63f6;
  --brand-blue-700:#2550c8;
  --brand:#2563eb; /* alias */
  --brand-700:#1d4ed8; /* alias */
  --bg:#f4f5f7;
  --card:#ffffff;
  --border:#e5e7eb;
  --text:#1f2937;
  --muted:#6b7280;
  --radius:14px;
  --danger:#dc2626;
  --success:#059669;
  --success-bg:#ecfdf5; --success-text:#065f46; --success-border:#a7f3d0;
  --error-bg:#fef2f2; --error-text:#b91c1c; --error-border:#fecaca;
}

/* Réinitialisation basique */
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:"Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:var(--bg);
  color:var(--text);
}

/* En-tête */
.header{
  background:var(--card);
  padding:1rem 2rem;
  box-shadow:0 2px 10px rgba(15,23,42,.06);
  display:flex; justify-content:space-between; align-items:center;
}
.logo{ font-size:1.5rem; font-weight:800; color:var(--brand-blue); letter-spacing:.3px; }
.user-info{ display:flex; align-items:center; gap:1rem; }
.welcome{ color:var(--muted); }
.logout-btn{ background:#dc3545; color:#fff; border:none; padding:8px 16px; border-radius:5px; cursor:pointer; text-decoration:none; font-size:14px; }
.logout-btn:hover{ background:#c82333; }

/* Conteneur principal */
.container{ max-width:1280px; margin:24px auto; padding:0 24px; }

/* Navigation rapide (include) */
.quick-nav{ display:flex; align-items:center; gap:8px; }
.qbtn{ display:inline-flex; align-items:center; gap:8px; padding:8px 12px; border-radius:10px; font-size:13px; font-weight:700; text-decoration:none; border:1px solid var(--border); background:#fff; color:#374151; box-shadow:0 1px 2px rgba(0,0,0,.03); transition:all .15s ease; }
.qbtn:hover{ background:#f8fafc; transform:translateY(-1px); box-shadow:0 4px 10px rgba(15,23,42,.08); }
.qbtn.active{ background:var(--brand-blue); color:#fff; border-color:transparent; box-shadow:0 6px 16px rgba(47,99,246,.25); }
.qbtn svg{ flex:0 0 auto; }
.qsep{ width:1px; height:26px; background:var(--border); margin:0 2px; }
.welcome-chip{ margin-left:8px; color:var(--muted); font-size:13px; }

/* Boutons génériques */
.btn{ height:40px; padding:0 14px; border-radius:10px; border:1px solid var(--border); background:#fff; cursor:pointer; font-weight:600; }
.btn.primary{ background:var(--brand); color:#fff; border-color:transparent; }
.btn.primary:hover{ background:var(--brand-700); }
.btn.danger{ background:#fff; color:var(--danger); border-color:#fecaca; }
.btn-secondary{ background:#6c757d; color:#fff; border:0; padding:8px 12px; border-radius:6px; text-decoration:none; cursor:pointer; }
.btn-primary{ background:var(--brand-blue); color:#fff; border:0; padding:10px 20px; border-radius:10px; cursor:pointer; font-size:14px; font-weight:700; }
.btn-primary:hover{ background:var(--brand-blue-700); }
.btn-danger{ background:#dc3545; color:#fff; border:0; padding:8px 16px; border-radius:5px; cursor:pointer; font-size:12px; }
.btn-danger:hover{ background:#c82333; }
.btn-start{ background:#16a34a; color:#fff; }
.btn-stop{ background:#dc2626; color:#fff; }
.btn-remove{ background:#6b7280; color:#fff; }
.btn-db{ background:#059669; color:#fff; }

/* Dashboard / cartes / stats */
.dashboard-card{ background:transparent; border-radius:var(--radius); padding:0; margin-bottom:2rem; }
.dashboard-title{ font-size:24px; font-weight:800; color:var(--text); margin-bottom:.25rem; }
.dashboard-subtitle{ color:var(--muted); margin-bottom:1.25rem; }
.stats-grid{ display:grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap:16px; margin-bottom:20px; }
.stat-card{ background:var(--card); border:1px solid var(--border); border-radius:var(--radius); padding:18px; text-align:left; box-shadow:0 10px 18px rgba(15,23,42,.06); }
.stat-card.clickable{ text-decoration:none; color:inherit; display:block; transition: transform .15s, box-shadow .15s; cursor:pointer; }
.stat-card.clickable:hover{ transform: translateY(-2px); box-shadow:0 12px 24px rgba(15,23,42,.12); }
.clickable-status{ color:#dc2626; cursor:pointer; text-decoration:underline; font-weight:600; }
.clickable-status:hover{ color:#b91c1c; }
.port-display{ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size:13px; color:#6b7280; background:#f9fafb; padding:2px 6px; border-radius:4px; }
.stat-number{ font-size:28px; font-weight:800; color:var(--text); margin-bottom:4px; }
.stat-label{ font-size:13px; color:var(--muted); }
.content-section{ background:var(--card); border:1px solid var(--border); padding:20px; border-radius:var(--radius); margin-bottom:16px; box-shadow:0 10px 18px rgba(15,23,42,.06); }
.grid{ display:grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap:1rem; }
.metric{ background:var(--card); border:1px solid var(--border); border-radius:12px; padding:16px; }
.metric h4{ margin-bottom:6px; color:var(--text); font-size:15px; font-weight:700; }
.progress{ height:8px; background:#eef2ff; border-radius:999px; overflow:hidden; margin-top:8px; }
.progress>span{ display:block; height:100%; background:var(--brand-blue); }
.muted{ color:var(--muted); font-size:13px; }
.section-title{ color:var(--text); margin-bottom:12px; font-size:18px; font-weight:800; }

/* Projets (dashboard) */
.projets-grid{ 
    display: grid !important; 
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important; 
    gap: 16px !important; 
    width: 100% !important;
}

#projectsContainer {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
    gap: 16px !important;
    width: 100% !important;
}
.projet-card{ background:var(--card); border:1px solid var(--border); border-radius:12px; padding:18px; transition: transform .15s, box-shadow .15s; box-shadow:0 6px 16px rgba(15,23,42,.06); }
.projet-card:hover{ transform: translateY(-2px); box-shadow:0 10px 22px rgba(15,23,42,.1); }
.projet-header{ display:flex; justify-content:space-between; align-items:center; margin-bottom:1rem; }
.projet-header h4{ margin:0; color:var(--text); font-weight:800; }
.status-badge{ display:inline-block; padding:4px 10px; border-radius:999px; font-size:12px; font-weight:700; color:#fff; }
.status-badge.active{ background:#22c55e; }
.status-badge.installing,.status-badge.pending{ background:#f59e0b; }
.status-badge.waiting{ background:#9ca3af; }
.status-badge.error{ background:#ef4444; }
.projet-info{ margin-bottom:1rem; }
.dot{ display:inline-block; width:10px; height:10px; border-radius:50%; margin-right:6px; vertical-align:middle; }
.dot.ok{ background:#22c55e; }
.dot.warn{ background:#f59e0b; }
.dot.err{ background:#ef4444; }
.info-item{ display:flex; justify-content:space-between; align-items:center; margin-bottom:.5rem; }
.info-item .label{ font-weight:700; color:var(--muted); }
.info-item .value-nowrap{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:inline-flex; align-items:center; gap:.5rem; }
.info-item .value-flex{ display:inline-flex; align-items:center; gap:.5rem; }
.btn-icon{ padding:6px; line-height:1; height:auto; display:inline-flex; align-items:center; justify-content:center; }
.projet-actions{ display:flex; gap:.5rem; }

/* Dropdown pour ouverture (local / domaine) */
.dropdown{ position:relative; display:inline-flex; gap:0; }
.dropdown .btn-secondary{ border-radius:0; }
.dropdown .btn-secondary:first-child{ border-top-left-radius:6px; border-bottom-left-radius:6px; }
.dropdown .btn-secondary:nth-child(2){ border-top-right-radius:6px; border-bottom-right-radius:6px; }
.dropdown-menu{ display:none; position:absolute; right:0; top:100%; margin-top:4px; background:#fff; border:1px solid var(--border); border-radius:8px; min-width:220px; box-shadow:0 8px 24px rgba(0,0,0,.12); z-index:20; }
.dropdown.open .dropdown-menu{ display:block; }
.dropdown-menu a, .dropdown-menu button{ display:block; width:100%; padding:8px 12px; color:#374151; text-decoration:none; font-size:13px; cursor:pointer; background:none; border:none; text-align:left; }
.dropdown-menu a:hover, .dropdown-menu button:hover{ background:#f8fafc; }

/* Modales génériques */
.modal{ display:none; position:fixed; z-index:1000; left:0; top:0; width:100%; height:100%; background-color:rgba(0,0,0,.5); }
.modal-content{ background:var(--card); margin:10% auto; padding:2rem; border-radius:var(--radius); border:1px solid var(--border); width:90%; max-width:1600px; box-shadow:0 10px 30px rgba(0,0,0,.3); }

/* Correctif pour les boîtes de dialogue natives <dialog> qui contiennent un enfant .modal */
dialog .modal{ display:block; position:static; background:transparent; border:none; width:90%; max-width:1600px; height:auto; box-shadow:none; margin:5% auto; }
dialog .modal header, dialog .modal .content, dialog .modal footer{ background:transparent; }
.modal-header{ display:flex; justify-content:space-between; align-items:center; margin-bottom:1.5rem; }
.modal-title{ font-size:1.5rem; color:#333; margin:0; }
.close{ color:#aaa; font-size:28px; font-weight:bold; cursor:pointer; }
.close:hover{ color:#000; }
.form-group{ margin-bottom:1rem; }
.form-group label{ display:block; margin-bottom:.5rem; font-weight:bold; color:#333; }
.form-group input,.form-group select{ width:100%; padding:10px 12px; border:1px solid var(--border); border-radius:10px; font-size:14px; }
.form-group input:focus,.form-group select:focus{ outline:none; border-color:#c7d2fe; box-shadow:0 0 0 3px rgba(59,130,246,.15); }
.alert{ display:none; border-radius:10px; padding:12px 14px; font-size:14px; margin-bottom:12px; border:1px solid transparent; }
.alert-error{ background:var(--error-bg); color:var(--error-text); border-color:var(--error-border); }
.alert-success{ background:var(--success-bg); color:var(--success-text); border-color:var(--success-border); }
.btn-primary .spinner{ display:none; width:16px; height:16px; border:2px solid #fff; border-right-color:transparent; border-radius:50%; margin-right:8px; animation:spin .6s linear infinite; }
.btn-primary.loading{ opacity:.9; pointer-events:none; }
.btn-primary.loading .spinner{ display:inline-block; }
.btn-primary .btn-contents{ display:inline-flex; align-items:center; justify-content:center; gap:8px; }
@keyframes spin{ to{ transform: rotate(360deg); } }
.modal-actions{ display:flex; justify-content:flex-end; gap:1rem; margin-top:1.5rem; }

/* Petit spinner inline pour statuts */
.spinner-sm{ display:inline-block; width:12px; height:12px; border:2px solid currentColor; border-right-color:transparent; border-radius:50%; animation:spin .6s linear infinite; margin-right:6px; vertical-align:-2px; }

/* Zone logs techniques (dashboard install modal) */
.log-status{ display:flex; gap:12px; align-items:center; font-size:14px; color:var(--muted); margin-bottom:10px; }
.log-pre{ background:#0b1021; color:#d1d5db; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; border-radius:10px; padding:12px; height:420px; overflow:auto; white-space:pre-wrap; word-break:break-word; border:1px solid #111827; }

/* Sections et tableaux (dockers) */
.section{ background:var(--card); border:1px solid var(--border); border-radius:var(--radius); padding:20px; margin-bottom:16px; box-shadow:0 10px 18px rgba(15,23,42,.06); }
.section-title{ margin:0 0 12px; font-size:18px; font-weight:800; color:var(--text); }
.table{ width:100%; border-collapse:collapse; }
.table th,.table td{ border-bottom:1px solid var(--border); padding:10px; text-align:left; font-size:14px; }
.badge{ display:inline-block; padding:3px 8px; border-radius:999px; font-size:12px; color:#fff; }
.badge.next{ background:#2563eb; }
.badge.db{ background:#059669; }
.badge.etat-actif{ background:#22c55e; }
.badge.etat-stop{ background:#ef4444; }
.page-title{ font-size:24px; font-weight:800; color:var(--text); margin:0 0 6px; }
.page-subtitle{ color:var(--muted); margin:0 0 16px; }

/* Admin utilisateurs */
.card{ background:var(--card); border:1px solid var(--border); border-radius:16px; padding:18px; }
.toolbar{ display:flex; gap:10px; flex-wrap:wrap; margin-bottom:12px; }
.search{ flex:1; min-width:200px; }
.input{ width:100%; height:40px; border:1px solid var(--border); border-radius:10px; padding:0 12px; }
table{ width:100%; border-collapse:separate; border-spacing:0; }
th,td{ padding:10px 12px; border-bottom:1px solid var(--border); text-align:left; font-size:14px; }
th{ font-size:12px; color:#6b7280; text-transform:uppercase; letter-spacing:.05em; }
tr:last-child td{ border-bottom:none; }
.actions{ display:flex; gap:8px; }
.empty{ padding:26px; text-align:center; color:var(--muted); }
dialog{ border:none; border-radius:14px; padding:0; box-shadow:0 10px 40px rgba(0,0,0,.15); }
.modal header{ padding:14px 16px; border-bottom:1px solid var(--border); font-weight:800; }
.modal .content{ padding:16px; }
.field{ margin-bottom:12px; }
.field label{ display:block; font-size:13px; color:#374151; margin-bottom:6px; }
.select,.password,.text{ width:100%; height:40px; border:1px solid var(--border); border-radius:10px; padding:0 12px; }
.modal footer{ display:flex; gap:10px; justify-content:flex-end; padding:12px 16px; border-top:1px solid var(--border); }

/* Page Logs */
.logs-card{ background:var(--card); border:1px solid var(--border); border-radius:var(--radius); padding:22px; box-shadow:0 10px 18px rgba(15,23,42,.06); }
.logs-title{ font-size:24px; font-weight:800; color:var(--text); margin-bottom:6px; }
.logs-subtitle{ color:var(--muted); margin-bottom:18px; }
.stats{ display:grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap:12px; margin-bottom:18px; }
.log-entry{ padding:12px 14px; margin-bottom:8px; border-radius:10px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size:13px; border:1px solid var(--border); }
.log-success{ background:var(--success-bg); color:var(--success-text); border-color:var(--success-border); }
.log-failed{ background:var(--error-bg); color:var(--error-text); border-color:var(--error-border); }
.no-logs{ text-align:center; color:var(--muted); padding:24px; }

/* Page Login */
.page{ width:100%; max-width:420px; padding:24px; margin:0 auto; }
.logo-wrap{ display:flex; align-items:center; justify-content:center; gap:10px; margin-bottom:24px; }
.wordmark{ font-weight:800; font-size:28px; letter-spacing:.5px; color:#2970f2; }
.wordmark small{ display:block; text-align:right; font-size:18px; letter-spacing:2px; color:#3a7af7; margin-top:-6px; }
.hat{ width:40px; height:40px; }
.title{ font-size:20px; font-weight:800; text-align:center; margin:6px 0 18px; }
.control{ position:relative; }
.control input{ width:100%; height:46px; border:1px solid var(--border); border-radius:10px; padding:0 42px 0 14px; font-size:15px; background:#fff; }
.control input::placeholder{ color:#9ca3af; }
.control input:focus{ outline:none; border-color:#c7d2fe; box-shadow:0 0 0 3px rgba(59,130,246,.15); }
.control .toggle{ position:absolute; right:12px; top:50%; transform:translateY(-50%); width:22px; height:22px; color:#9aa4b2; cursor:pointer; }
.forgot{ display:block; text-align:right; font-size:13px; color:#3b82f6; text-decoration:none; margin:6px 2px 14px; }
.google{ width:100%; height:46px; border:1px solid var(--border); border-radius:10px; background:#fff; display:flex; align-items:center; justify-content:center; gap:10px; cursor:pointer; }
.g-icon{ width:18px; height:18px; }
.signup{ margin-top:18px; text-align:center; font-size:14px; color:var(--muted); }
.signup a{ color:#2563eb; text-decoration:none; }
.error{ background:var(--error-bg); border:1px solid var(--error-border); color:var(--error-text); padding:10px 12px; border-radius:10px; margin-bottom:12px; font-size:14px; }

/* Outil BDD amélioré */
.db-info{ background:#f8fafc; border:1px solid #e2e8f0; border-radius:8px; padding:16px; margin-bottom:16px; }
.info-grid{ display:grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap:16px; }
.db-info .info-item{ display:flex; flex-direction:column; gap:4px; }
.info-label{ font-size:12px; color:var(--muted); font-weight:600; text-transform:uppercase; letter-spacing:0.5px; }
.info-value{ font-size:16px; font-weight:700; color:var(--text); }

.tables-container{ width:100%; }
.tables-table{ width:100%; border-collapse:collapse; font-size:13px; }
.tables-table th{ background:#f8fafc; padding:8px 12px; text-align:left; font-weight:600; font-size:12px; border-bottom:1px solid var(--border); color:var(--muted); }
.tables-table td{ padding:6px 12px; border-bottom:1px solid #f1f5f9; }
.tables-table tr:hover{ background:#f8fafc; }
.table-btn{ display:block; width:100%; text-align:left; padding:4px 8px; border-radius:4px; transition:all 0.15s ease; background:none; border:none; cursor:pointer; font-weight:600; color:var(--text); }
.table-btn:hover{ background:#e2e8f0; }
.table-count{ font-size:11px; color:var(--muted); background:#f1f5f9; padding:2px 6px; border-radius:4px; font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }

.empty-state{ text-align:center; padding:40px 20px; color:var(--muted); }
.empty-icon{ font-size:48px; margin-bottom:16px; }
.empty-state h4{ margin:0 0 8px 0; color:var(--text); }
.empty-state p{ margin:0; font-size:14px; }

.loading-state{ text-align:center; padding:40px 20px; }
.loading-spinner{ display:inline-block; width:32px; height:32px; border:3px solid #f3f4f6; border-top:3px solid var(--brand-blue); border-radius:50%; animation:spin 1s linear infinite; margin-bottom:16px; }

.error-state{ text-align:center; padding:40px 20px; color:var(--danger); }
.error-icon{ font-size:48px; margin-bottom:16px; }

.table-header{ display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:16px; padding-bottom:12px; border-bottom:1px solid var(--border); }
.table-info h4{ margin:0 0 8px 0; color:var(--text); font-weight:700; }
.table-stats{ display:flex; gap:12px; flex-wrap:wrap; }
.stat{ font-size:12px; color:var(--muted); background:#f1f5f9; padding:4px 8px; border-radius:4px; }
.table-actions{ display:flex; gap:8px; }
.btn-small{ padding:6px 10px; font-size:12px; border-radius:6px; border:1px solid var(--border); background:#fff; cursor:pointer; transition:all 0.15s ease; }
.btn-small:hover{ background:#f8fafc; }

.table-container{ overflow-x:auto; border:1px solid var(--border); border-radius:8px; }
.data-table{ width:100%; border-collapse:collapse; }
.data-table th{ background:#f8fafc; padding:12px 16px; text-align:left; font-weight:600; font-size:13px; border-bottom:1px solid var(--border); }
.data-table td{ padding:12px 16px; border-bottom:1px solid #f1f5f9; font-size:14px; }
.data-table tr:hover{ background:#f8fafc; }

.structure-table{ width:100%; border-collapse:collapse; }
.structure-table th{ background:#f8fafc; padding:12px 16px; text-align:left; font-weight:600; font-size:13px; border-bottom:1px solid var(--border); }
.structure-table td{ padding:12px 16px; border-bottom:1px solid #f1f5f9; font-size:14px; }
.structure-table code{ background:#f1f5f9; padding:2px 6px; border-radius:4px; font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size:12px; }

/* Styles pour les utilisateurs */
.link-button{ color:#3b82f6; text-decoration:none; background:none; border:none; cursor:pointer; }
.users-count-btn{ color:#3b82f6; text-decoration:none; background:none; border:none; cursor:pointer; font-weight:600; }
.users-count-btn:hover{ text-decoration:underline; }
.error-text{ color:#ef4444; font-size:12px; }

/* Styles pour le formulaire d'ajout d'utilisateur */
.form-control{ width:100%; padding:10px 12px; border:1px solid var(--border); border-radius:10px; font-size:14px; margin-bottom:1rem; }
.form-control:focus{ outline:none; border-color:#c7d2fe; box-shadow:0 0 0 3px rgba(59,130,246,.15); }

/* Styles pour les boutons de suppression */
.btn-danger{ background:#ef4444; color:#fff; border:1px solid #dc2626; }
.btn-danger:hover{ background:#dc2626; }
.btn-small{ padding:6px 10px; font-size:12px; border-radius:6px; cursor:pointer; transition:all 0.15s ease; }


#nouveauSiteForm {
  padding:0px 20px;
}