/* Styles du Dashboard Administrateur CIAA */

:root {
  --sidebar-w: 260px;
  --topbar-h: 70px;
}

body.dashboard-body {
  margin: 0;
  background: #f4f7fb;
  font-family: Inter, system-ui, sans-serif;
  color: #102b4e;
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.dash-sidebar {
  width: var(--sidebar-w);
  background: #0b2447;
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  box-shadow: 4px 0 20px rgba(11, 36, 71, 0.15);
}

.dash-brand {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-family: Sora, Inter, sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: 0.02em;
}

.dash-brand a {
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dash-brand-logo {
  height: 36px;
  max-width: 155px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.96);
  padding: 3px 8px;
  border-radius: 8px;
  display: block;
}

.dash-brand span.admin-badge {
  font-size: 0.7rem;
  background: var(--cyan);
  color: var(--navy);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
}

.dash-nav {
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  flex-grow: 1;
}

.dash-nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  background: transparent;
  border: none;
  color: #bad3e8;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  position: relative;
}

.dash-nav-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.dash-nav-btn.active {
  background: linear-gradient(90deg, #1b6b82, #1cc8d8);
  color: #fff;
  box-shadow: 0 4px 14px rgba(27, 107, 130, 0.3);
}

.dash-nav-btn span.badge-count {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.25);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.dash-nav-btn span.badge-count.urgent {
  background: #e74c3c;
  color: #fff;
}

.dash-sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dash-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dash-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--cyan);
  color: var(--navy);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.9rem;
}

.dash-user-table-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
}

.dash-user-table-avatar {
  position: relative;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--cyan);
  color: var(--navy);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.85rem;
}

