/* ============================================================
   DAC StoreIntel — admin.css  v2 (modernized)
   Tokens, DM Sans, warm palette. All class names preserved.
   ============================================================ */

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

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

:root {
  --bg: #f7f5f2;
  --surface: #ffffff;
  --surface-2: #faf9f7;
  --border: #ebe6e0;
  --border-2: #f0ebe5;
  --ink: #1a1410;
  --ink-2: #4a3f35;
  --ink-3: #8c7f74;
  --ink-4: #b5a99f;
  --green: #006b4f;
  --green-bg: #ecfaf5;
  --green-border: #a7dfd0;
  --amber: #7c5100;
  --amber-bg: #fff8ec;
  --amber-border: #f5d68a;
  --red: #9b1c1c;
  --red-bg: #fff1f2;
  --red-border: #fecdd3;
  --blue: #1e40af;
  --blue-bg: #eff6ff;
  --blue-border: #bfdbfe;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --shadow-sm: 0 1px 2px rgba(26, 20, 16, 0.06);
  --shadow: 0 2px 8px rgba(26, 20, 16, 0.08), 0 0 0 1px rgba(26, 20, 16, 0.04);
  --shadow-md:
    0 4px 16px rgba(26, 20, 16, 0.1), 0 0 0 1px rgba(26, 20, 16, 0.04);
  --shadow-lg:
    0 8px 32px rgba(26, 20, 16, 0.12), 0 0 0 1px rgba(26, 20, 16, 0.04);
  --transition: 0.15s ease;
}

body {
  margin: 0;
  padding: 0;
  font-family:
    "DM Sans",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: var(--bg);
  font-size: 15px;
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.app-container,
.si-container {
  padding: 20px 24px 40px;
  max-width: 1480px;
  margin: 0 auto;
}

/* ── Brand header ───────────────────────────────────────── */
.brand-header {
  background: linear-gradient(
    135deg,
    #1a0e2e 0%,
    #321748 45%,
    #6b1f4a 80%,
    #9f2b68 100%
  );
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  padding: 22px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(50, 23, 72, 0.25);
}
.brand-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      ellipse 50% 80% at 85% 50%,
      rgba(159, 43, 104, 0.3) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse 30% 60% at 10% 20%,
      rgba(255, 255, 255, 0.04) 0%,
      transparent 60%
    );
  pointer-events: none;
}
.brand-header-logo img {
  height: 48px;
  width: auto;
  display: block;
}
.brand-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
}
.brand-header-right {
  text-align: right;
  position: relative;
}
.brand-header-right h1 {
  margin: 0 0 2px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.brand-header-right p {
  margin: 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 400;
}
.brand-header-icon {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  backdrop-filter: blur(8px);
}

.page-width {
  max-width: 1429px;
  margin-inline: auto;
}
/* ── Buttons ─────────────────────────────────────────────── */
.button,
.si-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: all var(--transition);
  font-family: inherit;
  white-space: nowrap;
  line-height: 1;
  letter-spacing: -0.01em;
}
.button-primary,
.si-btn-primary {
  background: var(--si-accent, #9f2b68);
  color: #fff;
  border-color: var(--si-accent, #9f2b68);
  box-shadow:
    0 1px 4px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.button-primary:hover,
.si-btn-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.button-primary:active,
.si-btn-primary:active {
  transform: translateY(0);
  filter: brightness(0.96);
}
.button-primary:disabled,
.si-btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
a.button-secondary,
.button-secondary,
.si-btn-secondary {
  background: var(--surface);
  color: var(--ink-2);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
a.button-secondary:hover,
.button-secondary:hover,
.si-btn-secondary:hover {
  background: var(--surface-2);
  border-color: #d5cec8;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.button-danger,
.si-btn-danger {
  background: var(--surface);
  color: var(--red);
  border-color: var(--red-border);
}
.button-danger:hover,
.si-btn-danger:hover {
  background: var(--red-bg);
}
.button-small,
.si-btn-sm {
  padding: 6px 13px;
  font-size: 14px;
}
.si-btn-lg {
  padding: 12px 24px;
  font-size: 15px;
}
.si-link-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: var(--si-accent);
  font-size: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-family: inherit;
}
.si-link-btn:hover {
  opacity: 0.75;
}
.button-group,
.si-btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* ── Navigation ──────────────────────────────────────────── */
.si-nav {
  display: flex;
  justify-content: center;
  align-items: stretch;
  margin-bottom: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 0 8px;
  /* Allow height to grow when items wrap to a second row */
  flex-wrap: wrap;
}
.si-nav::-webkit-scrollbar {
  display: none;
}
/* Inner wrapper — wraps groups onto new rows when needed */
.nav-inner {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex: 1;
  min-width: 0;
}
.nav-group {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px 14px;
  gap: 4px;
  flex-shrink: 0;
}
.nav-group-label {
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-4);
  white-space: nowrap;
  padding: 0 2px;
  line-height: 1;
  margin-bottom: 2px;
}
.nav-group-links {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 2px;
  flex-wrap: nowrap;
}
/* Vertical pipe divider — centred between groups, hidden when wrapping */
.nav-divider {
  width: 1px;
  background: var(--border);
  margin: 10px 4px;
  align-self: stretch;
  flex-shrink: 0;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
  transition: all var(--transition);
  letter-spacing: -0.01em;
}
.nav-link:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.nav-link.active {
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--border);
  font-weight: 600;
}
.nav-icon {
  font-size: 14px;
}

/* ── Responsive nav ─────────────────────────────────────────────────────────── */
/* nav-compact: tighten padding + smaller text when nav width < 700px */
.nav-compact .nav-group {
  padding: 6px 8px;
}
.nav-compact .nav-link {
  padding: 6px 8px;
  font-size: 13px;
  gap: 4px;
}
.nav-compact .nav-group-label {
  font-size: 10px;
}
.nav-compact .nav-divider {
  display: none;
}

/* nav-tight: hide section labels, keep link text — still wraps */
.nav-tight .nav-group {
  padding: 6px 6px;
}
.nav-tight .nav-link {
  padding: 6px 8px;
  font-size: 13px;
}
.nav-tight .nav-group-label {
  display: none;
}
.nav-tight .nav-divider {
  display: none;
}

/* header-compact: hide text labels in the header action buttons */
.header-compact .nav-link-label {
  display: none;
}
.tab-btn,
.settings-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-3);
  text-decoration: none;
  white-space: nowrap;
  transition: all var(--transition);
  font-family: inherit;
  letter-spacing: -0.01em;
}
.tab-btn:hover,
.settings-tab-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.tab-btn.active,
.settings-tab-btn.active {
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--border);
  font-weight: 600;
}

