/* ============================================================
   SPPOTTER CRM — Professional Stylesheet
   ============================================================ */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --secondary: #7c3aed;
  --accent: #f97316;
  --accent-light: #fff7ed;
  --success: #16a34a;
  --success-light: #dcfce7;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --info: #0891b2;
  --info-light: #cffafe;

  --sidebar-bg: linear-gradient(180deg, #0b4aa8 0%, #083b8a 100%);
  --sidebar-hover: rgba(255,255,255,0.10);
  --sidebar-active: rgba(255,255,255,0.20);
  --sidebar-text: #dbe6fb;
  --sidebar-active-text: #ffffff;
  --sidebar-width: 264px;

  --bg: #f1f5f9;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --border-light: #f8fafc;

  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --header-height: 64px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);

  --t: .15s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow: hidden;
  height: 100vh;
}

/* ── Layout ─────────────────────────────────────── */
#app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width .2s ease, min-width .2s ease;
  z-index: 100;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
#sidebar.collapsed { width: 72px; min-width: 72px; }
#sidebar.collapsed .logo-name,
#sidebar.collapsed .nav-label,
#sidebar.collapsed .nav-chevron,
#sidebar.collapsed .nav-submenu,
#sidebar.collapsed .sync-text,
#sidebar.collapsed .nav-badge { display: none; }
#sidebar.collapsed .nav-item { justify-content: center; padding: 11px 0; }
#sidebar.collapsed .sidebar-header { padding: 18px 8px; justify-content: center; }
#sidebar.collapsed .logo { justify-content: center; }
#sidebar.collapsed .sidebar-collapse { display: none; }
#sidebar.collapsed .nav-item[data-count]::after {
  content: ''; position: absolute; top: 8px; right: 18px;
  width: 8px; height: 8px; border-radius: 50%; background: #f87171;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 20px 14px 16px 18px;
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.logo-img {
  width: 34px; height: 34px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.25));
}
.logo-name {
  font-family: 'Montserrat', 'Inter', sans-serif;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: .06em;
  line-height: 1;
  white-space: nowrap;
}
.sidebar-collapse {
  background: transparent;
  border: none;
  color: var(--sidebar-text);
  width: 30px; height: 30px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.sidebar-collapse:hover { background: var(--sidebar-hover); color: #fff; }

.sidebar-nav { flex: 1; padding: 6px 12px 12px; display: flex; flex-direction: column; gap: 4px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 11px 14px;
  border: none;
  background: transparent;
  border-radius: 10px;
  color: var(--sidebar-text);
  text-decoration: none;
  font: inherit;
  font-size: .95rem;
  font-weight: 600;
  text-align: left;
  transition: background var(--t), color var(--t);
  position: relative;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
}
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active {
  background: var(--sidebar-active);
  color: var(--sidebar-active-text);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.nav-icon { width: 20px; height: 20px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.nav-icon svg { width: 20px; height: 20px; }
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav-chevron { display: flex; transition: transform .2s ease; opacity: .8; }
.nav-group.open > .nav-item .nav-chevron { transform: rotate(90deg); }
.nav-badge {
  margin-left: auto;
  background: #f87171;
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 9999px;
  min-width: 20px;
  text-align: center;
}
.nav-group-toggle .nav-badge { margin-left: 0; }
.nav-group.open > .nav-group-toggle .nav-badge { display: none; }

.nav-submenu {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .2s ease;
}
.nav-group.open > .nav-submenu { grid-template-rows: 1fr; }
.nav-submenu-inner {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-left: 24px;
  padding-left: 12px;
  border-left: 1px solid rgba(255,255,255,.14);
}
.nav-subitem { padding: 8px 12px; font-size: .88rem; font-weight: 500; gap: 10px; }
.nav-subitem .nav-icon, .nav-subitem .nav-icon svg { width: 16px; height: 16px; }

.sidebar-footer {
  padding: 8px 12px 12px;
  border-top: 1px solid rgba(255,255,255,.12);
}
.nav-item-footer { width: 100%; }

.sync-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin-top: 4px;
}
.sync-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sync-dot.online { background: var(--success); box-shadow: 0 0 6px var(--success); }
.sync-dot.offline { background: var(--text-muted); }
.sync-dot.syncing { background: var(--warning); animation: pulse 1s infinite; }
.sync-text { color: rgba(219,230,251,.7); font-size: .72rem; }

/* ── Main ───────────────────────────────────────── */
#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  min-width: 0;
}

/* ── Header ─────────────────────────────────────── */
#header {
  height: var(--header-height);
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
  flex-shrink: 0;
  z-index: 50;
}
.header-left { display: flex; align-items: center; gap: 12px; }
.header-left h1 { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.breadcrumb { font-size: .78rem; color: var(--text-muted); }

.header-right { display: flex; align-items: center; gap: 10px; }
.header-search { position: relative; }
.search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); display: flex; color: var(--text-muted); pointer-events: none; }
.search-input {
  width: 240px;
  padding: 7px 10px 7px 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .83rem;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
}
.search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }

