/* srt.to app shell — refined Procellari dashboard */

/* ── Tokens ── */
body.app-page {
  --sidebar-width: 252px;
  --app-bg: #08080A;
  --app-surface: #101013;
  --app-border: rgba(255, 255, 255, 0.09);
  --app-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 40px rgba(0, 0, 0, 0.35);
  --app-shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.3), 0 24px 60px rgba(0, 0, 0, 0.45);
  background: var(--app-bg);
}

body.app-page::before { display: none; }

body.app-page:not(.app-layout) .app-shell-root {
  min-height: 100vh;
}

body.app-layout {
  min-height: 100vh;
  background: var(--app-bg);
  --sidebar-width: 252px;
  --topbar-height: 64px;
}

body.app-page.sidebar-collapsed,
body.app-layout.sidebar-collapsed {
  --sidebar-width: 76px;
}

body.app-layout::before { display: none; }

.app-shell-root {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar (premium, restrained) ── */
.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  background: var(--ink);
  color: rgba(255, 255, 255, 0.82);
  display: flex;
  flex-direction: column;
  z-index: 200;
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  transition: width 0.22s var(--ease-out-expo);
  overflow: visible;
}

.app-sidebar::-webkit-scrollbar { width: 4px; }
.app-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}

/* Collapse toggle — floating half-tab on the sidebar's edge */
.sidebar-collapse-toggle {
  position: absolute;
  top: 26px;
  right: -12px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #23262E;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  z-index: 210;
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease, transform 0.25s var(--ease-out-expo);
}

.sidebar-collapse-toggle:hover {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--ink);
}

.sidebar-collapse-toggle svg { width: 13px; height: 13px; }

.sidebar-collapsed .sidebar-collapse-toggle { transform: rotate(180deg); }

.sidebar-top {
  flex-shrink: 0;
  padding: 1.5rem 1.25rem 1rem;
}

.sidebar-brand {
  display: inline-flex;
  align-items: center;
  color: #fff;
}

.sidebar-brand-mark {
  display: none;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 9px;
  background: rgba(240, 169, 58, 0.14);
  color: var(--amber);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
}

.sidebar-brand-text {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  white-space: nowrap;
}

.sidebar-brand-accent {
  color: rgba(255, 255, 255, 0.42);
  font-weight: 600;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 0.75rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar-divider {
  height: 1px;
  margin: 0.65rem 0.5rem;
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.52);
  transition: color 0.15s ease, background 0.15s ease;
}

.sidebar-link:hover {
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-link.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.sidebar-link-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 7px;
  color: rgba(255, 255, 255, 0.38);
  transition: color 0.15s ease, background 0.15s ease;
}

.sidebar-link-icon svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.65;
}

.sidebar-link:hover .sidebar-link-icon {
  color: #fff;
}

.sidebar-link.is-active .sidebar-link-icon {
  color: var(--amber-strong);
  background: rgba(240, 169, 58, 0.18);
}

.sidebar-link-label {
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-bottom {
  flex-shrink: 0;
  padding: 0.85rem 0.75rem 1.15rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-create {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  margin-bottom: 0.85rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--amber);
  background: rgba(240, 169, 58, 0.12);
  border: 1px solid rgba(240, 169, 58, 0.25);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.sidebar-create:hover {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--ink);
}

.sidebar-create svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.sidebar-account {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.35rem;
  margin-bottom: 0.65rem;
}

.sidebar-account-avatar {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.sidebar-account-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.sidebar-account-name {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-plan {
  display: inline-flex;
  align-self: flex-start;
  padding: 0.12rem 0.5rem;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
}

.sidebar-foot-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0 0.35rem;
}

.sidebar-foot-link {
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.45);
  transition: color 0.15s ease;
}

.sidebar-foot-link:hover { color: rgba(255, 255, 255, 0.85); }

.sidebar-foot-link--muted { color: rgba(255, 255, 255, 0.28); }

.sidebar-foot-dot {
  color: rgba(255, 255, 255, 0.18);
  font-size: 0.75rem;
  user-select: none;
}

/* ── Collapsed state (icon rail) ── */
.sidebar-collapsed .sidebar-top {
  display: flex;
  justify-content: center;
  padding: 1.5rem 0.75rem 1rem;
}

.sidebar-collapsed .sidebar-brand-text { display: none; }
.sidebar-collapsed .sidebar-brand-mark { display: flex; }

.sidebar-collapsed .sidebar-nav { padding: 0 0.5rem; }

.sidebar-collapsed .sidebar-link {
  justify-content: center;
  padding: 0.5rem;
}

.sidebar-collapsed .sidebar-link-label { display: none; }

.sidebar-collapsed .sidebar-bottom { padding: 0.85rem 0.5rem 1.15rem; }

.sidebar-collapsed .sidebar-create {
  padding: 0.55rem;
}

.sidebar-collapsed .sidebar-create span:last-child { display: none; }

.sidebar-collapsed .sidebar-account {
  justify-content: center;
  padding: 0.45rem 0;
}

.sidebar-collapsed .sidebar-account-meta,
.sidebar-collapsed .sidebar-foot-links {
  display: none;
}

/* ── Main layout ── */
.app-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.22s var(--ease-out-expo);
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(240, 169, 58, 0.10), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(255, 255, 255, 0.05), transparent),
    var(--app-bg);
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 2rem;
  background: rgba(8, 8, 10, 0.72);
  backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--app-border);
}

