/* ============================================================
   NOVA SaaS - Sistema de Diseño Principal
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&display=swap');

:root {
  /* Paleta Nova */
  --nova-50:  #faf5ff;
  --nova-100: #f3e8ff;
  --nova-200: #e9d5ff;
  --nova-300: #d8b4fe;
  --nova-400: #c084fc;
  --nova-500: #a855f7;
  --nova-600: #9333ea;
  --nova-700: #7c3aed;
  --nova-800: #6d28d9;
  --nova-900: #4c1d95;

  /* Colors */
  --primary:    var(--nova-700);
  --primary-lt: var(--nova-500);
  --primary-dk: var(--nova-900);
  --accent:     #f59e0b;
  --success:    #10b981;
  --danger:     #ef4444;
  --warning:    #f59e0b;
  --info:       #3b82f6;

  /* Dark UI */
  --bg:         #09090f;
  --bg-2:       #0f0f1a;
  --bg-3:       #141422;
  --bg-card:    #161625;
  --bg-hover:   #1e1e30;
  --border:     rgba(255,255,255,0.07);
  --border-2:   rgba(255,255,255,0.12);

  /* Text */
  --text:       #f1f0ff;
  --text-2:     #a8a5c0;
  --text-3:     #6b6884;
  --text-inv:   #09090f;

  /* Fonts */
  --font-display: 'Syne', sans-serif;
  --font-body:    'DM Sans', sans-serif;

  /* Spacing */
  --radius:    12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --sidebar-w: 240px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 24px rgba(124,58,237,0.35);
  --shadow-glow-sm: 0 0 12px rgba(124,58,237,0.25);
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-lt); text-decoration: none; transition: color .2s; }
a:hover { color: var(--nova-300); }

img { max-width: 100%; display: block; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--nova-800); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--nova-600); }

/* ---- Layout ---- */
.nova-app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform .3s ease;
  overflow-y: auto;
}

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: 60px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 16px;
}

.page-body {
  flex: 1;
  padding: 28px 28px;
  max-width: 1400px;
  width: 100%;
}

/* ---- Sidebar ---- */
.sidebar-logo {
  padding: 20px 18px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo img { width: 38px; height: 38px; object-fit: contain; }
.sidebar-logo span {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--nova-400), var(--nova-600));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-section {
  padding: 16px 10px 4px;
}

.sidebar-section-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 0 8px;
  margin-bottom: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  color: var(--text-2);
  font-size: 0.87rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .18s ease;
  position: relative;
  margin-bottom: 1px;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(124,58,237,0.25), rgba(168,85,247,0.15));
  color: var(--nova-300);
  border: 1px solid rgba(124,58,237,0.3);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: var(--primary-lt);
  border-radius: 0 3px 3px 0;
}

.nav-item .nav-icon { font-size: 1rem; width: 20px; text-align: center; }
.nav-badge {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 99px;
}

.sidebar-bottom {
  margin-top: auto;
  padding: 12px 10px;
  border-top: 1px solid var(--border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .18s;
}

.sidebar-user:hover { background: var(--bg-hover); }

.sidebar-user .user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--nova-700), var(--nova-500));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-user .user-info { flex: 1; min-width: 0; }
.sidebar-user .user-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user .user-role {
  font-size: 0.7rem;
  color: var(--text-3);
}

/* ---- Cards ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: border-color .2s, box-shadow .2s;
}

.card:hover { border-color: var(--border-2); }

.card-glow {
  box-shadow: var(--shadow-glow-sm);
  border-color: rgba(124,58,237,0.3);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

/* ---- Stats Cards ---- */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: all .2s;
}

.stat-card:hover {
  border-color: rgba(124,58,237,0.4);
  box-shadow: var(--shadow-glow-sm);
  transform: translateY(-1px);
}

.stat-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.stat-icon.purple { background: rgba(124,58,237,0.2); }
.stat-icon.blue   { background: rgba(59,130,246,0.2); }
.stat-icon.green  { background: rgba(16,185,129,0.2); }
.stat-icon.orange { background: rgba(245,158,11,0.2); }

.stat-info { flex: 1; }
.stat-value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.stat-label { font-size: 0.78rem; color: var(--text-2); margin-top: 2px; }
.stat-change { font-size: 0.73rem; margin-top: 6px; }
.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.855rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .18s ease;
  white-space: nowrap;
  text-decoration: none;
}

.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--nova-700), var(--nova-500));
  color: #fff;
  box-shadow: 0 2px 12px rgba(124,58,237,0.4);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--nova-600), var(--nova-400));
  box-shadow: 0 4px 18px rgba(124,58,237,0.55);
  transform: translateY(-1px);
  color: #fff;
}