.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 300px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  max-height: 300px;
  overflow-y: auto;
}
.search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background var(--t);
}
.search-result-item:hover { background: var(--bg); }
.search-result-type {
  font-size: .65rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary);
}

.btn-icon {
  width: 36px; height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem;
  transition: background var(--t);
}
.btn-icon:hover { background: var(--bg); }
.sidebar-toggle { border: none; font-size: 1.1rem; background: transparent; }

.header-user { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.user-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.user-avatar-logo {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: contain;
  background: var(--primary-light);
  padding: 3px;
  flex-shrink: 0;
}
.user-name { font-size: .83rem; font-weight: 600; color: var(--text-secondary); }

/* ── Content ─────────────────────────────────────── */
#content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* ── Cards ───────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.card-title {
  font-size: .92rem;
  font-weight: 700;
  color: var(--text);
}
.card-body { padding: 20px; }
.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ── KPI Cards ───────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}
.kpi-grid-3 { grid-template-columns: repeat(3, 1fr); }
.kpi-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 24px;
  display: flex;
  align-items: flex-start;
  gap: 18px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t), transform var(--t);
}
.kpi-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.kpi-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.kpi-icon.blue   { background: var(--primary-light); color: var(--primary); }
.kpi-icon.green  { background: var(--success-light); color: var(--success); }
.kpi-icon.orange { background: var(--accent-light);  color: var(--accent); }
.kpi-icon.red    { background: var(--danger-light);  color: var(--danger); }
.kpi-icon.purple { background: #ede9fe;              color: var(--secondary); }

.kpi-info { flex: 1; min-width: 0; }
.kpi-label { font-size: .75rem; color: var(--text-muted); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 6px; }
.kpi-value { font-size: 1.7rem; font-weight: 800; color: var(--text); line-height: 1.1; }
.kpi-change {
  font-size: .73rem;
  font-weight: 600;
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 3px;
}
.kpi-change.up { color: var(--success); }
.kpi-change.down { color: var(--danger); }
.kpi-change.neutral { color: var(--text-muted); }

.kpi-edit-btn {
  position: absolute;
  top: 12px; right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: .85rem;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity var(--t);
  padding: 4px 6px;
  border-radius: 6px;
  line-height: 1;
}
.kpi-card:hover .kpi-edit-btn { opacity: 1; }
.kpi-edit-btn:hover { background: var(--bg); }

/* ── Grid Layouts ────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.grid-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: 20px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }

/* ── Tables ──────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .83rem;
}
thead { background: var(--bg); }
th {
  text-align: left;
  padding: 10px 14px;
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 11px 14px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }
.td-primary { color: var(--text) !important; font-weight: 600; }
.td-mono { font-family: monospace; font-size: .8rem; }

/* ── Page Toolbar ────────────────────────────────── */
.page-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.toolbar-left { flex: 1; display: flex; align-items: center; gap: 10px; }
.toolbar-right { display: flex; align-items: center; gap: 10px; }

/* ── Filters ─────────────────────────────────────── */
.filter-input {
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .83rem;
  outline: none;
  background: var(--card-bg);
  color: var(--text);
  transition: border-color var(--t);
}
.filter-input:focus { border-color: var(--primary); }
.filter-select {
  padding: 7px 28px 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .83rem;
  background: var(--card-bg);
  color: var(--text);
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

/* ── Buttons ─────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: .83rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--t);
  white-space: nowrap;
  text-decoration: none;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { background: #15803d; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-outline:hover:not(:disabled) { background: var(--bg); border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: transparent; color: var(--text-secondary); padding: 6px 10px; }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: .76rem; }
.btn-xs { padding: 3px 8px; font-size: .7rem; }
.btn-icon-text { gap: 4px; }

/* ── Badges / Pills ──────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: .7rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-info { background: var(--info-light); color: var(--info); }
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-gray { background: #f1f5f9; color: var(--text-secondary); }
.badge-accent { background: var(--accent-light); color: var(--accent); }

/* ── Forms ───────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-row { display: grid; gap: 14px; margin-bottom: 16px; }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 5px;
}
label .required { color: var(--danger); margin-left: 2px; }
.input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .85rem;
  color: var(--text);
  background: var(--card-bg);
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.input.error { border-color: var(--danger); }
select.input { cursor: pointer; }
textarea.input { resize: vertical; min-height: 80px; }
.input-group { position: relative; }
.input-prefix {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: .85rem;
  pointer-events: none;
}
.input-group .input { padding-left: 24px; }
.form-hint { font-size: .72rem; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: .72rem; color: var(--danger); margin-top: 4px; }

.form-actions {
  display: flex;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  margin-top: 20px;
}
.form-section-title {
  font-size: .8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 20px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

/* ── Modal ───────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  backdrop-filter: blur(2px);
  overflow-y: auto;
}
.modal-overlay.hidden { display: none; }
.modal-container {
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 640px;
  animation: slideIn .2s ease;
}
.modal-sm { max-width: 400px; }
.modal-lg { max-width: 860px; }
.modal-xl { max-width: 1060px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 1rem; font-weight: 700; color: var(--text); }
.modal-close {
  background: none; border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: var(--radius);
  transition: background var(--t), color var(--t);
}
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-body { padding: 22px; }

/* ── Charts ──────────────────────────────────────── */
.chart-wrapper {
  position: relative;
  height: 240px;
  padding: 10px 0;
}

/* ── Notifications / Toasts ──────────────────────── */
#notifications {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 340px;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  background: var(--text);
  color: #fff;
  box-shadow: var(--shadow-lg);
  font-size: .83rem;
  animation: toastIn .25s ease;
}
.toast.success { background: var(--success); }
.toast.danger  { background: var(--danger); }
.toast.warning { background: #b45309; }
.toast.info    { background: var(--primary); }
.toast-icon { font-size: 1rem; flex-shrink: 0; }
.toast-body { flex: 1; }
.toast-title { font-weight: 700; margin-bottom: 2px; }
.toast-message { font-size: .78rem; opacity: .85; }
.toast-close { background: none; border: none; color: rgba(255,255,255,.6); cursor: pointer; font-size: .9rem; }

/* ── Cart (Sales) ────────────────────────────────── */
.cart-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  background: var(--bg);
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-weight: 600; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item-meta { font-size: .72rem; color: var(--text-muted); }
.cart-item-qty input {
  width: 56px;
  padding: 4px 8px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .83rem;
  font-weight: 600;
}
.cart-item-total { font-weight: 700; color: var(--text); font-size: .85rem; min-width: 70px; text-align: right; }
.cart-item-remove { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 1rem; }

.sale-summary {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 14px;
  margin-top: 12px;
}
.sale-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  font-size: .83rem;
  color: var(--text-secondary);
}
.sale-summary-total {
  display: flex;
  justify-content: space-between;
  padding: 8px 0 3px;
  margin-top: 6px;
  border-top: 2px solid var(--border);
  font-weight: 800;
  font-size: 1rem;
  color: var(--text);
}
.sale-summary-profit {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  font-size: .83rem;
  font-weight: 700;
  color: var(--success);
}

/* ── Product Search Dropdown ─────────────────────── */
.product-search-wrapper { position: relative; }
.product-search-dropdown {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 300;
  max-height: 220px;
  overflow-y: auto;
}
.product-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  cursor: pointer;
  transition: background var(--t);
  border-bottom: 1px solid var(--border-light);
}
.product-option:hover { background: var(--bg); }
.product-option-name { font-weight: 600; font-size: .83rem; }
.product-option-meta { font-size: .72rem; color: var(--text-muted); }
.product-option-right { text-align: right; }
.product-option-price { font-weight: 700; font-size: .85rem; color: var(--primary); }
.product-option-stock { font-size: .7rem; }