.si-card,
.editor-section,
.card,
.admin-card,
.status-card,
.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
  /* Prevent card from collapsing in flex/grid context */
  min-width: 0;
  box-sizing: border-box;
}
.si-card:hover {
  box-shadow: var(--shadow);
}
.admin-card,
.settings-card {
  padding: 24px;
}
.si-card-title,
.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
}
.si-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}
.si-card-subtitle,
.card-desc {
  font-size: 14px;
  color: var(--ink-3);
  margin: -10px 0 16px;
  line-height: 1.5;
}
.si-card-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.si-card-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.si-collapse-toggle {
  background: none;
  border: none;
  padding: 2px 4px;
  cursor: pointer;
  color: var(--ink-3);
  font-size: 14px;
  line-height: 1;
  border-radius: 4px;
  transition:
    background var(--transition),
    color var(--transition);
  flex-shrink: 0;
}
.si-collapse-toggle:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.si-collapse-chevron {
  display: inline-block;
  transition: transform 0.22s ease;
  font-style: normal;
}
.si-card--collapsed .si-collapse-chevron {
  transform: rotate(-90deg);
}
.si-card-body {
  overflow: hidden;
  transition:
    max-height 0.28s ease,
    opacity 0.22s ease;
  max-height: 4000px;
  opacity: 1;
  padding: 1rem;
}
.si-card--collapsed .si-card-body {
  max-height: 0 !important;
  opacity: 0;
}
.si-card--collapsed {
  margin-bottom: 8px;
}
.si-card--collapsed .si-card-header {
  margin-bottom: 0;
}
.si-collapse-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 12px;
}
.si-collapse-toolbar button {
  font-size: 14px;
  padding: 5px 12px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  font-weight: 500;
  transition: background var(--transition);
  font-family: inherit;
}
.si-collapse-toolbar button:hover {
  background: var(--surface-2);
}
.tab-panel,
.si-tab-panel {
  display: none;
  padding-top: 1.5rem;
}
.tab-panel.active,
.si-tab-panel.active {
  display: block;
}
.si-card-header-left .si-card-title,
.si-card-header-left .card-title {
  margin: 0;
}

/* ── Metric tiles ─────────────────────────────────────────── */
.si-metrics-grid,
.stat-grid,
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.si-metric-tile,
.stat-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition:
    box-shadow var(--transition),
    transform var(--transition);
  position: relative;
  min-width: 0; /* allow shrinking in grid */
}
.si-metric-tile::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--border);
  transition: background var(--transition);
}
.si-metric-tile:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.si-metric-tile.highlight,
.stat-tile.highlight {
  background: linear-gradient(135deg, #fdf4f9 0%, #fff8fb 100%);
  border-color: #e8c2d8;
}
.si-metric-tile.highlight::before {
  background: var(--si-accent, #9f2b68);
}
.si-metric-val,
.stat-tile .val {
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -0.03em;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}
.si-metric-tile.highlight .si-metric-val,
.stat-tile.highlight .val {
  color: var(--si-accent, #9f2b68);
}
.si-metric-lbl,
.stat-tile .lbl {
  font-size: 12px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  line-height: 1.3;
}

/* ── Forms ───────────────────────────────────────────────── */
.si-form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.si-form-row.two-col {
  grid-template-columns: 1fr 1fr;
}
.si-form-row.three-col {
  grid-template-columns: 1fr 1fr 1fr;
}
.si-form-group,
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.si-label,
.form-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  display: block;
  letter-spacing: -0.01em;
}
.si-required {
  color: var(--red);
  margin-left: 3px;
}
.si-label-hint {
  font-size: 14px;
  color: var(--ink-3);
  font-weight: 400;
  margin-left: 6px;
}
.si-input,
.si-select,
.si-textarea,
.form-input {
  width: 100%;
  padding: 9px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface);
  outline: none;
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
  line-height: 1.5;
}
.si-input:focus,
.si-select:focus,
.si-textarea:focus,
.form-input:focus {
  border-color: var(--si-accent, #9f2b68);
  box-shadow: 0 0 0 3px rgba(159, 43, 104, 0.12);
}
.si-input::placeholder {
  color: var(--ink-4);
}
.si-textarea,
.form-textarea {
  resize: vertical;
  min-height: 90px;
}
.si-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238c7f74' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}
.si-hint,
.form-hint {
  font-size: 14px;
  color: var(--ink-3);
  margin-top: 2px;
  line-height: 1.4;
}
.si-required-star {
  color: var(--red);
}
.si-tag-input-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 7px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  min-height: 42px;
  cursor: text;
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}
.si-tag-input-wrap:focus-within {
  border-color: var(--si-accent, #9f2b68);
  box-shadow: 0 0 0 3px rgba(159, 43, 104, 0.12);
}
.si-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f3ecff;
  color: var(--si-accent, #9f2b68);
  border: 1px solid #d4b8e8;
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 14px;
  font-weight: 500;
}
.si-tag-pill button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: inherit;
  font-size: 14px;
  line-height: 1;
  opacity: 0.6;
}
.si-tag-pill button:hover {
  opacity: 1;
}
@keyframes si-pill-dupe-flash {
  0% {
    background: #fde8e8;
    border-color: #e57373;
    color: #c62828;
  }
  50% {
    background: #ffcdd2;
    border-color: #c62828;
    color: #c62828;
  }
  100% {
    background: #f3ecff;
    border-color: #d4b8e8;
    color: var(--si-accent, #9f2b68);
  }
}
.si-tag-pill-dupe {
  animation: si-pill-dupe-flash 0.4s ease 0s 3;
}
.si-tag-input-field {
  border: none;
  outline: none;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  flex: 1;
  min-width: 100px;
  background: transparent;
  padding: 2px 0;
}

/* ── Badges ──────────────────────────────────────────────── */
.si-badge,
.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.si-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.si-badge-draft {
  background: var(--surface-2);
  color: var(--ink-3);
  border: 1px solid var(--border);
}
.si-badge-draft::before {
  background: var(--ink-4);
}
.si-badge-scheduled {
  background: var(--amber-bg);
  color: var(--amber);
  border: 1px solid var(--amber-border);
}
.si-badge-scheduled::before {
  background: #f0a500;
  animation: si-pulse 2s infinite;
}
.si-badge-live {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid var(--green-border);
}
.si-badge-live::before {
  background: var(--green);
  animation: si-pulse 1.5s infinite;
}
.si-badge-completed {
  background: #efefef;
  color: #adadad;
  border: 1px solid #d3d3d3;
}
.si-badge-completed::before {
  background: #bcc0bf;
}
.si-badge-cancelled {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid var(--red-border);
}
.si-badge-cancelled::before {
  background: var(--red);
}
@keyframes si-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.4);
  }
}

