@import url('https://fonts.googleapis.com/css2?family=Fraunces:wght@400;500;600;700;800&family=Figtree:wght@400;500;600;700&display=swap');

:root {
  /* Fraunces (a warm serif with real optical character) carries headings;
     Figtree (a clean humanist sans) carries body copy and UI chrome. The
     previous pairing - Plus Jakarta Sans + Inter - is exactly the
     "ubiquitous geometric-sans-for-everything" combination that makes AI
     and template-built apps look interchangeable; splitting display and
     body into two genuinely different type classes is the fix. */
  --font-display: 'Fraunces', 'Georgia', serif;
  --font-sans: 'Figtree', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --violet-50: #f5f3ff;
  --violet-100: #ede9fe;
  --violet-200: #ddd6fe;
  --violet-300: #c4b5fd;
  --violet-500: #8b5cf6;
  --violet-600: #7c3aed;
  --violet-700: #6d28d9;
  --violet-900: #4c1d95;
  --purple-600: #9333ea;
  --magenta-500: #d946ef;
  --magenta-600: #c026d3;

  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --radius-2xl: 1rem;

  --shadow-sm: 0 1px 2px rgba(124, 58, 237, 0.06);
  --shadow: 0 4px 12px rgba(124, 58, 237, 0.08);
  --shadow-lg: 0 12px 30px rgba(124, 58, 237, 0.14);
  --shadow-glow: 0 0 24px rgba(124, 58, 237, 0.22);

  --bg-body: #f8f7ff;
  --bg-card: #ffffff;
  --bg-elevated: #ffffff;
  --bg-input: #ffffff;
  --bg-overlay: rgba(15, 10, 26, 0.55);
  --text-main: #1e1633;
  --text-muted: #6b6680;
  --text-sub: #4a4463;
  --border: #e2dcff;
  --border-focus: #c4b5fd;
  --accent: #7c3aed;
  --accent-hover: #6d28d9;
  --accent-soft: #f5f3ff;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #1e40af;
}

html.dark {
  color-scheme: dark;
  --bg-body: #0f0a1a;
  --bg-card: #1c1530;
  --bg-elevated: #231b3d;
  --bg-input: #130e24;
  --bg-overlay: rgba(0, 0, 0, 0.72);
  --text-main: #f5f3ff;
  --text-muted: #a89bc4;
  --text-sub: #d8d2f0;
  --border: #382e5a;
  --border-focus: #7c3aed;
  --accent: #8b5cf6;
  --accent-hover: #a78bfa;
  --accent-soft: #2d2149;
  --info: #60a5fa;
}

@media (min-width: 640px) {
  :root { --radius-2xl: 1.5rem; }
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg-body);
  color: var(--text-main);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.2s ease, color 0.2s ease;
}

body.scalio-container,
.scalio-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.scalio-main {
  flex: 1 1 auto;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

@media (min-width: 640px) {
  .scalio-main { padding: 1.5rem; }
}

@media (min-width: 1024px) {
  .scalio-main { padding: 2rem; }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.75rem;
}

p { margin: 0 0 0.75rem; color: var(--text-sub); }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover { color: var(--accent-hover); }

/* Inputs, selects, textareas */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="search"],
select,
textarea {
  width: 100% !important;
  padding: 0.75rem 1rem !important;
  background: var(--bg-input) !important;
  color: var(--text-main) !important;
  border: 1.5px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  font-family: inherit !important;
  font-size: 1rem !important;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: var(--shadow-sm);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18) !important;
}

input:read-only,
input[readonly] {
  background: var(--violet-50);
  color: var(--text-muted);
}
html.dark input:read-only,
html.dark input[readonly] {
  background: var(--accent-soft);
}

/* Buttons */
button,
.scalio-btn,
a.scalio-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.75rem 1.25rem !important;
  border: none !important;
  border-radius: var(--radius-lg) !important;
  font-family: inherit;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  background: linear-gradient(135deg, var(--violet-600), var(--purple-600)) !important;
  color: #fff !important;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, box-shadow 0.15s ease, filter 0.15s ease;
  text-decoration: none;
}

button:hover,
.scalio-btn:hover,
a.scalio-btn:hover {
  filter: brightness(1.08);
  box-shadow: var(--shadow-lg);
}

button:active,
.scalio-btn:active { transform: translateY(1px); }

button:disabled,
.scalio-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