.btn-secondary {
  background: var(--bg-3);
  color: var(--text-2);
  border: 1px solid var(--border-2);
}
.btn-secondary:hover { background: var(--bg-hover); color: var(--text); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid transparent;
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }

.btn-danger {
  background: rgba(239,68,68,0.15);
  color: #f87171;
  border: 1px solid rgba(239,68,68,0.3);
}
.btn-danger:hover { background: rgba(239,68,68,0.25); }

.btn-sm { padding: 6px 12px; font-size: 0.78rem; }
.btn-lg { padding: 12px 26px; font-size: 0.95rem; }
.btn-icon { padding: 8px; border-radius: 8px; }

/* ---- Forms ---- */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 7px;
}
.form-label .req { color: var(--nova-400); margin-left: 2px; }

.form-control {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.87rem;
  padding: 10px 14px;
  transition: border-color .18s, box-shadow .18s;
  outline: none;
}

.form-control:focus {
  border-color: var(--nova-600);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.2);
}

.form-control::placeholder { color: var(--text-3); }

textarea.form-control { resize: vertical; min-height: 90px; }

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b6884' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-hint { font-size: 0.73rem; color: var(--text-3); margin-top: 5px; }
.form-error { font-size: 0.73rem; color: var(--danger); margin-top: 5px; }

.form-row { display: grid; gap: 16px; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

/* Toggle switch */
.toggle { position: relative; display: inline-block; width: 42px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--bg-hover);
  border-radius: 99px;
  border: 1px solid var(--border-2);
  cursor: pointer;
  transition: .2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  height: 16px; width: 16px;
  left: 3px; bottom: 3px;
  background: var(--text-3);
  border-radius: 50%;
  transition: .2s;
}
.toggle input:checked + .toggle-slider { background: var(--nova-700); border-color: var(--nova-600); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); background: #fff; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }

table.nova-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.nova-table thead th {
  background: var(--bg-3);
  color: var(--text-3);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.nova-table tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  vertical-align: middle;
}

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

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

/* ---- Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 600;
}

.badge-purple  { background: rgba(124,58,237,0.2); color: var(--nova-300); border: 1px solid rgba(124,58,237,0.3); }
.badge-blue    { background: rgba(59,130,246,0.2); color: #93c5fd; border: 1px solid rgba(59,130,246,0.3); }
.badge-green   { background: rgba(16,185,129,0.2); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.3); }
.badge-yellow  { background: rgba(245,158,11,0.2); color: #fcd34d; border: 1px solid rgba(245,158,11,0.3); }
.badge-orange  { background: rgba(249,115,22,0.2); color: #fdba74; border: 1px solid rgba(249,115,22,0.3); }
.badge-red     { background: rgba(239,68,68,0.2);  color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); }
.badge-gray    { background: rgba(107,104,132,0.2); color: var(--text-3); border: 1px solid var(--border-2); }

/* ---- Modal ---- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s, visibility .25s;
}

.modal-overlay.open { opacity: 1; visibility: visible; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  box-shadow: var(--shadow-lg);
  transform: scale(.95) translateY(16px);
  transition: transform .25s;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-overlay.open .modal { transform: scale(1) translateY(0); }

.modal-lg { max-width: 760px; }
.modal-xl { max-width: 960px; }

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
}

.modal-close {
  background: var(--bg-hover);
  border: none;
  color: var(--text-2);
  width: 30px; height: 30px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  transition: all .18s;
}

.modal-close:hover { background: rgba(239,68,68,0.2); color: #f87171; }

.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* ---- Alerts/Flash ---- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 0.86rem;
  margin-bottom: 18px;
}

.alert-success { background: rgba(16,185,129,0.12); border: 1px solid rgba(16,185,129,0.3); color: #6ee7b7; }
.alert-error   { background: rgba(239,68,68,0.12);  border: 1px solid rgba(239,68,68,0.3);  color: #fca5a5; }
.alert-warning { background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.3); color: #fcd34d; }
.alert-info    { background: rgba(59,130,246,0.12); border: 1px solid rgba(59,130,246,0.3); color: #93c5fd; }

/* ---- Page Header ---- */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}

.page-title {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.page-subtitle { font-size: 0.85rem; color: var(--text-3); margin-top: 4px; }

.page-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* ---- Grid ---- */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* ---- Agent Card ---- */
.agent-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all .2s ease;
  position: relative;
  overflow: visible; /* allows dropdown to escape card bounds */
}

.agent-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--nova-700), var(--nova-500));
  opacity: 0;
  transition: opacity .2s;
}

.agent-card:hover {
  border-color: rgba(124,58,237,0.5);
  box-shadow: var(--shadow-glow-sm);
  transform: translateY(-2px);
}