/* Required / optional / connected integration badges */
.req-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.req-badge-required {
  background: #fff0f3;
  color: #9b1c1c;
  border: 1px solid #fecdd3;
}
.req-badge-optional {
  background: var(--surface-2);
  color: var(--ink-3);
  border: 1px solid var(--border);
}
.req-badge-connected {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid var(--green-border);
}

/* ── Tables ──────────────────────────────────────────────── */
/* Tables inside cards always stretch full width regardless of flex/grid context */
.si-card > table,
.si-card > .si-table,
.si-card > div > table,
.si-card > div > .si-table {
  width: 100%;
  min-width: 100%;
  box-sizing: border-box;
}

.si-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  width: 100%;
  box-sizing: border-box;
}
.si-table,
table {
  width: 100%;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.si-table th,
th {
  text-align: left;
  color: var(--ink-3);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 14px;
  border-bottom: 1.5px solid var(--border);
  background: var(--surface-2);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.si-table td,
td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-2);
  color: var(--ink);
  vertical-align: middle;
  line-height: 1.4;
}
.si-table tr:last-child td,
tr:last-child td {
  border-bottom: none;
}
.si-table tr:hover td,
tr:hover td {
  background: var(--surface-2);
}

/* ── Empty state ─────────────────────────────────────────── */
.si-empty,
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-3);
}
.si-empty-icon,
.empty-state .icon {
  font-size: 44px;
  margin-bottom: 14px;
}
.si-empty h3,
.empty-state h3 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
}
.si-empty p,
.empty-state p {
  font-size: 14px;
  margin: 0 0 20px;
  color: var(--ink-3);
}

/* ── Calendar items ──────────────────────────────────────── */
.si-cal-item {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition:
    box-shadow var(--transition),
    transform var(--transition);
}
.si-cal-item:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.si-cal-item.is-live {
  border-color: var(--si-accent, #9f2b68);
  background: #fdf9fb;
}
.si-cal-dates {
  font-size: 14px;
  color: var(--ink-3);
  line-height: 1.5;
}
.si-cal-dates strong {
  font-size: 14px;
  color: var(--ink);
  display: block;
}
.si-cal-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.si-cal-meta {
  font-size: 14px;
  color: var(--ink-3);
  margin-top: 2px;
}

/* ── Info boxes ──────────────────────────────────────────── */
.si-highlight-box {
  background: #f5f0ff;
  border: 1px solid #d4b8e8;
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 16px;
}
.si-highlight-box.warning {
  background: var(--amber-bg);
  border-color: var(--amber-border);
}
.si-highlight-box.info {
  background: var(--blue-bg);
  border-color: var(--blue-border);
}
.si-highlight-box.success {
  background: var(--green-bg);
  border-color: var(--green-border);
}
.si-highlight-box p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

/* Misc helpers */
.si-section-label {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-3);
  margin: 0 0 12px;
}
.si-divider,
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}
.alert-success {
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  color: var(--green);
}
.alert-error {
  background: var(--red-bg);
  border: 1px solid var(--red-border);
  color: var(--red);
}
.alert-warning {
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
  color: var(--amber);
}
.progress-bar-wrap {
  background: var(--border);
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
  margin-bottom: 10px;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--si-accent, #9f2b68), #c94484);
  transition: width 0.4s ease;
  width: 0%;
}
.view-toggle {
  display: flex;
  gap: 4px;
}
.view-toggle button {
  padding: 7px 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  color: var(--ink-2);
  font-family: inherit;
  transition: all var(--transition);
}
.view-toggle button:hover {
  background: var(--surface-2);
}
.view-toggle button.active {
  background: var(--si-accent, #9f2b68);
  color: #fff;
  border-color: var(--si-accent, #9f2b68);
}
.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--si-accent, #9f2b68);
  animation: si-pulse 1.5s infinite;
  margin-right: 5px;
  vertical-align: middle;
}

/* ── Modal ───────────────────────────────────────────────── */
.si-modal-backdrop,
.dac-modal-backdrop,
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 20, 16, 0.5);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(2px);
}
.si-modal,
.dac-modal,
.modal-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  animation: dacModalIn 0.18s ease;
  border: 1px solid var(--border);
}
.si-modal.si-modal-lg {
  max-width: 960px;
}
@keyframes dacModalIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
.si-modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.si-modal-title,
.dac-modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.01em;
}
.si-modal-close {
  background: var(--surface-2);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 16px;
  color: var(--ink-3);
  padding: 4px 8px;
  line-height: 1;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.si-modal-close:hover {
  background: var(--surface);
  color: var(--ink);
}
.si-modal-body {
  padding: 24px;
}
.si-modal-footer,
.dac-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--surface-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ── Toast ───────────────────────────────────────────────── */
.si-toast,
.dac-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--ink);
  color: #fff;
  padding: 11px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  max-width: calc(100vw - 48px);
  text-align: center;
  pointer-events: none;
  border-left: 3px solid transparent;
  white-space: nowrap;
}
.si-toast.show,
.dac-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.si-toast.success,
.dac-toast.success {
  border-left-color: var(--green);
}
.si-toast.error,
.dac-toast.error {
  border-left-color: var(--red);
}
.si-toast.info,
.dac-toast.info {
  border-left-color: #3b82f6;
}