button.secondary,
.scalio-btn.secondary {
  background: var(--bg-elevated) !important;
  color: var(--text-main) !important;
  border: 1.5px solid var(--border) !important;
}
button.secondary:hover,
.scalio-btn.secondary:hover { background: var(--violet-50) !important; }
html.dark button.secondary:hover,
html.dark .scalio-btn.secondary:hover { background: var(--accent-soft) !important; }

/* Theme toggle */
#themeToggle {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 9999;
  width: auto;
  padding: 0.55rem 1rem;
  border-radius: 9999px;
  background: var(--bg-elevated);
  color: var(--text-main);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 0.85rem;
  font-weight: 700;
}

#themeToggle::before {
  content: '';
  display: inline-block;
  width: 0.85rem;
  height: 0.85rem;
  margin-right: 0.4rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--violet-500), var(--magenta-500));
  vertical-align: middle;
}

/* Cards */
.scalio-card,
section,
#dashboard .scalio-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin: 0 0 1.25rem;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

@media (min-width: 640px) {
  .scalio-card,
  section { padding: 1.75rem; }
}

section h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 1rem;
  color: var(--text-main);
}

/* Header bar */
.scalio-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

html.dark .scalio-header {
  background: rgba(28, 21, 48, 0.88);
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  padding: 0.75rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  color: var(--text-sub);
}

th {
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.75rem;
}

tr:last-child td { border-bottom: none; }

/* Overlays + Modals */
.modal-overlay,
#loginOverlay,
#paywallModal,
#issueTokensModal,
#confirmModal {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

#loginOverlay { display: flex; }
.modal-overlay { display: none; }
.modal-overlay.active { display: flex; }
#paywallModal { display: none; }

.modal-box,
#loginOverlay > div,
#paywallModal > div,
#issueTokensModal > div,
#confirmModal > div {
  background: var(--bg-card) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-2xl) !important;
  box-shadow: var(--shadow-glow) !important;
  padding: 1.5rem !important;
  width: 100% !important;
  max-width: 440px !important;
}

/* Bottom nav */
.scalio-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 0.5rem 0 0.75rem;
  box-shadow: 0 -4px 16px rgba(124, 58, 237, 0.08);
}

html.dark .scalio-bottom-nav {
  background: rgba(28, 21, 48, 0.94);
}

.scalio-bottom-nav a,
.scalio-bottom-nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  background: transparent;
  color: var(--text-muted);
  border: none;
  box-shadow: none;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.scalio-bottom-nav a::before,
.scalio-bottom-nav button::before {
  content: '';
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 0.35rem;
  background: linear-gradient(135deg, var(--violet-500), var(--magenta-500));
  opacity: 0.65;
}

body:has(.scalio-bottom-nav),
.scalio-container:has(.scalio-bottom-nav) {
  padding-bottom: 4.5rem;
}

@media (min-width: 1024px) {
  .scalio-bottom-nav { display: none; }
  body:has(.scalio-bottom-nav),
  .scalio-container:has(.scalio-bottom-nav) { padding-bottom: 1rem; }
}

/* Login steps */
#loginStep1, #loginStep2 { margin-top: 1rem; }
#loginStep2 { display: none; }

/* Portal specifics */
#businessName {
  font-size: 1.65rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--violet-600), var(--magenta-500));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#serialNumber {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.8rem;
  margin-top: 0.35rem;
}

#walletBadge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  background: linear-gradient(135deg, var(--violet-600), var(--magenta-500));
  color: #fff;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: var(--shadow);
}

#walletExpiry {
  display: inline-block;
  margin-left: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

#metricsGrid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 520px) {
  #metricsGrid { grid-template-columns: repeat(2, 1fr); }
}

#metricsGrid > div {
  background: var(--bg-elevated) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-2xl) !important;
  padding: 1.25rem !important;
  text-align: center !important;
  box-shadow: var(--shadow-sm) !important;
}

#scanCount,
#reviewCount {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--violet-600), var(--purple-600));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0.5rem 0;
}

#reviewCount { background-image: linear-gradient(135deg, var(--success), #34d399); }

#walletSection,
#competitorSection,
#smartRepliesSection,
#feedbackSection,
#locationDropdown + section,
#dashboard > section {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-2xl) !important;
  padding: 1.25rem !important;
  margin: 1rem 0 !important;
  box-shadow: var(--shadow) !important;
}

#lowBalanceWarning {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  color: #b45309;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-lg);
  margin: 0.5rem 0 1rem;
}

html.dark #lowBalanceWarning {
  background: #3b2a05;
  border-color: #d97706;
  color: #fbbf24;
}

#walletLedger tr td,
#walletLedger tr th { border-bottom-color: var(--border); }

