:root {
  --bg-deep: #0d1117;
  --bg-surface: #161b22;
  --bg-card: #21262d;
  --bg-elevated: #2d333b;
  --border-default: #30363d;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;
  --accent-teal: #3fb9b0;
  --accent-teal-dim: #2d8a84;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(circle at 12% 0%, #2a3044 0%, #161a27 42%, #0f121b 100%);
  color: var(--text-primary);
}

.container {
  max-width: 1600px;
  margin: 20px auto;
  padding: 0 16px 30px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.muted {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

input,
button {
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 8px;
}

input {
  border: 1px solid var(--border-default);
  background: var(--bg-elevated);
  color: var(--text-primary);
}

button {
  border: none;
  background: var(--accent-teal);
  color: var(--bg-deep);
  cursor: pointer;
  font-weight: 600;
}

button:hover {
  background: var(--accent-teal-dim);
}

button.secondary {
  background: #39414c;
  color: var(--text-primary);
}

button.secondary:hover {
  background: #4a5563;
}

button.ghost {
  border: 1px solid var(--border-default);
  background: var(--bg-elevated);
  color: var(--text-primary);
}

button.ghost:hover {
  border-color: var(--accent-teal-dim);
}

pre {
  background: var(--bg-deep);
  border: 1px solid var(--border-default);
  color: #dce4f4;
  padding: 10px;
  border-radius: 8px;
  overflow: auto;
}

.dashboard-shell {
  background: #232634;
  border: 1px solid #363b52;
  border-radius: 18px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 78px 1fr;
  box-shadow: 0 22px 45px rgba(8, 10, 18, 0.45);
  transition: grid-template-columns 0.2s ease;
}

.dashboard-shell.sidebar-expanded {
  grid-template-columns: 250px 1fr;
}

.dashboard-sidebar {
  border-right: 1px solid #3a4158;
  background: linear-gradient(180deg, #1f2231 0%, #191c29 100%);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sidebar-brand {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.08rem;
  font-weight: 700;
  color: #e9edff;
  letter-spacing: -0.3px;
  padding: 4px 8px;
  display: none;
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.sidebar-pin-btn {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #445070;
  background: #252b3d;
  color: #d9e0f4;
  flex: 0 0 auto;
}

.sidebar-pin-btn.active {
  border-color: #7d8dbf;
  background: #313a54;
}

.dashboard-shell.sidebar-expanded .sidebar-brand {
  display: block;
}

.dashboard-shell.sidebar-expanded .sidebar-top {
  justify-content: flex-start;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-nav-group {
  position: relative;
}

.sidebar-nav-item {
  text-align: left;
  width: 52px;
  height: 52px;
  margin: 0 auto;
  border-radius: 10px;
  padding: 10px 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.sidebar-icon {
  width: 20px;
  text-align: center;
  flex: 0 0 20px;
  font-size: 1rem;
}

.sidebar-label {
  display: none;
  white-space: nowrap;
}

.sidebar-caret {
  display: none;
  margin-left: auto;
  opacity: 0.8;
  font-size: 0.8rem;
}

.dashboard-shell.sidebar-expanded .sidebar-label,
.dashboard-shell.sidebar-expanded .sidebar-caret {
  display: inline;
}

.dashboard-shell.sidebar-expanded .sidebar-nav-item {
  width: 100%;
  height: auto;
  margin: 0;
  justify-content: flex-start;
  gap: 10px;
}

.sidebar-nav-item:hover {
  background: #2a3043;
  border-color: #434d6a;
}

.sidebar-nav-item.active {
  background: #2d3550;
  border-color: #616f99;
  color: #f1f4ff;
}

.sidebar-submenu {
  display: none;
  margin-top: 6px;
  padding-left: 40px;
  padding-right: 4px;
  flex-direction: column;
  gap: 6px;
}

.sidebar-submenu-item {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #b8c2de;
  padding: 8px 10px;
  font-size: 0.8rem;
}

.sidebar-submenu-item:hover {
  background: #29324a;
  border-color: #47557a;
}

.sidebar-submenu-item.active {
  background: #354061;
  border-color: #6779aa;
  color: #f0f4ff;
}

.dashboard-shell.sidebar-expanded .sidebar-nav-item.active.has-submenu + .sidebar-submenu {
  display: flex;
}

.dashboard-shell:not(.sidebar-expanded) .sidebar-nav-group:hover .sidebar-submenu {
  display: flex;
  position: absolute;
  left: 100%;
  top: 0;
  min-width: 180px;
  padding: 8px;
  margin-left: 4px;
  border-radius: 10px;
  border: 1px solid #39425f;
  background: #1a1f2e;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  z-index: 20;
}

.dashboard-shell:not(.sidebar-expanded) .sidebar-nav-group:hover::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 100%;
  width: 10px;
  z-index: 21;
}

.dashboard-shell:not(.sidebar-expanded) .sidebar-nav-group:hover .sidebar-submenu::before {
  content: "Analytics";
  color: #96a3c7;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px 6px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 4px 2px;
}

.sidebar-footer button {
  width: 52px;
  height: 52px;
  margin: 0 auto;
  justify-content: center;
  gap: 0;
}

.dashboard-shell.sidebar-expanded .sidebar-footer button {
  width: 100%;
  height: auto;
  margin: 0;
  gap: 8px;
}

.dashboard-main {
  min-width: 0;
}

.dashboard-tab {
  display: none;
}

.dashboard-tab.active {
  display: block;
}

.dashboard-header {
  padding: 20px 24px;
  border-bottom: 1px solid #3a4158;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  background:
    radial-gradient(circle at 20% 10%, rgba(131, 120, 210, 0.3), transparent 46%),
    linear-gradient(150deg, #2b2f43 0%, #232634 100%);
}

.dashboard-title {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.55rem;
  letter-spacing: -0.4px;
}

.dashboard-app-brand {
  margin: 0 0 4px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #9ba8cc;
}

.dashboard-subtitle {
  margin: 4px 0 0;
}

.dashboard-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.icon-btn {
  min-width: 40px;
  padding-left: 10px;
  padding-right: 10px;
  font-size: 1rem;
  line-height: 1;
}

.products-section {
  padding: 22px 24px 28px;
  background: linear-gradient(180deg, #232634 0%, #1f2230 100%);
}

.products-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border-default);
  padding-bottom: 14px;
}

.products-section-title {
  margin: 0;
  font-size: 1.25rem;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.2px;
}

.analytics-subpanel .empty-state,
.account-card h3 {
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.2px;
}

/* Generic data-tooltip — hover to show, positions above the element */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 50%;
  left: calc(100% + 8px);
  transform: translateY(-50%);
  background: #1e2b3a;
  color: #d6e8f8;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  padding: 6px 10px;
  border-radius: 7px;
  border: 1px solid #2d3f52;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  text-transform: none;
  letter-spacing: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 140ms ease;
  z-index: 100;
}

[data-tooltip]:hover::after {
  opacity: 1;
}

[data-tooltip]:focus::after {
  opacity: 1;
}

.live-feed-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #39d98a;
  border: 1px solid rgba(57, 217, 138, 0.3);
  background: rgba(57, 217, 138, 0.08);
  border-radius: 999px;
  padding: 4px 10px;
  margin-right: auto;
}

.live-feed-indicator[hidden] {
  display: none !important;
}

.live-feed-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #39d98a;
  flex-shrink: 0;
  animation: live-pulse 2s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.75); }
}