/* ── Spinner ─────────────────────────────────────────────── */
.si-spinner,
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--si-accent, #9f2b68);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.si-loading,
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px;
  color: var(--ink-3);
  font-size: 14px;
}

/* ── Type dots & promo ───────────────────────────────────── */
.type-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}
.type-seasonal {
  background: #1a6b4a;
}
.type-flash {
  background: #e67e22;
}
.type-holiday {
  background: #c0392b;
}
.type-launch {
  background: #8e44ad;
}
.type-winback {
  background: #2980b9;
}
.type-loyalty {
  background: #f39c12;
}
.type-other {
  background: #95a5a6;
}
.promo-stats {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-2);
}
.promo-stat {
  font-size: 14px;
  color: var(--ink-3);
}
.promo-stat strong {
  font-size: 14px;
  color: var(--ink);
}
.cal-month-label {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-3);
  margin: 20px 0 8px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--border);
}
.bundle-row {
  display: grid;
  grid-template-columns: 1fr 1fr 60px auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}
.bundle-row-header {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.logo-preview {
  width: 180px;
  height: 80px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  display: block;
  padding: 8px;
}
.color-swatch {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
}

/* ── Setup checklist ─────────────────────────────────────── */
.setup-step {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  margin: 0 -20px;
  border-bottom: 1px solid var(--border-2);
  transition: background var(--transition);
}
.setup-step:last-child {
  border-bottom: none;
}
.setup-step.done {
  background: #f4fdf8;
}
.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 2px solid var(--border);
  color: var(--ink-3);
  font-size: 14px;
  font-weight: 700;
  transition: all 0.25s;
}
.step-num.done {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  font-size: 15px;
}
.step-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.step-label.done {
  color: var(--ink-3);
  font-weight: 500;
}
.step-hint {
  font-size: 14px;
  color: var(--ink-3);
  margin-top: 2px;
}
.setup-step.done .step-hint {
  color: var(--ink-4);
}

/* ── Quick link cards ────────────────────────────────────── */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.quick-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition:
    box-shadow var(--transition),
    transform var(--transition),
    border-color var(--transition);
}
.quick-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #cfc6bb;
  transform: translateY(-2px);
}
.quick-card-icon {
  font-size: 26px;
}
.quick-card-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.quick-card-desc {
  font-size: 14px;
  color: var(--ink-3);
  line-height: 1.4;
}

/* ── Dashboard grid ──────────────────────────────────────── */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  min-height: 120px;
  position: relative;
  transition:
    box-shadow var(--transition),
    border-color var(--transition);
}
.dash-card.width-quarter {
  grid-column: span 1;
}
.dash-card.width-half {
  grid-column: span 2;
}
.dash-card.width-three-quarter {
  grid-column: span 3;
}
.dash-card.width-full {
  grid-column: span 4;
}
.dash-card.half-width {
  grid-column: span 2;
}
.dash-card.full-width {
  grid-column: span 4;
}
.dash-card:hover {
  box-shadow: var(--shadow);
}
.dash-card.edit-mode {
  border-color: var(--si-accent);
  box-shadow: 0 0 0 2px rgba(159, 43, 104, 0.15);
}
.dash-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px dashed var(--si-accent, #9f2b68);
  border-radius: var(--radius);
  margin-bottom: 12px;
}
.dash-toolbar-label {
  font-size: 14px;
  color: var(--si-accent);
  font-weight: 500;
  flex: 1;
}
.card-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}
.card-type-btn {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 14px;
  cursor: pointer;
  text-align: center;
  transition: all var(--transition);
  background: var(--surface);
}
.card-type-btn:hover {
  border-color: var(--si-accent);
  background: #fdf9fb;
}
.card-type-btn.selected {
  border-color: var(--si-accent);
  background: #f5f0ff;
}
.card-type-icon {
  font-size: 24px;
  margin-bottom: 6px;
}
.card-type-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.card-type-desc {
  font-size: 14px;
  color: var(--ink-3);
  margin-top: 2px;
  line-height: 1.4;
}

/* ── Summary tab ─────────────────────────────────────────── */
.summary-section-label {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--si-accent);
  margin: 0 0 10px;
  padding-bottom: 5px;
  border-bottom: 2px solid var(--si-accent);
  opacity: 0.8;
}
.summary-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 4px;
}
.summary-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: box-shadow var(--transition);
  min-width: 0; /* allow grid item to shrink below content size */
}
.summary-tile:hover {
  box-shadow: var(--shadow);
}
.summary-tile-val {
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
  color: var(--ink);
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}
.summary-tile-lbl {
  font-size: 12px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  line-height: 1.3;
}
.tab-btn-summary.active {
  background: linear-gradient(135deg, #321748, #9f2b68);
  color: #fff;
  border-color: transparent;
}

/* ── Print ───────────────────────────────────────────────── */
.print-header,
.print-footer {
  display: none;
}
@media print {
  .si-card-body {
    max-height: none !important;
    opacity: 1 !important;
  }
  .si-card--collapsed .si-card-body {
    max-height: none !important;
    opacity: 1 !important;
  }
  .si-collapse-toolbar,
  .si-collapse-toggle {
    display: none !important;
  }
}

/* ── AI toggles / radio / checkbox cards ─────────────────── */
.ai-agent-toggle {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}
.ai-agent-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.ai-toggle-track {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  background: #d1d5db;
  border-radius: 999px;
  transition: background 0.2s;
  flex-shrink: 0;
}
.ai-agent-toggle input:checked + .ai-toggle-track {
  background: var(--si-accent);
}
.ai-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}
.ai-agent-toggle input:checked + .ai-toggle-track .ai-toggle-thumb {
  transform: translateX(20px);
}
.si-radio-card {
  display: flex;
  align-items: center;
  cursor: pointer;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
  background: var(--surface);
  transition:
    border-color var(--transition),
    background var(--transition);
  min-width: 110px;
}
.si-radio-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.si-radio-card:has(input:checked) {
  border-color: var(--si-accent);
  background: #fdf4f9;
}
.si-radio-card-inner {
  pointer-events: none;
}
.si-radio-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
}
.si-radio-card-desc {
  font-size: 14px;
  color: var(--ink-3);
  margin-top: 2px;
}
.si-checkbox-card {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  background: var(--surface);
  font-size: 14px;
  color: var(--ink);
  transition:
    border-color var(--transition),
    background var(--transition);
}
.si-checkbox-card input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--si-accent);
  cursor: pointer;
  flex-shrink: 0;
}
.si-checkbox-card:has(input:checked) {
  border-color: var(--si-accent);
  background: #fdf4f9;
}

