@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@300;400;500&display=swap');

:root {
  /* Slate Blue — primary palette */
  --blue-900: #1E3A5F;
  --blue-800: #1E40AF;
  --blue-700: #1D4ED8;
  --blue-600: #2563EB;
  --blue-500: #3B82F6;
  --blue-400: #60A5FA;
  --blue-200: #BFDBFE;
  --blue-100: #DBEAFE;
  --blue-50:  #EFF6FF;

  /* Neutrals */
  --gray-900: #0F172A;
  --gray-700: #334155;
  --gray-500: #64748B;
  --gray-400: #94A3B8;
  --gray-200: #E2E8F0;
  --gray-100: #F1F5F9;
  --gray-50:  #F8FAFC;
  --white:    #FFFFFF;

  /* Semantic */
  --success:  #059669;
  --warning:  #D97706;
  --danger:   #DC2626;

  /* Business category themes */
  --cat-restaurant-bg: #FFF7ED; --cat-restaurant-accent: #EA580C; --cat-restaurant-dark: #C2410C;
  --cat-salon-bg: #FDF4FF;      --cat-salon-accent: #9333EA;      --cat-salon-dark: #7E22CE;
  --cat-gym-bg: #F0FDF4;        --cat-gym-accent: #16A34A;        --cat-gym-dark: #166534;
  --cat-coaching-bg: #EFF6FF;   --cat-coaching-accent: #2563EB;   --cat-coaching-dark: #1E3A8A;
  --cat-realestate-bg: #FFFBEB; --cat-realestate-accent: #D97706; --cat-realestate-dark: #92400E;
  --cat-hotel-bg: #FFF1F2;      --cat-hotel-accent: #E11D48;      --cat-hotel-dark: #9F1239;
  --cat-clinic-bg: #ECFDF5;     --cat-clinic-accent: #059669;     --cat-clinic-dark: #064E3B;
  --cat-retail-bg: #F0F9FF;     --cat-retail-accent: #0284C7;     --cat-retail-dark: #075985;
  --cat-other-bg: #F8FAFC;      --cat-other-accent: #475569;      --cat-other-dark: #1E293B;

  /* Layout */
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow:    0 1px 3px rgba(0,0,0,.07), 0 4px 12px rgba(0,0,0,.04);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.10);
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: -.3px;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: 'Inter', sans-serif; font-size: 14px; }
.hidden { display: none !important; }
img { max-width: 100%; height: auto; }

/* ── TOPBAR ── */
.topbar {
  position: sticky; top: 0; z-index: 300;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 60px;
  box-shadow: var(--shadow-sm);
  gap: 12px;
}
.topbar-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px; font-weight: 700;
  color: var(--blue-800); letter-spacing: -.5px;
}
.topbar-logo span { color: var(--blue-500); }
.topbar-nav { display: flex; gap: 2px; }
.tnav-btn {
  padding: 7px 16px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500; cursor: pointer;
  border: none; background: transparent; color: var(--gray-500);
  transition: all .15s;
}
.tnav-btn:hover { background: var(--gray-100); color: var(--gray-900); }
.tnav-btn.active { background: var(--blue-50); color: var(--blue-700); font-weight: 600; }
.topbar-badge {
  background: var(--blue-600); color: var(--white);
  font-size: 12px; font-weight: 600;
  padding: 5px 14px; border-radius: 20px;
}

