/* MyMind Portal — Design system (maquette gris / charcoal) */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

:root {
  --bg-page: #f3f4f6;
  --bg-surface: #ffffff;
  --bg-muted: #f3f4f6;
  --bg-hover: #e5e7eb;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text: #111827;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --charcoal: #374151;
  --charcoal-hover: #1f2937;
  --accent-warn: #ea580c;
  --radius: 10px;
  --radius-sm: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
  --sidebar-w: 260px;
  --header-h: 64px;
  --font: 'DM Sans', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100%;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font-family: inherit; }
a { color: inherit; }
.hidden { display: none !important; }

/* ——— Icons ——— */
.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-sm { width: 14px; height: 14px; }
.icon-lg { width: 22px; height: 22px; }

/* ——— Buttons ——— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.2;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary {
  background: var(--charcoal);
  color: #fff;
  border-color: var(--charcoal);
}
.btn-primary:hover:not(:disabled) { background: var(--charcoal-hover); }
.btn-secondary {
  background: var(--bg-surface);
  color: var(--charcoal);
  border-color: var(--border-strong);
}
.btn-secondary:hover:not(:disabled) { background: var(--bg-muted); }
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) { background: var(--bg-muted); color: var(--text); }
.btn-danger {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-block { width: 100%; }

/* ——— Forms ——— */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.input, .form-group input, .form-group textarea, .form-group select,
input[type="text"], input[type="email"], input[type="password"], textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--bg-surface);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .form-group input:focus, .form-group textarea:focus,
input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus, textarea:focus {
  outline: none;
  border-color: var(--charcoal);
  box-shadow: 0 0 0 3px rgba(55, 65, 81, 0.12);
}
.search-field {
  position: relative;
  flex: 1;
  min-width: 0;
}
.search-field .icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.search-field input {
  padding-left: 40px;
}

/* ——— Badges / pills ——— */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-secondary);
  white-space: nowrap;
}
.badge-warn {
  color: var(--accent-warn);
  border-color: #fdba74;
  background: #fff7ed;
}
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--charcoal);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  margin-left: auto;
}

.filter-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 20px; }
.filter-pill {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.filter-pill:hover { background: var(--bg-muted); }
.filter-pill.active {
  background: var(--charcoal);
  border-color: var(--charcoal);
  color: #fff;
}

/* ——— Avatar ——— */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-muted);
  color: var(--charcoal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
  text-transform: uppercase;
}
.avatar-sm { width: 32px; height: 32px; font-size: 13px; }

/* ——— Alerts ——— */
.alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 12px;
}
.alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-info { background: #f8fafc; color: var(--text-secondary); border: 1px solid var(--border); }

/* ——— Login ——— */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse at 20% 0%, #e5e7eb 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, #d1d5db 0%, transparent 45%),
    var(--bg-page);
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 36px 32px;
  position: relative;
}
.login-card .hub-link {
  position: absolute;
  top: 16px;
  left: 16px;
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--charcoal);
  color: #e5e7eb;
  text-decoration: none;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 28px;
}
.login-brand img { height: 36px; }
.login-brand h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.login-card h2 { font-size: 18px; margin-bottom: 16px; }
.login-card .btn { width: 100%; margin-top: 4px; }
.login-card .btn + .btn { margin-top: 10px; }

/* ——— App shell ——— */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  z-index: 40;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 20px;
}
.sidebar-brand img { height: 28px; }
.sidebar-brand-text {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.sidebar-brand-text span {
  display: block;
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 11px;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow-y: auto;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: var(--bg-muted); color: var(--text); }
.nav-item.active {
  background: var(--bg-muted);
  color: var(--text);
  font-weight: 600;
}
.sidebar-promo {
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--bg-muted);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.sidebar-promo p {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
  position: relative;
  z-index: 1;
}
.sidebar-promo-icon {
  margin-bottom: 8px;
  color: var(--charcoal);
}
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 60;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.35);
  z-index: 35;
}

.app-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}
.app-header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 28px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}
.account-menu { position: relative; }
.account-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}
.account-trigger:hover { background: var(--bg-muted); }
.account-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 200px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 6px;
  z-index: 50;
}
.account-dropdown button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  font-size: 14px;
  cursor: pointer;
  color: var(--text);
  text-align: left;
}
.account-dropdown button:hover { background: var(--bg-muted); }
.account-email-label {
  padding: 8px 12px 10px;
  font-size: 12px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
  word-break: break-all;
}

.app-content {
  flex: 1;
  padding: 28px;
  overflow-x: hidden;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

.page-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

/* ——— Stats ——— */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}
.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--charcoal);
}
.stat-meta { font-size: 13px; color: var(--text-secondary); }
.stat-value { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }

/* ——— Clients layout ——— */
.clients-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
}
.clients-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 4px;
}
.client-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.client-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}
.client-card-body { flex: 1; min-width: 0; }
.client-card-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}
.client-card-title h3 {
  font-size: 15px;
  font-weight: 700;
}
.client-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.client-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}
.client-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.client-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.kebab {
  position: relative;
}
.kebab-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 160px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 4px;
  z-index: 20;
}
.kebab-menu button {
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
}
.kebab-menu button:hover { background: var(--bg-muted); }
.kebab-menu button.danger { color: #dc2626; }

.side-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: calc(var(--header-h) + 16px);
}
.side-panel h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
}
.side-client {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  background: var(--bg-surface);
}
.side-client-name {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}
.side-client-status {
  font-size: 12px;
  color: var(--accent-warn);
  margin-bottom: 8px;
}
.side-panel-footer {
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--charcoal);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.side-panel-footer:hover { text-decoration: underline; }

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}
.empty-state p { margin-top: 6px; font-size: 14px; }

/* ——— Modal ——— */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 18px; font-weight: 700; }
.modal-body { padding: 20px; }
.modal-footer {
  padding: 14px 20px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.visibility-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.visibility-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}
.visibility-option:has(input:checked) {
  border-color: var(--charcoal);
  background: var(--bg-muted);
}
.visibility-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.45;
}

/* ——— Overview / invitations ——— */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}
.overview-actions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.action-tile {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.action-tile:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}
.action-tile strong { font-size: 15px; }
.action-tile span { font-size: 13px; color: var(--text-secondary); }

.invite-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
}
.invite-card h4 { font-size: 15px; margin-bottom: 4px; }
.invite-card p { font-size: 13px; color: var(--text-secondary); }
.invite-actions { display: flex; gap: 8px; flex-shrink: 0; }
.section-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 24px 0 12px;
}

/* ——— Manage ——— */
.manage-layout {
  display: flex;
  gap: 20px;
  height: calc(100vh - var(--header-h) - 56px);
  min-height: 560px;
}
.manage-sidebar {
  width: 340px;
  background: var(--bg-surface);
  border-radius: var(--radius);
  padding: 20px;
  overflow-y: auto;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}