/* ── Agent carousel ──────────────────────────────────────── */
#agent-carousel-section {
  margin-bottom: 20px;
}
.agent-carousel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.agent-carousel-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 8px;
}
.agent-new-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--si-accent);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 7px;
  min-width: 20px;
}
.agent-carousel-viewport {
  overflow: hidden;
  position: relative;
}
.agent-carousel-track {
  display: flex;
  gap: 14px;
  transition: transform 0.3s ease;
}
.agent-insight-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  min-width: 320px;
  max-width: 520px;
  flex: 0 0 auto;
  box-shadow: var(--shadow-sm);
}
.agent-insight-card.priority-high {
  border-left: 3px solid #ef4444;
}
.agent-insight-card.priority-medium {
  border-left: 3px solid #f59e0b;
}
.agent-insight-card.priority-low {
  border-left: 3px solid #22c55e;
}
.agent-insight-card.is-pinned {
  border-left: 3px solid var(--si-accent);
  background: #fdf4f9;
}
.agent-insight-card.is-question {
  border-left: 3px solid #f59e0b;
  background: #fffbeb;
}
.agent-insight-card.is-question textarea:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.15);
}
.agent-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.agent-card-type-icon {
  font-size: 16px;
  line-height: 1;
}
.agent-card-type-label {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-3);
}
.agent-card-priority-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-left: auto;
  flex-shrink: 0;
}
.agent-card-priority-dot.high {
  background: #ef4444;
}
.agent-card-priority-dot.medium {
  background: #f59e0b;
}
.agent-card-priority-dot.low {
  background: #22c55e;
}
.agent-card-pin-icon {
  font-size: 14px;
  color: var(--si-accent);
  margin-left: 4px;
}
.agent-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 6px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.agent-card-body {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.6;
  margin: 0 0 12px;
}
.agent-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.agent-card-btn {
  font-size: 14px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  transition:
    background var(--transition),
    border-color var(--transition);
  white-space: nowrap;
  font-family: inherit;
}
.agent-card-btn:hover {
  background: var(--surface-2);
  border-color: #d5cec8;
}
.agent-card-btn.dismiss {
  color: var(--ink-3);
}
.agent-card-btn.pin {
  color: var(--si-accent);
  border-color: var(--si-accent);
}
.agent-card-btn.pin:hover {
  background: #fdf4f9;
}
.agent-card-btn.save {
  color: var(--green);
  border-color: var(--green-border);
  background: var(--green-bg);
}
.agent-card-btn.save:hover {
  background: #d6f5ea;
}
.agent-carousel-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
}
.agent-carousel-arrow {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  color: var(--ink-3);
  transition: background var(--transition);
}
.agent-carousel-arrow:hover:not(:disabled) {
  background: var(--surface-2);
}
.agent-carousel-arrow:disabled {
  opacity: 0.35;
  cursor: default;
}
.agent-carousel-dots {
  display: flex;
  gap: 6px;
}
.agent-carousel-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: background var(--transition);
  border: none;
  padding: 0;
}
.agent-carousel-dot.active {
  background: var(--si-accent);
}
.agent-list-popover {
  position: absolute;
  z-index: 500;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 8px;
  min-width: 200px;
  font-size: 14px;
}
.agent-list-popover-item {
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--ink);
  white-space: nowrap;
}
.agent-list-popover-item:hover {
  background: var(--surface-2);
}
.agent-list-popover-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}
.agent-list-new-input {
  display: flex;
  gap: 6px;
  padding: 4px 2px;
}
.agent-list-new-input input {
  flex: 1;
  font-size: 14px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  font-family: inherit;
}
.agent-list-new-input input:focus {
  border-color: var(--si-accent);
}
.agent-list-new-input button {
  font-size: 14px;
  padding: 5px 10px;
  background: var(--si-accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
}

/* ── Digest tabs + full cards ────────────────────────────── */
.digest-page-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}
.digest-page-tab {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-3);
  cursor: pointer;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border: 1px solid transparent;
  border-bottom: none;
  text-decoration: none;
  transition:
    background var(--transition),
    color var(--transition);
  margin-bottom: -1px;
  display: inline-block;
  font-family: inherit;
}
.digest-page-tab.active {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--border);
  border-bottom-color: var(--surface);
}
.digest-page-tab:hover:not(.active) {
  background: var(--surface-2);
  color: var(--ink);
}
.agent-full-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 10px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  transition: box-shadow var(--transition);
}
.agent-full-card:hover {
  box-shadow: var(--shadow);
}
.agent-full-card.priority-high {
  border-left: 3px solid #ef4444;
}
.agent-full-card.priority-medium {
  border-left: 3px solid #f59e0b;
}
.agent-full-card.priority-low {
  border-left: 3px solid #22c55e;
}
.agent-full-card.is-pinned {
  border-left: 3px solid var(--si-accent);
  background: #fdf4f9;
}
.agent-full-card.is-saved {
  opacity: 0.85;
}
.agent-full-card-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}
.agent-full-card-body {
  flex: 1;
  min-width: 0;
}
.agent-full-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  flex-wrap: wrap;
}
.agent-full-card-type {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-3);
}
.agent-full-card-date {
  font-size: 14px;
  color: var(--ink-4);
}
.agent-full-card-list {
  font-size: 14px;
  color: var(--si-accent);
  font-weight: 600;
  background: #fdf4f9;
  padding: 1px 7px;
  border-radius: 999px;
}
.agent-full-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 5px;
  letter-spacing: -0.01em;
}
.agent-full-card-text {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.6;
  margin: 0;
}
.agent-full-card-actions {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.agent-full-btn {
  font-size: 14px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-3);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition);
  font-family: inherit;
}
.agent-full-btn:hover {
  background: var(--surface-2);
}
.agent-full-btn.pin {
  color: var(--si-accent);
  border-color: var(--si-accent);
}
.agent-full-btn.pin:hover {
  background: #fdf4f9;
}
.agent-filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}
.agent-filter-btn {
  font-size: 14px;
  padding: 5px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-3);
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}
.agent-filter-btn.active,
.agent-filter-btn:hover {
  background: var(--si-accent);
  color: #fff;
  border-color: var(--si-accent);
}
.agent-list-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 14px;
  color: var(--ink-2);
  cursor: pointer;
  transition: all var(--transition);
}
.agent-list-chip:hover {
  background: #e9d5ff;
  border-color: #a855f7;
  color: #6b21a8;
}
.agent-list-chip.active {
  background: var(--si-accent);
  color: #fff;
  border-color: var(--si-accent);
}
.agent-list-chip-del {
  opacity: 0.5;
  font-size: 14px;
}
.agent-list-chip-del:hover {
  opacity: 1;
}

