/* ============================================================
   NewTech Lab — Global Design System
   Professional SaaS UI
   ============================================================ */

/* ── 1. DESIGN TOKENS ──────────────────────────────────────── */
:root {
  /* Colors */
  --nt-sidebar-bg:      #0f172a;
  --nt-sidebar-hover:   #1e293b;
  --nt-sidebar-active:  #1d4ed8;
  --nt-sidebar-text:    #94a3b8;
  --nt-sidebar-text-active: #ffffff;
  --nt-sidebar-border:  #1e293b;
  --nt-sidebar-width:   240px;
  --nt-sidebar-icon:    #64748b;

  --nt-topbar-bg:       #ffffff;
  --nt-topbar-border:   #e2e8f0;
  --nt-topbar-height:   56px;

  --nt-content-bg:      #f1f5f9;
  --nt-card-bg:         #ffffff;
  --nt-card-shadow:     0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.05);
  --nt-card-shadow-md:  0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -1px rgba(0,0,0,.05);
  --nt-card-radius:     10px;

  --nt-blue:            #2563eb;
  --nt-blue-light:      #eff6ff;
  --nt-blue-hover:      #1d4ed8;

  --nt-success:         #16a34a;
  --nt-success-light:   #f0fdf4;
  --nt-warning:         #1e3a8a;
  --nt-warning-light:   #dbeafe;
  --nt-danger:          #dc2626;
  --nt-danger-light:    #fef2f2;
  --nt-info:            #0891b2;
  --nt-info-light:      #ecfeff;

  --nt-text:            #0f172a;
  --nt-text-secondary:  #475569;
  --nt-text-muted:      #94a3b8;
  --nt-border:          #e2e8f0;
  --nt-border-radius:   8px;

  /* Typography */
  --nt-font:            'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --nt-font-mono:       'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  --nt-font-size-base:  0.875rem;
}

/* ── 2. GOOGLE FONTS ────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── 3. RESET & BASE ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  font-family: var(--nt-font);
  font-size: var(--nt-font-size-base);
  color: var(--nt-text);
  background: var(--nt-content-bg);
  -webkit-font-smoothing: antialiased;
}

/* ── 4. LAYOUT ───────────────────────────────────────────────── */
.nt-layout {
  display: flex;
  min-height: 100vh;
}

/* ── 5. SIDEBAR ─────────────────────────────────────────────── */
.nt-sidebar {
  width: var(--nt-sidebar-width);
  background: var(--nt-sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 1040;
  transition: transform .25s ease, width .25s ease;
  overflow: hidden;
}

/* Brand / Logo */
.nt-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  height: var(--nt-topbar-height);
  border-bottom: 1px solid var(--nt-sidebar-border);
  text-decoration: none;
  flex-shrink: 0;
}
.nt-sidebar-brand-icon {
  width: 32px; height: 32px;
  background: var(--nt-blue);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px; font-weight: 700;
  flex-shrink: 0;
}
.nt-sidebar-brand-text {
  color: #ffffff;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: -.02em;
  white-space: nowrap;
}