#feedbackList,
#insightsList {
  list-style: none;
  padding: 0;
  margin: 0;
}

#feedbackList > li,
#insightsList > li,
#reviewsList > div,
#reviewsList > p,
#leaderboardContainer > div > div,
#leaderboardContainer > p,
#feedbackList > p {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin: 0 0 0.75rem;
  color: var(--text-sub);
}

#insightsList > li:only-child,
#feedbackList > li:only-child,
#feedbackList > p:only-child,
#reviewsList > p:only-child { text-align: center; font-style: italic; color: var(--text-muted); }

#reviewsList > div button,
#leaderboardContainer button,
#reviewsList button {
  margin-top: 0.75rem;
  padding: 0.55rem 0.9rem;
  font-size: 0.85rem;
}

#reviewsList textarea,
#reviewsList > div textarea {
  width: 100%;
  margin-top: 0.75rem;
  resize: vertical;
  min-height: 5rem;
}

/* Register */
#step1, #step2, #step3 {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: 1.5rem;
  margin: 1rem 0;
  box-shadow: var(--shadow);
}

#otpBanner {
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.9rem 1rem;
  color: var(--text-sub);
  font-size: 0.9rem;
}

#duplicateBanner {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  border-radius: var(--radius-lg);
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

html.dark #duplicateBanner {
  background: #3b0f0f;
  border-color: #991b1b;
  color: #fca5a5;
}