/* ── Onboarding components ───────────────────────────────── */
.ob-hero {
  background: linear-gradient(
    135deg,
    #1a0e2e 0%,
    #321748 45%,
    #6b1f4a 80%,
    #9f2b68 100%
  );
  border-radius: var(--radius-xl);
  padding: 40px 48px;
  color: #fff;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(50, 23, 72, 0.25);
}
.ob-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      ellipse 60% 80% at 90% 50%,
      rgba(159, 43, 104, 0.3) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse 30% 50% at 5% 10%,
      rgba(255, 255, 255, 0.04) 0%,
      transparent 60%
    );
  pointer-events: none;
}
.ob-hero-content {
  position: relative;
  max-width: 600px;
}
.ob-hero h1 {
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 700;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.ob-hero p {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.65);
  margin: 0;
  line-height: 1.6;
  font-weight: 300;
}
.ob-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.ob-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition:
    box-shadow var(--transition),
    transform var(--transition);
  position: relative;
  overflow: hidden;
}
.ob-step::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--border);
}
.ob-step.ob-step-done::before {
  background: var(--green);
}
.ob-step.ob-step-active::before {
  background: var(--si-accent, #9f2b68);
}
.ob-step:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.ob-step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
  background: var(--surface-2);
  border: 2px solid var(--border);
  color: var(--ink-3);
}
.ob-step.ob-step-done .ob-step-num {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.ob-step.ob-step-active .ob-step-num {
  background: var(--si-accent, #9f2b68);
  border-color: var(--si-accent, #9f2b68);
  color: #fff;
}
.ob-step-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.ob-step-desc {
  font-size: 14px;
  color: var(--ink-3);
  line-height: 1.5;
}
.ob-step-status {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border-2);
}
.ob-step-status.done {
  color: var(--green);
}
.ob-step-status.active {
  color: var(--si-accent);
}
.ob-step-status.pending {
  color: var(--ink-4);
}

/* ── NProgress bar — themed to accent color ──────────────── */
#nprogress .bar {
  background: var(--si-accent, #9f2b68) !important;
  height: 3px !important;
}
#nprogress .peg {
  box-shadow:
    0 0 10px var(--si-accent, #9f2b68),
    0 0 5px var(--si-accent, #9f2b68) !important;
}

/* ── Skeleton loading screens ────────────────────────────── */
/* Use <div class="si-skeleton"> or <div class="si-skeleton si-skeleton-text"> */
.si-skeleton {
  background: linear-gradient(
    90deg,
    var(--border) 25%,
    var(--border-2) 50%,
    var(--border) 75%
  );
  background-size: 200% 100%;
  animation: si-shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes si-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}
.si-skeleton-text {
  height: 14px;
  margin-bottom: 8px;
  border-radius: 4px;
}
.si-skeleton-text.wide {
  width: 80%;
}
.si-skeleton-text.mid {
  width: 55%;
}
.si-skeleton-text.short {
  width: 35%;
}
.si-skeleton-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 16px;
}
.si-skeleton-tile {
  height: 72px;
  border-radius: var(--radius);
}
.si-skeleton-row {
  height: 38px;
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}

/* ── Button loading state ────────────────────────────────── */
/* Applied automatically by head.php JS when data-loading-text is set */
.si-btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .app-container {
    padding: 12px;
  }
  .brand-header {
    padding: 18px 20px;
    flex-direction: column;
    align-items: flex-start;
  }
  .si-form-row.two-col,
  .si-form-row.three-col {
    grid-template-columns: 1fr;
  }
  .two-col {
    grid-template-columns: 1fr;
  }
  .si-cal-item {
    grid-template-columns: 1fr;
  }
  .si-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dash-grid {
    grid-template-columns: 1fr 1fr;
  }
  .dash-card.width-quarter,
  .dash-card.width-half,
  .dash-card.width-three-quarter,
  .dash-card.width-full,
  .dash-card.half-width,
  .dash-card.full-width {
    grid-column: span 2;
  }
  .ob-hero {
    padding: 28px 24px;
  }
}
@media (max-width: 480px) {
  .dash-grid {
    grid-template-columns: 1fr;
  }
  .dash-card.width-quarter,
  .dash-card.width-half,
  .dash-card.width-three-quarter,
  .dash-card.width-full {
    grid-column: span 1;
  }
}

/* ============================================================
   APP LAYOUT
   Standard sidebar + content website layout.
   No conditional modes — this is always the layout.

   HTML structure every page produces:
     body
       aside.sidebar          (fixed, 220px wide)
       main.si-main           (everything right of sidebar)
         header.topbar        (sticky, 56px)
         div.wrapper          (scrollable page content)
   ============================================================ */

/* ── Reset body for app layout ───────────────────────────────── */
html {
  height: 100%;
  overflow: hidden; /* prevent html-level scrollbar */
}
body {
  height: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  background: var(--bg, #f7f5f2);
  overflow: hidden; /* body doesn't scroll — .si-main does */
  position: relative;
}

/* Hide old Shopify-embedded elements (never used anymore) */
.brand-header,
.si-nav {
  display: none !important;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
:root {
  --sb: 220px; /* sidebar full width */
  --sb-icon: 56px; /* sidebar collapsed width */
  --tb: 56px; /* topbar height */
}

.sidebar {
  width: var(--sb);
  flex-shrink: 0;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  background: #140d24;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  transition:
    width 0.2s ease,
    transform 0.2s ease;
  overflow: hidden;
}
.sidebar.collapsed {
  width: var(--sb-icon);
}

/* ── Sidebar top row ─────────────────────────────────────────── */
.sidebar-top {
  display: flex;
  align-items: center;
  height: var(--tb);
  padding: 0 12px;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  overflow: hidden;
  flex: 1;
  min-width: 0;
}
.sidebar-logo-icon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: linear-gradient(135deg, #9f2b68, #6b1f4a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.sidebar-logo-img {
  width: auto;
  max-width: 100%;
  flex-shrink: 0;
  border-radius: 3px;
  object-fit: contain;
}
.sidebar-logo-text {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.2s;
}
.sidebar.collapsed .sidebar-logo-text {
  opacity: 0;
  pointer-events: none;
}

.sidebar-collapse-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  padding: 5px;
  border-radius: 5px;
  font-size: 12px;
  line-height: 1;
  flex-shrink: 0;
  transition:
    color 0.15s,
    background 0.15s;
}
.sidebar-collapse-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

/* ── Sidebar nav ─────────────────────────────────────────────── */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}
.sidebar-nav::-webkit-scrollbar {
  width: 3px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.nav-section-label {
  padding: 14px 16px 3px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.2);
  white-space: nowrap;
  transition: opacity 0.2s;
}
.sidebar.collapsed .nav-section-label {
  opacity: 0;
}

/* Nav items — both <a> and <button> */
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: calc(100% - 12px);
  margin: 1px 6px;
  padding: 8px 10px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  position: relative;
  transition:
    color 0.15s,
    background 0.15s;
  text-align: left;
}
.nav-item:hover {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.07);
}
.nav-item.active {
  color: #c150c4;
  /*background: linear-gradient(
    135deg,
    rgba(200, 60, 160, 0.22) 0%,
    rgba(140, 40, 180, 0.16) 100%
  );
  box-shadow:
    0 0 0 1px rgba(210, 80, 170, 0.25),
    0 0 12px rgba(200, 60, 160, 0.18),
    inset 0 1px 0 rgba(255, 180, 230, 0.08);
    */
}
.nav-item.active .nav-icon {
  filter: drop-shadow(0 0 5px rgba(230, 100, 200, 0.7));
}
.nav-item.active .nav-label {
  color: #fff;
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, #e060c8 0%, #a040c0 100%);
  box-shadow: 0 0 8px rgba(210, 80, 200, 0.8);
}
.nav-icon {
  font-size: 18px;
  flex-shrink: 0;
  width: 22px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Iconify icons inside nav */
.nav-icon iconify-icon {
  font-size: 18px;
  width: 18px;
  height: 18px;
  display: block;
}
.nav-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.2s;
}
.nav-chevron {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.25);
  transition:
    transform 0.2s,
    opacity 0.2s;
  flex-shrink: 0;
}
.nav-item.open .nav-chevron {
  transform: rotate(90deg);
}

