/* ==========================================================================
   CRM Dashboard - Shadcn UI Kit (HTML puro)
   ========================================================================== */

/* ---------- Design tokens (preset default + chart colors red) ---------- */
:root {
  --background: #ffffff;
  --foreground: #0a0a0a;
  --card: #ffffff;
  --card-foreground: #0a0a0a;
  --popover: #ffffff;
  --popover-foreground: #0a0a0a;
  --primary: #171717;
  --primary-foreground: #fafafa;
  --secondary: #f5f5f5;
  --secondary-foreground: #171717;
  --muted: #f5f5f5;
  --muted-foreground: #737373;
  --accent: #f5f5f5;
  --accent-foreground: #171717;
  --destructive: #e40014;
  --border: #e5e5e5;
  --input: #e5e5e5;
  --ring: #a1a1a1;
  --chart-1: #e40014;
  --chart-2: #fb2c36;
  --chart-3: #ff6568;
  --chart-4: #ffa3a3;
  --chart-5: #ffcaca;
  --radius: 0.625rem;
  --sidebar: #f7f6f6;
  --sidebar-foreground: #646464;
  --sidebar-primary: #242424;
  --sidebar-primary-foreground: #fafafa;
  --sidebar-accent: #e1e1e1;
  --sidebar-accent-foreground: #000000;
  --sidebar-border: #e5e5e5;
  --sidebar-ring: #a1a1a1;
  --header-height: 3.5rem;
}

html.dark {
  --background: #0a0a0a;
  --foreground: #fafafa;
  --card: #171717;
  --card-foreground: #fafafa;
  --popover: #171717;
  --popover-foreground: #fafafa;
  --primary: #e5e5e5;
  --primary-foreground: #171717;
  --secondary: #262626;
  --secondary-foreground: #fafafa;
  --muted: #262626;
  --muted-foreground: #a1a1a1;
  --accent: #262626;
  --accent-foreground: #fafafa;
  --destructive: #ff6568;
  --border: rgba(255, 255, 255, 0.1);
  --input: rgba(255, 255, 255, 0.15);
  --ring: #737373;
  --sidebar: #171717;
  --sidebar-foreground: #b0b0b0;
  --sidebar-primary: #e5e5e5;
  --sidebar-primary-foreground: #171717;
  --sidebar-accent: #2c2c2c;
  --sidebar-accent-foreground: #ffffff;
  --sidebar-border: rgba(255, 255, 255, 0.1);
  --sidebar-ring: #737373;
}

/* ---------- Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: var(--foreground);
  background: var(--sidebar);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; }
h1, h2, h3, h4, p { margin: 0; }

.lucide { width: 16px; height: 16px; stroke-width: 2; flex-shrink: 0; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--foreground) 18%, transparent); border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- App shell ---------- */
.app { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 16rem;
  flex: 0 0 16rem;
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--sidebar);
  color: var(--sidebar-foreground);
  transition: width .2s ease, flex-basis .2s ease;
}

.sidebar-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px;
  font-weight: 600;
  color: var(--foreground);
}
.brand-logo { width: 32px; height: 32px; border-radius: 6px; display: block; }
.brand-name { white-space: nowrap; font-size: 14px; }

.sidebar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--sidebar-border);
  border-radius: 8px;
  background: var(--background);
  color: var(--muted-foreground);
  font-size: 13px;
}
.sidebar-search:hover { border-color: var(--ring); }
.sidebar-search .lucide { width: 15px; height: 15px; }
.sidebar-search span { flex: 1; text-align: left; }
.sidebar-search kbd {
  font-family: inherit;
  font-size: 11px;
  padding: 1px 4px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--muted);
  color: var(--muted-foreground);
}

.sidebar-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 12px 12px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.sidebar-nav::-webkit-scrollbar { width: 0; height: 0; }
.sidebar-nav:hover { scrollbar-width: thin; }
.sidebar-nav:hover::-webkit-scrollbar { width: 8px; }
.sidebar-nav:hover::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--foreground) 18%, transparent);
  border-radius: 999px;
}
.sidebar-nav:hover::-webkit-scrollbar-track { background: transparent; }