.manage-sidebar h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.manage-editor {
  flex: 1;
  background: var(--bg-surface);
  border-radius: var(--radius);
  padding: 28px;
  overflow-y: auto;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.tree-view { font-size: 14px; }
.tree-item {
  padding: 8px 12px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  margin: 2px 0;
  transition: background 0.15s;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tree-item:hover { background: var(--bg-muted); }
.tree-item.active {
  background: var(--charcoal);
  color: #fff;
}
.tree-item-client { font-weight: 700; font-size: 14px; padding-left: 8px; }
.tree-item-group { padding-left: 24px; font-weight: 600; color: var(--text-secondary); }
.tree-item-category { padding-left: 40px; color: var(--text-secondary); }
.tree-item-shortcut { padding-left: 56px; color: var(--text-muted); font-size: 13px; }
.tree-item.active.tree-item-group,
.tree-item.active.tree-item-category,
.tree-item.active.tree-item-shortcut,
.tree-item.active.tree-item-client { color: #fff; }
.tree-children { margin-left: 4px; }
.tree-children.collapsed { display: none; }
.tree-toggle {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--text-muted);
}
.section { margin-bottom: 24px; }
.section-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
}

/* ——— Admin / download / help ——— */
.admin-list-item,
.download-card,
.help-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.download-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}
.download-card h3 { font-size: 18px; margin-bottom: 8px; }
.download-card p { color: var(--text-secondary); font-size: 14px; margin-bottom: 16px; }
.download-card ul {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
  padding-left: 18px;
  margin-bottom: 18px;
}
.download-card details { margin-top: 14px; }
.download-card summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: var(--charcoal);
}
.download-card .btn { width: 100%; margin-bottom: 8px; }
.download-compare {
  margin-top: 28px;
  padding: 24px;
  background: var(--bg-muted);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.help-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  align-items: start;
}
.help-toc {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.help-toc h3 { font-size: 14px; margin-bottom: 12px; }
.toc-item {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  margin-bottom: 2px;
}
.toc-item:hover { background: var(--bg-muted); color: var(--text); }
.toc-item.active {
  background: var(--bg-muted);
  color: var(--text);
  font-weight: 600;
}
.help-section h2 { font-size: 22px; margin-bottom: 12px; }
.help-section h3 { font-size: 16px; margin: 20px 0 8px; }
.help-section p, .help-section li {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-secondary);
}
.help-section ul, .help-section ol { padding-left: 20px; margin: 8px 0; }
.help-section code {
  background: var(--bg-muted);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
}
.info-box, .success-box, .warning-box {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin: 14px 0;
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid var(--border);
  background: var(--bg-muted);
  color: var(--text-secondary);
}
.success-box { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.warning-box { background: #fff7ed; border-color: #fdba74; color: #9a3412; }
.info-box { background: #f8fafc; }

/* AI editor overrides (neutral) */
.ai-editor-submit {
  background: var(--charcoal) !important;
  box-shadow: none !important;
}
.ai-editor-textarea:focus {
  border-color: var(--charcoal) !important;
  box-shadow: 0 0 0 2px rgba(55, 65, 81, 0.15) !important;
}

/* Legacy / generated manage buttons */
.manage-editor button,
.section button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: var(--charcoal);
  color: #fff;
}
.manage-editor button.secondary,
.section button.secondary,
button.secondary {
  background: var(--bg-surface);
  color: var(--charcoal);
  border-color: var(--border-strong);
}
.manage-editor input[type="text"],
.manage-editor input[type="email"],
.manage-editor textarea,
.manage-editor select {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

/* ——— Editor toolbar ——— */
.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.editor-toolbar-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.editor-toolbar-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-right: 4px;
}
.editor-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 32px;
  height: 32px;
  padding: 0 10px !important;
  border-radius: 6px !important;
  border: 1px solid var(--charcoal) !important;
  background: var(--charcoal) !important;
  color: #fff !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  cursor: pointer;
  box-shadow: none !important;
}
.editor-btn:hover {
  background: var(--charcoal-hover) !important;
  border-color: var(--charcoal-hover) !important;
}
.editor-btn[title="Noir"],
.editor-btn[title="Rouge"],
.editor-btn[title="Vert"],
.editor-btn[title="Jaune"],
.editor-btn[title="Bleu"] {
  background: var(--bg-surface) !important;
  border-color: var(--border-strong) !important;
  font-weight: 800 !important;
}
.editor-btn[title="Noir"] { color: #111827 !important; }
.editor-btn[title="Rouge"] { color: #e53e3e !important; }
.editor-btn[title="Vert"] { color: #38a169 !important; }
.editor-btn[title="Jaune"] { color: #d69e2e !important; }
.editor-btn[title="Bleu"] { color: #3182ce !important; }

.html-editor {
  min-height: 160px;
  padding: 12px;
  border: 1px solid var(--border-strong);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  background: var(--bg-surface);
  outline: none;
}
.html-editor:focus {
  border-color: var(--charcoal);
  box-shadow: 0 0 0 3px rgba(55, 65, 81, 0.12);
}

.tree-item-shortcut-actions,
.tree-item-actions {
  display: inline-flex;
  gap: 4px;
  margin-left: 6px;
  flex-shrink: 0;
}
.btn-test,
.btn-edit,
.btn-delete,
.btn-add {
  width: 28px;
  height: 28px;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 6px !important;
  border: 1px solid var(--border-strong) !important;
  background: var(--bg-surface) !important;
  color: var(--charcoal) !important;
  font-size: 13px !important;
  cursor: pointer;
  box-shadow: none !important;
}
.btn-test:hover,
.btn-edit:hover,
.btn-add:hover,
.btn-delete:hover {
  background: var(--bg-muted) !important;
  border-color: var(--charcoal) !important;
}

.tree-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--bg-muted);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  margin-left: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.tree-badge-client,
.tree-badge-group,
.tree-badge-category {
  background: var(--bg-muted);
  color: var(--charcoal);
}

.manage-editor input[type="file"] {
  font-size: 13px;
  color: var(--text-secondary);
}
.manage-editor input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--charcoal);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.manage-editor input[type="file"]::file-selector-button:hover {
  background: var(--bg-muted);
}

/* Force charcoal on leftover inline-colored action buttons (background only) */
button[style*="background: linear-gradient(135deg, #48bb78"],
button[style*="background: linear-gradient(135deg, #ed8936"],
button[style*="background: linear-gradient(135deg, #e74c3c"],
button[style*="background: linear-gradient(135deg, #e53e3e"],
button[style*="background: linear-gradient(135deg, #1a365d"],
button[style*="background: linear-gradient(135deg, #374151"],
button[style*="background: #48bb78"],
button[style*="background: #e53e3e"],
button[style*="background: #e74c3c"],
button[style*="background: #dc3545"],
button[style*="background: #6c757d"] {
  background: var(--charcoal) !important;
  background-image: none !important;
  border-color: var(--charcoal) !important;
  color: #fff !important;
  box-shadow: none !important;
}

/* ——— Responsive ——— */
@media (max-width: 1100px) {
  .clients-layout { grid-template-columns: 1fr; }
  .side-panel { position: static; }
  .stats-row, .overview-grid { grid-template-columns: 1fr; }
  .download-grid { grid-template-columns: 1fr; }
  .help-layout { grid-template-columns: 1fr; }
  .help-toc { position: static; }
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow);
  }
  .app-shell.sidebar-open .app-sidebar { transform: translateX(0); }
  .app-shell.sidebar-open .sidebar-backdrop { display: block; }
  .sidebar-toggle { display: inline-flex; }
  .app-header { padding-left: 64px; }
  .app-content { padding: 20px 16px; }
  .manage-layout { flex-direction: column; height: auto; }
  .manage-sidebar { width: 100%; max-height: 280px; }
  .invite-card { flex-direction: column; align-items: flex-start; }
}