/* Collapsed state */
.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 8px 0;
  margin: 1px 8px;
  width: calc(100% - 16px);
}
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-chevron {
  opacity: 0;
  width: 0;
  pointer-events: none;
}
.sidebar.collapsed .nav-section-label {
  opacity: 0;
}

/* Tooltip when collapsed */
.sidebar.collapsed .nav-item:hover::after {
  content: attr(data-tip);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: #1a1035;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: none;
  z-index: 999;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Sub-menus */
.nav-submenu {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.22s ease;
}
.nav-submenu.open {
  max-height: 300px;
}
.sidebar.collapsed .nav-submenu {
  display: none;
}

.nav-sub-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 38px;
  margin: 1px 6px;
  border-radius: 6px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.38);
  text-decoration: none;
  transition:
    color 0.12s,
    background 0.12s;
  white-space: nowrap;
}
.nav-sub-item:hover {
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.05);
}
.nav-sub-item.active {
  color: #fff;
  font-weight: 600;
  text-shadow: 0 0 10px rgba(230, 100, 200, 0.4);
}
.nav-sub-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
  transition:
    background 0.12s,
    box-shadow 0.12s;
}
.nav-sub-item.active .nav-sub-dot,
.nav-sub-item:hover .nav-sub-dot {
  background: #e060c8;
  box-shadow: 0 0 6px rgba(220, 80, 200, 0.7);
}

/* ── Sidebar user row ────────────────────────────────────────── */
.sidebar-user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: background 0.15s;
}
.sidebar-user-row:hover {
  background: rgba(255, 255, 255, 0.05);
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #9f2b68, #321748);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.user-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  transition: opacity 0.2s;
}
.user-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.user-role {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
}
.user-menu-dots {
  color: rgba(255, 255, 255, 0.25);
  font-size: 12px;
  flex-shrink: 0;
}
.sidebar.collapsed .user-info,
.sidebar.collapsed .user-menu-dots {
  opacity: 0;
  pointer-events: none;
}

/* User dropdown */
.user-dropdown {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 8px;
  background: #1f1535;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 6px;
  min-width: 180px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  z-index: 999;
  display: none;
}
.user-dropdown.open {
  display: block;
}
.user-dropdown a,
.user-dropdown button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  width: 100%;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition:
    background 0.12s,
    color 0.12s;
}
.user-dropdown a:hover,
.user-dropdown button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.user-dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 4px 0;
}