/* Danger-soft callouts (admin "needs attention" cards/rows) */
.rm-danger-card {
  border-color: #fecaca;
  background: #fff5f5;
}
.rm-danger-card .rm-stat-label { color: #991b1b; }

.rm-danger-row {
  border: 1.5px solid #fecaca;
  background: #fff5f5;
}

html.dark .rm-danger-card,
html.dark .rm-danger-row {
  background: #3b0f0f;
  border-color: #991b1b;
}
html.dark .rm-danger-card .rm-stat-label { color: #fca5a5; }

/* Admin */
#adminCommandCenter,
.admin-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  margin-top: 1rem;
}

#globalModules,
.accordion-item,
#ownersAccordion > div,
#modules- + div,
#globalModules .feature-toggle,
.features-section {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin-bottom: 0.75rem;
}

#globalModules { display: grid; grid-template-columns: 1fr; gap: 0.75rem; }
@media (min-width: 520px) { #globalModules { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); } }

#searchInput { margin-bottom: 1rem; }

.accordion-header {
  background: var(--accent-soft);
  color: var(--text-main);
  border-radius: var(--radius-lg);
  padding: 1rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
}

.accordion-header.active { background: var(--violet-100); color: var(--violet-900); }
html.dark .accordion-header.active { background: var(--violet-900); color: var(--violet-100); }

.accordion-arrow { transition: transform 0.2s ease; color: var(--text-muted); }
.accordion-arrow.active { transform: rotate(180deg); }

.accordion-content { display: none; padding: 0.5rem; }
.accordion-content.active { display: block; }

.owner-badge,
.status-active,
.status-suspended,
.clientCount {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.clientCount { background: var(--accent-soft); color: var(--accent); }
.status-active { background: #d1fae5; color: #065f46; }
.status-suspended { background: #fee2e2; color: #991b1b; }
html.dark .status-active { background: #064e3b; color: #6ee7b7; }
html.dark .status-suspended { background: #3b0f0f; color: #fca5a5; }

.feature-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1rem;
}

.feature-switch {
  position: relative;
  width: 46px;
  height: 24px;
  background: var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.feature-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.feature-switch.active {
  background: linear-gradient(135deg, var(--violet-600), var(--magenta-500));
}
.feature-switch.active::after { transform: translateX(22px); }

/* Landing */
.scalio-hero {
  position: relative;
  padding: 5rem 1rem 4rem;
  text-align: center;
  overflow: hidden;
  background: radial-gradient(ellipse at top, var(--violet-100), transparent 60%),
              linear-gradient(180deg, var(--violet-50) 0%, var(--bg-body) 60%);
}

html.dark .scalio-hero {
  background: radial-gradient(ellipse at top, var(--violet-900), transparent 60%),
              linear-gradient(180deg, #1a1033 0%, var(--bg-body) 60%);
}

.scalio-hero::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 28rem;
  height: 28rem;
  background: linear-gradient(135deg, var(--violet-500), var(--magenta-500));
  filter: blur(80px);
  opacity: 0.28;
  border-radius: 50%;
}

.scalio-hero h1 {
  font-size: clamp(2rem, 6vw, 3.25rem);
  font-weight: 800;
  line-height: 1.1;
  max-width: 22ch;
  margin: 0 auto 1rem;
}

.scalio-hero p {
  max-width: 56ch;
  margin: 0 auto 1.5rem;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.scalio-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.9rem;
  border-radius: 9999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.8rem;
  margin-bottom: 1rem;
}

.scalio-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.scalio-hero-actions a {
  padding: 0.9rem 1.5rem;
  border-radius: var(--radius-lg);
  font-weight: 700;
}

.scalio-hero-actions a:first-child {
  background: linear-gradient(135deg, var(--violet-600), var(--magenta-500));
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.scalio-hero-actions a:last-child {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1.5px solid var(--border);
}

.scalio-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

html.dark .scalio-nav { background: rgba(28, 21, 48, 0.9); }

.scalio-nav a.brand {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text-main);
}

.scalio-nav a.brand span {
  background: linear-gradient(135deg, var(--violet-600), var(--magenta-500));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.scalio-nav-links { display: flex; gap: 0.75rem; }

.scalio-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

@media (min-width: 640px) {
  .scalio-grid { grid-template-columns: repeat(2, 1fr); padding: 2.5rem 1.5rem; }
}

@media (min-width: 1024px) {
  .scalio-grid { grid-template-columns: repeat(3, 1fr); padding: 3rem 2rem; }
}

.scalio-card-feature {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: 1.75rem;
  box-shadow: var(--shadow);
}

.scalio-card-feature .icon {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--violet-600), var(--magenta-500));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.scalio-section-title {
  text-align: center;
  padding: 2.5rem 1rem 0;
}

.scalio-pricing-card {
  max-width: 380px;
  margin: 1.5rem auto 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.scalio-pricing-card .price {
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--text-main);
}

.scalio-pricing-card ul {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0;
  text-align: left;
}

.scalio-pricing-card li {
  padding: 0.4rem 0;
  color: var(--text-sub);
}

.scalio-pricing-card li span {
  color: var(--success);
  font-weight: 700;
  margin-right: 0.4rem;
}

.scalio-footer {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  padding: 2.5rem 1rem 1.5rem;
  margin-top: 2rem;
}

.scalio-footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

@media (min-width: 640px) {
  .scalio-footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}

.scalio-footer h4 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1rem;
}

.modal-actions button,
.modal-actions a {
  flex: 1 1 auto;
  min-width: 90px;
  padding: 0.7rem 1.2rem !important;
  border-radius: var(--radius-lg) !important;
  font-weight: 700 !important;
}

.modal-confirm,
.modal-actions .modal-confirm,
.modal-actions button:last-child {
  background: linear-gradient(135deg, var(--violet-600), var(--magenta-500)) !important;
  color: #fff !important;
}

.modal-cancel,
.modal-actions .modal-cancel,
.modal-actions button:first-child {
  background: var(--bg-elevated) !important;
  color: var(--text-main) !important;
  border: 1.5px solid var(--border) !important;
}

/* App shell: hamburger + side navigation drawer (mobile overlay / desktop persistent rail) */
.rm-hamburger {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--bg-card) !important;
  border: 1.5px solid var(--border) !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-sub) !important;
  cursor: pointer;
  padding: 0 !important;
  box-shadow: none !important;
  flex: 0 0 auto;
}

.rm-scrim {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: 55;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.rm-scrim.open { opacity: 1; pointer-events: auto; }

.rm-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  max-width: 82vw;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  box-shadow: 12px 0 32px rgba(15, 10, 26, 0.18);
  z-index: 60;
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  transform: translateX(-100%);
  transition: transform 0.25s ease, background 0.2s ease, border-color 0.2s ease;
}
.rm-drawer.open { transform: translateX(0); }

.rm-drawer-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 0 4px;
}

.rm-brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--violet-600), var(--magenta-500));
  flex: 0 0 auto;
}

.rm-drawer-close {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted) !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  cursor: pointer;
  padding: 0 !important;
}

.rm-shop-switcher {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  margin-bottom: 16px;
  gap: 8px;
}

.rm-nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
  overflow-y: auto;
}