.app-menu-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.88);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.app-menu-toggle-bars {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.app-menu-toggle-bars span {
  display: block;
  width: 18px;
  height: 2px;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 1px;
}

.app-menu-toggle-label {
  display: inline;
  width: auto;
  height: auto;
  background: none;
}

.app-search {
  flex: 1;
  height: 38px;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  box-shadow: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.app-search:focus-within {
  border-color: rgba(240, 169, 58, 0.35);
  box-shadow: 0 0 0 3px rgba(240, 169, 58, 0.1);
}

.app-search svg {
  width: 17px;
  height: 17px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.app-search input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.875rem;
  outline: none;
  color: var(--text-primary);
}

.app-search input::placeholder { color: var(--text-muted); }

.app-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.app-upgrade-btn {
  height: 38px;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0 1.1rem;
  border-radius: 999px;
  background: rgba(240, 169, 58, 0.12);
  border: 1px solid rgba(240, 169, 58, 0.28);
  color: var(--amber);
  transition: background 0.2s, border-color 0.2s;
}

.app-upgrade-btn:hover {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--ink);
  transform: none;
  box-shadow: 0 4px 16px rgba(240, 169, 58, 0.3);
}

.app-content {
  flex: 1;
  padding: 1.75rem 2.5rem 2.5rem;
  width: 100%;
  max-width: 1800px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Bitly-style quick create (home) ── */
.home-create-wrap {
  max-width: 920px;
  margin: 0 auto 2rem;
}

.create-mode-tabs-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.create-mode-tabs {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.25rem;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 999px;
  box-shadow: var(--app-shadow);
}

.create-mode-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.create-mode-tab svg {
  width: 16px;
  height: 16px;
}

.create-mode-tab.is-active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(20, 23, 28, 0.1);
}

.create-panel[hidden] { display: none !important; }
.create-panel.is-active:not([hidden]) { display: block; }

.quick-create-card {
  padding: 0;
  overflow: hidden;
}

.quick-create-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.35rem 1.5rem;
  border-bottom: 1px solid var(--app-border);
}

.quick-create-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.quick-create-usage {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.quick-usage-info {
  display: inline-flex;
  color: var(--text-muted);
  cursor: help;
}

.quick-usage-info svg {
  width: 14px;
  height: 14px;
}

.quick-create-usage strong {
  color: var(--text-primary);
}

.quick-create-usage a {
  color: var(--accent);
  font-weight: 600;
}

.quick-create-body {
  display: grid;
  grid-template-columns: 1fr 280px;
}

.quick-create-main {
  padding: 1.35rem 1.5rem 1.25rem;
  border-right: 1px solid var(--app-border);
}

.quick-domain-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  margin-bottom: 1.1rem;
  font-size: 0.85rem;
}

.quick-domain-label {
  color: var(--text-muted);
}

.quick-domain-value {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
  color: var(--text-primary);
}

.quick-domain-lock {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
}

.quick-domain-link {
  margin-left: auto;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
}

.quick-field-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.quick-url-row {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.quick-url-input {
  flex: 1;
  min-width: 200px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--app-border);
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.quick-url-input:focus {
  outline: none;
  border-color: rgba(240, 169, 58, 0.45);
  box-shadow: 0 0 0 3px rgba(240, 169, 58, 0.1);
}

.quick-create-btn {
  white-space: nowrap;
  padding-left: 1.35rem;
  padding-right: 1.35rem;
}

.quick-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  margin-bottom: 1rem;
}

.quick-create-error {
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
}

.quick-upgrade-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding: 0.65rem 0.85rem;
  background: rgba(240, 169, 58, 0.06);
  border-radius: var(--radius);
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.quick-upgrade-strip a {
  font-weight: 700;
  color: var(--accent);
}