.nav-group { margin-bottom: 14px; }
.nav-group-label {
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted-foreground);
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 13.5px;
  color: var(--sidebar-foreground);
  text-align: left;
  transition: background .12s ease, color .12s ease;
}
.nav-item:hover { background: var(--sidebar-accent); color: var(--sidebar-accent-foreground); }
.nav-item.active { background: var(--sidebar-accent); color: var(--sidebar-accent-foreground); font-weight: 500; }
.nav-item .lucide { width: 17px; height: 17px; }
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav-badge-new {
  font-size: 10px;
  line-height: 1;
  padding: 3px 6px;
  border: 1px solid #4ade80;
  border-radius: 999px;
  color: #16a34a;
}
.nav-badge-num { font-size: 11px; font-variant-numeric: tabular-nums; }
.nav-chevron { width: 14px !important; height: 14px !important; color: var(--muted-foreground); transition: transform .2s ease; }
.nav-item.open .nav-chevron { transform: rotate(90deg); }

.nav-sub { display: none; flex-direction: column; gap: 2px; margin: 2px 0 4px; padding-left: 33px; }
.nav-sub.open { display: flex; }
.nav-subitem { padding: 6px 8px; border-radius: 7px; font-size: 13px; color: var(--sidebar-foreground); }
.nav-subitem:hover { background: var(--sidebar-accent); color: var(--sidebar-accent-foreground); }
.nav-subitem.active { background: var(--sidebar-accent); color: var(--sidebar-accent-foreground); font-weight: 500; }

.sidebar-footer { padding: 12px; }
.promo {
  padding: 14px;
  border: 1px solid var(--sidebar-border);
  border-radius: 12px;
  background: var(--background);
}
.promo-title { font-size: 13.5px; font-weight: 600; color: var(--foreground); }
.promo-desc { margin: 4px 0 10px; font-size: 12px; line-height: 1.4; color: var(--muted-foreground); }

/* ---------- Collapsed sidebar (modo ícone) ---------- */
.app.collapsed .sidebar { width: 3.25rem; flex-basis: 3.25rem; }
.app.collapsed .brand-name,
.app.collapsed .sidebar-search span,
.app.collapsed .sidebar-search kbd,
.app.collapsed .nav-label,
.app.collapsed .nav-group-label,
.app.collapsed .nav-badge-new,
.app.collapsed .nav-badge-num,
.app.collapsed .nav-chevron,
.app.collapsed .promo { display: none; }
.app.collapsed .sidebar-header { padding: 12px 6px; }
.app.collapsed .sidebar-nav { padding: 0 6px 12px; }
.app.collapsed .sidebar-footer { padding: 6px; }
.app.collapsed .brand,
.app.collapsed .sidebar-search,
.app.collapsed .nav-item { justify-content: center; padding-left: 0; padding-right: 0; }
.app.collapsed .nav-sub { display: none; }
.app.collapsed .nav-group { margin-bottom: 6px; }

/* ---------- Main / inset ---------- */
.main-wrap { flex: 1; min-width: 0; padding: 6px; }
.main {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 12px);
  overflow: hidden;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 14px;
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--header-height);
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--background) 60%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-right { margin-left: auto; }

.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted-foreground);
}
.icon-btn:hover { background: var(--accent); color: var(--foreground); }
.dot-red {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--destructive);
}

.chev { width: 14px !important; height: 14px !important; color: var(--muted-foreground); }

.separator { width: 1px; height: 22px; background: var(--border); }

.avatar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
}
.avatar-btn:hover { background: var(--accent); }
.avatar-img { width: 28px; height: 28px; border-radius: 999px; object-fit: cover; display: block; }

/* ---------- Dropdowns ---------- */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 60;
  min-width: 190px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--popover);
  color: var(--popover-foreground);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
  display: none;
}
.dropdown-menu.right { left: auto; right: 0; }
.dropdown-menu.open { display: block; }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  font-size: 13px;
  text-align: left;
}
.dropdown-item:hover { background: var(--accent); }
.dropdown-item .lucide { width: 15px; height: 15px; color: var(--muted-foreground); }
.dropdown-item .check { margin-left: auto; }
.dropdown-label { padding: 6px 9px; font-size: 11px; color: var(--muted-foreground); }
.dropdown-sep { height: 1px; margin: 4px 0; background: var(--border); }