/* ── Main content area ───────────────────────────────────────── */
.si-main {
  margin-left: var(--sb);
  flex: 1;
  min-width: 0;
  min-height: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* wrapper inside handles scrolling */
  transition: margin-left 0.2s ease;
  background: var(--bg, #f7f5f2);
}
body.sb-collapsed .si-main {
  margin-left: var(--sb-icon);
}

/* ── Top bar ─────────────────────────────────────────────────── */
.topbar {
  height: var(--tb);
  background: var(--surface, #fff);
  border-bottom: 1px solid var(--border, #ebe6e0);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  flex-shrink: 0;
  box-shadow: 0 1px 0 var(--border);
}
.topbar-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-2);
  padding: 6px;
  border-radius: 6px;
  font-size: 20px;
  line-height: 1;
}
.topbar-hamburger:hover {
  background: var(--surface-2);
}
.topbar-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Page content wrapper ────────────────────────────────────── */
/* Sole scrolling container. Sidebar and topbar stay fixed.
   Must be full viewport width (no max-width) so mouse scroll works
   anywhere in the gutter — not just over the centred content. */
.wrapper {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 28px 32px 60px;
  box-sizing: border-box;
  width: 100%;
  scrollbar-width: none;
}
.wrapper::-webkit-scrollbar {
  width: 5px;
}
.wrapper::-webkit-scrollbar-thumb {
  background: var(--border, #ebe6e0);
  border-radius: 3px;
}
.wrapper::-webkit-scrollbar-track {
  background: transparent;
}

/* ── Mobile overlay ──────────────────────────────────────────── */
/* Hidden by default always — JS adds/removes display via style attribute */
.si-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 199;
  backdrop-filter: blur(2px);
  pointer-events: none; /* extra safety — can't block clicks when hidden */
}
.si-overlay.active {
  display: block;
  pointer-events: auto;
}

/* Legacy wrappers — neutralize their own padding/max-width
   since .wrapper now handles all spacing */
.wrapper .app-container,
.wrapper .si-container {
  padding: 0 !important;
  max-width: none !important;
  margin: 0 !important;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* 1200px and below — auto-collapse sidebar */
@media (max-width: 1200px) {
  :root {
    --sb: 220px;
  }
  .sidebar {
    width: var(--sb-icon);
  }
  .sidebar .sidebar-logo-text,
  .sidebar .nav-label,
  .sidebar .nav-chevron,
  .sidebar .nav-section-label,
  .sidebar .user-info,
  .sidebar .user-menu-dots {
    opacity: 0;
    pointer-events: none;
  }
  .sidebar .nav-item {
    justify-content: center;
    padding: 8px 0;
    margin: 1px 8px;
    width: calc(100% - 16px);
  }
  .sidebar .nav-submenu {
    display: none;
  }
  .sidebar-collapse-btn {
    display: none;
  }
  .si-main {
    margin-left: var(--sb-icon);
  }
  .wrapper {
    padding: 20px 20px 40px;
  }
}

/* Expand when hovering on medium screens */
@media (min-width: 901px) and (max-width: 1200px) {
  .sidebar:hover {
    width: var(--sb);
  }
  .sidebar:hover .sidebar-logo-text,
  .sidebar:hover .nav-label,
  .sidebar:hover .nav-chevron,
  .sidebar:hover .nav-section-label,
  .sidebar:hover .user-info,
  .sidebar:hover .user-menu-dots {
    opacity: 1;
    pointer-events: auto;
  }
  .sidebar:hover .nav-item {
    justify-content: flex-start;
    padding: 8px 10px;
    margin: 1px 6px;
    width: calc(100% - 12px);
  }
  .sidebar:hover .nav-submenu {
    display: block;
  }
}

/* 900px and below — sidebar off canvas, hamburger appears */
@media (max-width: 900px) {
  .sidebar {
    width: var(--sb) !important;
    transform: translateX(-100%);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .sidebar.mobile-open .sidebar-logo-text,
  .sidebar.mobile-open .nav-label,
  .sidebar.mobile-open .nav-chevron,
  .sidebar.mobile-open .nav-section-label,
  .sidebar.mobile-open .user-info,
  .sidebar.mobile-open .user-menu-dots {
    opacity: 1 !important;
    pointer-events: auto !important;
  }
  .sidebar.mobile-open .nav-item {
    justify-content: flex-start !important;
    padding: 8px 10px !important;
    margin: 1px 6px !important;
    width: calc(100% - 12px) !important;
  }
  .si-main {
    margin-left: 0 !important;
  }
  .topbar-hamburger {
    display: flex !important;
  }
  /* Overlay is hidden by default — JS shows it only when sidebar opens */
  .wrapper {
    padding: 16px 16px 32px;
  }
}

/* 480px — compact mobile */
@media (max-width: 480px) {
  .wrapper {
    padding: 12px 12px 24px;
  }
  .topbar {
    padding: 0 12px;
  }
  .topbar-title {
    font-size: 14px;
  }
  .si-metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .two-col,
  .si-form-row.two-col,
  .si-form-row.three-col {
    grid-template-columns: 1fr !important;
  }
  .tab-btn {
    font-size: 12px;
    padding: 6px 8px;
  }
}

/* Tables scroll horizontally — never break out of wrapper */
.si-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
table {
  width: 100%;
  min-width: 0;
}
.dash-grid {
  overflow: hidden;
}
.si-card {
  overflow: hidden;
  min-width: 0;
}

.sa-panel .si-card {
  overflow: visible;
}

.wrapper {
  overflow-x: hidden;
}

/* ── Table overflow fixes ─────────────────────────────────────── */

/* Any table not inside a si-table-wrap gets scroll protection */
.si-card > table,
.si-card > div > table {
  display: table;
  overflow-x: auto;
  max-width: 100%;
}

/* Dashboard grid cards */
.dash-card {
  overflow: hidden;
  min-width: 0;
}

/* Prevent any element breaking out of wrapper */

.wrapper img {
  height: auto;
}
/* Exception — let tables be wider than parent when wrapped */
.wrapper .si-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}
.wrapper .si-table-wrap table,
.wrapper .si-table-wrap .si-table {
  display: table;
  max-width: none;
  width: 100%;
}