.quick-qr-hint {
  margin-top: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.qr-create-result {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(240, 169, 58, 0.04);
  border: 1px solid var(--app-border);
  border-radius: var(--radius);
}

.qr-create-short-url,
.qr-modal-url {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  word-break: break-all;
}

.qr-create-preview,
.qr-modal-preview {
  display: flex;
  justify-content: center;
  padding: 0.75rem;
  background: #fff;
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
}

.qr-create-preview svg,
.qr-modal-preview svg {
  max-width: 180px;
  height: auto;
}

.qr-create-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.quick-create-aside {
  padding: 1.35rem 1.25rem;
  background: linear-gradient(160deg, rgba(240, 169, 58, 0.1) 0%, rgba(255, 255, 255, 0.02) 100%);
}

.workflow-card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.workflow-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.workflow-pills {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1.1rem;
}

.workflow-pill {
  display: block;
  padding: 0.55rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 999px;
  text-align: center;
  transition: border-color 0.15s, color 0.15s;
}

.workflow-pill:hover {
  border-color: rgba(240, 169, 58, 0.35);
  color: var(--accent);
}

.workflow-cta {
  font-size: 0.85rem;
}

.stats-grid-compact {
  margin-bottom: 1.25rem;
}

.stats-grid-compact .stat-card-dash {
  padding: 0.95rem 1rem;
}

.stats-grid-compact .stat-value-dash {
  font-size: 1.45rem;
}

.home-secondary-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.home-secondary-card {
  display: block;
  padding: 1.25rem 1.35rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.home-secondary-card:hover {
  border-color: rgba(240, 169, 58, 0.25);
  box-shadow: var(--app-shadow-lg);
}

.home-secondary-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.home-secondary-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
}

.home-secondary-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
}

.dash-side-stack {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.dash-side-stack .home-secondary-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.top-links-card {
  padding: 1.1rem 1.25rem;
}

.top-links-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.85rem;
}

.top-links-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.top-links-row {
  display: grid;
  grid-template-columns: 1.35rem 1fr auto;
  gap: 0.55rem;
  align-items: center;
}

.top-links-rank {
  display: grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: rgba(240, 169, 58, 0.12);
  color: var(--amber);
  font-size: 0.68rem;
  font-weight: 700;
}

.top-links-main { min-width: 0; }

.top-links-slug {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-links-track {
  height: 4px;
  margin-top: 0.3rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  overflow: hidden;
}

.top-links-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--amber-strong), var(--amber));
  border-radius: 99px;
}

.top-links-clicks {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
}

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

.chart-range--up { color: #3FB57C; background: rgba(63, 181, 124, 0.1); }
.chart-range--down { color: var(--danger); background: rgba(229, 72, 77, 0.1); }

@media (max-width: 900px) {
  .quick-create-body {
    grid-template-columns: 1fr;
  }

  .quick-create-main {
    border-right: none;
    border-bottom: 1px solid var(--app-border);
  }

  .home-secondary-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .quick-url-row {
    flex-direction: column;
  }

  .quick-create-btn {
    width: 100%;
  }
}

.app-view { display: none; }
.app-view.is-active { display: block; animation: appFadeIn 0.35s ease; }

@keyframes appFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Page headers ── */
.dash-header {
  margin-bottom: 1.75rem;
}

.dash-header--compact { margin-bottom: 1.35rem; }

.dash-home-header {
  margin-bottom: 1.75rem;
}

.dash-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.dash-eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  background: var(--teal);
}

.dash-greeting {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.15;
}

.dash-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--text-primary);
  line-height: 1.15;
  margin-bottom: 0.4rem;
}

.dash-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 520px;
}

.app-page-head { margin-bottom: 1.75rem; }

.app-page-head h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.35rem;
}

.app-page-head p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ── Plan banner ── */
.plan-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  padding: 0.85rem 1.1rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, rgba(240, 169, 58, 0.14), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(240, 169, 58, 0.2);
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.plan-banner-icon {
  color: var(--accent);
  font-size: 1rem;
}

.plan-banner a {
  margin-left: auto;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
}

/* ── Stat readout (departures-board strip, not icon tiles) ── */
.stats-grid-dash {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--ink-line);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--app-shadow);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.stat-card-dash {
  position: relative;
  padding: 1.1rem 1.35rem 1.25rem;
  background: var(--ink);
  transition: background 0.18s ease;
  animation: dashCardIn 0.4s var(--ease-out-expo) backwards;
}

@keyframes dashCardIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.stats-grid-dash .stat-card-dash:nth-child(1) { animation-delay: 0.02s; }
.stats-grid-dash .stat-card-dash:nth-child(2) { animation-delay: 0.06s; }
.stats-grid-dash .stat-card-dash:nth-child(3) { animation-delay: 0.1s; }
.stats-grid-dash .stat-card-dash:nth-child(4) { animation-delay: 0.14s; }

.dash-chart-row > * {
  animation: dashCardIn 0.45s var(--ease-out-expo) 0.1s backwards;
}

.recent-board-wrap {
  animation: dashCardIn 0.45s var(--ease-out-expo) 0.16s backwards;
}

@media (prefers-reduced-motion: reduce) {
  .stat-card-dash, .dash-chart-row > *, .recent-board-wrap { animation: none; }
}

.stat-card-dash:hover { background: rgba(255, 255, 255, 0.03); }

.stat-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 0;
}

.stat-label-dash {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.4);
}

.stat-label-dash::before {
  content: '';
  width: 5px;
  height: 5px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.28);
}

.stat-card--links .stat-label-dash::before,
.stat-card--clicks .stat-label-dash::before {
  background: var(--amber);
}

.stat-card-icon { display: none; }