.rm-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px !important;
  border-radius: var(--radius-md) !important;
  color: var(--text-sub) !important;
  font-weight: 600 !important;
  font-size: 0.88rem !important;
  text-decoration: none;
  cursor: pointer;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  width: 100%;
  text-align: left;
}
.rm-nav-item:hover { background: var(--accent-soft) !important; }
.rm-nav-item .rm-nav-label { display: flex; align-items: center; gap: 12px; }
.rm-nav-item svg { flex: 0 0 auto; color: var(--text-muted); }
.rm-nav-item.active { background: var(--accent-soft) !important; color: var(--accent-hover) !important; }
.rm-nav-item.active svg { color: var(--accent); }

.rm-nav-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rm-drawer-footer {
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 6px;
}

@media (min-width: 1024px) {
  .rm-scrim { display: none !important; }
  .rm-hamburger { display: none !important; }
  .rm-drawer {
    top: 56px;
    transform: none !important;
    box-shadow: none;
    z-index: 35;
  }
  .rm-drawer-close { display: none !important; }
  .rm-main-shifted { margin-left: 280px; width: calc(100% - 280px); }
}

/* Utilities */
.text-center { text-align: center; }
.mb-0 { margin-bottom: 0; }
.hidden { display: none !important; }

/* ---- Toast + confirm/prompt dialog (public/js/ui-feedback.js) ----
   Replaces window.alert()/confirm()/prompt(): those block the whole tab,
   give no visual distinction between a success and a failure, and a bare
   confirm() gives a destructive action no context about what's being
   destroyed. These are built from the app's own tokens so they read as
   part of the product instead of an OS interruption. */
.rm-toast-stack {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: min(380px, calc(100vw - 2rem));
  pointer-events: none;
}

@media (max-width: 640px) {
  .rm-toast-stack { top: auto; bottom: 1rem; right: 1rem; left: 1rem; max-width: none; }
}

.rm-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  background: var(--bg-elevated);
  color: var(--text-main);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  line-height: 1.4;
  animation: rm-toast-in 0.22s ease;
}

.rm-toast.rm-toast-leaving { animation: rm-toast-out 0.18s ease forwards; }

@keyframes rm-toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes rm-toast-out { to { opacity: 0; transform: translateY(-8px); } }

@media (prefers-reduced-motion: reduce) {
  .rm-toast, .rm-toast.rm-toast-leaving { animation: none; }
}

.rm-toast-icon {
  flex-shrink: 0;
  width: 1.3rem;
  height: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 800;
  color: #fff;
  margin-top: 0.05rem;
}
.rm-toast-success .rm-toast-icon { background: var(--success); }
.rm-toast-error .rm-toast-icon { background: var(--danger); }
.rm-toast-warning .rm-toast-icon { background: var(--warning); }
.rm-toast-info .rm-toast-icon { background: var(--info); }

.rm-toast-message { flex: 1 1 auto; word-break: break-word; align-self: center; }

.rm-toast-close {
  flex-shrink: 0;
  background: none !important;
  border: none !important;
  padding: 0 !important;
  box-shadow: none !important;
  color: var(--text-muted) !important;
  font-size: 1.2rem !important;
  line-height: 1 !important;
  cursor: pointer;
}

.rm-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: var(--bg-overlay);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: rm-dialog-fade-in 0.15s ease;
}

@keyframes rm-dialog-fade-in { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .rm-dialog-overlay { animation: none; }
}

.rm-dialog-box {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-glow);
  padding: 1.5rem;
  width: 100%;
  max-width: 420px;
}

.rm-dialog-title { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; margin: 0 0 0.5rem; }
.rm-dialog-message { color: var(--text-sub); margin: 0 0 1rem; font-size: 0.95rem; line-height: 1.5; white-space: pre-line; }

.rm-dialog-input {
  width: 100% !important;
  padding: 0.75rem 1rem !important;
  background: var(--bg-input) !important;
  color: var(--text-main) !important;
  border: 1.5px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  font-family: inherit !important;
  font-size: 1rem !important;
  outline: none;
  margin-bottom: 1rem;
  box-sizing: border-box;
}
.rm-dialog-input:focus { border-color: var(--accent) !important; box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18) !important; }

.rm-dialog-actions { display: flex; gap: 0.75rem; justify-content: flex-end; flex-wrap: wrap; }
.rm-dialog-actions button { flex: 0 0 auto; min-width: 90px; }

.rm-dialog-cancel { background: var(--bg-elevated) !important; color: var(--text-main) !important; border: 1.5px solid var(--border) !important; }
.rm-dialog-confirm { background: linear-gradient(135deg, var(--violet-600), var(--purple-600)) !important; color: #fff !important; }
.rm-dialog-confirm.rm-dialog-danger { background: linear-gradient(135deg, #ef4444, #dc2626) !important; }
