/* ============================================================
   admin.css — Styles Panneau d'Administration Middle-Tracking
   ============================================================ */

/* ── Tabs navigation ────────────────────────────────────── */
.admin-tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 4px;
  margin-bottom: var(--space-6);
  width: fit-content;
  flex-wrap: wrap;
}

.admin-tab {
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  background: none;
  font-family: inherit;
  white-space: nowrap;
}

.admin-tab:hover:not(.active) {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.admin-tab.active {
  background: var(--accent-violet);
  color: white;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(124,58,237,0.35);
}

/* ── Alert warning (admin) ──────────────────────────────── */
.admin-alert-warning {
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.35);
  border-left: 4px solid var(--accent-amber);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: 0.82rem;
  color: var(--accent-amber);
  margin-bottom: var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* ── Data table ─────────────────────────────────────────── */
.adm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.adm-table th {
  text-align: left;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.adm-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.adm-table tbody tr {
  transition: background var(--transition-fast);
}

.adm-table tbody tr:hover td {
  background: var(--bg-hover);
}

.adm-table tbody tr:last-child td {
  border-bottom: none;
}

.adm-empty {
  text-align: center;
  padding: var(--space-10) !important;
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* ── User Avatar ────────────────────────────────────────── */
.adm-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent-violet-dim), var(--accent-violet));
  color: var(--accent-violet-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  border: 1px solid var(--accent-violet-dim);
}

/* ── Role Pills ─────────────────────────────────────────── */
.adm-role-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.adm-role-pill.role-admin   { background: rgba(198,40,40,0.09);   color: #C62828; border: 1px solid rgba(198,40,40,0.2); }
.adm-role-pill.role-ops     { background: rgba(21,101,192,0.09);  color: #1565C0; border: 1px solid rgba(21,101,192,0.2); }
.adm-role-pill.role-manager { background: rgba(106,27,154,0.09);  color: #6A1B9A; border: 1px solid rgba(106,27,154,0.2); }
.adm-role-pill.role-viewer  { background: rgba(122,132,168,0.09); color: #5A6490; border: 1px solid rgba(122,132,168,0.2); }

/* ── Status pills ───────────────────────────────────────── */
.adm-status {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.adm-status.active   { background: var(--accent-green-dim); color: var(--accent-green-light); }
.adm-status.inactive { background: var(--accent-red-dim);   color: var(--accent-red); }

/* ── Temp password badge ────────────────────────────────── */
.adm-badge-warn {
  background: rgba(245,158,11,0.15);
  color: var(--accent-amber);
  font-size: 0.6rem;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 600;
}

/* ── Action Buttons ─────────────────────────────────────── */
.adm-btn {
  padding: 4px 9px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid;
  white-space: nowrap;
}

.adm-btn.edit {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border-color: var(--border-default);
}
.adm-btn.edit:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-strong); }

.adm-btn.del {
  background: rgba(198,40,40,0.07);
  color: var(--accent-red);
  border-color: rgba(198,40,40,0.25);
}
.adm-btn.del:hover { background: var(--accent-red); color: white; border-color: var(--accent-red); }

.adm-btn.warn {
  background: rgba(245,127,23,0.08);
  color: var(--accent-amber);
  border-color: rgba(245,127,23,0.25);
}
.adm-btn.warn:hover { background: var(--accent-amber); color: white; border-color: var(--accent-amber); }

.adm-btn.ok {
  background: rgba(46,125,50,0.08);
  color: var(--accent-green);
  border-color: rgba(46,125,50,0.25);
}
.adm-btn.ok:hover { background: var(--accent-green); color: white; border-color: var(--accent-green); }

/* ── Types de tâches rows ───────────────────────────────── */
.adm-type-section {
  margin-bottom: var(--space-5);
}

.adm-type-cat {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-subtle);
}

.adm-type-cat span {
  font-weight: 400;
  color: var(--text-muted);
}

.adm-type-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.adm-type-row:hover { background: var(--bg-hover); }

.adm-type-icon  { font-size: 1.1rem; width: 24px; text-align: center; flex-shrink: 0; }
.adm-type-label { flex: 1; font-size: 0.84rem; font-weight: 500; }
.adm-type-badge { font-size: 0.65rem; }
.adm-type-dur   { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; }

/* ── Info grid (config tab) ─────────────────────────────── */
.adm-info-grid {
  display: grid;
  grid-template-columns: auto auto;
  gap: var(--space-3) var(--space-6);
  align-items: center;
  font-size: 0.82rem;
}

/* ── Modal error ─────────────────────────────────────────── */
.modal-error {
  color: var(--accent-red);
  font-size: 0.8rem;
  flex: 1;
  min-height: 0;
}

/* ── Sidebar : utilisateur connecté ──────────────────────── */
.sidebar-user {
  border-top: 1px solid var(--sidebar-border);
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #1565C0, #42A5F5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--sidebar-text-active);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 0.62rem;
  color: var(--sidebar-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Bouton Déconnexion ─────────────────────────────────── */
.logout-btn {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  margin: 2px var(--space-2);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(168,178,216,0.7);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  background: none;
  font-family: inherit;
  width: calc(100% - var(--space-4));
  text-align: left;
}

.logout-btn:hover {
  background: rgba(198,40,40,0.15);
  color: #EF5350;
}

.logout-btn .nav-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
}

/* ── Switcher de vue (Admin) ────────────────────────────── */
.view-switcher-section {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--sidebar-border);
}

.view-switcher-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--sidebar-text-muted);
  font-weight: 600;
  margin-bottom: var(--space-2);
}