.stat-value-dash {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: #fff;
  line-height: 1;
}

/* ── Charts ── */
.dash-chart-row {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 300px);
  gap: 1.15rem;
  margin-bottom: 1.5rem;
}

.chart-card {
  padding: 1.35rem 1.4rem;
  min-height: 280px;
}

.chart-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.chart-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.chart-range {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.25rem 0.6rem;
  background: var(--bg-secondary);
  border-radius: 999px;
}

.clicks-chart {
  min-height: 180px;
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 0.85rem;
  height: 180px;
  padding: 0.5rem 0.25rem 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.12);
}

.chart-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  font-size: 0.68rem;
  color: var(--text-muted);
  gap: 0.35rem;
}

.chart-bar {
  width: 100%;
  max-width: 48px;
  background: linear-gradient(180deg, #F7C271 0%, #D9902A 100%);
  border-radius: 8px 8px 4px 4px;
  min-height: 6px;
  box-shadow: 0 4px 14px rgba(240, 169, 58, 0.35);
  transition: height 0.4s var(--ease-out-expo);
}

.chart-bar-col em {
  font-style: normal;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.chart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  text-align: center;
  padding: 1.5rem;
}

.chart-empty-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 64px;
  margin-bottom: 1rem;
  opacity: 0.35;
}

.chart-empty-bars span {
  width: 12px;
  border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, var(--accent), var(--teal));
}

.chart-empty-bars span:nth-child(1) { height: 30%; }
.chart-empty-bars span:nth-child(2) { height: 55%; }
.chart-empty-bars span:nth-child(3) { height: 40%; }
.chart-empty-bars span:nth-child(4) { height: 70%; }
.chart-empty-bars span:nth-child(5) { height: 45%; }

.chart-empty p {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.chart-empty small {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Upgrade card ── */
.upgrade-card {
  position: relative;
  padding: 1.4rem;
  overflow: hidden;
  background: linear-gradient(155deg, #0D0F13 0%, #17191F 60%, #1E212A 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.9);
}

.upgrade-card-glow {
  position: absolute;
  top: -40%;
  right: -30%;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.28), transparent 70%);
  pointer-events: none;
}

.upgrade-badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--teal);
  margin-bottom: 0.65rem;
}

.upgrade-card h3 {
  position: relative;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.45rem;
}

.upgrade-lead {
  position: relative;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.upgrade-card ul {
  position: relative;
  list-style: none;
  margin-bottom: 1.25rem;
}

.upgrade-card li {
  padding: 0.35rem 0 0.35rem 1.35rem;
  position: relative;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.78);
}

.upgrade-card li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--teal);
  font-weight: 700;
}

.upgrade-card .btn-primary {
  position: relative;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.upgrade-card .btn-primary:hover {
  background: var(--amber);
  color: var(--ink);
}

/* ── Recent links (departures board) ── */
.recent-board-wrap { margin-bottom: 1.5rem; }

.recent-board-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.recent-board-top h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.recent-section-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.recent-board-top a {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  padding-top: 0.25rem;
}

.board--dash {
  max-width: none;
  width: 100%;
  margin: 0;
  box-shadow: var(--app-shadow);
}

.board--dash .board-dest {
  white-space: nowrap;
  text-overflow: ellipsis;
}

@media (min-width: 641px) {
  .board--dash .board-head,
  .board--dash .board-row {
    grid-template-columns: 150px 100px 1fr;
  }
}

.board-status--new { color: rgba(255, 255, 255, 0.35); }

.board-empty {
  padding: 2.5rem 1.5rem;
  text-align: center;
}

.board-empty p {
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 0.35rem;
}

.board-empty small {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
}

/* ── Empty states ── */
.dash-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  text-align: center;
}

.dash-empty-icon {
  margin-bottom: 0.75rem;
  color: var(--text-muted);
  opacity: 0.7;
}

.dash-empty-icon svg {
  width: 32px;
  height: 32px;
}

.dash-empty p {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.dash-empty small {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Shorten dock ── */
.shorten-dock {
  position: fixed;
  bottom: 1.25rem;
  left: calc(var(--sidebar-width) + 2rem);
  right: 2rem;
  z-index: 90;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.shorten-dock-inner {
  pointer-events: auto;
  width: 100%;
  max-width: 720px;
  padding: 0.85rem 1rem 0.75rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px) saturate(1.3);
  border: 1px solid rgba(20, 23, 28, 0.1);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 40px rgba(20, 23, 28, 0.12), 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
}

.shorten-bar-form {
  display: flex;
  gap: 0.65rem;
  align-items: center;
}

.shorten-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0 0.85rem;
  background: var(--bg-secondary);
  border: 1px solid var(--app-border);
  border-radius: var(--radius);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.shorten-input-wrap:focus-within {
  border-color: rgba(240, 169, 58, 0.4);
  box-shadow: 0 0 0 3px rgba(240, 169, 58, 0.1);
  background: #fff;
}

.shorten-input-icon {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.shorten-input-wrap input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.85rem 0;
  font-size: 0.92rem;
  font-family: inherit;
  outline: none;
  min-width: 0;
}

.shorten-submit {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius);
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(240, 169, 58, 0.35);
}

.shorten-submit svg { width: 16px; height: 16px; }

.shorten-meta {
  margin-top: 0.45rem;
  padding-left: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.shorten-meta a { color: var(--accent); font-weight: 600; }

.shorten-error { margin-top: 0.35rem; font-size: 0.82rem; }

.shorten-success {
  margin-top: 0.75rem;
  padding: 0.85rem 1rem;
  background: rgba(240, 169, 58, 0.06);
  border: 1px solid rgba(240, 169, 58, 0.18);
  border-radius: var(--radius);
}

.shorten-success-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
}

.shorten-success-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.shorten-success-dismiss {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
}

.shorten-result-url {
  display: block;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--amber-strong);
  word-break: break-all;
  margin-bottom: 0.65rem;
}

