:root {
  --gise-primary: #1e40af;
  --gise-primary-dark: #1e3a8a;
  --gise-accent: #0ea5e9;
  --gise-accent-soft: #e0f2fe;
  --gise-success: #059669;
  --gise-warning: #d97706;
  --gise-danger: #dc2626;
  --gise-sidebar: #0f172a;
  --gise-sidebar-hover: #1e293b;
  --gise-sidebar-active: #2563eb;
  --gise-surface: #ffffff;
  --gise-bg: #f1f5f9;
  --gise-border: #e2e8f0;
  --gise-text: #0f172a;
  --gise-text-muted: #64748b;
  --gise-radius: 12px;
  --gise-radius-lg: 16px;
  --gise-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 4px 16px rgba(15, 23, 42, 0.06);
  --gise-shadow-lg: 0 8px 32px rgba(15, 23, 42, 0.12);
  --gise-topbar-h: 72px;
  --gise-sidebar-w: 260px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

@media (min-width: 768px) {
  html { font-size: 16px; }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  background: var(--gise-bg);
  color: var(--gise-text);
  line-height: 1.6;
}

/* ── Topbar ── */
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  height: var(--gise-topbar-h);
  background: var(--gise-surface);
  border-bottom: 1px solid var(--gise-border);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.app-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 1.25rem;
  max-width: 100%;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--gise-text);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.app-brand-logo {
  height: 36px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  border-radius: 8px;
}

.app-brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--gise-primary), var(--gise-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.1rem;
}

.app-brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.app-brand-name {
  line-height: 1.2;
}

.app-brand-sub {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--gise-text-muted);
  display: block;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(22rem, 42vw);
}

.app-nav {
  display: none;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 992px) {
  .app-nav { display: flex; }
}

.app-nav-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  color: var(--gise-text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.app-nav-link:hover,
.app-nav-link.active {
  background: var(--gise-accent-soft);
  color: var(--gise-primary);
}

/* ── Shell ── */
.app-shell {
  display: flex;
  min-height: calc(100vh - var(--gise-topbar-h));
}

.app-sidebar {
  display: none;
  width: var(--gise-sidebar-w);
  flex-shrink: 0;
  background: var(--gise-sidebar);
  color: #cbd5e1;
  padding: 1.25rem 0.75rem;
  position: sticky;
  top: var(--gise-topbar-h);
  height: calc(100vh - var(--gise-topbar-h));
  overflow-y: auto;
}

@media (min-width: 992px) {
  .app-shell.has-sidebar .app-sidebar { display: block; }
}

.app-sidebar-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  padding: 0.5rem 0.85rem 0.35rem;
  margin-top: 0.5rem;
}

.app-sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 2px;
}

.app-sidebar-link i { font-size: 1.05rem; width: 1.25rem; text-align: center; }

.app-sidebar-link:hover {
  background: var(--gise-sidebar-hover);
  color: #f1f5f9;
}

.app-sidebar-link.active {
  background: var(--gise-sidebar-active);
  color: #fff;
}

.app-content {
  flex: 1;
  min-width: 0;
  padding: 1.5rem 1.25rem 3rem;
}

@media (min-width: 768px) {
  .app-content { padding: 2rem 2rem 3rem; }
}

.app-container {
  max-width: 1280px;
  margin: 0 auto;
}

/* ── Page header ── */
.page-header {
  margin-bottom: 1.75rem;
}

.page-header-title {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.25rem;
  color: var(--gise-text);
}

.page-header-subtitle {
  color: var(--gise-text-muted);
  margin: 0;
  font-size: 0.95rem;
}

.page-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

/* ── Cards ── */
.gise-card {
  background: var(--gise-surface);
  border: 1px solid var(--gise-border);
  border-radius: var(--gise-radius-lg);
  box-shadow: var(--gise-shadow);
  overflow: hidden;
}

