* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f4f5fb;
  color: #1e293b;
  line-height: 1.5;
}
a { color: #4f46e5; }
code { font-family: 'Consolas','Monaco',monospace; }

.sd-wrap { max-width: 1200px; margin: 0 auto; padding: 24px 20px 60px; }
.sd-wrap.sd-wide { max-width: 1400px; }

/* ── Header ── */
.sd-header {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px;
  padding: 14px 20px; background: #fff; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.08);
  margin-bottom: 20px;
}
.sd-header-logo { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.sd-logo-icon { font-size: 24px; }
.sd-header-logo strong { display: block; font-size: 14px; font-weight: 700; color: #4f46e5; }
.sd-header-logo span { font-size: 11px; color: #94a3b8; }
.sd-nav { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.sd-nav-link {
  text-decoration: none; padding: 7px 12px; border-radius: 8px; font-size: 12.5px; font-weight: 600;
  color: #64748b; transition: all .15s; white-space: nowrap;
}
.sd-nav-link:hover  { background: #f1f5f9; color: #1e293b; }
.sd-nav-link.active { background: #eef2ff; color: #4f46e5; }

/* ── Panels / cards ── */
.sd-panel { background: #fff; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.08); margin-bottom: 18px; overflow: hidden; }
.sd-panel-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 14px 20px; border-bottom: 1px solid #f1f5f9; }
.sd-panel-header h2 { margin: 0; font-size: 14px; font-weight: 700; }
.sd-panel-body { padding: 18px 20px; }

/* ── KPI row ── */
.sd-kpi-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 18px; }
@media (max-width: 900px) { .sd-kpi-row { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 520px) { .sd-kpi-row { grid-template-columns: 1fr; } }
.sd-kpi { background: #fff; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.08); padding: 16px; }
.sd-kpi-lbl { font-size: 10.5px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: .05em; }
.sd-kpi-val { font-size: 26px; font-weight: 800; color: #0f172a; margin-top: 6px; letter-spacing: -.02em; }
.sd-kpi-sub { font-size: 11.5px; color: #94a3b8; margin-top: 4px; }

/* ── Period selector ── */
.sd-period-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.sd-pbtn {
  text-decoration: none; padding: 6px 16px; border-radius: 20px; font-size: 12.5px; font-weight: 600;
  color: #64748b; background: #fff; border: 1px solid #e2e8f0;
}
.sd-pbtn.active { background: #4f46e5; color: #fff; border-color: #4f46e5; }
.sd-sync-btn {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  background: #4f46e5; color: #fff; border: none; border-radius: 8px; padding: 8px 16px;
  font-size: 13px; font-weight: 700; cursor: pointer;
}
.sd-sync-btn:hover { background: #4338ca; }

/* ── Site cards grid ── */
.sd-sites-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 14px; }
.sd-site-card { background: #fff; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.08); padding: 16px; border-left: 4px solid #4f46e5; text-decoration: none; color: inherit; display: block; }
.sd-site-card.sd-site-error { border-left-color: #ef4444; }
.sd-site-card.sd-site-never { border-left-color: #cbd5e1; }
.sd-site-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.sd-site-name { font-weight: 700; font-size: 14px; color: #1e293b; }
.sd-site-domain { font-size: 11px; color: #94a3b8; text-decoration: none; word-break: break-all; }
.sd-site-domain:hover { color: #4f46e5; }
.sd-status-pill { font-size: 10px; font-weight: 700; padding: 2px 9px; border-radius: 20px; white-space: nowrap; }
.sd-status-ok    { background: #f0fdf4; color: #15803d; }
.sd-status-error { background: #fef2f2; color: #b91c1c; }
.sd-status-never  { background: #f1f5f9; color: #64748b; }
.sd-site-stats { display: flex; gap: 18px; margin: 10px 0; }
.sd-site-stat-val { font-size: 20px; font-weight: 800; color: #0f172a; line-height: 1; }
.sd-site-stat-lbl { font-size: 10px; color: #94a3b8; text-transform: uppercase; letter-spacing: .04em; margin-top: 3px; }
.sd-site-meta { font-size: 11.5px; color: #94a3b8; border-top: 1px solid #f1f5f9; padding-top: 8px; margin-top: 8px; }
.sd-site-error-msg { font-size: 11.5px; color: #b91c1c; background: #fef2f2; border-radius: 6px; padding: 6px 9px; margin-top: 8px; }

/* ── Tables ── */
.sd-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sd-table th { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: #94a3b8; font-weight: 700; padding: 8px 20px; border-bottom: 1px solid #f1f5f9; text-align: left; background: #fafafa; }
.sd-table td { padding: 10px 20px; border-bottom: 1px solid #f8fafc; vertical-align: middle; }
.sd-table tr:last-child td { border-bottom: none; }
.sd-table tr:hover td { background: #fafbff; }
.sd-tc { text-align: right; }

/* ── Forms / buttons ── */
.sd-input, .sd-select { width: 100%; padding: 9px 12px; border: 1.5px solid #e2e8f0; border-radius: 8px; font-size: 13.5px; color: #1e293b; background: #fff; }
.sd-input:focus, .sd-select:focus { outline: none; border-color: #4f46e5; }
.sd-field { margin-bottom: 14px; }
.sd-field label { display: block; font-size: 12.5px; font-weight: 700; color: #475569; margin-bottom: 5px; }
.sd-field .sd-hint { font-size: 11.5px; color: #94a3b8; margin: 6px 0 0; }
.sd-hint { font-size: 11.5px; color: #94a3b8; }
.sd-btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: 8px; font-size: 13.5px; font-weight: 700; text-decoration: none; border: none; cursor: pointer; }
.sd-btn-primary { background: #4f46e5; color: #fff; }
.sd-btn-primary:hover { background: #4338ca; }
.sd-btn-secondary { background: #f1f5f9; color: #1e293b; }
.sd-btn-secondary:hover { background: #e2e8f0; }
.sd-btn-danger { background: #fef2f2; color: #dc2626; border: 1px solid #fca5a5; }
.sd-btn-danger:hover { background: #fee2e2; }
.sd-btn-ghost { background: transparent; border: 1.5px solid #e2e8f0; color: #475569; }
.sd-btn-ghost:hover { border-color: #94a3b8; color: #1e293b; }
.sd-btn-block { width: 100%; justify-content: center; }
.sd-btn[disabled] { opacity: .5; cursor: not-allowed; }

.sd-notice { padding: 12px 18px; border-radius: 8px; margin-bottom: 18px; font-size: 13.5px; font-weight: 500; }
.sd-notice-success { background: #f0fdf4; border: 1px solid #86efac; color: #15803d; }
.sd-notice-error   { background: #fef2f2; border: 1px solid #fca5a5; color: #b91c1c; }
.sd-notice-info    { background: #eff6ff; border: 1px solid #93c5fd; color: #1d4ed8; }

.sd-toggle-pill { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 20px; }
.sd-toggle-on  { background: #f0fdf4; color: #15803d; }
.sd-toggle-off { background: #f1f5f9; color: #94a3b8; }

.sd-badge { font-size: 10.5px; font-weight: 700; padding: 3px 10px; border-radius: 20px; display: inline-block; }
.sd-badge-indigo { background: #eef2ff; color: #4f46e5; }
.sd-badge-green  { background: #f0fdf4; color: #15803d; }
.sd-badge-amber  { background: #fffbeb; color: #b45309; }
.sd-badge-red    { background: #fef2f2; color: #b91c1c; }
.sd-badge-gray   { background: #f1f5f9; color: #64748b; }

.sd-empty { text-align: center; padding: 50px 20px; color: #94a3b8; }
.sd-chart-wrap { padding: 4px; height: 280px; position: relative; }
.sd-chart-wrap canvas { width: 100% !important; height: 100% !important; }
.sd-chart-wrap.sd-chart-tall { height: 360px; }
.sd-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sd-grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
@media (max-width: 900px) { .sd-grid-2, .sd-grid-3 { grid-template-columns: 1fr; } }

.sd-footer { text-align: center; font-size: 11.5px; color: #94a3b8; margin-top: 30px; }

/* ── Auth pages ── */
.sd-auth-wrap { max-width: 400px; margin: 60px auto; }
.sd-auth-card { background: #fff; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,.08); padding: 30px; }
.sd-auth-card h1 { font-size: 18px; margin: 0 0 4px; text-align: center; }
.sd-auth-card p.sd-auth-sub { text-align: center; color: #94a3b8; font-size: 12.5px; margin: 0 0 20px; }
.sd-auth-links { text-align: center; font-size: 12.5px; color: #94a3b8; margin-top: 16px; }

/* ── Quota bar ── */
.sd-quota { background: #fff; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.08); padding: 16px 20px; margin-bottom: 18px; }
.sd-quota-top { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; font-weight: 700; color: #475569; margin-bottom: 8px; }
.sd-quota-track { height: 8px; background: #f1f5f9; border-radius: 20px; overflow: hidden; }
.sd-quota-fill { height: 100%; background: linear-gradient(90deg,#4f46e5,#7c6df2); border-radius: 20px; }
.sd-quota-fill.sd-quota-full { background: linear-gradient(90deg,#f59e0b,#ef4444); }

/* ── Pricing / checkout ── */
.sd-pricing-row { display: grid; grid-template-columns: repeat(2,1fr); gap: 18px; margin: 20px 0; }
@media (max-width: 700px) { .sd-pricing-row { grid-template-columns: 1fr; } }
.sd-pricing-card { background: #fff; border-radius: 12px; border: 2px solid #e2e8f0; padding: 22px; cursor: pointer; transition: all .15s; position: relative; }
.sd-pricing-card:hover { border-color: #c7d2fe; }
.sd-pricing-card.selected { border-color: #4f46e5; box-shadow: 0 0 0 3px #eef2ff; }
.sd-pricing-card input { position: absolute; top: 18px; right: 18px; }
.sd-pricing-card .sd-pc-label { font-weight: 700; font-size: 14px; }
.sd-pricing-card .sd-pc-price { font-size: 28px; font-weight: 800; margin: 8px 0 2px; color: #0f172a; }
.sd-pricing-card .sd-pc-price small { font-size: 13px; font-weight: 600; color: #94a3b8; }
.sd-pricing-card .sd-pc-save { font-size: 11.5px; color: #15803d; font-weight: 700; }
.sd-stepper-qty { display: flex; align-items: center; gap: 10px; }
.sd-stepper-qty button { width: 34px; height: 34px; border-radius: 8px; border: 1.5px solid #e2e8f0; background: #fff; font-size: 16px; font-weight: 700; cursor: pointer; }
.sd-stepper-qty span { font-size: 18px; font-weight: 800; min-width: 28px; text-align: center; }
.sd-checkout-summary { background: #fafbff; border: 1px solid #eef2ff; border-radius: 10px; padding: 16px; font-size: 13px; }
.sd-checkout-summary .row { display: flex; justify-content: space-between; padding: 6px 0; }
.sd-checkout-summary .row.total { border-top: 1px solid #e2e8f0; margin-top: 6px; padding-top: 10px; font-weight: 800; font-size: 15px; }
.sd-coupon-row { display: flex; gap: 8px; }
.sd-coupon-row input { flex: 1; }

/* ── Landing page ── */
.sd-hero { text-align: center; padding: 64px 20px 40px; }
.sd-hero h1 { font-size: 38px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 16px; }
.sd-hero p { font-size: 16px; color: #64748b; max-width: 560px; margin: 0 auto 28px; }
.sd-hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.sd-features { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; margin: 50px 0; }
@media (max-width: 800px) { .sd-features { grid-template-columns: 1fr; } }
.sd-feature { background: #fff; border-radius: 12px; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.sd-feature .sd-feature-icon { font-size: 26px; margin-bottom: 10px; }
.sd-feature h3 { margin: 0 0 6px; font-size: 15px; }
.sd-feature p { margin: 0; font-size: 13px; color: #64748b; }
.sd-section-title { text-align: center; font-size: 24px; font-weight: 800; margin: 50px 0 8px; }
.sd-section-sub { text-align: center; color: #94a3b8; font-size: 13.5px; margin-bottom: 28px; }

/* ── Step guide ── */
.sd-steps { counter-reset: sdstep; }
.sd-step { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid #f1f5f9; }
.sd-step:last-child { border-bottom: none; }
.sd-step-num { counter-increment: sdstep; flex: none; width: 28px; height: 28px; border-radius: 50%; background: #eef2ff; color: #4f46e5; font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.sd-step-body h4 { margin: 0 0 4px; font-size: 13.5px; }
.sd-step-body p { margin: 0; font-size: 12.5px; color: #64748b; }
.sd-step-body code { background: #f1f5f9; padding: 1px 6px; border-radius: 4px; font-size: 12px; }

/* ── Installer ── */
.sd-install-wrap { max-width: 640px; margin: 40px auto; }
.sd-install-card { background: #fff; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,.08); padding: 34px; }
.sd-install-progress { display: flex; gap: 6px; margin-bottom: 26px; }
.sd-install-progress span { flex: 1; height: 5px; border-radius: 20px; background: #e2e8f0; }
.sd-install-progress span.done { background: #4f46e5; }
.sd-req-list { list-style: none; padding: 0; margin: 0 0 20px; }
.sd-req-list li { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid #f1f5f9; font-size: 13.5px; }
.sd-req-ok { color: #15803d; font-weight: 700; }
.sd-req-fail { color: #b91c1c; font-weight: 700; }

/* ── Admin sidebar-free layout helper ── */
.sd-muted { color: #94a3b8; }
.sd-mono { font-family: Consolas,Monaco,monospace; }