.shorten-result-url:hover { text-decoration: underline; }

.shorten-success-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.shorten-dock--success .shorten-dock-inner {
  border-color: rgba(240, 169, 58, 0.25);
  box-shadow: 0 8px 40px rgba(240, 169, 58, 0.12);
}

.shorten-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* Legacy class alias */
.shorten-bar { display: none; }

/* Legacy floating dock — replaced by home quick create */
.shorten-dock { display: none; }

body.app-layout .app-content { padding-bottom: 2.5rem; }

/* ── Links view ── */
.links-toolbar { padding: 1.15rem 1.25rem; margin-bottom: 1rem; }

.links-table-card { overflow: hidden; }

.links-table-toolbar {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--app-border);
  background: var(--bg-secondary);
}

.card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: -0.25rem 0 0.85rem;
}

.card-desc code {
  font-size: 0.8rem;
  padding: 0.1rem 0.35rem;
  background: var(--bg-secondary);
  border-radius: 4px;
}

.bulk-msg { margin-top: 0.5rem; font-size: 0.82rem; }

.link-select-wrap { margin-right: 0.5rem; }

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.75rem;
}

/* ── App surfaces ── */
body.app-layout .btn {
  letter-spacing: 0.01em;
  text-transform: none;
  font-weight: 600;
  border-radius: var(--radius);
  font-size: 0.88rem;
  padding: 0.65rem 1.15rem;
}

body.app-layout .btn-sm {
  font-size: 0.8rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius);
}

body.app-layout .btn-primary:hover,
body.app-layout .btn:not(.btn-outline):not(.danger):hover {
  transform: translateY(-1px);
}

body.app-layout .card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--app-border);
  background: var(--app-surface);
  box-shadow: var(--app-shadow);
}

body.app-layout .card::before { display: none; }

body.app-layout .card:hover {
  transform: none;
  box-shadow: var(--app-shadow);
}

body.app-layout .link-row {
  padding: 1rem 1.25rem;
  transition: background 0.15s;
}

body.app-layout .link-row:hover {
  background: rgba(240, 169, 58, 0.025);
}

/* ── Pricing page ── */
.pricing-cards-dash {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.pricing-card-dash {
  position: relative;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1rem;
  text-align: center;
  box-shadow: var(--app-shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.pricing-card-dash:hover {
  transform: translateY(-2px);
  box-shadow: var(--app-shadow-lg);
}

.pricing-card-dash.featured {
  border-color: var(--accent);
  box-shadow: 0 12px 32px rgba(240, 169, 58, 0.15);
}

.pricing-badge-dash {
  position: absolute;
  top: -0.5rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.22rem 0.55rem;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--gradient);
  color: #fff;
  border-radius: 999px;
  white-space: nowrap;
}

.price-dash {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--amber-strong);
  margin: 0.5rem 0 1rem;
}

.pricing-table-wrap { padding: 1.25rem; overflow: hidden; }
.pricing-table-scroll { overflow-x: auto; }

.pricing-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.pricing-table th,
.pricing-table td {
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid var(--app-border);
  text-align: center;
}

.pricing-table th:first-child,
.pricing-table td:first-child { text-align: left; font-weight: 500; }

.pricing-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg-secondary);
}

.billing-toggle {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}

.billing-toggle-active { font-weight: 700; color: var(--accent); }

.coming-soon-box {
  max-width: 520px;
  margin: 2rem auto;
  padding: 2.5rem 2rem;
  text-align: center;
}

.coming-soon-box h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

/* ── Responsive ── */
@media (max-width: 1100px) {
  .stats-grid-dash { grid-template-columns: repeat(2, 1fr); }
  .dash-chart-row { grid-template-columns: 1fr; }
  .pricing-cards-dash { grid-template-columns: repeat(2, 1fr); }
  .shorten-dock { left: 1.25rem; right: 1.25rem; }
}