.gise-card-header {
  padding: 1.15rem 1.35rem;
  border-bottom: 1px solid var(--gise-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.gise-card-header h2,
.gise-card-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.gise-card-body { padding: 1.35rem; }

.gise-card-footer {
  padding: 1rem 1.35rem;
  border-top: 1px solid var(--gise-border);
  background: #fafbfc;
}

/* ── Stat cards ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.stat-card {
  background: var(--gise-surface);
  border: 1px solid var(--gise-border);
  border-radius: var(--gise-radius-lg);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--gise-shadow);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: transform 0.15s, box-shadow 0.15s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--gise-shadow-lg);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.stat-icon.blue { background: #dbeafe; color: #1d4ed8; }
.stat-icon.green { background: #d1fae5; color: #059669; }
.stat-icon.amber { background: #fef3c7; color: #d97706; }
.stat-icon.cyan { background: #cffafe; color: #0891b2; }

.stat-value {
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--gise-text-muted);
  font-weight: 500;
}

/* ── Profile hero ── */
.profile-hero {
  background: linear-gradient(135deg, var(--gise-primary-dark) 0%, var(--gise-primary) 50%, #0369a1 100%);
  border-radius: var(--gise-radius-lg);
  padding: 2rem 1.75rem;
  color: #fff;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.profile-hero::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -10%;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}

.profile-hero-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  position: relative;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 3px solid rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-hero-name {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.15rem;
}

.profile-hero-email {
  opacity: 0.85;
  margin: 0;
  font-size: 0.95rem;
}

.profile-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
  padding: 0.25rem 0.65rem;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

/* ── Form sections ── */
.form-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gise-text-muted);
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--gise-border);
}

.form-label {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--gise-text);
  margin-bottom: 0.35rem;
}