/* ---------- Notifications ---------- */
.notif-menu { width: 360px; padding: 0; }
.notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.notif-title { font-size: 14px; font-weight: 600; }
.notif-pill {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 11px;
  font-weight: 600;
}
.notif-list { max-height: 340px; overflow-y: auto; }
.notif-item { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: var(--accent); }
.notif-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 999px;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}
.notif-body { flex: 1; min-width: 0; }
.notif-name { font-size: 13px; font-weight: 600; }
.notif-text { font-size: 12.5px; color: var(--muted-foreground); }
.notif-time { margin-top: 2px; font-size: 11px; color: var(--muted-foreground); }
.notif-dot {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--primary);
}
.notif-footer {
  display: block;
  padding: 10px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 12.5px;
  font-weight: 500;
}
.notif-footer:hover { background: var(--accent); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background .15s ease, opacity .15s ease;
}
.btn .lucide { width: 15px; height: 15px; }
.btn-primary { background: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover { opacity: .88; }
.btn-outline { background: var(--background); border-color: var(--border); color: var(--foreground); }
.btn-outline:hover { background: var(--muted); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn-block { width: 100%; }

/* ---------- Content ---------- */
.content {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
}

.page-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.page-title-row h1 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.page-actions { display: flex; align-items: center; gap: 8px; }

/* ---------- Grid ---------- */
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------- Card ---------- */
.card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
  border-radius: 14px;
  background: color-mix(in srgb, var(--muted) 40%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--foreground) 10%, transparent);
  color: var(--card-foreground);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 52px;
  padding: 10px 16px;
}
.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 16px;
  overflow: hidden;
  border-radius: 10px;
  background: var(--card);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--foreground) 5%, transparent), 0 1px 2px rgba(0, 0, 0, .05);
}
.card-title { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; }
.card-title .info { width: 13px; height: 13px; color: var(--muted-foreground); }
.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted-foreground);
}