@media (max-width: 768px) {
  .app-menu-toggle { display: inline-flex; }

  .sidebar-collapse-toggle { display: none; }

  .app-sidebar {
    width: 252px !important;
    transform: translateX(-100%);
    transition: transform 0.28s var(--ease-out-expo);
    box-shadow: 8px 0 40px rgba(0, 0, 0, 0.3);
  }

  .sidebar-collapsed .sidebar-brand-text,
  .sidebar-collapsed .sidebar-link-label,
  .sidebar-collapsed .sidebar-create span:last-child {
    display: inline;
  }

  .sidebar-collapsed .sidebar-account-meta,
  .sidebar-collapsed .sidebar-foot-links {
    display: flex;
  }

  .sidebar-collapsed .sidebar-brand-mark { display: none; }
  .sidebar-collapsed .sidebar-top { justify-content: flex-start; }
  .sidebar-collapsed .sidebar-link { justify-content: flex-start; }
  .sidebar-collapsed .sidebar-create,
  .sidebar-collapsed .sidebar-account { justify-content: flex-start; }

  .sidebar-open .app-sidebar { transform: translateX(0); }

  .app-main { margin-left: 0; }

  .app-content { padding: 1.25rem 1.25rem 7rem; }

  .app-search { max-width: none; }

  .app-upgrade-btn { display: none; }

  .pricing-cards-dash { grid-template-columns: 1fr; }

  .stats-grid-dash { grid-template-columns: 1fr 1fr; }

  .shorten-bar-form { flex-direction: column; }

  .shorten-submit { width: 100%; justify-content: center; }
}

@media (max-width: 480px) {
  .stats-grid-dash { grid-template-columns: 1fr; }
}

/* ── Analytics dashboard (Bitly-style modules) ── */
.analytics-page .app-content {
  max-width: 1200px;
}

.analytics-top {
  margin-bottom: 1.25rem;
}

.analytics-back {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.analytics-back svg {
  width: 16px;
  height: 16px;
}

.analytics-back:hover {
  color: var(--accent);
}

.analytics-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.analytics-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.analytics-title-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.analytics-title-actions .btn svg {
  width: 15px;
  height: 15px;
}

.analytics-plan-banner {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  background: rgba(240, 169, 58, 0.08);
  border: 1px solid rgba(240, 169, 58, 0.15);
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.analytics-plan-banner svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--accent);
  margin-top: 0.1rem;
}

.analytics-plan-banner a {
  font-weight: 700;
  color: var(--accent);
  margin-left: auto;
}

.analytics-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
}

.analytics-toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.analytics-range-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.65rem;
  background: var(--bg-secondary);
  border: 1px solid var(--app-border);
  border-radius: var(--radius);
}