.form-control, .form-select {
  border-radius: 8px;
  border-color: var(--gise-border);
  padding: 0.55rem 0.85rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus, .form-select:focus {
  border-color: var(--gise-accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.form-control:read-only {
  background: #f8fafc;
  color: var(--gise-text-muted);
}

/* ── Buttons ── */
.btn {
  border-radius: 8px;
  font-weight: 600;
  padding: 0.5rem 1.1rem;
  font-size: 0.9rem;
}

.btn-primary {
  background: var(--gise-primary);
  border-color: var(--gise-primary);
}

.btn-primary:hover {
  background: var(--gise-primary-dark);
  border-color: var(--gise-primary-dark);
}

.btn-glow {
  background: linear-gradient(135deg, var(--gise-primary), #2563eb);
  border: none;
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn-glow:hover {
  background: linear-gradient(135deg, var(--gise-primary-dark), var(--gise-primary));
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

/* ── Tables ── */
.gise-table-wrap {
  overflow-x: auto;
  border-radius: var(--gise-radius);
}

.gise-table {
  width: 100%;
  margin: 0;
  font-size: 0.9rem;
}

.gise-table thead th {
  background: #f8fafc;
  border-bottom: 2px solid var(--gise-border);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gise-text-muted);
  padding: 0.75rem 1rem;
  white-space: nowrap;
}

.gise-table tbody td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--gise-border);
  vertical-align: middle;
}

.gise-table tbody tr:last-child td { border-bottom: none; }

.gise-table tbody tr:hover { background: #f8fafc; }

/* ── Badges ── */
.badge { font-weight: 600; font-size: 0.75rem; padding: 0.35em 0.65em; border-radius: 6px; }

/* ── Alerts ── */
.gise-alert {
  border-radius: var(--gise-radius);
  border: none;
  padding: 0.85rem 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.gise-alert-success { background: #ecfdf5; color: #065f46; }
.gise-alert-danger { background: #fef2f2; color: #991b1b; }

/* ── User menu ── */
.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.65rem 0.35rem 0.35rem;
  border: 1px solid var(--gise-border);
  border-radius: 999px;
  background: var(--gise-surface);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.user-menu-btn:hover {
  border-color: #cbd5e1;
  box-shadow: var(--gise-shadow);
}

.user-menu-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gise-primary), var(--gise-accent));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.user-menu-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gise-text);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-menu {
  border: 1px solid var(--gise-border);
  border-radius: var(--gise-radius);
  box-shadow: var(--gise-shadow-lg);
  padding: 0.5rem;
}

.dropdown-item {
  border-radius: 6px;
  padding: 0.5rem 0.85rem;
  font-size: 0.9rem;
  font-weight: 500;
}

/* ── Hero landing ── */
.landing-hero {
  text-align: center;
  padding: 3rem 1rem 4rem;
  max-width: 720px;
  margin: 0 auto;
}

.landing-hero h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.landing-hero p {
  font-size: 1.1rem;
  color: var(--gise-text-muted);
  margin-bottom: 2rem;
}

.landing-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.feature-card {
  background: var(--gise-surface);
  border: 1px solid var(--gise-border);
  border-radius: var(--gise-radius-lg);
  padding: 1.5rem;
  text-align: left;
  box-shadow: var(--gise-shadow);
}

.feature-card i {
  font-size: 1.5rem;
  color: var(--gise-primary);
  margin-bottom: 0.75rem;
  display: block;
}

.feature-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.feature-card p {
  font-size: 0.875rem;
  color: var(--gise-text-muted);
  margin: 0;
}

/* ── Footer ── */
.app-footer {
  padding: 1.25rem;
  text-align: center;
  color: var(--gise-text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--gise-border);
  background: var(--gise-surface);
}

/* ── Toggle switch ── */
.form-switch .form-check-input {
  width: 2.5em;
  height: 1.25em;
  cursor: pointer;
}

.form-switch .form-check-input:checked {
  background-color: var(--gise-success);
  border-color: var(--gise-success);
}

/* ── Mobile sidebar toggle ── */
.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--gise-border);
  border-radius: 8px;
  background: var(--gise-surface);
  color: var(--gise-text);
  cursor: pointer;
}

@media (min-width: 992px) {
  .sidebar-toggle { display: none; }
}

.app-shell.has-sidebar .app-sidebar.mobile-open {
  display: block;
  position: fixed;
  left: 0;
  top: var(--gise-topbar-h);
  z-index: 1020;
  box-shadow: var(--gise-shadow-lg);
}

@media (max-width: 991px) {
  .app-shell.has-sidebar .app-sidebar {
    display: none;
  }
}

/* ── RBAC habilitation matrix (CogniDoc style) ── */
.rbac-matrix-page {
  max-width: 100%;
}

.rbac-matrix-card {
  background: var(--gise-surface);
  border: 1px solid var(--gise-border);
  border-radius: var(--gise-radius-lg);
  box-shadow: var(--gise-shadow);
  overflow: hidden;
}

.rbac-matrix-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 55%, #2563eb 100%);
  color: #fff;
  padding: 1.35rem 1.75rem;
}

.rbac-matrix-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.rbac-matrix-meta {
  margin: 0.35rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  opacity: 0.9;
}

.rbac-matrix-app {
  font-weight: 600;
}

.rbac-matrix-app::after {
  content: "•";
  margin-left: 1rem;
  opacity: 0.6;
}

.rbac-matrix-body {
  padding: 0;
}

.rbac-table-wrap {
  overflow-x: auto;
}

.rbac-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.rbac-table thead th {
  padding: 0;
  border-bottom: 2px solid var(--gise-border);
  vertical-align: bottom;
}

.rbac-col-module {
  min-width: 140px;
  text-align: left;
  padding: 0.65rem 1rem;
  background: #fff;
  font-weight: 500;
}

.rbac-col-action {
  min-width: 180px;
  text-align: left;
  padding: 0.65rem 1rem;
  background: #fff;
  color: var(--gise-text);
  font-weight: 500;
}

.rbac-col-role {
  min-width: 108px;
  text-align: center;
  padding: 0;
}

.rbac-role-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.85rem 0.5rem;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: uppercase;
}

.rbac-role-icon {
  font-size: 1.15rem;
  opacity: 0.95;
}