/* ── VIEWS ── */
.view { display: none; }
.view.active { display: block; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 11px 22px; border-radius: var(--radius);
  font-size: 14px; font-weight: 600; cursor: pointer;
  border: none; transition: all .15s; white-space: nowrap;
  font-family: 'Inter', sans-serif;
}
.btn-primary { background: var(--blue-600); color: var(--white); }
.btn-primary:hover { background: var(--blue-700); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.btn-secondary { background: var(--white); color: var(--gray-700); border: 1px solid var(--gray-200); }
.btn-secondary:hover { background: var(--gray-50); border-color: var(--gray-400); }
.btn-ghost { background: transparent; color: var(--blue-600); border: 1px solid var(--blue-200); }
.btn-ghost:hover { background: var(--blue-50); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-full { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 15px; }

/* ── CARDS ── */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }

/* ── FORM ELEMENTS ── */
.frow { margin-bottom: 16px; }
.frow label {
  display: block; font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--gray-500); margin-bottom: 6px;
}
.frow input, .frow select, .frow textarea {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--gray-200); border-radius: var(--radius);
  background: var(--white); color: var(--gray-900);
  transition: all .15s; outline: none;
}
.frow input:focus, .frow select:focus, .frow textarea:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
.frow textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
.fg2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.fg3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ── ALERTS ── */
.alert { padding: 14px 18px; border-radius: var(--radius); font-size: 13px; margin-bottom: 16px; display: none; line-height: 1.6; }
.alert.show { display: block; }
.alert-success { background: #ECFDF5; border: 1px solid #6EE7B7; color: #065F46; }
.alert-error   { background: #FEF2F2; border: 1px solid #FECACA; color: #991B1B; }
.alert-info    { background: var(--blue-50); border: 1px solid var(--blue-200); color: var(--blue-800); }

/* ── AI LOADING BAR ── */
.ai-bar {
  display: none; align-items: center; gap: 12px;
  background: var(--blue-50); border: 1px solid var(--blue-200);
  border-radius: var(--radius); padding: 13px 16px;
  font-size: 13px; color: var(--blue-700); margin: 12px 0;
}
.ai-bar.show { display: flex; }
.spinner {
  width: 18px; height: 18px; flex-shrink: 0;
  border: 2.5px solid var(--blue-200);
  border-top-color: var(--blue-600);
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── PILLS ── */
.pill { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.pill-blue   { background: var(--blue-50);  color: var(--blue-700); }
.pill-green  { background: #ECFDF5; color: #065F46; }
.pill-amber  { background: #FFFBEB; color: #92400E; }
.pill-gray   { background: var(--gray-100); color: var(--gray-500); }
.pill-red    { background: #FEF2F2; color: #991B1B; }

/* ── STATS CARDS ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow-sm); }
.stat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--gray-500); margin-bottom: 6px; }
.stat-val { font-size: 28px; font-weight: 700; font-family: 'Space Grotesk', sans-serif; color: var(--gray-900); line-height: 1; }
.stat-val.blue { color: var(--blue-700); }
.stat-sub { font-size: 11px; color: var(--gray-500); margin-top: 4px; }

/* ── TABS ── */
.tab-bar { display: flex; border-bottom: 1.5px solid var(--gray-200); margin-bottom: 24px; gap: 0; }
.tab-btn {
  padding: 10px 18px; font-size: 13px; font-weight: 500; cursor: pointer;
  border: none; background: transparent; color: var(--gray-500);
  border-bottom: 2.5px solid transparent; margin-bottom: -1.5px;
  transition: all .15s; font-family: 'Inter', sans-serif;
}
.tab-btn:hover { color: var(--gray-900); }
.tab-btn.active { color: var(--blue-700); border-bottom-color: var(--blue-600); font-weight: 600; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── TABLE ── */
.tbl-wrap { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { padding: 11px 16px; text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--gray-500); background: var(--gray-50); border-bottom: 1px solid var(--gray-200); }
.tbl td { padding: 13px 16px; border-bottom: 1px solid var(--gray-100); color: var(--gray-700); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: var(--gray-50); }

/* ── TOGGLE ── */
.toggle-wrap { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); margin-bottom: 10px; }
.toggle-icon { width: 38px; height: 38px; border-radius: var(--radius); background: var(--blue-50); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; color: var(--blue-600); }
.toggle-label { font-size: 13px; font-weight: 600; color: var(--gray-900); }
.toggle-sub { font-size: 11px; color: var(--gray-500); margin-top: 2px; }
.toggle-switch { width: 42px; height: 24px; border-radius: 12px; background: var(--blue-600); position: relative; cursor: pointer; flex-shrink: 0; transition: background .2s; }
.toggle-switch::after { content: ''; width: 18px; height: 18px; border-radius: 50%; background: var(--white); position: absolute; top: 3px; right: 3px; transition: right .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.toggle-switch.off { background: var(--gray-200); }
.toggle-switch.off::after { right: auto; left: 3px; }

/* ── CHART ── */
.mini-chart { display: flex; align-items: flex-end; gap: 6px; height: 80px; padding: 0 4px; }
.mc-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.mc-bar { width: 100%; background: var(--blue-500); border-radius: 4px 4px 0 0; transition: height .4s ease; min-height: 4px; }
.mc-bar:hover { background: var(--blue-700); }
.mc-label { font-size: 10px; color: var(--gray-400); }

/* ── STAMP SYSTEM ── */
.stamps-row { display: flex; gap: 6px; flex-wrap: wrap; }
.stamp { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; border: 2px solid var(--gray-200); background: var(--white); transition: all .2s; }
.stamp.filled { background: var(--blue-600); border-color: var(--blue-600); color: var(--white); }

/* ── LOGO UPLOAD ── */
.logo-upload { border: 2px dashed var(--gray-200); border-radius: var(--radius-lg); padding: 24px 16px; text-align: center; cursor: pointer; transition: all .2s; background: var(--gray-50); }
.logo-upload:hover { border-color: var(--blue-400); background: var(--blue-50); }
.logo-upload input[type="file"] {
  width: 100%; max-width: 260px; margin: 0 auto 10px; display: block;
  font-size: 12px; color: var(--gray-500);
}
.logo-preview { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 3px solid var(--blue-200); margin: 0 auto 10px; display: none; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 3px; }

/* ── SECTION LABEL ── */
.section-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--gray-400); margin-bottom: 14px; }

/* ── RESPONSIVE ── */
@media (max-width: 720px) {
  .topbar { padding: 0 14px; height: 54px; }
  .topbar-logo { font-size: 17px; }
  .topbar-nav {
    position: fixed; top: 54px; left: 0; right: 0; bottom: 0;
    background: var(--white); z-index: 250;
    display: none; flex-direction: column; gap: 2px;
    padding: 12px; overflow-y: auto;
  }
  .topbar-nav.open { display: flex; }
  .tnav-btn { width: 100%; text-align: left; padding: 13px 16px; font-size: 15px; border-radius: var(--radius); }
  .topbar-badge { font-size: 11px; padding: 4px 10px; }
  .mobile-menu-btn { display: flex !important; }

  .fg2, .fg3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .card { padding: 18px; }

  h1 { font-size: 26px !important; }
  h2 { font-size: 21px !important; }

  .tab-bar { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; }
  .tab-btn { white-space: nowrap; padding: 9px 12px; font-size: 12px; }

  .tbl-wrap { overflow-x: auto; }
  .tbl { min-width: 480px; }

  #pricing-modal > div { padding: 22px; }
  #pricing-modal [style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr 1fr; gap: 8px; }
}

@media (max-width: 420px) {
  .stats-grid { grid-template-columns: 1fr; }
  .topbar-badge { display: none; }
}

.mobile-menu-btn {
  display: none; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: var(--radius);
  border: 1px solid var(--gray-200); background: var(--white);
  cursor: pointer; font-size: 18px; color: var(--gray-700);
}