.dash-user-table-avatar img {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dash-user-table-avatar.has-image img {
  display: block;
}

.dash-user-table-avatar.has-image .dash-user-initials {
  display: none;
}

.dash-user-info {
  line-height: 1.2;
}

.dash-user-info strong {
  font-size: 0.88rem;
  display: block;
  color: #fff;
}

.dash-user-info span {
  font-size: 0.75rem;
  color: #8faec8;
}

.btn-sidebar-link {
  color: #8faec8;
  font-size: 0.82rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  transition: color 0.15s ease;
}

.btn-sidebar-link:hover {
  color: #fff;
}

/* Main Content Area */
.dash-main {
  margin-left: var(--sidebar-w);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dash-topbar {
  height: var(--topbar-h);
  background: #ffffff;
  border-bottom: 1px solid #e1ecf4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.dash-topbar-title h1 {
  margin: 0;
  font-size: 1.4rem;
  color: var(--navy);
  font-family: Sora, Inter, sans-serif;
}

.dash-topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-site-return {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--teal);
  background: #f0f7fb;
  border: 1px solid #d4e8f3;
  padding: 8px 14px;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-site-return:hover {
  background: #e0f0f8;
}

/* Dashboard Body Container */
.dash-container {
  padding: 30px 32px 60px;
  max-width: 1300px;
  width: 100%;
  box-sizing: border-box;
}

/* KPI Cards Row */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.kpi-card {
  background: #ffffff;
  border: 1px solid #e1ecf4;
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 4px 16px rgba(16, 43, 78, 0.04);
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.kpi-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.kpi-icon.blue {
  background: #eaf2fc;
  color: #2f5fe3;
}
.kpi-icon.amber {
  background: #fef8eb;
  color: #d97706;
}
.kpi-icon.green {
  background: #edf9f2;
  color: #10b981;
}
.kpi-icon.teal {
  background: #eaf7fa;
  color: #1b6b82;
}

.kpi-details {
  line-height: 1.2;
}

.kpi-number {
  font-family: Sora, Inter, sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 4px;
}

.kpi-label {
  font-size: 0.82rem;
  color: #55728d;
  font-weight: 500;
}

/* Dashboard Tabs / Sections */
.dash-tab-section {
  display: none;
}

.dash-tab-section.active {
  display: block;
}

/* Panel Containers */
.dash-panel {
  background: #ffffff;
  border: 1px solid #e1ecf4;
  border-radius: 18px;
  box-shadow: 0 6px 24px rgba(16, 43, 78, 0.04);
  padding: 28px;
  margin-bottom: 26px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid #edf4f8;
}

.panel-title h2 {
  font-size: 1.25rem;
  color: var(--navy);
  margin: 0 0 4px;
}

.panel-title p {
  margin: 0;
  font-size: 0.88rem;
  color: #55728d;
}

/* Data Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

table.dash-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

table.dash-table th {
  background: #f7fafd;
  color: #52718e;
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 2px solid #e2ecf3;
  white-space: nowrap;
}

table.dash-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #edf4f8;
  vertical-align: middle;
}

table.dash-table tr:hover td {
  background: #fbfdff;
}

/* Badges de Statut */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
}

.status-pill.approved {
  background: #eafaf1;
  color: #27ae60;
  border: 1px solid #bcead0;
}
.status-pill.pending {
  background: #fef9e7;
  color: #d4ac0d;
  border: 1px solid #f9e79f;
}
.status-pill.rejected {
  background: #fdedec;
  color: #e74c3c;
  border: 1px solid #fadbd8;
}
.status-pill.featured {
  background: #f5eef8;
  color: #8e44ad;
  border: 1px solid #d7bde2;
}

/* Action Buttons inside tables */
.table-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.dash-user-photo-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.dash-user-photo-label {
  cursor: pointer;
}

.dash-user-photo-input:focus-visible + .dash-user-photo-label {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.btn-tbl {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.btn-tbl.accept {
  background: #eafaf1;
  color: #27ae60;
  border-color: #bcead0;
}
.btn-tbl.accept:hover {
  background: #27ae60;
  color: #fff;
}

.btn-tbl.reject {
  background: #fdedec;
  color: #e74c3c;
  border-color: #fadbd8;
}
.btn-tbl.reject:hover {
  background: #e74c3c;
  color: #fff;
}

.btn-tbl.edit {
  background: #eaf2fc;
  color: #2f5fe3;
  border-color: #c9ddf8;
}
.btn-tbl.edit:hover {
  background: #2f5fe3;
  color: #fff;
}

.btn-tbl.delete {
  background: #f7f9fa;
  color: #7f8c8d;
  border-color: #dce4ec;
}
.btn-tbl.delete:hover {
  background: #c0392b;
  color: #fff;
  border-color: #c0392b;
}

.btn-tbl.featured-toggle {
  background: #fff8e6;
  color: #b7791f;
  border-color: #fed7aa;
}
.btn-tbl.featured-toggle.active {
  background: #b7791f;
  color: #fff;
}

.btn-tbl.reply {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #bae6fd;
}
.btn-tbl.reply:hover {
  background: #0284c7;
  color: #fff;
}

.status-pill.unread {
  background: #fef3c7;
  color: #92400e;
  font-weight: 700;
  border: 1px solid #fde68a;
}
.status-pill.read {
  background: #f1f5f9;
  color: #64748b;
}

/* Modale de lecture d'email dans le dashboard */
.dash-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 36, 71, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.dash-modal-container {
  background: #fff;
  border-radius: 16px;
  width: min(100%, 640px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.dash-modal-header {
  padding: 20px 24px;
  background: #f8fbfe;
  border-bottom: 1px solid #e2ecf5;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.dash-modal-header h3 {
  margin: 0 0 6px;
  color: var(--navy);
  font-size: 1.25rem;
}

.dash-modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: #7f8c8d;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.dash-modal-body {
  padding: 24px;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #334e68;
}

.dash-modal-meta {
  background: #f1f5f9;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 18px;
  font-size: 0.88rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.dash-modal-message-text {
  background: #fff;
  border: 1px solid #e2ecf5;
  border-radius: 10px;
  padding: 16px;
  white-space: pre-wrap;
  font-family: inherit;
  color: #102b4e;
  max-height: 280px;
  overflow-y: auto;
}

.dash-modal-footer {
  padding: 16px 24px;
  background: #f8fbfe;
  border-top: 1px solid #e2ecf5;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Modales personnalisées pour alert et confirm */
.ciaa-dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 36, 71, 0.65);
  backdrop-filter: blur(5px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.ciaa-dialog-box {
  background: #ffffff;
  border-radius: 18px;
  width: min(100%, 450px);
  padding: 28px 24px 22px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(11, 36, 71, 0.25);
  border: 1px solid #dce8f2;
  position: relative;
}

.ciaa-dialog-top-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: transparent;
  border: none;
  font-size: 1.6rem;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.ciaa-dialog-top-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.ciaa-dialog-icon-wrapper {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  background: #eaf4fb;
  color: var(--teal);
}

.ciaa-dialog-icon-wrapper.success {
  background: #eafaf1;
  color: #27ae60;
  font-size: 2rem;
  font-weight: 800;
}

.ciaa-dialog-icon-wrapper.error {
  background: #fdedec;
  color: #e74c3c;
  font-size: 1.8rem;
  font-weight: 800;
}

.ciaa-dialog-icon-wrapper.confirm {
  background: #fff8e6;
  color: #d97706;
}

.ciaa-dialog-title {
  margin: 0 0 8px;
  color: var(--navy);
  font-family: Sora, Inter, sans-serif;
  font-size: 1.25rem;
}

.ciaa-dialog-message {
  margin: 0 0 22px;
  color: #4b6178;
  font-size: 0.95rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.ciaa-dialog-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.ciaa-dialog-btn {
  padding: 10px 22px;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: all 0.2s ease;
}

.ciaa-dialog-btn.primary {
  background: var(--navy);
  color:#fff;
}

.ciaa-dialog-btn.primary:hover {
  background: var(--teal);
}

.ciaa-dialog-btn.primary.success {
  background: #16a34a;
  color: #fff;
}

.ciaa-dialog-btn.primary.success:hover {
  background: #15803d;
}

.ciaa-dialog-btn.primary.danger {
  background: #e74c3c;
}

.ciaa-dialog-btn.primary.danger:hover {
  background: #c0392b;
}

.ciaa-dialog-btn.secondary {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.ciaa-dialog-btn.secondary:hover {
  background: #e2e8f0;
}

/* Dashboard Forms */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.form-group-dash {
  margin-bottom: 18px;
}

.form-group-dash label {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 6px;
}

.form-group-dash input,
.form-group-dash select,
.form-group-dash textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d5e3ed;
  border-radius: 9px;
  background: #fbfdff;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--navy);
  box-sizing: border-box;
  outline: none;
  transition: all 0.2s ease;
}

.form-group-dash input:focus,
.form-group-dash select:focus,
.form-group-dash textarea:focus {
  border-color: var(--teal);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(27, 107, 130, 0.12);
}

.btn-dash-primary {
  color: #0284c7;
  padding: 10px 20px;
  border-radius: 9px;
  background: var(--navy);
  border: none;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-dash-primary:hover {
  background: var(--teal);
}

.form-status-feedback {
  min-height: 1.4em;
  font-size: 0.88rem;
  font-weight: 600;
  margin-top: 10px;
}

.form-status-feedback.success {
  color: #27ae60;
}
.form-status-feedback.error {
  color: #e74c3c;
}

/* Action Banner pour redirection vers les pages individuelles */
.dash-action-banner {
  background: linear-gradient(135deg, #0b2447 0%, #1b6b82 100%);
  color: #fff;
  border-radius: 14px;
  padding: 18px 22px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 4px 18px rgba(11, 36, 71, 0.12);
  flex-wrap: wrap;
}

.dash-action-banner-info h3 {
  margin: 0 0 4px;
  color: #fff;
  font-size: 1.15rem;
}

.dash-action-banner-info p {
  margin: 0;
  color: #bad3e8;
  font-size: 0.88rem;
}

.btn-open-individual-page {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #1cc8d8;
  color: #0b2447;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-open-individual-page:hover {
  background: #fff;
  color: #0b2447;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

/* Zone d'upload de fichiers locaux depuis l'appareil dans le Dashboard */
.file-upload-zone-dash {
  border: 2px dashed #b8d2e8;
  border-radius: 10px;
  background: #fbfdff;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.file-upload-zone-dash:hover,
.file-upload-zone-dash.dragover {
  border-color: var(--teal);
  background: #f0f7fb;
}

.file-upload-zone-dash input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-upload-content-dash {
  pointer-events: none;
}

.file-upload-icon-dash {
  font-size: 1.8rem;
  margin-bottom: 4px;
}

.file-upload-title-dash {
  font-weight: 600;
  color: var(--navy);
  font-size: 0.88rem;
}

.file-upload-subtitle-dash {
  color: #6c8299;
  font-size: 0.78rem;
}

.image-preview-box-dash {
  margin-top: 10px;
  display: none;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid #d5e3ed;
  border-radius: 8px;
  padding: 8px 12px;
}

.image-preview-box-dash.has-image {
  display: flex;
}

.image-preview-thumb-dash {
  width: 60px;
  height: 45px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #cddde9;
  flex-shrink: 0;
}

.image-preview-info-dash {
  flex-grow: 1;
  font-size: 0.82rem;
}

.btn-remove-image-dash {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-remove-image-dash:hover {
  background: #fca5a5;
}

/* Grandes modales d'édition complète */
.dash-modal-container.large {
  width: min(100%, 780px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

.dash-modal-container.large .dash-modal-body {
  overflow-y: auto;
  max-height: calc(92vh - 140px);
  padding: 22px 28px;
}

.dash-modal-body .form-grid-2,
.dash-modal-body .form-grid-3 {
  margin-bottom: 0;
}

/* Zone de composition de réponse email intégrée */
.msg-reply-box {
  margin-top: 18px;
  padding: 16px;
  background: #f0f7fc;
  border: 1px solid #cce1f0;
  border-radius: 12px;
  display: none;
}

.msg-reply-box.active {
  display: block;
}

.msg-reply-box label {
  display: block;
  font-weight: 700;
  color: var(--navy);
  font-size: 0.88rem;
  margin-bottom: 6px;
}

.msg-reply-box textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #b8d4e8;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  background: #fff;
  outline: none;
  box-sizing: border-box;
  resize: vertical;
}

.msg-reply-box textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(27, 107, 130, 0.15);
}

.msg-reply-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

/* Badge accès drive et bureau */
.status-pill.drive-granted {
  background: #eafaf1;
  color: #27ae60;
  border: 1px solid #bcead0;
  font-weight: 600;
}

.status-pill.drive-pending {
  background: #fef9e7;
  color: #b7791f;
  border: 1px solid #f9e79f;
  font-weight: 600;
}

.status-pill.dash-access-yes {
  background: #eafaf1;
  color: #1e824c;
  border: 1px solid #b7ebd0;
  font-weight: 700;
}

.status-pill.dash-access-no {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
}

/* Section drive info académique */
.dash-academic-info-banner {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.dash-academic-info-banner .icon {
  font-size: 2rem;
  color: #16a34a;
  flex-shrink: 0;
}

.dash-academic-info-banner h4 {
  margin: 0 0 4px;
  color: #166534;
  font-size: 1.05rem;
}

.dash-academic-info-banner p {
  margin: 0;
  color: #15803d;
  font-size: 0.88rem;
  line-height: 1.5;
}

/* ==============================================================================
   STYLES DU MODULE BACKEND SUPABASE (CLOUD & SENSIBILITÉ TEMPS RÉEL)
   ============================================================================== */
.backend-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: all 0.25s ease;
  user-select: none;
}

.backend-status-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.backend-status-pill.online {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}

.backend-status-pill.online .dot {
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
  animation: pulse-dot 2s infinite;
}

.backend-status-pill.offline {
  background: #fffbeb;
  color: #92400e;
  border-color: #fde68a;
}

.backend-status-pill.offline .dot {
  background: #f59e0b;
}

@keyframes pulse-dot {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.backend-panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.backend-info-card {
  background: #f8fbfe;
  border: 1px solid #dce8f2;
  border-radius: 14px;
  padding: 18px 20px;
}

.backend-info-card h4 {
  margin: 0 0 6px;
  color: var(--navy);
  font-size: 1rem;
}

.backend-info-card p {
  margin: 0;
  color: #55728d;
  font-size: 0.88rem;
  line-height: 1.5;
}

.backend-counts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.backend-count-box {
  background: #fff;
  border: 1px solid #e2ecf5;
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}

.backend-count-box .val {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--navy);
  font-family: Sora, Inter, sans-serif;
}

.backend-count-box .lbl {
  font-size: 0.76rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.backend-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.backend-console-output {
  background: #0f172a;
  color: #38bdf8;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.85rem;
  border-radius: 12px;
  padding: 16px;
  max-height: 220px;
  overflow-y: auto;
  white-space: pre-wrap;
  border: 1px solid #1e293b;
  margin-top: 16px;
}

/* Responsive */
@media (max-width: 900px) {
  .dash-sidebar {
    width: 70px;
  }
  .dash-brand span.text,
  .dash-nav-btn span.label,
  .dash-sidebar-footer span.text {
    display: none;
  }
  .dash-main {
    margin-left: 70px;
  }
  .form-grid-2,
  .form-grid-3 {
    grid-template-columns: 1fr;
  }
  .dash-action-banner {
    flex-direction: column;
    align-items: flex-start;
  }
}