.agent-card:hover::before { opacity: 1; }

.agent-avatar {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--nova-800), var(--nova-600));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 14px;
  border: 1px solid rgba(124,58,237,0.3);
}

.agent-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.agent-desc {
  font-size: 0.8rem;
  color: var(--text-3);
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.agent-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-3);
}

/* ---- Tabs ---- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }

.tab-btn {
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all .18s;
  background: none;
  border-top: none; border-left: none; border-right: none;
  font-family: var(--font-body);
}

.tab-btn:hover { color: var(--text-2); }
.tab-btn.active {
  color: var(--nova-300);
  border-bottom-color: var(--nova-500);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ---- Empty State ---- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}
.empty-icon { font-size: 3rem; margin-bottom: 16px; opacity: .4; }
.empty-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 8px;
}
.empty-text { font-size: 0.85rem; color: var(--text-3); max-width: 380px; margin: 0 auto 24px; }

/* ---- Search ---- */
.search-box {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.search-box .search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-3);
  font-size: 0.9rem;
  pointer-events: none;
}
.search-box input {
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.85rem;
  padding: 9px 14px 9px 36px;
  width: 240px;
  transition: border-color .18s, box-shadow .18s;
  font-family: var(--font-body);
}
.search-box input:focus {
  outline: none;
  border-color: var(--nova-600);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.2);
  width: 280px;
}

/* ---- Dropdown ---- */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: fixed; /* fixed instead of absolute so it escapes any overflow:hidden parent */
  background: var(--bg-card);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  min-width: 180px;
  box-shadow: var(--shadow-lg);
  z-index: 9000;
  display: none;
  overflow: hidden;
}
.dropdown-menu.open { display: block; animation: fadeIn .15s ease; }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 0.84rem;
  color: var(--text-2);
  cursor: pointer;
  transition: background .15s;
}
.dropdown-item:hover { background: var(--bg-hover); color: var(--text); }
.dropdown-item.danger { color: #f87171; }
.dropdown-item.danger:hover { background: rgba(239,68,68,0.1); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ---- Progress ---- */
.progress-bar {
  height: 6px;
  background: var(--bg-3);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--nova-700), var(--nova-400));
  transition: width .5s ease;
}
.progress-fill.warning { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.progress-fill.danger  { background: linear-gradient(90deg, #ef4444, #f87171); }

/* ---- Topbar ---- */
.topbar-left { flex: 1; display: flex; align-items: center; gap: 12px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-3);
}
.topbar-breadcrumb a { color: var(--text-3); }
.topbar-breadcrumb a:hover { color: var(--text-2); }
.topbar-breadcrumb .sep { color: var(--text-3); }
.topbar-breadcrumb .current { color: var(--text-2); }

.notif-btn {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-2);
  font-size: 1rem;
  transition: all .18s;
  position: relative;
}
.notif-btn:hover { background: var(--bg-hover); color: var(--text); }
.notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--primary-lt);
  border-radius: 50%;
  border: 2px solid var(--bg-2);
}

/* ---- Animations ---- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 12px rgba(124,58,237,0.3); }
  50%       { box-shadow: 0 0 24px rgba(124,58,237,0.6); }
}

.animate-fade { animation: fadeIn .3s ease; }
.animate-up   { animation: slideUp .35s ease; }

/* ---- Utilities ---- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.w-full { width: 100%; }
.text-sm { font-size: 0.82rem; }
.text-xs { font-size: 0.72rem; }
.text-muted { color: var(--text-3); }
.text-center { text-align: center; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.p-4 { padding: 16px; }
.hidden { display: none !important; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.truncate { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content { margin-left: 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row.cols-2, .form-row.cols-3 { grid-template-columns: 1fr; }
  .page-body { padding: 16px; }
  .page-header { flex-direction: column; align-items: flex-start; }
}

/* ---- Chat Widget Preview ---- */
.chat-preview {
  background: var(--bg-3);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}

.chat-preview-header {
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--nova-800), var(--nova-600));
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-messages { padding: 16px; display: flex; flex-direction: column; gap: 10px; min-height: 180px; }

.chat-msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.82rem;
  line-height: 1.5;
}
.chat-msg.bot {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-2);
  align-self: flex-start;
}
.chat-msg.user {
  background: linear-gradient(135deg, var(--nova-700), var(--nova-600));
  color: #fff;
  align-self: flex-end;
}

.chat-input {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
}

.chat-input input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.82rem;
  padding: 8px 12px;
}

/* ---- Sidebar collapsed ---- */
.sidebar-toggle {
  display: none;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  color: var(--text-2);
  width: 36px; height: 36px;
  border-radius: 10px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

@media (max-width: 768px) {
  .sidebar-toggle { display: flex; }
}