/* ── Activity / Timeline ─────────────────────────── */
.activity-list { display: flex; flex-direction: column; gap: 0; }
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem;
  flex-shrink: 0;
}
.activity-content { flex: 1; min-width: 0; }
.activity-title { font-size: .83rem; font-weight: 600; color: var(--text); }
.activity-time { font-size: .72rem; color: var(--text-muted); margin-top: 2px; }
.activity-amount { font-weight: 700; color: var(--success); font-size: .85rem; }

/* ── Stock Level Indicator ───────────────────────── */
.stock-bar-wrapper { width: 80px; }
.stock-bar {
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  overflow: hidden;
  margin-bottom: 2px;
}
.stock-bar-fill { height: 100%; border-radius: 2px; transition: width .3s; }
.stock-label { font-size: .68rem; color: var(--text-muted); }

/* ── Tabs ────────────────────────────────────────── */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.tab-btn {
  padding: 8px 16px;
  border: none;
  background: none;
  font-size: .83rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color var(--t), border-color var(--t);
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Alerts ──────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: .83rem;
  margin-bottom: 10px;
}
.alert-icon { font-size: 1rem; flex-shrink: 0; }
.alert-warning { background: var(--warning-light); border: 1px solid #fcd34d; color: #92400e; }
.alert-danger  { background: var(--danger-light); border: 1px solid #fca5a5; color: #7f1d1d; }
.alert-success { background: var(--success-light); border: 1px solid #86efac; color: #14532d; }
.alert-info    { background: var(--info-light); border: 1px solid #67e8f9; color: #164e63; }

/* ── Empty State ─────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state-title { font-size: .95rem; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state-text { font-size: .83rem; }

/* ── Pagination ──────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
.pagination-info { font-size: .78rem; color: var(--text-muted); }
.pagination-buttons { display: flex; gap: 4px; }
.page-btn {
  width: 30px; height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
  cursor: pointer;
  font-size: .78rem;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--t);
}
.page-btn:hover { background: var(--bg); }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Reports ─────────────────────────────────────── */
.report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.date-range { display: flex; align-items: center; gap: 8px; }

/* ── Settings ────────────────────────────────────── */
.settings-layout { display: grid; grid-template-columns: 200px 1fr; gap: 24px; align-items: start; }
.settings-menu { background: var(--card-bg); border-radius: var(--radius-lg); border: 1px solid var(--border); overflow: hidden; }
.settings-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: .83rem;
  cursor: pointer;
  color: var(--text-secondary);
  border-left: 3px solid transparent;
  transition: all var(--t);
}
.settings-menu-item:hover { background: var(--bg); color: var(--text); }
.settings-menu-item.active { background: var(--primary-light); color: var(--primary); border-left-color: var(--primary); font-weight: 600; }
.settings-panel { display: none; }
.settings-panel.active { display: block; }

/* ── Google Sheets Connect ───────────────────────── */
.connect-card {
  border: 2px dashed var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  text-align: center;
  background: var(--bg);
}
.connect-icon { font-size: 3rem; margin-bottom: 12px; }
.connect-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; }
.connect-text { color: var(--text-secondary); font-size: .85rem; max-width: 400px; margin: 0 auto 20px; }

/* ── Misc Utilities ──────────────────────────────── */
.hidden { display: none !important; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-primary { color: var(--primary) !important; }
.text-warning { color: var(--warning) !important; }
.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.fs-sm { font-size: .78rem; }
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 20px; }
.mb-1 { margin-bottom: 6px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 20px; }
.gap-1 { gap: 6px; }
.gap-2 { gap: 12px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.nowrap { white-space: nowrap; }

/* ── Separator ───────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* ── Skeleton Loader ─────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}

/* ── Delivery status badge ───────────────────────── */
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .72rem;
  font-weight: 600;
}
.status-dot { width: 6px; height: 6px; border-radius: 50%; }

/* ── Profit highlight ────────────────────────────── */
.profit-positive { color: var(--success); font-weight: 700; }
.profit-negative { color: var(--danger); font-weight: 700; }

/* ── Dashboard Hero ──────────────────────────────── */
.dash-hero {
  background: linear-gradient(135deg, #0c1424 0%, #0f2042 55%, #162d5a 100%);
  border-radius: var(--radius-xl);
  padding: 32px 36px;
  color: #fff;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.dash-hero-left { display: flex; flex-direction: column; gap: 4px; }
.dash-hero-eyebrow {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.4);
  margin-bottom: 2px;
}
.dash-hero-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: #fff;
  line-height: 1.15;
}
.dash-hero-date {
  font-size: .82rem;
  color: rgba(255,255,255,.5);
  margin-top: 2px;
}
.dash-hero-btn {
  background: rgba(255,255,255,.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: var(--radius-lg);
  padding: 10px 22px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t), border-color var(--t);
  letter-spacing: .01em;
  flex-shrink: 0;
}
.dash-hero-btn:hover {
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.3);
}

/* ── Animations ──────────────────────────────────── */
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-10px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ── Scrollbar ───────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── Print ───────────────────────────────────────── */
@media print {
  #sidebar, #header, .page-toolbar, .btn, .no-print { display: none !important; }
  #main { margin: 0; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}


/* ── Drag & Drop ─────────────────────────────────── */
.drag-handle-cell { user-select: none; }
.drag-handle-cell:hover { color: var(--primary) !important; }
tr.drag-row-over    { background: var(--primary-light) !important; outline: 2px solid var(--primary); }

/* ── Dark Mode ───────────────────────────────────── */
body.dark {
  --bg: #0c1322;
  --card-bg: #162032;
  --border: #263348;
  --border-light: #1c2d3f;
  --text: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --primary-light: rgba(37,99,235,.2);
  --success-light: rgba(22,163,74,.18);
  --warning-light: rgba(217,119,6,.18);
  --danger-light: rgba(220,38,38,.18);
  --info-light: rgba(8,145,178,.18);
  --accent-light: rgba(249,115,22,.18);
}
body.dark #header { background: #162032; border-color: #263348; }
body.dark .card, body.dark .kpi-card, body.dark .table-wrapper { background: #162032; border-color: #263348; }
body.dark thead { background: #0c1322; }
body.dark tbody tr:hover { background: rgba(255,255,255,.03); }
body.dark .filter-input, body.dark .filter-select, body.dark .input, body.dark .search-input {
  background: #1e2d42; border-color: #263348; color: #f1f5f9;
}
body.dark .filter-input::placeholder, body.dark .search-input::placeholder { color: #475569; }
body.dark .badge-gray { background: #1e2d42; color: #94a3b8; }
body.dark .btn-outline { border-color: #263348; color: #94a3b8; }
body.dark .btn-outline:hover { background: #1e2d42; border-color: var(--primary); color: var(--primary); }
body.dark .btn-icon { background: #162032; border-color: #263348; color: #94a3b8; }
body.dark .btn-icon:hover { background: #1e2d42; }
body.dark .btn-ghost:hover { background: #1e2d42; }
body.dark .modal-container { background: #162032; }
body.dark .modal-header { border-color: #263348; }
body.dark .sale-summary, body.dark .cart-item { background: #0c1322; border-color: #263348; }
body.dark .settings-menu { background: #162032; border-color: #263348; }
body.dark .settings-menu-item:hover { background: #1e2d42; }
body.dark .connect-card { background: #0c1322; border-color: #263348; }
body.dark .card-footer { background: #0c1322; border-color: #263348; }
body.dark .skeleton { background: linear-gradient(90deg,#1e2d42 25%,#263348 50%,#1e2d42 75%); background-size: 200% 100%; }
body.dark .page-btn { background: #162032; border-color: #263348; color: #94a3b8; }
body.dark .page-btn:hover { background: #1e2d42; }
body.dark .page-btn.active { background: var(--primary); color: #fff; }
body.dark .product-search-dropdown, body.dark .search-dropdown { background: #162032; border-color: #263348; }
body.dark .product-option:hover, body.dark .search-result-item:hover { background: #1e2d42; }

body.dark { --sidebar-bg: linear-gradient(180deg, #0a2f6b 0%, #071f4a 100%); }

/* ── Bandeja de entrada ──────────────────────────── */
#content.content-flush { padding: 0; overflow: hidden; }
.inbox {
  display: grid;
  grid-template-columns: 340px 1fr;
  height: 100%;
  min-height: 0;
  background: var(--card-bg);
}
.inbox-list { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--border); }
.inbox-list-head { padding: 14px 14px 10px; border-bottom: 1px solid var(--border); }
.inbox-tabs { display: flex; gap: 4px; background: var(--bg); padding: 4px; border-radius: 10px; margin-bottom: 10px; }
.inbox-tab {
  flex: 1; border: none; background: transparent; padding: 7px 4px; border-radius: 8px;
  font: inherit; font-size: .78rem; font-weight: 600; color: var(--text-secondary); cursor: pointer; white-space: nowrap;
}
.inbox-tab.active { background: var(--card-bg); color: var(--primary); box-shadow: var(--shadow); }
.inbox-tab-count { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 99px; background: var(--primary-light); color: var(--primary); font-size: .68rem; }
.inbox-filters { display: flex; flex-direction: column; gap: 8px; }
.inbox-filters .filter-input { width: 100%; }
.inbox-filter-row { display: flex; gap: 8px; }
.inbox-filter-row .filter-select { flex: 1; min-width: 0; }
.inbox-items { flex: 1; overflow-y: auto; }
.inbox-item {
  display: flex; gap: 12px; width: 100%; padding: 12px 14px; border: none; border-bottom: 1px solid var(--border);
  background: transparent; text-align: left; font: inherit; color: inherit; cursor: pointer;
}
.inbox-item:hover { background: var(--bg); }
.inbox-item.active { background: var(--primary-light); }
.inbox-avatar {
  position: relative; width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 700;
}
.inbox-channel-dot {
  position: absolute; right: -2px; bottom: -2px; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--card-bg); color: #fff; display: flex; align-items: center; justify-content: center;
}
.inbox-item-body { flex: 1; min-width: 0; }
.inbox-item-top, .inbox-item-bottom { display: flex; align-items: center; gap: 8px; }
.inbox-item-name { flex: 1; min-width: 0; font-weight: 700; font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-item-time { font-size: .7rem; color: var(--text-muted); flex-shrink: 0; }
.inbox-item-last { flex: 1; min-width: 0; font-size: .8rem; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-unread { background: #25d366; color: #fff; font-size: .68rem; font-weight: 700; min-width: 20px; padding: 1px 6px; border-radius: 99px; text-align: center; }
.inbox-item-agent { font-size: .7rem; color: var(--text-muted); margin-top: 2px; }
.inbox-empty { padding: 32px 16px; text-align: center; color: var(--text-muted); font-size: .85rem; line-height: 1.6; }

.inbox-chat { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--bg); }
.inbox-placeholder { flex: 1; display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center; color: var(--text-muted); }
.inbox-chat-head {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--card-bg);
  border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.inbox-chat-title { flex: 1; min-width: 160px; }
.inbox-chat-name { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.inbox-chat-sub { font-size: .76rem; color: var(--text-muted); }
.inbox-chat-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.inbox-messages { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 4px; }
.inbox-day { align-self: center; margin: 10px 0; padding: 3px 10px; border-radius: 99px; background: var(--card-bg); color: var(--text-muted); font-size: .7rem; text-transform: capitalize; box-shadow: var(--shadow-sm); }
.inbox-msg { display: flex; }
.inbox-msg.out { justify-content: flex-end; }
.inbox-bubble {
  max-width: min(70%, 560px); padding: 7px 10px 5px; border-radius: 12px; background: var(--card-bg);
  box-shadow: var(--shadow-sm); font-size: .86rem; overflow-wrap: anywhere;
}
.inbox-msg.in .inbox-bubble { border-top-left-radius: 4px; }
.inbox-msg.out .inbox-bubble { background: #dcf3ff; border-top-right-radius: 4px; }
.inbox-author { font-size: .7rem; font-weight: 700; color: var(--primary); margin-bottom: 2px; }
.inbox-text { white-space: pre-wrap; }
.inbox-media { font-size: .8rem; color: var(--text-secondary); font-style: italic; }
.inbox-meta { font-size: .66rem; color: var(--text-muted); text-align: right; margin-top: 2px; }
.inbox-failed { color: var(--danger); }
.inbox-failed a { color: var(--danger); font-weight: 600; }
.inbox-warning { margin: 0 16px 8px; padding: 8px 12px; border-radius: var(--radius); background: var(--warning-light); color: var(--warning); font-size: .78rem; }
.inbox-composer { display: flex; align-items: flex-end; gap: 8px; padding: 10px 16px; background: var(--card-bg); border-top: 1px solid var(--border); }
.inbox-composer textarea {
  flex: 1; resize: none; border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px;
  font: inherit; font-size: .88rem; background: var(--bg); color: var(--text); max-height: 140px; outline: none;
}
.inbox-composer textarea:focus { border-color: var(--primary); }
.inbox-quick { display: flex; flex-direction: column; gap: 6px; }
.inbox-quick-item {
  text-align: left; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card-bg); color: var(--text); font: inherit; font-size: .85rem; cursor: pointer; white-space: pre-wrap;
}
.inbox-quick-item:hover { border-color: var(--primary); background: var(--primary-light); }

body.dark .inbox, body.dark .inbox-chat-head, body.dark .inbox-composer, body.dark .inbox-bubble, body.dark .inbox-day { background: #162032; border-color: #263348; }
body.dark .inbox-chat, body.dark .inbox-tabs, body.dark .inbox-composer textarea { background: #0c1322; border-color: #263348; }
body.dark .inbox-msg.out .inbox-bubble { background: #1e3a5f; }
body.dark .inbox-item, body.dark .inbox-list, body.dark .inbox-list-head { border-color: #263348; }
body.dark .inbox-item.active { background: #1e2d42; }
body.dark .inbox-tab.active { background: #162032; }

@media (max-width: 900px) {
  .inbox { grid-template-columns: 1fr; }
  .inbox.has-active .inbox-list { display: none; }
  .inbox:not(.has-active) .inbox-chat { display: none; }
}
.inbox-back { display: none; }
@media (max-width: 900px) { .inbox-back { display: flex; } }

/* ── Configuración → Inbox (canales) ─────────────── */
.settings-menu-item svg { flex-shrink: 0; opacity: .85; }
.ch-card { margin-bottom: 16px; }
.ch-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ch-icon {
  width: 36px; height: 36px; border-radius: 10px; color: #fff; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.ch-icon-server { background: linear-gradient(135deg, #0b4aa8, #083b8a); }
.ch-title { flex: 1; min-width: 180px; }
.ch-sub { font-size: .75rem; color: var(--text-muted); margin-top: 2px; }
.ch-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px;
  font-size: .72rem; font-weight: 700; white-space: nowrap;
}
.ch-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.ch-pill-ok    { background: var(--success-light); color: var(--success); }
.ch-pill-bad   { background: var(--danger-light);  color: var(--danger); }
.ch-pill-muted { background: var(--bg);            color: var(--text-muted); }
.ch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 16px; }
.ch-copy { margin-bottom: 14px; }
.ch-copy label { display: block; font-size: .78rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.ch-copy-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ch-copy-row code, .ch-kv code {
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 5px 9px;
  font-size: .78rem; overflow-wrap: anywhere;
}
.ch-copy-row code { flex: 1; min-width: 200px; }
.ch-kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; font-size: .82rem; margin: 6px 0 14px; align-items: center; }
.ch-kv > span { color: var(--text-muted); }
.ch-kv > b { font-weight: 600; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ch-kv code { padding: 2px 7px; font-size: .74rem; }
.ch-steps { padding-left: 20px; font-size: .83rem; line-height: 1.7; color: var(--text-secondary); margin-bottom: 12px; }
.ch-steps code { font-size: .76rem; background: var(--bg); padding: 1px 5px; border-radius: 4px; }
.ch-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ch-actions a.btn { text-decoration: none; }
.ch-test-result:empty { display: none; }
.ch-test-result { margin-top: 12px; padding: 9px 12px; border-radius: var(--radius); font-size: .8rem; background: var(--bg); color: var(--text-secondary); }
.ch-test-result.ok  { background: var(--success-light); color: var(--success); }
.ch-test-result.bad { background: var(--danger-light);  color: var(--danger); }
.ch-label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.ch-label-row label { margin: 0; }
.ch-code {
  background: #0f172a; color: #e2e8f0; border-radius: var(--radius); padding: 12px 14px; font-size: .76rem;
  line-height: 1.6; overflow-x: auto; white-space: pre; margin: 0;
}
.ch-agent { padding: 6px 0; border-bottom: 1px solid var(--border); font-size: .85rem; }
@media (max-width: 640px) { .ch-kv { grid-template-columns: 1fr; gap: 2px; } .ch-kv > b { margin-bottom: 8px; } }
body.dark .ch-copy-row code, body.dark .ch-kv code, body.dark .ch-steps code, body.dark .ch-test-result { background: #0c1322; border-color: #263348; }
body.dark .ch-pill-muted { background: #1e2d42; }

/* ── Asistente IA en la bandeja ──────────────────── */
.inbox-item-ai { font-size: .7rem; margin-top: 3px; color: var(--secondary); font-weight: 600; }
.inbox-item-ai.order { color: var(--success); }
.inbox-item-ai.bot { color: var(--text-muted); font-weight: 500; }
.inbox-msg.out.bot .inbox-bubble { background: #ede9fe; }
.inbox-msg.out.bot .inbox-author { color: var(--secondary); }
.inbox-ai-toggle.on { border-color: var(--secondary); color: var(--secondary); }
.inbox-ai-banner {
  margin: 0 16px 8px; padding: 9px 12px; border-radius: var(--radius); font-size: .8rem;
  background: #ede9fe; color: #4c1d95; display: flex; flex-direction: column; gap: 2px;
}
.inbox-ai-banner.order { background: var(--success-light); color: #14532d; }
.inbox-ai-banner-actions { margin-top: 6px; }
body.dark .inbox-msg.out.bot .inbox-bubble { background: #2e1f5e; }
body.dark .inbox-ai-banner { background: #2e1f5e; color: #ddd6fe; }
body.dark .inbox-ai-banner.order { background: #14351f; color: #bbf7d0; }
.ch-checks { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: .83rem; }
.ch-check { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; font-weight: 500; }
.ch-switch { display: flex; align-items: flex-start; gap: 8px; font-size: .86rem; cursor: pointer; line-height: 1.4; }
.ch-switch input { margin-top: 3px; }
.ch-time { width: auto; padding: 5px 8px; }