.stat-value { margin: 2px 0 6px; font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.stat-sub { font-size: 13px; color: var(--muted-foreground); }
.text-green { color: #16a34a; }
.text-red { color: #e11d48; }
.text-orange { color: #f97316; }

/* Goal card */
.goal-title { margin-bottom: 18px; font-size: 20px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.goal-row { display: flex; align-items: center; gap: 14px; margin-top: auto; }
.goal-text { font-size: 13px; color: var(--muted-foreground); }
.gauge { width: 64px; height: 64px; flex-shrink: 0; }

/* Donut */
.donut-wrap { position: relative; width: 100%; max-width: 230px; margin: 4px auto 22px; }
.donut { width: 100%; aspect-ratio: 1 / 1; }
.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.donut-center strong { font-size: 28px; font-weight: 700; line-height: 1; }
.donut-center small { margin-top: 4px; font-size: 13px; color: var(--muted-foreground); }
.donut-legend { display: flex; justify-content: space-around; gap: 8px; }
.legend-item { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.legend-top { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 8px; height: 8px; border-radius: 999px; }
.legend-label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-foreground); }
.legend-value { font-size: 20px; font-weight: 700; }

/* Tasks */
.task-list { display: flex; flex-direction: column; gap: 12px; }
.task {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: background .15s ease;
}
.task:hover { background: color-mix(in srgb, var(--muted) 50%, transparent); }
.task.done { background: color-mix(in srgb, var(--muted) 60%, transparent); }
.checkbox {
  position: relative;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  flex-shrink: 0;
  border: 1.5px solid var(--input);
  border-radius: 4px;
  background: var(--background);
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.checkbox:checked { background: var(--primary); border-color: var(--primary); }
.checkbox:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid var(--primary-foreground);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.task-body { flex: 1; min-width: 0; }
.task-title { font-size: 14.5px; font-weight: 500; }
.task.done .task-title { text-decoration: line-through; color: var(--muted-foreground); }
.task-sub { margin-top: 2px; font-size: 13px; color: var(--muted-foreground); }
.task.done .task-sub { text-decoration: line-through; }
.task-meta { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.task-due { font-size: 12.5px; color: var(--muted-foreground); }

.badge { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.badge-high { background: #fee2e2; color: #b91c1c; }
.badge-medium { background: #fef3c7; color: #b45309; }
.badge-low { background: #dcfce7; color: #15803d; }
html.dark .badge-high { background: rgba(239, 68, 68, .15); color: #fca5a5; }
html.dark .badge-medium { background: rgba(245, 158, 11, .15); color: #fcd34d; }
html.dark .badge-low { background: rgba(34, 197, 94, .15); color: #86efac; }

/* Pipeline */
.pipeline-bar {
  display: flex;
  width: 100%;
  height: 14px;
  margin-bottom: 24px;
  border-radius: 999px;
  overflow: hidden;
}
.pipeline-seg { height: 100%; }
.pipeline-list { display: flex; flex-direction: column; gap: 22px; }
.pipe-row { display: flex; align-items: center; gap: 14px; }
.pipe-dot { width: 12px; height: 12px; border-radius: 999px; flex-shrink: 0; }
.pipe-main { flex: 1; min-width: 0; }
.pipe-name { font-size: 15px; font-weight: 600; }
.pipe-meta { margin-top: 2px; font-size: 12.5px; color: var(--muted-foreground); }
.pipe-pct { width: 36px; text-align: right; font-size: 13px; font-weight: 500; color: var(--muted-foreground); }
.progress { flex: 0 0 84px; width: 84px; height: 8px; border-radius: 999px; background: var(--muted); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 999px; background: var(--primary); }

/* ---------- Table ---------- */
.table-card .card-body { padding: 0; overflow: visible; }
.table-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.input-group {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 240px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--background);
}
.input-group .lucide { width: 15px; height: 15px; color: var(--muted-foreground); }
.input-group input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--foreground); font-size: 13px; }

.table-scroll { overflow-x: auto; }
.table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed;
}
.table th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted-foreground);
  text-align: left;
  white-space: nowrap;
}
.table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.table tbody tr { transition: background .12s ease; }
.table tbody tr:hover { background: var(--muted); }
.table tbody tr:last-child td { border-bottom: 0; }

.lead-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.lead-email { font-size: 11.5px; color: var(--muted-foreground); text-transform: lowercase; overflow: hidden; text-overflow: ellipsis; }
.cell-muted { color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; }
.cell-amount { text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }

.sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted-foreground);
}
.sort-btn .lucide { width: 13px; height: 13px; }

.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  text-transform: capitalize;
  line-height: 1.4;
}
.pill-outline { border: 1px solid var(--border); color: var(--foreground); }
.pill-success { border: 1px solid #4ade80; background: #f0fdf4; color: #166534; }
.pill-info { border: 1px solid #60a5fa; background: #eff6ff; color: #1e40af; }
.pill-warning { border: 1px solid #fb923c; background: #fff7ed; color: #9a3412; }
.pill-destructive { border: 1px solid #f87171; background: rgba(228, 0, 20, .1); color: var(--destructive); }
html.dark .pill-success { background: rgba(34, 197, 94, .12); color: #86efac; border-color: #16a34a; }
html.dark .pill-info { background: rgba(59, 130, 246, .12); color: #93c5fd; border-color: #2563eb; }
html.dark .pill-warning { background: rgba(249, 115, 22, .12); color: #fdba74; border-color: #ea580c; }
html.dark .pill-destructive { border-color: #dc2626; }

.row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted-foreground);
}
.row-actions:hover { background: var(--accent); color: var(--foreground); }

.table-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
}
.table-footer .count { flex: 1; font-size: 13px; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.pager {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--background);
  color: var(--muted-foreground);
}
.pager:hover:not(:disabled) { background: var(--muted); color: var(--foreground); }
.pager:disabled { opacity: .5; cursor: not-allowed; }
.row-check { width: 40px; }

/* ---------- Command palette ---------- */
.palette-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 14vh;
  background: rgba(0, 0, 0, .5);
}
.palette-overlay.open { display: flex; }
.palette {
  width: min(560px, 92vw);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--popover);
  color: var(--popover-foreground);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
.palette-input { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.palette-input .lucide { color: var(--muted-foreground); }
.palette-input input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--foreground); font-size: 15px; }
.palette-list { max-height: 320px; overflow-y: auto; padding: 8px; }
.palette-group { padding: 8px 10px 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-foreground); }
.palette-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  cursor: pointer;
}
.palette-item:hover, .palette-item.active { background: var(--accent); }
.palette-item .lucide { color: var(--muted-foreground); }
.palette-empty { padding: 24px; text-align: center; font-size: 13px; color: var(--muted-foreground); }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 110;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
  }
  .app.collapsed .sidebar { width: 16rem; flex-basis: 16rem; }
  .app.collapsed .brand-name,
  .app.collapsed .sidebar-search span,
  .app.collapsed .sidebar-search kbd,
  .app.collapsed .nav-label,
  .app.collapsed .nav-group-label,
  .app.collapsed .nav-badge-new,
  .app.collapsed .nav-badge-num,
  .app.collapsed .nav-chevron,
  .app.collapsed .promo { display: initial; }
  .app.collapsed .brand,
  .app.collapsed .sidebar-search,
  .app.collapsed .nav-item { justify-content: flex-start; padding-left: 8px; padding-right: 8px; }
  .app.mobile-open .sidebar { transform: none; }
  .main-wrap { padding: 0; }
  .main { border-radius: 0; border-left: 0; border-right: 0; min-height: 100vh; }
}
@media (max-width: 640px) {
  .grid-4 { grid-template-columns: 1fr; }
  .content { padding: 16px; }
  .topbar { padding: 0 10px; }
}