/* Nav */
.nt-sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 8px;
  scrollbar-width: thin;
  scrollbar-color: #334155 transparent;
}
.nt-sidebar-nav::-webkit-scrollbar { width: 4px; }
.nt-sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.nt-sidebar-nav::-webkit-scrollbar-thumb { background: #334155; border-radius: 2px; }

/* Section label */
.nt-nav-label {
  color: #475569;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 16px 12px 6px;
  white-space: nowrap;
}

/* Nav item */
.nt-nav-item { list-style: none; margin: 1px 0; }

.nt-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--nt-sidebar-text);
  text-decoration: none;
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
  user-select: none;
}
.nt-nav-link i { font-size: 1rem; color: var(--nt-sidebar-icon); transition: color .15s; flex-shrink: 0; }
.nt-nav-link:hover { background: var(--nt-sidebar-hover); color: #cbd5e1; }
.nt-nav-link:hover i { color: #cbd5e1; }
.nt-nav-link.active { background: var(--nt-sidebar-active); color: #fff; }
.nt-nav-link.active i { color: #fff; }

/* Collapse arrow */
.nt-nav-link .nt-arrow {
  margin-left: auto;
  font-size: .7rem;
  transition: transform .2s;
  color: #475569;
}
.nt-nav-link[aria-expanded="true"] .nt-arrow { transform: rotate(90deg); }

/* Sub-nav */
.nt-subnav { list-style: none; padding: 2px 0 2px 16px; margin: 0; }
.nt-subnav .nt-nav-link {
  font-size: .8rem;
  padding: 6px 10px;
  gap: 8px;
  color: #64748b;
}
.nt-subnav .nt-nav-link:hover { color: #cbd5e1; }
.nt-subnav .nt-nav-link.active { background: rgba(37,99,235,.15); color: #93c5fd; }
.nt-subnav .nt-nav-link.active i { color: #93c5fd; }

/* Agent IA — lien mis en évidence */
.nt-agent-link {
  background: linear-gradient(90deg, rgba(37,99,235,.18) 0%, rgba(139,92,246,.12) 100%);
  border: 1px solid rgba(99,102,241,.35);
  color: #a5b4fc !important;
  font-weight: 600;
  position: relative;
}
.nt-agent-link i { color: #818cf8 !important; }
.nt-agent-link:hover {
  background: linear-gradient(90deg, rgba(37,99,235,.30) 0%, rgba(139,92,246,.22) 100%);
  color: #c7d2fe !important;
}
.nt-agent-badge {
  margin-left: auto;
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .05em;
  background: #4f46e5;
  color: #fff;
  padding: 1px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

/* Sidebar footer (user) */
.nt-sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid var(--nt-sidebar-border);
  flex-shrink: 0;
}
.nt-user-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s;
  width: 100%;
  border: none;
  background: none;
  text-align: left;
}
.nt-user-btn:hover { background: var(--nt-sidebar-hover); }
.nt-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700;
  flex-shrink: 0;
  text-transform: uppercase;
}
.nt-user-info { overflow: hidden; }
.nt-user-name { color: #e2e8f0; font-size: .8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nt-user-role { color: #64748b; font-size: .7rem; white-space: nowrap; }

/* ── 6. TOPBAR ───────────────────────────────────────────────── */
.nt-topbar {
  height: var(--nt-topbar-height);
  background: var(--nt-topbar-bg);
  border-bottom: 1px solid var(--nt-topbar-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}

.nt-topbar-toggle {
  display: none;
  background: none;
  border: none;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--nt-text-secondary);
  font-size: 1.1rem;
}
.nt-topbar-toggle:hover { background: var(--nt-border); }

.nt-topbar-title {
  font-size: .95rem;
  font-weight: 600;
  color: var(--nt-text);
  flex: 1;
}

.nt-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.nt-topbar-btn {
  background: none;
  border: 1px solid var(--nt-border);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: .8rem;
  font-weight: 500;
  color: var(--nt-text-secondary);
  cursor: pointer;
  transition: all .15s;
  display: flex; align-items: center; gap: 6px;
  text-decoration: none;
  white-space: nowrap;
}
.nt-topbar-btn:hover { border-color: var(--nt-blue); color: var(--nt-blue); background: var(--nt-blue-light); }
.nt-topbar-btn.primary { background: var(--nt-blue); color: #fff; border-color: var(--nt-blue); }
.nt-topbar-btn.primary:hover { background: var(--nt-blue-hover); border-color: var(--nt-blue-hover); color: #fff; }

/* ── 7. MAIN CONTENT ─────────────────────────────────────────── */
.nt-main {
  margin-left: var(--nt-sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left .25s ease;
}

.nt-content {
  flex: 1;
  padding: 24px;
  overflow-x: hidden;
}

/* ── 8. CARDS ────────────────────────────────────────────────── */
.nt-card {
  background: var(--nt-card-bg);
  border-radius: var(--nt-card-radius);
  box-shadow: var(--nt-card-shadow);
  border: 1px solid var(--nt-border);
  margin-bottom: 20px;
}
.nt-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--nt-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.nt-card-header-title {
  font-size: .9rem;
  font-weight: 600;
  color: var(--nt-text);
  display: flex; align-items: center; gap: 8px;
  margin: 0;
}
.nt-card-body { padding: 20px; }
.nt-card-body.p-0 { padding: 0; }

/* Override Bootstrap card for consistency */
.card {
  border-radius: var(--nt-card-radius) !important;
  border: 1px solid var(--nt-border) !important;
  box-shadow: var(--nt-card-shadow) !important;
}

/* ── 9. PAGE HEADER ──────────────────────────────────────────── */
.nt-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.nt-page-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--nt-text);
  margin: 0;
  letter-spacing: -.02em;
}
.nt-page-subtitle {
  font-size: .8rem;
  color: var(--nt-text-muted);
  margin: 2px 0 0;
}

/* ── 10. BUTTONS ─────────────────────────────────────────────── */
.btn {
  border-radius: 6px !important;
  font-weight: 500 !important;
  font-size: .8rem !important;
  transition: all .15s !important;
}
.btn-sm { font-size: .75rem !important; }
.btn-lg { font-size: .9rem !important; }

.btn-primary { background: var(--nt-blue) !important; border-color: var(--nt-blue) !important; }
.btn-primary:hover { background: var(--nt-blue-hover) !important; border-color: var(--nt-blue-hover) !important; }

.btn-success { background: var(--nt-success) !important; border-color: var(--nt-success) !important; }
.btn-warning { background: var(--nt-warning) !important; border-color: var(--nt-warning) !important; color: #fff !important; }
.btn-warning:hover { filter: brightness(.92) !important; }
.btn-danger  { background: var(--nt-danger)  !important; border-color: var(--nt-danger)  !important; }

.btn-outline-primary { color: var(--nt-blue) !important; border-color: var(--nt-blue) !important; }
.btn-outline-primary:hover { background: var(--nt-blue) !important; color: #fff !important; }
.btn-outline-secondary { color: var(--nt-text-secondary) !important; border-color: var(--nt-border) !important; }
.btn-outline-secondary:hover { background: var(--nt-border) !important; color: var(--nt-text) !important; }
.btn-outline-danger { color: var(--nt-danger) !important; border-color: var(--nt-danger) !important; }
.btn-outline-danger:hover { background: var(--nt-danger) !important; color: #fff !important; }
.btn-outline-warning { color: var(--nt-warning) !important; border-color: var(--nt-warning) !important; }
.btn-outline-warning:hover { background: var(--nt-warning) !important; color: #fff !important; }

/* ── 11. BADGES ──────────────────────────────────────────────── */
.badge {
  font-size: .68rem !important;
  font-weight: 600 !important;
  letter-spacing: .03em !important;
  padding: .28em .6em !important;
  border-radius: 5px !important;
}
.badge.bg-success  { background: var(--nt-success)  !important; }
.badge.bg-danger   { background: var(--nt-danger)   !important; }
.badge.bg-warning  { background: var(--nt-warning)  !important; color: #fff !important; }
.badge.bg-primary  { background: var(--nt-blue)     !important; }
.badge.bg-secondary { background: #64748b !important; }

/* Soft badges */
.badge-soft-success  { background: var(--nt-success-light) !important; color: var(--nt-success) !important; }
.badge-soft-danger   { background: var(--nt-danger-light)  !important; color: var(--nt-danger)  !important; }
.badge-soft-warning  { background: var(--nt-warning-light) !important; color: var(--nt-warning) !important; }
.badge-soft-primary  { background: var(--nt-blue-light)    !important; color: var(--nt-blue)    !important; }
.badge-soft-info     { background: var(--nt-info-light)    !important; color: var(--nt-info)    !important; }

/* ── 12. TABLES ──────────────────────────────────────────────── */
.table {
  font-size: .8rem;
  color: var(--nt-text);
  --bs-table-striped-bg: #f8fafc;
}
.table thead th {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--nt-text-muted);
  background: #f8fafc;
  border-bottom: 1px solid var(--nt-border) !important;
  padding: 10px 12px;
  white-space: nowrap;
}
.table td {
  padding: 10px 12px;
  vertical-align: middle;
  border-color: var(--nt-border);
}
.table tbody tr:hover { background: #f8fafc; }
.table-responsive { border-radius: var(--nt-card-radius); overflow: hidden; }

/* ── 13. FORMS ───────────────────────────────────────────────── */
.form-control, .form-select {
  font-size: .82rem !important;
  border-color: var(--nt-border) !important;
  border-radius: 6px !important;
  color: var(--nt-text) !important;
  background-color: #fff !important;
  transition: border-color .15s, box-shadow .15s !important;
}
.form-control:focus, .form-select:focus {
  border-color: var(--nt-blue) !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12) !important;
  outline: none !important;
}
.form-label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--nt-text-secondary);
  margin-bottom: 4px;
}
.form-text { font-size: .73rem; color: var(--nt-text-muted); }

/* ── 14. ALERTS ──────────────────────────────────────────────── */
.alert {
  border-radius: 8px !important;
  font-size: .82rem !important;
  border: none !important;
  border-left: 4px solid !important;
}
.alert-success { background: var(--nt-success-light) !important; border-color: var(--nt-success) !important; color: #166534 !important; }
.alert-danger  { background: var(--nt-danger-light)  !important; border-color: var(--nt-danger)  !important; color: #991b1b !important; }
.alert-warning { background: var(--nt-warning-light) !important; border-color: var(--nt-warning) !important; color: #92400e !important; }
.alert-info    { background: var(--nt-info-light)    !important; border-color: var(--nt-info)    !important; color: #155e75 !important; }

/* ── 15. MODALS ──────────────────────────────────────────────── */
.modal-content {
  border: none !important;
  border-radius: 12px !important;
  box-shadow: 0 20px 60px rgba(0,0,0,.15) !important;
}
.modal-header {
  border-bottom: 1px solid var(--nt-border) !important;
  padding: 16px 20px !important;
}
.modal-title { font-size: .95rem !important; font-weight: 700 !important; }
.modal-footer { border-top: 1px solid var(--nt-border) !important; padding: 12px 20px !important; }
.modal-body { padding: 20px !important; }
.modal-dialog:not(.modal-sm) { max-width: 88vw; }

/* ── 16. DATATABLES ──────────────────────────────────────────── */
div.dataTables_wrapper { font-size: .8rem; }
div.dataTables_filter input {
  border: 1px solid var(--nt-border);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: .8rem;
  outline: none;
}
div.dataTables_filter input:focus { border-color: var(--nt-blue); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
div.dataTables_length select {
  border: 1px solid var(--nt-border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: .8rem;
}
/* Pagination Bootstrap 5 — fix taille proportionnée */
.dataTables_wrapper .pagination {
  margin: 0;
  flex-wrap: wrap;
  gap: 2px;
}
.dataTables_wrapper .page-item .page-link {
  font-size: .72rem !important;
  padding: 3px 8px !important;
  line-height: 1.4 !important;
  border-radius: 5px !important;
  border-color: var(--nt-blue) !important;
  color: var(--nt-blue) !important;
  background: var(--nt-blue-light);
  font-weight: 500 !important;
}
.dataTables_wrapper .page-item.active .page-link {
  background: var(--nt-blue) !important;
  color: #fff !important;
  border-color: var(--nt-blue) !important;
}
.dataTables_wrapper .page-item.disabled .page-link {
  color: #93c5fd !important;
  background: #eff6ff !important;
  border-color: #bfdbfe !important;
}
.dataTables_wrapper .page-item:not(.active):not(.disabled) .page-link:hover {
  background: var(--nt-blue) !important;
  color: #fff !important;
  border-color: var(--nt-blue) !important;
}

/* ── 17. DROPDOWNS ───────────────────────────────────────────── */
.dropdown-menu {
  border: 1px solid var(--nt-border) !important;
  border-radius: 8px !important;
  box-shadow: 0 8px 30px rgba(0,0,0,.1) !important;
  padding: 6px !important;
  font-size: .82rem !important;
  min-width: 200px;
}
.dropdown-item {
  border-radius: 5px !important;
  padding: 7px 10px !important;
  font-size: .8rem !important;
  color: var(--nt-text) !important;
  font-weight: 500 !important;
  transition: background .12s !important;
}
.dropdown-item:hover { background: var(--nt-blue-light) !important; color: var(--nt-blue) !important; }
.dropdown-item i { color: var(--nt-text-muted); margin-right: 6px; font-size: .9rem; }
.dropdown-divider { border-color: var(--nt-border) !important; margin: 4px 0 !important; }

/* ── 18. FOOTER ──────────────────────────────────────────────── */
.nt-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--nt-border);
  font-size: .73rem;
  color: var(--nt-text-muted);
  background: var(--nt-topbar-bg);
  text-align: center;
  flex-shrink: 0;
}

/* ── 19. STAT CARDS ──────────────────────────────────────────── */
.nt-stat-card {
  background: var(--nt-card-bg);
  border: 1px solid var(--nt-border);
  border-radius: var(--nt-card-radius);
  box-shadow: var(--nt-card-shadow);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.nt-stat-icon {
  width: 48px; height: 48px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.nt-stat-icon.blue    { background: var(--nt-blue-light);    color: var(--nt-blue); }
.nt-stat-icon.green   { background: var(--nt-success-light); color: var(--nt-success); }
.nt-stat-icon.yellow  { background: var(--nt-warning-light); color: var(--nt-warning); }
.nt-stat-icon.red     { background: var(--nt-danger-light);  color: var(--nt-danger); }
.nt-stat-value { font-size: 1.6rem; font-weight: 700; color: var(--nt-text); line-height: 1; }
.nt-stat-label { font-size: .75rem; color: var(--nt-text-muted); margin-top: 3px; font-weight: 500; }

/* ── 20. SIDEBAR OVERLAY (mobile) ────────────────────────────── */
.nt-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1039;
}
.nt-sidebar-overlay.show { display: block; }

/* ── 21. RESPONSIVE ──────────────────────────────────────────── */

/* Bouton fermer dans la sidebar (mobile only) */
.nt-sidebar-close {
  display: none;
  position: absolute;
  top: 12px; right: 12px;
  background: none;
  border: none;
  color: #64748b;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 5px;
  line-height: 1;
  z-index: 10;
}
.nt-sidebar-close:hover { background: #1e293b; color: #e2e8f0; }

@media (max-width: 991.98px) {
  .nt-sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }
  .nt-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,.35);
  }
  .nt-sidebar-close { display: flex; align-items: center; }
  .nt-main {
    margin-left: 0 !important;
  }
  .nt-topbar-toggle {
    display: flex;
    align-items: center;
  }
  .nt-content {
    padding: 16px;
  }
}

@media (max-width: 575.98px) {
  .nt-content { padding: 12px; }
  .nt-page-title { font-size: 1.05rem; }
  .nt-topbar { padding: 0 12px; }
  .nt-topbar-title { display: none; }
}

/* ── 22. FULL-PAGE SCRIPT LAYOUT ─────────────────────────────── */
.nt-script-page {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.nt-script-page .nt-script-header {
  flex-shrink: 0;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.nt-script-page .nt-script-body {
  display: flex;
  gap: 4px;
  align-items: flex-start;
}
.nt-script-page .nt-script-left {
  width: 340px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: width .25s ease;
}
/* Collapsed left panel */
.nt-script-page .nt-script-left.collapsed {
  width: 0 !important;
  overflow: hidden;
  gap: 0;
}
/* Reduce card padding in left column */
.nt-script-left .card { padding: 8px !important; }

.nt-script-page .nt-script-right {
  flex: 1;
  min-width: 0;
}
/* Editor wrapper — hauteur fixe garantie, toujours visible */
.nt-editor-wrap {
  width: 100%;
}
.nt-editor-wrap > div {
  width: 100%;
  min-height: 450px;
}
.nt-editor-wrap .ace_editor {
  width: 100% !important;
  min-height: 450px !important;
}

@media (max-width: 991.98px) {
  .nt-script-page .nt-script-body { flex-direction: column; gap: 4px; }
  .nt-script-page .nt-script-left { width: 100% !important; }
  .nt-script-page .nt-script-left.collapsed { max-height: 0; overflow: hidden; }
  .nt-editor-wrap > div,
  .nt-editor-wrap .ace_editor { min-height: 300px !important; }
}

/* ── 22. SCROLLBAR GLOBAL ────────────────────────────────────── */
* { scrollbar-width: thin; scrollbar-color: #e2e8f0 transparent; }
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* ── 23. MISC UTILITIES ──────────────────────────────────────── */
.text-muted { color: var(--nt-text-muted) !important; }
.fw-medium { font-weight: 500 !important; }
.gap-xs { gap: 6px !important; }
.font-mono { font-family: var(--nt-font-mono) !important; }

/* Crispy forms overrides */
.asteriskField { color: var(--nt-danger); }
#div_id_password, #div_id_password1, #div_id_password2 { margin-bottom: 1rem; }

/* ── ACE EDITOR — Dark theme global ─────────────────────────── */
.ace_editor {
  border-radius: 6px !important;
  overflow: hidden;
  border: 1px solid #1e293b !important;
  background: #0d1117 !important;
  color: #e6edf3 !important;
  font-family: var(--nt-font-mono) !important;
  font-size: 13px !important;
  line-height: 1.6 !important;
}
.ace_gutter {
  background: #161b22 !important;
  color: #484f58 !important;
  border-right: 1px solid #21262d !important;
}
.ace_gutter-active-line { background: #1c2128 !important; }
.ace_scroller,
.ace_content { background: #0d1117 !important; }
.ace_cursor { color: #58a6ff !important; border-color: #58a6ff !important; }
.ace_selection,
.ace_marker-layer .ace_selection { background: #264f78 !important; }
.ace_active-line,
.ace_marker-layer .ace_active-line { background: #161b22 !important; }
.ace_print-margin { background: #21262d !important; width: 1px !important; }
/* Syntax colors — GitHub Dark style */
.ace_keyword          { color: #ff7b72 !important; }
.ace_string           { color: #a5d6ff !important; }
.ace_comment          { color: #8b949e !important; font-style: italic !important; }
.ace_numeric          { color: #79c0ff !important; }
.ace_constant         { color: #79c0ff !important; }
.ace_variable         { color: #ffa657 !important; }
.ace_function         { color: #d2a8ff !important; }
.ace_builtin          { color: #79c0ff !important; }
.ace_operator         { color: #ff7b72 !important; }
.ace_identifier       { color: #e6edf3 !important; }
.ace_tag              { color: #7ee787 !important; }
.ace_attribute-name   { color: #79c0ff !important; }
.ace_attribute-value  { color: #a5d6ff !important; }
.ace_support.ace_function { color: #d2a8ff !important; }
/* Scrollbar inside Ace */
.ace_scrollbar-v::-webkit-scrollbar { width: 6px; }
.ace_scrollbar-h::-webkit-scrollbar { height: 6px; }
.ace_scrollbar::-webkit-scrollbar-thumb { background: #30363d; border-radius: 3px; }
.ace_scrollbar::-webkit-scrollbar-track { background: transparent; }

/* Override Bootstrap warning color (border-warning, text-warning, bg-warning) */
.border-warning { border-color: #1e3a8a !important; }
.text-warning   { color: #1e3a8a !important; }
.bg-warning     { background: #1e3a8a !important; }
.btn-outline-warning { color: #1e3a8a !important; border-color: #1e3a8a !important; }
.btn-outline-warning:hover { background: #1e3a8a !important; color: #fff !important; }

/* Code inline */
code {
  background: #f1f5f9;
  color: #0f172a;
  padding: 1px 5px;
  border-radius: 4px;
  font-family: var(--nt-font-mono);
  font-size: .82em;
}