.products-count {
  background: #1a1e2b;
  border: 1px solid #3b425c;
  border-radius: 8px;
  color: #b2bdd8;
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.loading-inline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.loading-spinner {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(163, 177, 211, 0.45);
  border-top-color: #c8d3f2;
  animation: spin 0.85s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 15px;
  margin-top: 18px;
}

.products-grid.loading {
  position: relative;
}

.product-card {
  --tile-accent: #5b7fae;
  --tile-accent-hover: #4d6d97;
  --tile-accent-soft: rgba(91, 127, 174, 0.14);
  --tile-accent-border: rgba(91, 127, 174, 0.32);
  --tile-accent-hover-border: rgba(91, 127, 174, 0.58);
  background: linear-gradient(180deg, #1a1e2b 0%, #161925 100%);
  border: 1px solid #343a51;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 20px rgba(8, 10, 18, 0.35);
}

.product-card:hover {
  transform: translateY(-3px);
  border-color: var(--tile-accent-hover-border);
  box-shadow: 0 14px 28px rgba(7, 8, 16, 0.52);
}

.product-card.loading-skeleton:hover {
  transform: none;
  border-color: #343a51;
  box-shadow: 0 8px 20px rgba(8, 10, 18, 0.35);
}

.skeleton-block {
  border-radius: 8px;
  background: linear-gradient(90deg, #202637 0%, #2a3248 50%, #202637 100%);
  background-size: 220% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
}

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.skeleton-image {
  width: calc(100% - 12px);
  height: calc(100% - 12px);
}

.skeleton-title {
  height: 12px;
  margin-bottom: 8px;
}

.skeleton-title.short {
  width: 68%;
}

.skeleton-category {
  height: 34px;
  margin-bottom: 8px;
}

.skeleton-price {
  width: 56%;
  height: 20px;
  margin: 2px auto 10px;
}

.skeleton-date {
  width: 78%;
  height: 20px;
  margin: 2px auto 0;
}

.skeleton-button {
  width: 100%;
  height: 32px;
}

.product-image-wrap {
  width: 100%;
  height: 180px;
  background: #10131d;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #353b52;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}

.product-info {
  padding: 10px;
  display: flex;
  flex-direction: column;
  min-height: 220px;
}

.product-title {
  margin: 0 0 8px;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
  min-height: 2.6em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-category {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--tile-accent-soft);
  border: 1px solid var(--tile-accent-border);
  color: #f5f8ff;
  border-radius: 6px;
  font-size: 0.58rem;
  line-height: 1.15;
  padding: 4px 7px;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 8px;
  height: 3.45em;
  overflow: hidden;
}

.product-price-wrap {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.product-price {
  font-size: 1.35rem;
  line-height: 1;
  font-weight: 800;
  color: #e7edf8;
}

.product-price.no-price {
  font-size: 0.84rem;
  color: #9aa7c3;
  font-weight: 600;
}

.product-dates {
  display: flex;
  align-items: center;
  width: 100%;
  border-top: 1px solid #37405a;
  margin-top: auto;
  margin-bottom: 10px;
  padding-top: 10px;
}

.date-item {
  flex: 1;
  text-align: center;
}

.date-item:first-child {
  border-right: 1px solid #37405a;
}

.date-label {
  display: block;
  color: #7e8cab;
  font-size: 0.56rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
}

.date-value {
  color: #dbe3f3;
  font-size: 0.72rem;
  font-weight: 700;
}

.product-actions {
  margin-top: 0;
}

.product-link {
  display: block;
  width: 100%;
  text-align: center;
  background: var(--tile-accent);
  color: #f5f6ff;
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 7px 10px;
  border-radius: 7px;
}

.product-link:hover {
  background: var(--tile-accent-hover);
}

.empty-state {
  margin-top: 18px;
  text-align: center;
  padding: 40px 18px;
  border-radius: 12px;
  border: 1px dashed #3b425c;
  background: #1a1e2b;
  color: #aab5d0;
}

.dashboard-shell input {
  border-color: #454c67;
  background: #1a1e2b;
  color: #eef1ff;
}

.dashboard-shell button {
  background: #6d5cc7;
  color: #f6f7ff;
}

.dashboard-shell .sidebar-nav-item {
  background: transparent;
  color: #bec9e5;
  border: 1px solid transparent;
}

.dashboard-shell .sidebar-nav-item:hover {
  background: #2a3043;
  border-color: #434d6a;
}

.dashboard-shell .sidebar-nav-item.active {
  background: #2d3550;
  border-color: #616f99;
  color: #f1f4ff;
}

.dashboard-shell .sidebar-pin-btn {
  background: #252b3d;
  color: #d9e0f4;
  border: 1px solid #445070;
}

.dashboard-shell .sidebar-pin-btn:hover {
  background: #313a54;
}

.dashboard-shell .sidebar-pin-btn.active {
  border-color: #7d8dbf;
  background: #313a54;
}

.dashboard-shell .sidebar-submenu-item {
  background: transparent;
  color: #b8c2de;
  border: 1px solid transparent;
}

.dashboard-shell .sidebar-submenu-item:hover {
  background: #29324a;
  border-color: #47557a;
}

.dashboard-shell .sidebar-submenu-item.active {
  background: #354061;
  border-color: #6779aa;
  color: #f0f4ff;
}

.dashboard-shell button:hover {
  background: #5f4eb7;
}

.dashboard-shell button.secondary {
  background: #2f3448;
  color: #f1f3ff;
}

.dashboard-shell button.secondary:hover {
  background: #3b4158;
}

.dashboard-shell button.ghost {
  border: 1px solid #4a5270;
  background: #262b3c;
  color: #dce2f8;
}

.dashboard-shell button.ghost:hover {
  border-color: #69739a;
}

.dashboard-shell button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.dashboard-shell .dashboard-subtitle {
  color: #b7c0da;
}

.analytics-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.analytics-subtabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dashboard-shell .analytics-subtab-btn {
  border: 1px solid #4b5474;
  background: #262d41;
  color: #d6def4;
}

.dashboard-shell .analytics-subtab-btn:hover {
  background: #313a54;
}

.dashboard-shell .analytics-subtab-btn.active {
  border-color: #7787bb;
  background: #394467;
}

.analytics-subpanel {
  display: none;
}

.analytics-subpanel.active {
  display: block;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.account-card {
  background: #1a1e2b;
  border: 1px solid #3b425c;
  border-radius: 12px;
  padding: 14px;
}

.account-card h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.account-card p {
  margin: 0 0 7px;
  font-size: 0.84rem;
  color: #c5cfe7;
}

.account-card p:last-child {
  margin-bottom: 0;
}

/* Owner preview mode section */
.owner-preview-section {
  margin-top: 16px;
  background: #1a1e2b;
  border: 1px solid #3b425c;
  border-radius: 12px;
  padding: 16px;
}

.owner-preview-heading {
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.2px;
  margin: 0 0 4px;
  font-size: 1rem;
  color: #e6edf3;
}

.owner-preview-desc {
  margin: 0 0 14px;
  font-size: 0.82rem;
}

.owner-preview-toggle-group {
  display: inline-flex;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.owner-preview-toggle {
  cursor: pointer;
  margin: 0;
}

.owner-preview-toggle input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.owner-preview-toggle-track {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 18px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  color: #8b949e;
  transition: background 150ms ease, color 150ms ease;
  user-select: none;
}

.owner-preview-toggle input[type="radio"]:checked + .owner-preview-toggle-track {
  background: #6d5cc7;
  color: #f6f7ff;
}

.owner-preview-toggle:hover .owner-preview-toggle-track {
  color: #c9d1d9;
}

.owner-preview-toggle input[type="radio"]:checked + .owner-preview-toggle-track:hover {
  color: #f6f7ff;
}

.owner-preview-status {
  margin: 10px 0 0;
  font-size: 0.8rem;
}

.account-effective-badge {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(109, 92, 199, 0.2);
  color: #a89be8;
  margin-left: 6px;
}

.auth-shell {
  min-height: calc(100vh - 40px);
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  border: 1px solid var(--border-default);
  border-radius: 18px;
  overflow: hidden;
  background: #232634;
  box-shadow: 0 30px 55px rgba(0, 0, 0, 0.35);
}

.auth-hero {
  margin: 16px;
  border-radius: 14px;
  padding: 24px 22px 26px;
  background:
    linear-gradient(180deg, rgba(17, 24, 39, 0.15) 0%, rgba(9, 12, 21, 0.78) 66%, rgba(6, 8, 15, 0.96) 100%),
    radial-gradient(circle at 15% 12%, rgba(150, 186, 255, 0.24), transparent 40%),
    url("https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?auto=format&fit=crop&w=1400&q=80");
  background-size: cover;
  background-position: center;
  transition: background-image 0.25s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.auth-kicker {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 1.38rem;
  color: #f3f5ff;
  font-weight: 700;
}

.auth-back-link {
  text-decoration: none;
  color: #f0f2ff;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.auth-back-link:hover {
  background: rgba(255, 255, 255, 0.22);
}

.auth-hero-bottom {
  max-width: 28ch;
}

.auth-quote {
  margin: 0;
  color: #f4f6ff;
  font-size: 2rem;
  line-height: 1.12;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.4px;
}

.auth-quote-dots {
  margin-top: 18px;
  display: flex;
  gap: 10px;
}

.auth-slide-dot {
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  border: 0;
  padding: 0;
  cursor: pointer;
}

.auth-slide-dot.active {
  background: #ffffff;
}

.auth-panel {
  padding: 56px 48px 34px;
}

.auth-panel-head h2 {
  margin: 0;
  font-size: 2.45rem;
  line-height: 1.1;
  letter-spacing: -0.5px;
  margin-bottom: 18px;
}

.auth-panel-head p {
  margin: 10px 0 24px;
  font-size: 0.94rem;
}

.auth-google-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #f6f7fb;
  color: #1f2937;
  border: 1px solid #aab1bf;
  font-weight: 600;
  padding: 12px 14px;
}

.auth-google-btn:hover {
  background: #ffffff;
  border-color: #8e98aa;
}

.google-mark {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
}

.auth-divider {
  position: relative;
  text-align: center;
  margin: 14px 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.auth-divider::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 1px solid var(--border-default);
}

.auth-divider span {
  position: relative;
  z-index: 1;
  background: #232634;
  padding: 0 10px;
}

.auth-fields {
  display: grid;
  gap: 8px;
}

.auth-form-tabs {
  display: inline-flex;
  border: 1px solid var(--border-default);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
}

.auth-form-tab {
  background: #2a3042;
  color: #c8d2ea;
  border: 0;
  border-radius: 0;
  min-width: 108px;
}

.auth-form-tab:hover {
  background: #343c54;
}

.auth-form-tab.active {
  background: #5f4eb7;
  color: #f4f6ff;
}

.auth-form-panel {
  display: none;
}

.auth-form-panel.active {
  display: block;
}

.auth-name-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.auth-fields input {
  width: 100%;
}

.auth-email-btn {
  min-width: 170px;
  width: auto;
}

.auth-action-row {
  gap: 10px;
}

.auth-create-inline-btn {
  min-width: 150px;
  width: auto;
}

.auth-status-wrap {
  margin-top: 18px;
}

.auth-status-wrap h3 {
  margin: 0 0 8px;
  font-size: 0.9rem;
}

.auth-status-wrap pre {
  min-height: 110px;
}

/* ─── Analytics ─────────────────────────────────────────────────────────── */

.analytics-window-selector {
  display: inline-flex;
  gap: 0;
  border: 1px solid #4a5270;
  border-radius: 7px;
  overflow: hidden;
  max-width: 100%;
}

.analytics-window-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.dashboard-shell .analytics-window-btn {
  border: 0;
  border-radius: 0;
  background: #262b3c;
  color: #c8d2ea;
  padding: 5px 8px;
  min-width: 34px;
  font-size: 0.72rem;
  font-weight: 600;
}

.dashboard-shell .analytics-window-btn:hover {
  background: #313a54;
}

.dashboard-shell .analytics-window-btn.active {
  background: #6d5cc7;
  color: #f6f7ff;
}

.dashboard-shell .analytics-window-btn--gated:disabled {
  background: #1b1f2e;
  color: #3e4760;
  font-style: italic;
  cursor: not-allowed;
}

.dashboard-shell .analytics-refresh-btn {
  min-width: 40px;
}

.analytics-loading-state {
  padding: 40px 0;
  color: #8b949e;
  font-size: 0.9rem;
}

.analytics-error-state {
  padding: 20px;
  border-radius: 10px;
  border: 1px solid #5c3535;
  background: #1e1516;
  color: #f08080;
  font-size: 0.88rem;
}

.analytics-empty-state {
  margin-top: 12px;
  text-align: center;
  padding: 48px 18px;
  border-radius: 12px;
  border: 1px dashed #3b425c;
  background: #1a1e2b;
  color: #8b949e;
  font-size: 0.9rem;
}

.analytics-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.analytics-kpi-card {
  background: #1a1e2b;
  border: 1px solid #3b425c;
  border-radius: 10px;
  padding: 14px 16px;
}

.analytics-kpi-value {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: #e6edf3;
  line-height: 1;
  margin-bottom: 4px;
}

.analytics-kpi-value--sm {
  font-size: 1.1rem;
  word-break: break-word;
}

.analytics-kpi-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6e7681;
  margin-bottom: 4px;
}

.analytics-kpi-sub {
  font-size: 0.72rem;
  color: #8b949e;
}

.analytics-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.analytics-charts-grid--compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.analytics-chart-card {
  position: relative;
  background: #1a1e2b;
  border: 1px solid #3b425c;
  border-radius: 10px;
  padding: 14px 16px;
}

.dashboard-shell .analytics-chart-expand-btn {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0 !important;
  background: transparent !important;
  color: #aebce3;
  font-size: 1.36rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.dashboard-shell .analytics-chart-expand-btn:hover {
  background: transparent !important;
  color: #d9e3ff;
}

.analytics-chart-title {
  margin: 0 0 12px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: #8b949e;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.analytics-help-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid #4f5a7a;
  background: #242a3a;
  color: #c8d2ea;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1;
  cursor: help;
}

.analytics-help-icon[data-tooltip]::after {
  white-space: normal;
  width: min(260px, 70vw);
  top: calc(100% + 8px);
  left: 0;
  transform: none;
}

.analytics-help-icon.tooltip-left[data-tooltip]::after {
  left: auto;
  right: 0;
}

.analytics-chart-wrap {
  position: relative;
  height: 180px;
}

.analytics-chart-wrap--tall {
  height: 340px;
}

.analytics-chart-wrap--compact {
  height: 240px;
}

.analytics-gated-msg {
  margin-top: 10px;
  text-align: center;
  font-size: 0.82rem;
  color: #6e7681;
}

.analytics-table-wrap {
  margin-top: 14px;
  overflow-x: auto;
}

.analytics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.analytics-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #6e7681;
  border-bottom: 1px solid #3b425c;
}

.analytics-table td {
  padding: 8px 12px;
  color: #c9d1d9;
  border-bottom: 1px solid #21262d;
}

.analytics-table tbody tr:hover td {
  background: #1f2535;
}

.analytics-table-rank {
  color: #6e7681;
  font-size: 0.78rem;
  width: 32px;
}

.analytics-table-num {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.analytics-coming-soon {
  text-align: center;
  padding: 60px 20px;
  color: #8b949e;
}

.analytics-coming-soon-icon {
  font-size: 2.5rem;
  margin-bottom: 14px;
}

.analytics-coming-soon h3 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.15rem;
  color: #c9d1d9;
  margin: 0 0 10px;
}

.analytics-coming-soon p {
  margin: 0 0 8px;
  font-size: 0.88rem;
  max-width: 40ch;
  margin-left: auto;
  margin-right: auto;
}

.analytics-chart-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
}

.analytics-chart-modal.active {
  display: block;
}

.analytics-chart-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 23, 0.74);
  backdrop-filter: blur(2px);
  opacity: 0;
}

.analytics-chart-modal-panel {
  position: relative;
  z-index: 1;
  width: min(980px, 92vw);
  height: min(76vh, 680px);
  margin: min(10vh, 90px) auto 0;
  border-radius: 14px;
  border: 1px solid #3b425c;
  background: #171c2a;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.5);
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transform-origin: center center;
  will-change: transform, opacity;
  transition: transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 280ms ease;
}

.analytics-chart-modal-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.analytics-chart-modal-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.analytics-chart-modal-header h3 {
  margin: 0;
  font-size: 1.16rem;
  font-family: "Space Grotesk", sans-serif;
  color: #e6edf3;
}

.dashboard-shell .analytics-chart-modal-close {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 0 !important;
  background: transparent !important;
  color: #c8d2ea;
  cursor: pointer;
  padding: 0;
}

.dashboard-shell .analytics-chart-modal-close:hover {
  background: transparent !important;
  color: #e6edf3;
}

.analytics-chart-modal-body {
  position: relative;
  flex: 1;
  min-height: 0;
}

.analytics-chart-modal-body canvas {
  width: 100% !important;
  height: 100% !important;
}

@media (max-width: 768px) {
  .container {
    margin-top: 10px;
    padding: 0 8px 18px;
  }

  .dashboard-header {
    padding: 16px;
  }

  .products-section {
    padding: 16px;
  }

  .dashboard-shell {
    grid-template-columns: 1fr;
  }

  .dashboard-sidebar {
    position: sticky;
    top: 0;
    z-index: 60;
    border-right: 0;
    border-bottom: 1px solid #3a4158;
    background: #1d2130;
    padding: 10px 10px 8px;
    gap: 10px;
  }

  .dashboard-shell.sidebar-expanded {
    grid-template-columns: 1fr;
  }

  .sidebar-brand,
  .sidebar-label {
    display: inline;
  }

  .sidebar-pin-btn {
    display: none;
  }

  .sidebar-top {
    justify-content: flex-start;
  }

  .sidebar-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }

  .sidebar-nav-group {
    display: contents;
  }

  .sidebar-nav-item {
    width: 100%;
    height: 42px;
    margin: 0;
    border-radius: 8px;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px;
  }

  .sidebar-footer {
    margin-top: 0;
    margin-left: auto;
    width: auto;
  }

  .sidebar-footer button {
    width: auto;
  }

  .sidebar-submenu {
    display: none !important;
    position: static;
    box-shadow: none;
  }

  .sidebar-caret {
    display: none !important;
  }

  .dashboard-app-brand {
    display: none;
  }

  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    gap: 10px;
  }

  .product-image-wrap {
    height: 150px;
  }

  .auth-shell {
    grid-template-columns: 1fr;
    min-height: unset;
  }

  .auth-hero {
    min-height: 320px;
    margin: 10px 10px 0;
  }

  .auth-kicker {
    font-size: 1rem;
  }

  .auth-quote {
    font-size: 1.5rem;
    max-width: 20ch;
  }

  .auth-slide-dot {
    width: 24px;
  }

  .auth-panel {
    padding: 28px 16px 18px;
  }

  .auth-panel-head h2 {
    font-size: 2rem;
  }

  .auth-name-row {
    grid-template-columns: 1fr;
  }

  .analytics-charts-grid--compact {
    grid-template-columns: 1fr;
  }

  .dashboard-shell .analytics-chart-expand-btn {
    display: none;
  }

  .analytics-chart-wrap--compact {
    height: 320px;
  }
}