.analytics-range-wrap svg {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.analytics-range-select {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}

.analytics-range-select:focus {
  outline: none;
}

.analytics-range-wrap .themed-select-btn {
  border: none;
  background: transparent;
  padding: 0;
  font-weight: 600;
}

.analytics-range-wrap .themed-select-btn:focus-visible {
  box-shadow: none;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.analytics-filter-btn svg {
  width: 14px;
  height: 14px;
}

.analytics-toolbar-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
}

.analytics-global-error {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(229, 72, 77, 0.1);
  border: 1px solid rgba(229, 72, 77, 0.25);
  border-left: 3px solid var(--danger);
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: #ff8086;
}

.analytics-global-error svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ── KPI hero row ── */
.analytics-kpi-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.kpi-tile {
  position: relative;
  padding: 1.25rem 1.4rem;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--app-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  animation: kpiFadeIn 0.4s var(--ease-out-expo) backwards;
}

.analytics-kpi-row .kpi-tile:nth-child(1) { animation-delay: 0.02s; }
.analytics-kpi-row .kpi-tile:nth-child(2) { animation-delay: 0.06s; }
.analytics-kpi-row .kpi-tile:nth-child(3) { animation-delay: 0.1s; }
.analytics-kpi-row .kpi-tile:nth-child(4) { animation-delay: 0.14s; }

@keyframes kpiFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.kpi-tile--primary {
  background:
    radial-gradient(ellipse 120% 100% at 0% 0%, rgba(240, 169, 58, 0.14), transparent 60%),
    var(--app-surface);
  border-color: rgba(240, 169, 58, 0.22);
}

.kpi-label {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.kpi-value {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.kpi-value--sm {
  font-size: 1.2rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kpi-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.kpi-delta {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.kpi-delta--up { color: #3FB57C; }
.kpi-delta--down { color: var(--danger); }

.analytics-modules {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.analytics-module {
  padding: 0;
  overflow: hidden;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  animation: moduleFadeIn 0.45s var(--ease-out-expo) backwards;
}

@keyframes moduleFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.analytics-modules .analytics-module:nth-child(1) { animation-delay: 0.05s; }
.analytics-modules .analytics-module:nth-child(2) { animation-delay: 0.09s; }
.analytics-modules .analytics-module:nth-child(3) { animation-delay: 0.13s; }
.analytics-modules .analytics-module:nth-child(4) { animation-delay: 0.17s; }
.analytics-modules .analytics-module:nth-child(5) { animation-delay: 0.21s; }
.analytics-modules .analytics-module:nth-child(6) { animation-delay: 0.25s; }
.analytics-modules .analytics-module:nth-child(7) { animation-delay: 0.29s; }
.analytics-modules .analytics-module:nth-child(8) { animation-delay: 0.33s; }

@media (prefers-reduced-motion: reduce) {
  .kpi-tile, .analytics-module { animation: none; }
}

@media (max-width: 1100px) {
  .analytics-kpi-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .analytics-kpi-row { grid-template-columns: 1fr; }
}

.analytics-module--wide {
  grid-column: 1 / -1;
}

.analytics-module-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--app-border);
  background: rgba(255, 255, 255, 0.03);
}

.analytics-module-grip {
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: -0.15em;
  opacity: 0.5;
  user-select: none;
}

.analytics-module-title {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
}

.analytics-module-menu {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.15rem 0.35rem;
  border-radius: 6px;
  cursor: pointer;
}

.analytics-module-menu:hover {
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

.analytics-module-body {
  flex: 1;
  padding: 1.1rem 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.analytics-module-body:has(.analytics-bar-list),
.analytics-module-body:has(.analytics-line-chart),
.analytics-module-body:has(.analytics-donut-wrap),
.analytics-module-body:has(.geo-spotlight),
.analytics-module-body:has(.geo-breakdown),
.analytics-module-body:has(.analytics-day-spotlight),
.analytics-module-body:has(.analytics-ref-list),
.analytics-module-body:has(.analytics-area-wrap) {
  align-items: stretch;
  justify-content: stretch;
}

.analytics-module-body--geo {
  padding: 0;
  align-items: stretch;
}

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

.analytics-module-error {
  width: 100%;
  padding: 0.75rem 0.85rem;
  background: rgba(229, 72, 77, 0.1);
  border-left: 3px solid var(--danger);
  border-radius: 8px;
  font-size: 0.82rem;
  color: #ff8086;
}

.analytics-kpi {
  text-align: center;
  width: 100%;
}

.analytics-kpi-value {
  display: block;
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.1;
}

.analytics-kpi-label {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.analytics-kpi-sub {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
}

.analytics-empty {
  text-align: center;
  width: 100%;
}

.analytics-empty-chart {
  width: 100px;
  height: 100px;
  margin: 0 auto 0.85rem;
  border-radius: 50%;
  border: 12px solid rgba(255, 255, 255, 0.08);
  opacity: 0.7;
}

.analytics-empty p {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.analytics-empty a {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
}

.analytics-bar-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.analytics-bar-row {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) 1.5fr auto;
  gap: 0.65rem;
  align-items: center;
}

.analytics-bar-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-bar-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.analytics-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #F7C271);
  border-radius: 999px;
  min-width: 4px;
}

.analytics-bar-value {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 2rem;
  text-align: right;
}

.analytics-donut-wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: center;
  width: 100%;
  position: relative;
}

.analytics-donut {
  width: 120px;
  height: 120px;
}

.analytics-donut-center {
  position: absolute;
  left: 60px;
  top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.analytics-donut-center strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
}

.analytics-donut-center span {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.analytics-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.analytics-legend li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.analytics-legend em {
  margin-left: auto;
  font-style: normal;
  font-weight: 700;
  color: var(--text-primary);
}

.analytics-legend-pct {
  font-size: 0.72rem;
  color: var(--text-muted);
  min-width: 2.5rem;
  text-align: right;
}

/* Top day spotlight */
.analytics-day-spotlight {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  width: 100%;
  align-items: center;
}

.analytics-day-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: rgba(240, 169, 58, 0.1);
  border-radius: 999px;
}

.analytics-day-value {
  display: block;
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1;
}

.analytics-day-label {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.analytics-day-share {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
}

.analytics-day-mini-title {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.analytics-day-bars {
  display: flex;
  align-items: flex-end;
  gap: 0.35rem;
  height: 72px;
}

.analytics-day-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  height: 100%;
}

.analytics-day-bar-col span {
  font-size: 0.62rem;
  color: var(--text-muted);
}

.analytics-day-bar {
  width: 100%;
  max-width: 20px;
  margin-top: auto;
  background: rgba(240, 169, 58, 0.25);
  border-radius: 4px 4px 2px 2px;
  min-height: 8px;
}

.analytics-day-bar-col.is-peak .analytics-day-bar {
  background: linear-gradient(180deg, #F7C271, var(--accent));
}

/* Referrers */
.analytics-ref-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.analytics-ref-row {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
}

.analytics-ref-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent);
  background: rgba(240, 169, 58, 0.08);
  border: 1px solid rgba(240, 169, 58, 0.12);
  border-radius: 8px;
}

.analytics-ref-main {
  flex: 1;
  min-width: 0;
}

.analytics-ref-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.analytics-ref-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-ref-stats {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.analytics-ref-stats em {
  font-style: normal;
  font-weight: 700;
  color: var(--text-primary);
}

/* Geo map */
.geo-spotlight {
  width: 100%;
  text-align: left;
}

.geo-spotlight-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.geo-spotlight-flag {
  font-size: 2rem;
  line-height: 1;
}

.geo-spotlight-name {
  display: block;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
}

.geo-spotlight-meta {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.geo-spotlight-map {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--app-border);
}

.geo-spotlight-hint {
  margin: 0.5rem 0 0;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.geo-map-svg {
  display: block;
  width: 100%;
  height: auto;
}

.geo-map-svg--compact {
  max-height: 140px;
}

.geo-grid {
  stroke: rgba(255, 255, 255, 0.07);
  stroke-width: 1;
}

.geo-land {
  fill: rgba(255, 255, 255, 0.05);
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1;
}

.geo-bubble {
  cursor: help;
}

.geo-bubble:focus circle:last-of-type {
  stroke: var(--text-primary);
  stroke-width: 3;
}

.geo-breakdown {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  width: 100%;
  min-height: 360px;
}

.geo-breakdown-map {
  padding: 1rem;
  border-right: 1px solid var(--app-border);
  background: linear-gradient(160deg, rgba(240, 169, 58, 0.03) 0%, transparent 100%);
}

.geo-map-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.65rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.geo-map-legend-scale {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.geo-map-legend-scale i {
  display: block;
  border-radius: 50%;
  background: rgba(240, 169, 58, 0.55);
  border: 2px solid #fff;
}

.geo-map-legend-scale i:nth-child(1) { width: 8px; height: 8px; opacity: 0.45; }
.geo-map-legend-scale i:nth-child(2) { width: 14px; height: 14px; opacity: 0.7; }
.geo-map-legend-scale i:nth-child(3) { width: 22px; height: 22px; }

.geo-breakdown-panel {
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.geo-panel-head {
  margin-bottom: 0.85rem;
}

.geo-panel-head h3 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.geo-panel-head span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.geo-rank-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: 320px;
}

.geo-rank-row {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 0.5rem;
  align-items: start;
  padding: 0.55rem 0.6rem;
  border-radius: var(--radius);
  transition: background 0.15s;
}

.geo-rank-row.is-top {
  background: rgba(240, 169, 58, 0.06);
  border: 1px solid rgba(240, 169, 58, 0.12);
}

.geo-rank-num {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  padding-top: 0.15rem;
  min-width: 1rem;
}

.geo-rank-flag {
  font-size: 1.15rem;
  line-height: 1;
}

.geo-rank-main {
  min-width: 0;
}

.geo-rank-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.geo-rank-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.geo-rank-stats {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.geo-rank-stats strong {
  color: var(--text-primary);
}

.geo-bar-fill {
  background: linear-gradient(90deg, #D9902A, #F0A93A);
}

/* Area chart timeline */
.analytics-area-wrap {
  width: 100%;
  padding: 0.5rem 0.25rem 0;
}

.analytics-area-chart {
  display: block;
  width: 100%;
  height: auto;
}

.chart-grid-line {
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.chart-axis-label {
  font-size: 11px;
  fill: rgba(245, 245, 247, 0.45);
  font-family: inherit;
}

.chart-point-dot {
  fill: #fff;
  stroke: var(--accent);
  stroke-width: 2.5;
}

.chart-point:hover .chart-point-dot {
  fill: var(--accent);
  r: 6;
}

.analytics-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.analytics-line-chart {
  display: flex;
  align-items: flex-end;
  gap: 0.35rem;
  width: 100%;
  min-height: 140px;
  padding-top: 0.5rem;
}

.analytics-line-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.analytics-line-bar {
  width: 100%;
  max-width: 28px;
  background: linear-gradient(180deg, #F7C271, var(--accent));
  border-radius: 6px 6px 2px 2px;
  min-height: 4px;
}

.analytics-line-col span {
  font-size: 0.65rem;
  color: var(--text-muted);
}

@media (max-width: 900px) {
  .analytics-modules {
    grid-template-columns: 1fr;
  }

  .analytics-module--wide {
    grid-column: auto;
  }

  .analytics-donut-wrap {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .analytics-donut-center {
    left: 50%;
  }

  .analytics-day-spotlight {
    grid-template-columns: 1fr;
  }

  .geo-breakdown {
    grid-template-columns: 1fr;
  }

  .geo-breakdown-map {
    border-right: none;
    border-bottom: 1px solid var(--app-border);
  }

  .geo-rank-list {
    max-height: none;
  }
}

@media print {
  .app-sidebar,
  .analytics-back,
  .analytics-title-actions,
  .analytics-toolbar,
  .analytics-plan-banner,
  .analytics-module-grip,
  .analytics-module-menu {
    display: none !important;
  }

  .app-content {
    padding: 0 !important;
    max-width: none !important;
  }

  body.app-page:not(.app-layout) .app-shell-root {
    padding-left: 0 !important;
  }

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