.rbac-role-superadmin { background: linear-gradient(180deg, #dc2626, #b91c1c); }
.rbac-role-admin { background: linear-gradient(180deg, #2563eb, #1d4ed8); }
.rbac-role-manager { background: linear-gradient(180deg, #16a34a, #15803d); }
.rbac-role-collaborateur { background: linear-gradient(180deg, #ea580c, #c2410c); }
.rbac-role-lecteur { background: linear-gradient(180deg, #9333ea, #7e22ce); }
.rbac-role-invite { background: linear-gradient(180deg, #64748b, #475569); }
.rbac-role-default { background: linear-gradient(180deg, #334155, #1e293b); }

.rbac-module-row {
  background: #f1f5f9;
}

.rbac-module-cell {
  padding: 0.7rem 1rem !important;
  border-top: 2px solid #cbd5e1;
  border-bottom: 1px solid #e2e8f0;
}

.rbac-module-label {
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  color: #334155;
}

.rbac-module-sub {
  margin-left: 0.35rem;
  font-weight: 400;
  color: var(--gise-text-muted);
  font-size: 0.78rem;
}

.rbac-action-row td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.rbac-action-row:nth-child(even) td {
  background: #fafbfc;
}

.rbac-action-resource {
  color: var(--gise-text-muted);
  font-size: 0.8rem;
}

.rbac-resource-tag {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: #e2e8f0;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.rbac-property-name {
  font-size: 0.78rem;
  color: #475569;
  background: transparent;
}

.rbac-col-cell {
  text-align: center;
  width: 108px;
}

.rbac-cell-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin: 0;
  padding: 0.15rem;
  border-radius: 8px;
  transition: background 0.15s ease;
}

.rbac-cell-toggle:hover {
  background: rgba(37, 99, 235, 0.08);
}

.rbac-cell-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.rbac-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  font-size: 1rem;
  font-weight: 700;
}

.rbac-symbol-granted {
  background: #dcfce7;
  color: #16a34a;
}

.rbac-symbol-partial {
  background: #ffedd5;
  color: #ea580c;
  font-family: ui-monospace, monospace;
  font-size: 1.1rem;
  line-height: 1;
}

.rbac-symbol-denied {
  background: #fee2e2;
  color: #dc2626;
}

.rbac-cell-toggle .rbac-symbol-granted,
.rbac-cell-toggle .rbac-symbol-partial,
.rbac-cell-toggle .rbac-symbol-denied {
  display: none;
}

.rbac-cell-toggle:has(.rbac-cell-input:checked) .rbac-symbol-granted {
  display: inline-flex;
}

.rbac-cell-toggle:not(:has(.rbac-cell-input:checked)) .rbac-symbol-denied {
  display: inline-flex;
}

.rbac-matrix-footer {
  padding: 1.1rem 1.5rem 1.35rem;
  background: #f8fafc;
  border-top: 1px solid var(--gise-border);
}

.rbac-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
  margin-bottom: 0.85rem;
}

.rbac-legend-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.82rem;
  color: var(--gise-text-muted);
}

.rbac-legend-symbol {
  width: 1.65rem;
  height: 1.65rem;
  font-size: 0.85rem;
}

.rbac-info-note {
  margin: 0;
  font-size: 0.8rem;
  color: #64748b;
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
}

.rbac-info-note i {
  color: #2563eb;
  margin-top: 0.1rem;
  flex-shrink: 0;
}

/* Legacy habilitation helpers (EditRole view) */
.habilitation-group {
  border-bottom: 1px solid var(--gise-border);
}

.habilitation-group:last-child {
  border-bottom: none;
}

.habilitation-group-title {
  padding: 0.85rem 1.25rem;
  background: #f8fafc;
  font-size: 0.95rem;
}

.habilitation-table-wrap {
  overflow-x: auto;
}

.habilitation-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.habilitation-table thead th {
  background: #fff;
  border-bottom: 2px solid var(--gise-border);
  padding: 0.65rem 0.75rem;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gise-text-muted);
  text-align: center;
  white-space: nowrap;
}

.habilitation-table thead th.hab-col-action,
.habilitation-table thead th.hab-col-property {
  text-align: left;
}

.habilitation-table tbody td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.hab-col-action { min-width: 110px; }
.hab-col-property { min-width: 120px; }
.hab-col-role { min-width: 90px; }
.hab-col-check { text-align: center; width: 90px; }

.hab-checkbox {
  width: 1.15rem;
  height: 1.15rem;
  cursor: pointer;
  accent-color: var(--gise-primary);
}

.hab-action-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
}

.hab-action-view { background: #dbeafe; color: #1d4ed8; }
.hab-action-create { background: #d1fae5; color: #047857; }
.hab-action-edit { background: #fef3c7; color: #b45309; }
.hab-action-delete { background: #fee2e2; color: #b91c1c; }
.hab-action-export { background: #e0e7ff; color: #4338ca; }
.hab-action-manage { background: #f3e8ff; color: #7e22ce; }

.sticky-save-bar {
  position: sticky;
  bottom: 0;
  background: linear-gradient(to top, var(--gise-bg) 80%, transparent);
  padding: 1rem 0;
  z-index: 10;
}

/* ── Boutique GISEBS ── */
.shop-announcement-banner {
  background: var(--gise-surface);
  border-bottom: 1px solid var(--gise-border);
}

.shop-announcement-banner .carousel,
.shop-announcement-banner .carousel-inner,
.shop-announcement-banner .carousel-item {
  min-height: 220px;
}

.shop-announcement-slide {
  min-height: 220px;
  background: linear-gradient(135deg, var(--gise-primary) 0%, var(--gise-primary-dark) 55%, #0c4a6e 100%);
  background-size: cover;
  background-position: center;
}

.shop-announcement-overlay {
  min-height: 220px;
  display: flex;
  align-items: center;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.82) 0%, rgba(15, 23, 42, 0.45) 55%, rgba(15, 23, 42, 0.2) 100%);
}

.shop-announcement-content {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
  color: #fff;
}

@media (min-width: 768px) {
  .shop-announcement-slide,
  .shop-announcement-overlay,
  .shop-announcement-banner .carousel,
  .shop-announcement-banner .carousel-inner,
  .shop-announcement-banner .carousel-item {
    min-height: 260px;
  }

  .shop-announcement-content {
    padding: 2.5rem 2rem;
  }
}

.shop-announcement-kicker {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
}

.shop-announcement-title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.5rem, 3vw, 2.35rem);
  font-weight: 800;
  line-height: 1.15;
  max-width: 42rem;
}

.shop-announcement-body {
  margin: 0 0 1.15rem;
  max-width: 40rem;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
}

.shop-announcement-cta {
  font-weight: 700;
}

.shop-announcement-banner .carousel-indicators [data-bs-target] {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
}

.shop-announcement-banner .carousel-control-prev,
.shop-announcement-banner .carousel-control-next {
  width: 8%;
}

.shop-announcement-preview {
  height: 120px;
  border-radius: var(--gise-radius);
  background-size: cover;
  background-position: center;
  border: 1px solid var(--gise-border);
}

.shop-layout {
  display: flex;
  gap: 1.75rem;
  align-items: flex-start;
}

.shop-sidebar {
  width: 240px;
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--gise-topbar-h) + 1rem);
  background: var(--gise-surface);
  border: 1px solid var(--gise-border);
  border-radius: var(--gise-radius-lg);
  padding: 1rem;
  box-shadow: var(--gise-shadow);
}

.shop-search-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gise-border);
}

.shop-search-input-wrap {
  position: relative;
}

.shop-search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gise-text-muted);
  pointer-events: none;
}

.shop-search-input {
  width: 100%;
  padding: 0.55rem 0.75rem 0.55rem 2.25rem;
  border: 1px solid var(--gise-border);
  border-radius: 10px;
  font-size: 0.88rem;
  background: var(--gise-bg);
  color: var(--gise-text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.shop-search-input:focus {
  outline: none;
  border-color: var(--gise-primary);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.12);
}

.shop-search-btn {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: 10px;
  background: var(--gise-primary);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.shop-search-btn:hover {
  background: var(--gise-primary-dark);
}

.shop-search-clear {
  font-size: 0.78rem;
  color: var(--gise-text-muted);
  text-align: center;
  text-decoration: none;
}

.shop-search-clear:hover {
  color: var(--gise-primary);
}

.shop-sidebar-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gise-text-muted);
  margin-bottom: 0.5rem;
}

.shop-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.shop-sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  color: var(--gise-text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
}

.shop-sidebar-link i {
  width: 1.15rem;
  text-align: center;
  font-size: 1rem;
}

.shop-sidebar-link:hover {
  background: var(--gise-accent-soft);
  color: var(--gise-primary);
}

.shop-sidebar-link.active {
  background: var(--gise-primary);
  color: #fff;
}

.shop-sidebar-cart {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--gise-border);
  color: var(--gise-text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.shop-sidebar-cart:hover {
  background: var(--gise-bg);
  border-color: var(--gise-primary);
  color: var(--gise-primary);
}

.shop-main {
  flex: 1;
  min-width: 0;
}

.shop-main-header {
  margin-bottom: 1.25rem;
}

.shop-main-header h2 {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 800;
}

.shop-main-header p {
  margin: 0;
  max-width: 42rem;
  color: var(--gise-text-muted);
  font-size: 0.92rem;
}

@media (max-width: 991px) {
  .shop-layout {
    flex-direction: column;
    gap: 1rem;
  }

  .shop-sidebar {
    width: 100%;
    position: static;
  }

  .shop-sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .shop-sidebar-link {
    flex: 1 1 auto;
    justify-content: center;
    min-width: calc(50% - 0.2rem);
  }

  .shop-sidebar-cart {
    justify-content: center;
  }
}

.shop-section {
  margin-bottom: 2.5rem;
}

.shop-section-featured {
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--gise-border);
}

.shop-section-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.15rem;
}

.shop-section-header h2 {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  font-weight: 800;
}

.shop-section-header p {
  margin: 0;
  max-width: 36rem;
  color: var(--gise-text-muted);
  font-size: 0.92rem;
}

.shop-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.shop-grid-featured {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.shop-card {
  position: relative;
  background: var(--gise-surface);
  border: 1px solid var(--gise-border);
  border-radius: var(--gise-radius-lg);
  padding: 1.35rem;
  box-shadow: var(--gise-shadow);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  overflow: hidden;
}

.shop-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--gise-shadow-lg);
}

.shop-card-featured {
  border-color: #93c5fd;
  background: linear-gradient(180deg, #fff 0%, #f0f9ff 100%);
}

.shop-card-ribbon {
  position: absolute;
  top: 0.85rem;
  right: -2rem;
  transform: rotate(35deg);
  background: #f59e0b;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 2.5rem;
}

.shop-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.shop-card-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 12px;
  background: var(--gise-accent-soft);
  color: var(--gise-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.shop-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.shop-badge {
  display: inline-block;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.shop-badge-software { background: #dbeafe; color: #1d4ed8; }
.shop-badge-subscription { background: #d1fae5; color: #047857; }
.shop-badge-service { background: #ffedd5; color: #c2410c; }
.shop-badge-featured { background: #fef3c7; color: #b45309; }
.shop-badge-default { background: #e2e8f0; color: #475569; }

.shop-card-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.shop-card-title-link {
  color: inherit;
  text-decoration: none;
}

.shop-card-title-link:hover {
  color: var(--gise-primary);
}

.shop-card-desc {
  margin: 0;
  color: var(--gise-text-muted);
  font-size: 0.9rem;
  flex: 1;
  line-height: 1.45;
}

.shop-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  font-size: 0.78rem;
  color: var(--gise-text-muted);
}

.shop-card-billing {
  font-weight: 600;
}

.shop-card-sku {
  opacity: 0.85;
}

.shop-card-price {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--gise-primary);
}

.shop-card-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

.shop-detail-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 16px;
  background: var(--gise-accent-soft);
  color: var(--gise-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  flex-shrink: 0;
}

.shop-card-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  overflow: hidden;
  background: var(--gise-accent-soft);
  margin-bottom: 0.75rem;
}

.shop-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shop-detail-image {
  border-radius: var(--gise-radius-lg);
  overflow: hidden;
  border: 1px solid var(--gise-border);
  background: var(--gise-surface);
}

.shop-detail-image img {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  display: block;
}

.shop-detail-text {
  white-space: pre-line;
}

.shop-detail-summary .lead {
  font-size: 1.05rem;
  color: var(--gise-text);
}

.shop-admin-preview-img {
  max-width: 240px;
  max-height: 160px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--gise-border);
}

.shop-auth-cta {
  background: var(--gise-bg);
  border-radius: var(--gise-radius);
  padding: 0.75rem;
}

.shop-detail-buy {
  border: 2px solid var(--gise-border);
}

.shop-detail-price {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--gise-primary);
}

.shop-cart-table thead th {
  background: #f8fafc;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.shop-confirmation-icon {
  font-size: 3.5rem;
  color: var(--gise-success);
}

.shop-confirmation-lines li {
  padding: 0.25rem 0;
  color: var(--gise-text-muted);
}

.shop-admin-link {
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.shop-admin-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--gise-shadow-lg);
}

.shop-admin-link-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 12px;
  background: var(--gise-accent-soft);
  color: var(--gise-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}
