/* Meridian Admin — Teal & Amber palette (distinct from Phoenix blue) */
:root {
  --bg: #eef3f1;
  --bg-elevated: #f7faf9;
  --surface: #ffffff;
  --surface-muted: #f0f5f3;
  --border: #d5e0dc;
  --border-strong: #b8cdc5;
  --text: #14231f;
  --text-secondary: #4a635c;
  --text-muted: #7a9089;
  --primary: #0f766e;
  --primary-hover: #0d5f59;
  --primary-soft: #d5f0ec;
  --primary-mid: #2dd4bf;
  --accent: #d97706;
  --accent-soft: #fef3c7;
  --success: #059669;
  --success-soft: #d1fae5;
  --warning: #d97706;
  --warning-soft: #ffedd5;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --chart-1: #0f766e;
  --chart-2: #5eead4;
  --chart-3: #99f6e4;
  --chart-4: #cbd5d1;
  --sidebar-w: 260px;
  --topbar-h: 64px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 35, 31, 0.04);
  --font: "Plus Jakarta Sans", system-ui, sans-serif;
  --ease: 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(45, 212, 191, 0.12), transparent 55%),
    radial-gradient(900px 400px at 100% 0%, rgba(217, 119, 6, 0.08), transparent 50%),
    var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

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

/* —— Sidebar —— */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 40;
  transition: transform var(--ease), width var(--ease);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--topbar-h);
  padding: 0 22px;
  border-bottom: 1px solid var(--border);
}

.brand-mark {
  width: 30px;
  height: 30px;
  color: var(--primary);
  display: grid;
  place-items: center;
}

.brand-mark svg {
  width: 28px;
  height: 28px;
}

.brand-text {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 18px 14px 12px;
}

.nav-label {
  margin: 16px 10px 8px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.nav-label:first-child {
  margin-top: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-secondary);
  font-weight: 500;
  transition: background var(--ease), color var(--ease);
  position: relative;
}

.nav-item i {
  font-size: 1.05rem;
  width: 1.25rem;
  text-align: center;
  opacity: 0.85;
}

.nav-item:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--primary);
}

/* Submenu accordion */
.nav-group {
  margin-bottom: 2px;
}

.nav-parent {
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.nav-caret {
  margin-left: auto !important;
  width: auto !important;
  font-size: 0.75rem !important;
  opacity: 0.7;
  transition: transform var(--ease);
}

.nav-group.open .nav-caret {
  transform: rotate(90deg);
}

.nav-group.open > .nav-parent {
  color: var(--primary);
  font-weight: 600;
}

.nav-submenu {
  display: none;
  padding: 2px 0 6px 16px;
  margin: 0 0 4px;
  border-left: 1px solid var(--border);
  margin-left: 22px;
}

.nav-group.open .nav-submenu {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-sublink {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.86rem;
  font-weight: 500;
  transition: background var(--ease), color var(--ease);
}

.nav-sublink:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.nav-sublink.active {
  color: var(--primary);
  font-weight: 700;
  background: var(--primary-soft);
}

body.sidebar-collapsed .nav-submenu,
body.sidebar-collapsed .nav-caret {
  display: none !important;
}

body.sidebar-darker .nav-submenu {
  border-left-color: #3a4a45;
}

body.sidebar-darker .nav-sublink {
  color: #a8bbb4;
}

body.sidebar-darker .nav-sublink:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

body.sidebar-darker .nav-sublink.active {
  background: rgba(45, 212, 191, 0.15);
  color: var(--primary-mid);
}

body.sidebar-darker .nav-group.open > .nav-parent {
  color: var(--primary-mid);
}

/* Page helpers */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--text-muted);
}

.breadcrumb a:hover {
  color: var(--primary);
}

.form-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 16px;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--surface);
  outline: 0;
  font: inherit;
  color: var(--text);
}

.field textarea {
  min-height: 120px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary-mid);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.upload-box {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 28px 16px;
  text-align: center;
  color: var(--text-muted);
  background: var(--surface-muted);
}

.upload-box i {
  font-size: 1.6rem;
  color: var(--primary);
  display: block;
  margin-bottom: 8px;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-primary.btn-sm,
.btn-secondary.btn-sm {
  padding: 8px 12px;
  font-size: 0.8rem;
}

.detail-hero {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}

.detail-hero img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.stat-box {
  padding: 14px;
  border-radius: 12px;
  background: var(--surface-muted);
}

.stat-box span {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.stat-box strong {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 1000px) {
  .form-grid,
  .two-col,
  .stat-grid,
  .field-row {
    grid-template-columns: 1fr;
  }
}

.badge-new {
  margin-left: auto;
  font-style: normal;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
}

.sidebar-collapse {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 14px 16px;
  padding: 12px;
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color var(--ease), color var(--ease), background var(--ease);
}

.sidebar-collapse:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

/* —— Main / Topbar —— */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  transition: margin-left var(--ease);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  color: var(--text);
}

.topbar-brand img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  object-fit: cover;
}

.topbar-brand span {
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 1.05rem;
  display: none;
}

.brand-mark img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  object-fit: cover;
}

/* —— Page loader —— */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background:
    radial-gradient(900px 420px at 20% 0%, rgba(45, 212, 191, 0.16), transparent 55%),
    radial-gradient(700px 360px at 100% 10%, rgba(217, 119, 6, 0.1), transparent 50%),
    color-mix(in srgb, var(--bg) 92%, #fff);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 140ms var(--ease), visibility 140ms var(--ease);
}

.page-loader.show,
body.is-loading .page-loader {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.page-loader-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.page-loader-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.2);
}

.page-loader-spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid color-mix(in srgb, var(--primary) 20%, transparent);
  border-top-color: var(--primary);
  animation: loaderSpin 0.55s linear infinite;
}

.page-loader-card p {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

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

@media (prefers-reduced-motion: reduce) {
  .page-loader {
    transition: none;
  }

  .page-loader-spinner {
    animation: none;
  }
}

.search-box {
  flex: 1;
  max-width: 420px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  height: 40px;
  background: var(--surface-muted);
  border: 1px solid transparent;
  border-radius: 12px;
  transition: border-color var(--ease), background var(--ease), box-shadow var(--ease);
}

.search-box:focus-within {
  background: var(--surface);
  border-color: var(--primary-mid);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.search-box i {
  color: var(--text-muted);
}

.search-box input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  min-width: 0;
}

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

.search-box.compact {
  max-width: 220px;
  margin: 0;
  height: 36px;
  background: var(--bg);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background var(--ease), color var(--ease);
}

.icon-btn:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.icon-btn i {
  font-size: 1.15rem;
}

.notif-dot {
  position: absolute;
  top: 9px;
  right: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface);
}

.avatar-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 2px solid var(--border);
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-muted);
  cursor: pointer;
  margin-left: 4px;
  transition: border-color var(--ease), transform var(--ease);
}

.avatar-btn:hover {
  border-color: var(--primary);
  transform: scale(1.04);
}

.avatar-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mobile-menu {
  display: none;
}

/* —— Topbar dropdowns —— */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 80;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(20, 35, 31, 0.14);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity var(--ease), transform var(--ease), visibility var(--ease);
}

.dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown.open .dropdown-toggle {
  background: var(--surface-muted);
  color: var(--primary);
}

.dropdown-head,
.dropdown-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
}

.dropdown-head {
  border-bottom: 1px solid var(--border);
}

.dropdown-foot {
  border-top: 1px solid var(--border);
  justify-content: center;
}

.dropdown-head strong {
  font-size: 0.95rem;
}

.dropdown-head a,
.dropdown-foot a {
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 600;
}

.dropdown-head a:hover,
.dropdown-foot a:hover {
  text-decoration: underline;
}

.dropdown-notif {
  width: 360px;
  max-width: calc(100vw - 24px);
}

.notif-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  max-height: 360px;
  overflow-y: auto;
}

.notif-list li {
  display: grid;
  grid-template-columns: 40px 1fr auto auto;
  gap: 10px;
  align-items: start;
  padding: 12px 14px;
  transition: background var(--ease);
}

.notif-list li:hover {
  background: var(--surface-muted);
}

.notif-list img,
.notif-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.notif-icon {
  display: grid;
  place-items: center;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 1rem;
}

.notif-body p {
  margin: 0 0 4px;
  font-size: 0.84rem;
  line-height: 1.35;
  color: var(--text-secondary);
}

.notif-body strong {
  color: var(--text);
  font-weight: 700;
}

.notif-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.notif-time {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  padding-top: 2px;
}

.icon-btn.tiny {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.icon-btn.tiny i {
  font-size: 0.95rem;
}

.dropdown-apps {
  width: 320px;
  padding: 16px;
  max-width: calc(100vw - 24px);
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.app-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 6px;
  border-radius: 12px;
  transition: background var(--ease);
}

.app-item:hover {
  background: var(--surface-muted);
}

.app-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.2rem;
}

.app-item em {
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
}

.dropdown-profile {
  width: 280px;
  padding: 16px;
  max-width: calc(100vw - 24px);
}

.profile-card {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.profile-card img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.profile-card strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.profile-card input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  background: var(--surface-muted);
  outline: 0;
  font-size: 0.78rem;
}

.profile-card input:focus {
  border-color: var(--primary-mid);
  background: var(--surface);
}

.profile-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 10px;
}

.profile-links a,
.profile-add {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.88rem;
  transition: background var(--ease), color var(--ease);
}

.profile-links a i,
.profile-add i {
  width: 1.1rem;
  text-align: center;
  opacity: 0.8;
}

.profile-links a:hover,
.profile-add:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.profile-add {
  margin-bottom: 10px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 9px 9px;
  padding-top: 12px;
}

.btn-signout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  background: var(--surface-muted);
  color: var(--text);
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 12px;
  transition: background var(--ease), color var(--ease);
}

.btn-signout:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.profile-legal {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.profile-legal a {
  color: var(--text-muted);
}

.profile-legal a:hover {
  color: var(--primary);
}

body.topbar-darker .dropdown-menu {
  background: #1f2b28;
  border-color: #2a3834;
  color: #e8efec;
}

body.topbar-darker .notif-body p,
body.topbar-darker .profile-links a,
body.topbar-darker .profile-add,
body.topbar-darker .app-item em {
  color: #b8c9c2;
}

body.topbar-darker .notif-body strong,
body.topbar-darker .profile-card strong {
  color: #fff;
}

body.topbar-darker .notif-list li:hover,
body.topbar-darker .app-item:hover,
body.topbar-darker .profile-links a:hover,
body.topbar-darker .btn-signout {
  background: rgba(255, 255, 255, 0.06);
}

body.topbar-darker .profile-card input {
  background: rgba(255, 255, 255, 0.06);
  border-color: #3a4a45;
  color: #fff;
}

/* —— Content —— */
.content {
  padding: 28px 28px 80px;
  transform-origin: top center;
}

.content > * {
  animation: fadeUp 0.48s var(--ease) both;
}

.content > *:nth-child(1) { animation-delay: 0ms; }
.content > *:nth-child(2) { animation-delay: 55ms; }
.content > *:nth-child(3) { animation-delay: 110ms; }
.content > *:nth-child(4) { animation-delay: 150ms; }
.content > *:nth-child(5) { animation-delay: 190ms; }

body.page-leave .content {
  animation: pageLeave 240ms cubic-bezier(0.4, 0, 1, 1) both;
  pointer-events: none;
}

body.page-leave .content > * {
  animation: none;
}

body.page-leave .sidebar,
body.page-leave .topbar {
  transition: opacity 200ms ease;
  opacity: 0.75;
}

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

@keyframes pageLeave {
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .content > *,
  body.page-leave .content {
    animation: none !important;
  }

  body.page-leave .sidebar,
  body.page-leave .topbar {
    opacity: 1;
    transition: none;
  }
}

.page-head {
  margin-bottom: 22px;
}

.page-head h1 {
  margin: 0 0 4px;
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.page-head p {
  margin: 0;
  color: var(--text-muted);
}

/* Status strip */
.status-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.status-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform var(--ease), border-color var(--ease);
}

.status-card:hover {
  transform: translateY(-2px);
}

.status-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.status-card strong {
  display: block;
  font-size: 0.98rem;
  font-weight: 700;
}

.status-card span {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.status-success .status-icon {
  background: var(--success-soft);
  color: var(--success);
}

.status-warning .status-icon {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-danger .status-icon {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-success {
  border-color: color-mix(in srgb, var(--success) 18%, var(--border));
}

.status-warning {
  border-color: color-mix(in srgb, var(--warning) 18%, var(--border));
}

.status-danger {
  border-color: color-mix(in srgb, var(--danger) 18%, var(--border));
}

/* Panels */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.panel h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.range-select {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color var(--ease), color var(--ease);
}

.range-select:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Dashboard grids */
.dash-grid {
  display: grid;
  grid-template-columns: 1.7fr 0.85fr;
  gap: 16px;
  margin-bottom: 16px;
}

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

.metrics-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.metric-card {
  flex: 1;
  display: flex;
  flex-direction: column;
}

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

.metric-label {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
}

.metric-value {
  margin: 6px 0 10px;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.delta {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 7px;
}

.delta.down {
  color: var(--danger);
  background: var(--danger-soft);
}

.delta.up {
  color: var(--accent);
  background: var(--accent-soft);
}

.chart-wrap {
  position: relative;
  width: 100%;
}

.chart-lg {
  height: 280px;
}

.chart-sm {
  height: 72px;
  margin-top: auto;
}

.chart-doughnut {
  width: 160px;
  height: 160px;
  margin: 0 auto;
}

.chart-gauge {
  height: 150px;
  max-width: 240px;
  margin: 8px auto 0;
}

.doughnut-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding-top: 8px;
}

.doughnut-center,
.gauge-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.doughnut-center strong {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.gauge-center {
  top: 28%;
  flex-direction: column;
  align-content: center;
  text-align: center;
  line-height: 1.15;
}

.gauge-center strong {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
}

.gauge-center span {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.legend-list {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.legend-list.horizontal {
  flex-direction: row;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 8px;
}

.legend-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

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

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

.dot.c1 { background: var(--chart-1); }
.dot.c2 { background: var(--chart-2); }
.dot.c3 { background: var(--chart-3); }
.dot.c4 { background: var(--chart-4); }

.promo-panel {
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(145deg, rgba(15, 118, 110, 0.08), transparent 55%),
    var(--surface);
}

.promo-copy {
  margin: 12px 0 18px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.55;
}

.promo-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.promo-stats div {
  padding: 12px 10px;
  background: var(--surface-muted);
  border-radius: 10px;
  text-align: center;
}

.promo-stats span {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.promo-stats strong {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: auto;
  padding: 11px 16px;
  border: 0;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background var(--ease), transform var(--ease);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

/* Table */
.table-panel {
  padding: 0;
  overflow: hidden;
}

.table-toolbar {
  padding: 18px 20px 14px;
  margin: 0;
  border-bottom: 1px solid var(--border);
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.table-scroll {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table th {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: var(--bg-elevated);
  white-space: nowrap;
}

.data-table tbody tr {
  transition: background var(--ease);
}

.data-table tbody tr:hover {
  background: color-mix(in srgb, var(--primary-soft) 45%, var(--surface));
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.product-cell,
.user-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.product-cell img {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--surface-muted);
}

.product-cell strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-cell span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.user-cell img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
}

.user-cell span {
  font-weight: 500;
  white-space: nowrap;
}

.stars {
  color: var(--accent);
  letter-spacing: 1px;
  font-size: 0.85rem;
  white-space: nowrap;
}

.review-text {
  max-width: 260px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.muted {
  color: var(--text-muted);
  white-space: nowrap;
  font-size: 0.82rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.pill.success {
  background: var(--success-soft);
  color: var(--success);
}

.pill.warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.pill.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
  cursor: pointer;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 35, 31, 0.35);
  z-index: 35;
  opacity: 0;
  transition: opacity var(--ease);
}

.sidebar-overlay.show {
  display: block;
  opacity: 1;
}

/* Collapsed sidebar (desktop) */
body.sidebar-collapsed .sidebar {
  width: 76px;
}

body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .nav-item span,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .badge-new,
body.sidebar-collapsed .sidebar-collapse span {
  display: none;
}

body.sidebar-collapsed .sidebar-brand {
  justify-content: center;
  padding: 0;
}

body.sidebar-collapsed .nav-item {
  justify-content: center;
  padding: 12px;
}

body.sidebar-collapsed .nav-item.active::before {
  display: none;
}

body.sidebar-collapsed .sidebar-collapse {
  justify-content: center;
}

body.sidebar-collapsed .main {
  margin-left: 76px;
}

/* Responsive */
@media (max-width: 1200px) {
  .dash-grid {
    grid-template-columns: 1fr;
  }

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

  .metrics-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .promo-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }

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

  .main {
    margin-left: 0;
  }

  body.sidebar-collapsed .main {
    margin-left: 0;
  }

  .mobile-menu {
    display: grid;
  }

  .topbar-brand {
    display: flex;
  }

  .topbar-brand span {
    display: inline;
  }

  .search-box {
    margin: 0;
    max-width: none;
  }

  .content {
    padding: 20px 16px 90px;
  }

  .status-strip {
    grid-template-columns: 1fr;
  }

  .dash-grid.secondary,
  .metrics-col {
    grid-template-columns: 1fr;
  }

  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-actions {
    width: 100%;
  }

  .toolbar-actions .search-box.compact {
    flex: 1;
    max-width: none;
  }
}

@media (max-width: 600px) {
  .topbar {
    padding: 0 12px;
  }

  .page-head h1 {
    font-size: 1.35rem;
  }

  .chart-lg {
    height: 220px;
  }
}

/* —— Color themes —— */
html[data-color="ocean"] {
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-soft: #e0f2fe;
  --primary-mid: #38bdf8;
  --chart-1: #0284c7;
  --chart-2: #7dd3fc;
  --chart-3: #bae6fd;
  --bg: #eef2f6;
  --surface-muted: #f1f5f9;
  --border: #d5dee8;
}

html[data-color="forest"] {
  --primary: #15803d;
  --primary-hover: #166534;
  --primary-soft: #dcfce7;
  --primary-mid: #4ade80;
  --chart-1: #15803d;
  --chart-2: #86efac;
  --chart-3: #bbf7d0;
  --bg: #eef4ef;
  --surface-muted: #f1f7f2;
  --border: #d4e0d6;
}

html[data-color="amber"] {
  --primary: #d97706;
  --primary-hover: #b45309;
  --primary-soft: #fef3c7;
  --primary-mid: #fbbf24;
  --chart-1: #d97706;
  --chart-2: #fcd34d;
  --chart-3: #fde68a;
  --bg: #f5f1ea;
  --surface-muted: #f7f3ec;
  --border: #e5dccf;
}

html[data-color="rose"] {
  --primary: #e11d48;
  --primary-hover: #be123c;
  --primary-soft: #ffe4e6;
  --primary-mid: #fb7185;
  --chart-1: #e11d48;
  --chart-2: #fda4af;
  --chart-3: #fecdd3;
  --bg: #f4eef0;
  --surface-muted: #f8f1f3;
  --border: #e4d5d9;
}

html[data-color="slate"] {
  --primary: #475569;
  --primary-hover: #334155;
  --primary-soft: #e2e8f0;
  --primary-mid: #94a3b8;
  --chart-1: #475569;
  --chart-2: #94a3b8;
  --chart-3: #cbd5e1;
  --bg: #eef1f4;
  --surface-muted: #f1f5f9;
  --border: #d5dbe3;
}

/* —— Skin variants —— */
body.sidebar-darker .sidebar {
  background: #1a2421;
  border-right-color: #2a3834;
  color: #d5e0dc;
}

body.sidebar-darker .brand-text,
body.sidebar-darker .nav-item {
  color: #c5d4ce;
}

body.sidebar-darker .nav-label {
  color: #7a9089;
}

body.sidebar-darker .nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

body.sidebar-darker .nav-item.active {
  background: rgba(45, 212, 191, 0.15);
  color: var(--primary-mid);
}

body.sidebar-darker .sidebar-collapse {
  border-color: #3a4a45;
  color: #a8bbb4;
}

body.sidebar-darker .sidebar-brand {
  border-bottom-color: #2a3834;
}

body.topbar-darker .topbar {
  background: #1a2421;
  border-bottom-color: #2a3834;
  color: #e8efec;
}

body.topbar-darker .topbar .icon-btn {
  color: #c5d4ce;
}

body.topbar-darker .topbar .icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

body.topbar-darker .topbar .search-box {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

body.topbar-darker .topbar .search-box input::placeholder,
body.topbar-darker .topbar .search-box i {
  color: #8aa099;
}

body.topbar-darker .topbar .notif-dot {
  border-color: #1a2421;
}

body.topbar-slim .topbar {
  height: 52px;
}

body.topbar-slim {
  --topbar-h: 52px;
}

body.layout-dual .sidebar-brand {
  display: none;
}

/* —— Table footer —— */
.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

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

.link-muted:hover {
  color: var(--primary);
}

.pager {
  display: flex;
  gap: 8px;
}

.pager-btn {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  font-weight: 500;
}

.pager-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.pager-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pill i {
  margin-right: 4px;
  font-size: 0.75rem;
}

/* —— Regions —— */
.regions-section {
  margin-top: 20px;
}

.regions-head {
  margin-bottom: 14px;
}

.regions-head h2 {
  margin: 0 0 4px;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.regions-head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.regions-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 16px;
}

.regions-table-wrap {
  padding: 0;
  overflow: hidden;
}

.regions-table {
  min-width: 560px;
}

.regions-table td em {
  display: block;
  font-style: normal;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.country-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.country-cell img {
  border-radius: 3px;
  box-shadow: 0 0 0 1px var(--border);
}

.map-panel {
  position: relative;
  min-height: 360px;
  padding: 12px;
  overflow: hidden;
  background: var(--surface);
}

.date-cta-panel {
  display: flex;
  align-items: stretch;
  min-height: 360px;
  padding: 0;
  overflow: hidden;
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--primary) 14%, transparent), transparent 55%),
    var(--surface);
}

.date-cta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px 26px;
  width: 100%;
}

.date-eyebrow {
  display: inline-flex;
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.date-display {
  display: block;
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: var(--text);
}

.date-sub {
  margin: 6px 0 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.date-copy {
  margin: 16px 0 22px;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.55;
  max-width: 28ch;
}

.date-cta .btn-primary {
  margin-top: 0;
  align-self: flex-start;
}

/* Full month calendar */
.calendar-panel {
  min-height: 360px;
  padding: 16px;
}

.calendar-widget {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 328px;
}

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

.calendar-toolbar h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 6px;
}

.calendar-weekdays span {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 0;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  flex: 1;
}

.cal-day {
  aspect-ratio: 1;
  min-height: 34px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--ease), color var(--ease);
}

.cal-day:hover:not(:disabled) {
  background: var(--surface-muted);
}

.cal-day.muted {
  color: var(--text-muted);
  opacity: 0.45;
}

.cal-day.today {
  box-shadow: inset 0 0 0 1.5px var(--primary);
  color: var(--primary);
}

.cal-day.selected {
  background: var(--primary);
  color: #fff;
  box-shadow: none;
}

.cal-day.has-event::after {
  content: "";
  display: block;
  width: 4px;
  height: 4px;
  margin: 2px auto 0;
  border-radius: 50%;
  background: var(--accent);
}

.cal-day.selected.has-event::after {
  background: #fff;
}

.calendar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.calendar-footer .date-eyebrow {
  margin-bottom: 4px;
}

.calendar-footer strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
}

.calendar-footer .btn-primary {
  margin-top: 0;
  flex-shrink: 0;
}

.world-map {
  width: 100%;
  height: 340px;
  position: relative;
}

.map-controls {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.map-controls button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
}

.map-controls button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.world-map {
  width: 100%;
  height: 340px;
  position: relative;
}

.world-map .jvm-container {
  background: transparent !important;
  width: 100% !important;
  height: 100% !important;
}

.world-map svg {
  width: 100%;
  height: 100%;
}

.jvm-zoom-btn {
  display: none !important;
}

.jvm-tooltip {
  background: var(--text) !important;
  border-radius: 8px !important;
  font-family: var(--font) !important;
  font-size: 12px !important;
  padding: 6px 10px !important;
  border: 0 !important;
}

.world-map .jvm-marker {
  filter: drop-shadow(0 0 0 4px rgba(15, 118, 110, 0.2));
}

/* —— Customize tab & panel —— */
.customize-tab {
  position: fixed;
  top: 50%;
  right: 0;
  z-index: 55;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 8px;
  border: 1px solid var(--border);
  border-right: 0;
  border-radius: 12px 0 0 12px;
  background: var(--surface);
  color: var(--primary);
  cursor: pointer;
  box-shadow: -4px 0 16px rgba(20, 35, 31, 0.08);
  transition: background var(--ease), color var(--ease), right var(--ease);
}

.customize-tab i {
  font-size: 1.1rem;
}

.customize-tab span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.customize-tab:hover {
  background: var(--primary);
  color: #fff;
}

body.customizer-open .customize-tab {
  right: 340px;
}

.customizer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 35, 31, 0.28);
  z-index: 60;
  opacity: 0;
  transition: opacity var(--ease);
}

.customizer-overlay.show {
  display: block;
  opacity: 1;
}

.customizer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 340px;
  max-width: 100%;
  z-index: 65;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -12px 0 40px rgba(20, 35, 31, 0.12);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--ease);
}

.customizer.open {
  transform: translateX(0);
}

.customizer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 18px 14px;
  border-bottom: 1px solid var(--border);
}

.customizer-header h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 800;
}

.customizer-header p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
  max-width: 240px;
}

.customizer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px 24px;
}

.reset-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  justify-content: center;
  margin-bottom: 18px;
  padding: 10px;
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

.reset-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.customizer-block {
  margin-bottom: 22px;
}

.customizer-block h4 {
  margin: 0 0 12px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
}

.color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.swatch {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--sw);
  cursor: pointer;
  position: relative;
  box-shadow: inset 0 0 0 2px #fff;
  transition: transform var(--ease), box-shadow var(--ease);
}

.swatch:hover {
  transform: scale(1.08);
}

.swatch.active {
  box-shadow: inset 0 0 0 2px #fff, 0 0 0 2px var(--sw);
}

.option-row {
  display: flex;
  gap: 18px;
}

.radio-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 500;
  color: var(--text-secondary);
}

.radio-option input {
  accent-color: var(--primary);
}

.thumb-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.thumb-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.thumb-option em {
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.thumb-option input {
  accent-color: var(--primary);
}

.thumb {
  width: 100%;
  height: 72px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  overflow: hidden;
  display: flex;
  transition: border-color var(--ease), box-shadow var(--ease);
}

.thumb-option:has(input:checked) .thumb {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 25%, transparent);
}

.thumb .t-side {
  width: 28%;
  background: #fff;
  border-right: 1px solid var(--border);
}

.thumb .t-side.dark {
  background: #1a2421;
}

.thumb .t-main,
.thumb .t-body {
  flex: 1;
  background: #e8eeeb;
}

.thumb-top-default,
.thumb-top-slim,
.thumb-topbar-light,
.thumb-topbar-dark {
  flex-direction: column;
}

.thumb .t-top {
  height: 18px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.thumb .t-top.slim {
  height: 10px;
}

.thumb .t-top.dark {
  background: #1a2421;
}

.customizer-footer {
  padding: 14px 18px 18px;
  border-top: 1px solid var(--border);
}

.btn-block {
  width: 100%;
}

/* ---------- Apps & Pages layouts ---------- */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 14px;
  overflow-x: auto;
}

.kanban-col {
  background: var(--panel-bg, var(--card, #fff));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  min-height: 360px;
}

.kanban-col-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.kanban-card {
  background: var(--bg, #f8faf9);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
}

.kanban-card h3 {
  margin: 0 0 6px;
  font-size: 0.95rem;
}

.kanban-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.kanban-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.kanban-meta img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

.chat-layout,
.mail-layout {
  display: grid;
  min-height: 520px;
  overflow: hidden;
  padding: 0 !important;
}

.mail-layout {
  grid-template-columns: 200px 280px 1fr;
}

/* Chat app — Phoenix-style two-pane */
.content-chat {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--topbar-h, 64px));
  padding-top: 16px;
  padding-bottom: 16px !important;
}

.chat-app {
  display: grid;
  grid-template-columns: 340px 1fr;
  flex: 1;
  min-height: calc(100vh - 100px);
  overflow: hidden;
  padding: 0 !important;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel-bg, #fff);
  box-shadow: var(--shadow, 0 1px 2px rgba(15, 23, 42, 0.04));
}

.chat-sidebar {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--panel-bg, #fff);
  min-height: 0;
}

.chat-sidebar .chat-search,
.chat-sidebar .search-box.compact {
  flex: 0 0 auto;
  margin: 16px 16px 10px;
  width: auto;
  max-width: none;
  align-self: stretch;
}

.chat-tabs.status-tabs {
  display: flex;
  gap: 4px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  margin: 0;
  overflow: visible;
  flex: 0 0 auto;
}

.chat-tabs .status-tab {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  border-radius: 0;
  position: relative;
}

.chat-tabs .status-tab::after,
.chat-tabs .status-tab.active::after {
  display: none !important;
  content: none !important;
}

.chat-tabs .status-tab:hover {
  color: var(--text);
}

.chat-tabs .status-tab.active {
  color: var(--primary, #0f766e);
  border-bottom-color: var(--primary, #0f766e);
  background: transparent;
}

.chat-list,
.chat-contacts {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
}

.chat-empty {
  padding: 16px;
  text-align: center;
  font-size: 0.88rem;
}

.chat-contact {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 10px;
  align-items: start;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 12px;
  padding: 10px;
  cursor: pointer;
  color: inherit;
  width: 100%;
  font: inherit;
}

.chat-contact:hover {
  background: color-mix(in srgb, var(--primary, #0f766e) 6%, transparent);
}

.chat-contact.active {
  background: color-mix(in srgb, var(--primary, #0f766e) 12%, transparent);
}

.chat-contact.hidden {
  display: none;
}

.chat-contact > img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.chat-contact > div {
  min-width: 0;
}

.chat-contact > div strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-contact > div span {
  display: block;
  color: var(--text-muted);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.chat-contact-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.chat-contact > em,
.chat-contact-meta em {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-style: normal;
  white-space: nowrap;
}

.chat-contact > .unread-badge {
  grid-column: 3;
  justify-self: end;
}

.unread-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--primary, #0f766e);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chat-thread {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--panel-bg, #fff);
}

.chat-thread-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-thread-user,
.chat-user {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.chat-thread-user img,
.chat-user img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.chat-thread-user strong,
.chat-user strong {
  display: block;
  font-size: 1rem;
}

.chat-status,
.chat-user span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 2px;
}

.online-dot,
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
}

.chat-thread-actions,
.chat-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.chat-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 0;
  background: color-mix(in srgb, var(--primary, #0f766e) 12%, transparent);
  color: var(--primary, #0f766e);
  cursor: pointer;
  font-size: 0.95rem;
}

.chat-action-btn:hover {
  background: color-mix(in srgb, var(--primary, #0f766e) 20%, transparent);
}

.chat-action-btn.ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.chat-action-btn.ghost:hover {
  color: var(--text);
  background: var(--bg, #f8faf9);
}

.chat-messages {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  background: var(--bg, #f8faf9);
  min-height: 0;
}

.msg-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  max-width: 72%;
}

.msg-row.in {
  align-self: flex-start;
}

.msg-row.out {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg-row > img,
.msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.msg-row > div,
.msg-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.msg-row.out > div,
.msg-row.out .msg-content {
  align-items: flex-end;
}

.bubble {
  max-width: 100%;
  padding: 10px 14px;
  border-radius: 14px;
  line-height: 1.45;
  font-size: 0.9rem;
}

.bubble.in {
  background: var(--panel-bg, #fff);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.bubble.out {
  background: var(--primary, #0f766e);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.bubble.media {
  padding: 4px;
  overflow: hidden;
  width: fit-content;
  max-width: min(280px, 100%);
}

.bubble.media img {
  display: block;
  max-width: 260px;
  width: 100%;
  border-radius: 10px;
}

.bubble.media p {
  margin: 8px 10px 6px;
  font-size: 0.88rem;
  max-width: 260px;
}

.msg-time,
.msg-row time {
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 0 4px;
}

.chat-compose {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 20px 16px;
  border-top: 1px solid var(--border);
  background: var(--panel-bg, #fff);
  flex-shrink: 0;
}

.chat-compose textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--bg, #f8faf9);
  color: inherit;
  font: inherit;
  font-size: 0.9rem;
  resize: none;
  outline: 0;
  min-height: 72px;
}

.chat-compose textarea:focus {
  border-color: color-mix(in srgb, var(--primary, #0f766e) 45%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary, #0f766e) 15%, transparent);
}

.chat-compose-bar,
.compose-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chat-compose-tools,
.compose-tools {
  display: flex;
  align-items: center;
  gap: 4px;
}

.compose-tools .icon-btn:hover {
  color: var(--primary, #0f766e);
}

.mail-item.active,
.mail-folder.active {
  background: color-mix(in srgb, var(--primary, #0f766e) 12%, transparent);
}

.mail-folders,
.mail-list {
  border-right: 1px solid var(--border);
  padding: 14px;
}

.mail-folder,
.mail-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-decoration: none;
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  text-align: left;
}

.mail-folder em,
.mail-item em {
  margin-left: auto;
  font-style: normal;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.mail-item {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  position: relative;
  margin-bottom: 4px;
}

.mail-item strong {
  font-size: 0.9rem;
}

.mail-item span {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.mail-item em {
  position: absolute;
  top: 10px;
  right: 10px;
}

.mail-preview {
  padding: 18px 20px;
}

.mail-preview h2 {
  margin: 0 0 6px;
}

.mail-preview header p {
  margin: 0 0 16px;
  color: var(--text-muted);
}

.mail-body p {
  line-height: 1.6;
  color: var(--text, inherit);
}

/* Apps calendar (Phoenix-style month / week board) */
.cal-app-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.cal-app-head h1 {
  margin: 0;
  font-size: clamp(1.45rem, 2.4vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.cal-app-head h1 span {
  color: var(--text-muted);
  font-weight: 600;
  margin: 0 6px;
}

.cal-app-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.cal-sync {
  border: 0;
  background: transparent;
  color: var(--primary, #0f766e);
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 4px;
}

.cal-sync.spinning i {
  animation: loaderSpin 0.6s linear;
}

.cal-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.cal-cat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: var(--panel-bg, #fff);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.cal-cat:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--primary, #0f766e) 35%, var(--border));
}

.cal-cat.active {
  color: #9a3412;
  border-color: color-mix(in srgb, #d97706 40%, var(--border));
  background: color-mix(in srgb, #d97706 14%, #fff);
}

.cal-cat-dot,
.cal-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cat, #64748b);
  flex-shrink: 0;
}

.cal-board {
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--panel-bg, #fff);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.cal-toolbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg, #f8faf9) 65%, #fff);
}

.cal-toolbar .btn-secondary {
  justify-self: start;
}

.cal-month-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cal-month-nav .icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--panel-bg, #fff);
  border: 1px solid var(--border);
}

.cal-month-nav strong {
  min-width: 168px;
  text-align: center;
  font-size: 0.98rem;
  font-weight: 800;
}

.cal-view-toggle {
  justify-self: end;
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg, #f8faf9);
  padding: 3px;
  gap: 2px;
}

.cal-view-btn {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
}

.cal-view-btn.active {
  background: var(--panel-bg, #fff);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.cal-swipe {
  user-select: none;
  touch-action: pan-y;
  background: var(--bg, #f4f6f5);
}

.cal-swipe.dragging {
  cursor: grabbing;
}

.cal-weekdays,
.cal-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.cal-weekday {
  padding: 12px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg, #f8faf9) 80%, #fff);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cal-weekday em {
  font-style: normal;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text);
}

.cal-weekday.weekend {
  color: #c2410c;
  background: color-mix(in srgb, #f59e0b 10%, #fff);
}

.cal-weekday.weekend em {
  color: #c2410c;
}

.cal-weekday.is-today {
  background: color-mix(in srgb, #d97706 12%, #fff);
}

.cal-weekday.is-today em {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: #d97706;
  color: #fff;
}

.cal-cell {
  min-height: 108px;
  padding: 8px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: background 140ms ease;
}

.cal-cell:nth-child(7n) {
  border-right: 0;
}

.cal-cell:hover {
  background: color-mix(in srgb, var(--primary, #0f766e) 4%, #fff);
}

.cal-cell.weekend {
  background: color-mix(in srgb, #f59e0b 7%, #fff);
}

.cal-cell.weekend:hover {
  background: color-mix(in srgb, #f59e0b 11%, #fff);
}

.cal-cell.muted {
  background: color-mix(in srgb, var(--bg, #f8faf9) 88%, #fff);
}

.cal-cell.muted .cal-date {
  color: color-mix(in srgb, var(--text-muted) 75%, transparent);
}

.cal-cell.today {
  background: #fff;
  box-shadow: inset 0 0 0 2px #d97706;
  z-index: 1;
}

.cal-cell-top {
  display: flex;
  justify-content: flex-start;
}

.cal-date {
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text-secondary, var(--text));
}

.cal-date.is-today {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: #d97706;
  color: #fff;
  font-weight: 800;
}

.cal-events {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 0;
}

.cal-empty-slot {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.7;
}

.cal-pill {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 8px;
  background: #fff;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.cal-pill-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.cal-pill-text strong {
  font-size: 0.74rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cal-pill-text small {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
}

.cal-pill:hover {
  border-color: color-mix(in srgb, var(--cat, #64748b) 50%, var(--border));
  box-shadow: 0 4px 12px color-mix(in srgb, var(--cat, #64748b) 18%, transparent);
  transform: translateY(-1px);
}

.cal-board.is-week .cal-week-grid .cal-cell {
  min-height: 280px;
  padding: 10px;
}

.cal-board.is-week .cal-pill {
  padding: 8px 10px;
}

.cal-board.is-month .cal-pill {
  border-radius: 999px;
  padding: 4px 8px 4px 6px;
  align-items: center;
}

.cal-board.is-month .cal-pill-text small {
  display: none;
}

@media (max-width: 900px) {
  .cal-toolbar {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .cal-toolbar .btn-secondary,
  .cal-view-toggle {
    justify-self: stretch;
  }

  .cal-month-nav {
    justify-content: center;
  }

  .cal-view-toggle {
    width: 100%;
  }

  .cal-view-btn {
    flex: 1;
  }

  .cal-cell {
    min-height: 84px;
    padding: 6px;
  }

  .cal-board.is-week .cal-week-grid .cal-cell {
    min-height: 140px;
  }

  .cal-pill-text strong {
    font-size: 0.68rem;
  }
}

/* legacy apps calendar helpers (kept for older snippets) */
.calendar-panel {
  padding: 16px;
}

.cal-head {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  padding: 6px;
}

.cal-event {
  display: block;
  font-style: normal;
  font-size: 0.72rem;
  padding: 3px 6px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--primary, #0f766e) 18%, transparent);
  color: var(--primary, #0f766e);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-event.alt {
  background: color-mix(in srgb, #d97706 18%, transparent);
  color: #d97706;
}

.gantt-panel {
  padding: 16px;
}

.gantt-scroll {
  overflow-x: auto;
}

.gantt-table {
  min-width: 720px;
}

.gantt-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.gantt-row.head {
  margin-bottom: 16px;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.gantt-bars-head,
.gantt-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0;
  height: 34px;
  align-items: center;
}

.gantt-bars-head span {
  text-align: center;
}

.gantt-track {
  background: var(--bg, #f8faf9);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.gantt-bar {
  position: absolute;
  height: 18px;
  border-radius: 999px;
  background: var(--primary, #0f766e);
}

.gantt-bar.alt {
  background: #0284c7;
}

.gantt-bar.warn {
  background: #d97706;
}

.gantt-bar.success {
  background: #15803d;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--bg, #f8faf9);
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
}

.faq-item p {
  margin: 10px 0 0;
  color: var(--text-muted);
  line-height: 1.55;
}

.faq-item code {
  font-size: 0.85em;
}

.starter-panel {
  min-height: 360px;
  display: grid;
  place-items: center;
}

.starter-empty {
  text-align: center;
  max-width: 420px;
  padding: 24px;
}

.starter-empty i {
  font-size: 2.4rem;
  color: var(--primary, #0f766e);
}

.starter-empty h2 {
  margin: 12px 0 8px;
}

.starter-empty p {
  color: var(--text-muted);
  margin: 0 0 16px;
  line-height: 1.55;
}

.landing-preview {
  padding: 0;
  overflow: hidden;
}

.landing-hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 0;
  min-height: 380px;
  background:
    radial-gradient(640px 280px at 10% 0%, color-mix(in srgb, var(--primary, #0f766e) 16%, transparent), transparent 55%),
    radial-gradient(520px 240px at 70% 100%, color-mix(in srgb, #d97706 12%, transparent), transparent 50%),
    var(--panel-bg, #fff);
}

.landing-hero-copy {
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.landing-brand {
  margin: 0 0 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: lowercase;
  color: var(--primary, #0f766e);
  font-size: 1.35rem;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.landing-brand img {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: cover;
}

.landing-hero-copy h2 {
  margin: 0 0 12px;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  max-width: 14ch;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.landing-hero-copy > p {
  margin: 0 0 20px;
  color: var(--text-muted);
  max-width: 38ch;
  line-height: 1.55;
  font-size: 0.98rem;
}

.landing-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.landing-actions .btn-primary,
.landing-actions .btn-secondary,
.landing-strip-copy .btn-primary {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.landing-hero-media {
  margin: 0;
  min-height: 100%;
  overflow: hidden;
  position: relative;
}

.landing-hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--panel-bg, #fff), transparent 28%);
  pointer-events: none;
}

.landing-hero-media img,
.landing-module img,
.landing-strip-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.landing-hero-media img {
  min-height: 380px;
  animation: landingFade 700ms ease both;
}

.landing-hero-copy {
  animation: landingRise 560ms ease both;
}

.landing-modules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--border);
}

.landing-module {
  display: grid;
  grid-template-rows: 160px auto;
  border-right: 1px solid var(--border);
  background: var(--panel-bg, #fff);
  transition: background 180ms ease;
}

.landing-module:last-child {
  border-right: 0;
}

.landing-module:hover {
  background: color-mix(in srgb, var(--primary, #0f766e) 4%, var(--panel-bg, #fff));
}

.landing-module img {
  height: 160px;
}

.landing-module > div {
  padding: 16px 18px 20px;
}

.landing-module h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.landing-module p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.landing-strip {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  border-top: 1px solid var(--border);
  min-height: 260px;
}

.landing-strip-copy {
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--primary, #0f766e) 10%, transparent), transparent 65%),
    var(--bg, #f8faf9);
}

.landing-strip-copy h3 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  max-width: 18ch;
}

.landing-strip-copy p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.55;
  max-width: 40ch;
}

.landing-strip-media {
  margin: 0;
  overflow: hidden;
  min-height: 260px;
}

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

@keyframes landingFade {
  from {
    opacity: 0;
    transform: scale(1.03);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 1100px) {
  .landing-hero,
  .landing-modules,
  .landing-strip {
    grid-template-columns: 1fr;
  }

  .landing-hero-media::after {
    background: linear-gradient(180deg, var(--panel-bg, #fff), transparent 35%);
  }

  .landing-hero-media img {
    min-height: 220px;
    max-height: 280px;
  }

  .landing-module {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .landing-module:last-child {
    border-bottom: 0;
  }
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.pricing-hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  align-items: center;
  margin-bottom: 22px;
  padding: 22px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background:
    radial-gradient(700px 280px at 0% 0%, color-mix(in srgb, var(--primary, #0f766e) 14%, transparent), transparent 60%),
    radial-gradient(520px 240px at 100% 20%, color-mix(in srgb, #d97706 12%, transparent), transparent 55%),
    var(--panel-bg, #fff);
  overflow: hidden;
}

.pricing-hero-copy h1 {
  margin: 8px 0 10px;
  font-size: clamp(1.6rem, 2.4vw, 2.2rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.pricing-hero-copy p {
  margin: 0 0 16px;
  color: var(--text-muted);
  max-width: 42ch;
  line-height: 1.55;
}

.pricing-billing {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: var(--bg, #f8faf9);
  border: 1px solid var(--border);
  gap: 4px;
}

.billing-btn {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.billing-btn em {
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 700;
  color: #b45309;
  background: color-mix(in srgb, #d97706 16%, transparent);
  padding: 2px 6px;
  border-radius: 999px;
}

.billing-btn.active {
  background: var(--panel-bg, #fff);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.pricing-hero-media {
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  min-height: 220px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
}

.pricing-hero-media img,
.pricing-card-media img,
.pricing-trust-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pricing-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--panel-bg, #fff);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.pricing-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.pricing-card.featured {
  border-color: color-mix(in srgb, var(--primary, #0f766e) 55%, #d97706);
  box-shadow: 0 16px 36px color-mix(in srgb, var(--primary, #0f766e) 16%, transparent);
}

.pricing-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  padding: 5px 10px;
  border-radius: 999px;
  background: #d97706;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.pricing-card-media {
  height: 150px;
  overflow: hidden;
  background: var(--bg, #f8faf9);
}

.pricing-card-media img {
  transition: transform 280ms ease;
}

.pricing-card:hover .pricing-card-media img {
  transform: scale(1.04);
}

.pricing-card-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 18px 20px;
  flex: 1;
}

.pricing-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.pricing-card-head h2 {
  margin: 0 0 2px;
  font-size: 1.15rem;
}

.pricing-card-head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.pricing-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--primary, #0f766e) 12%, transparent);
  color: var(--primary, #0f766e);
  font-size: 1.1rem;
}

.pricing-card.featured .pricing-icon {
  background: color-mix(in srgb, #d97706 16%, transparent);
  color: #b45309;
}

.pricing-card .price {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.pricing-card .price strong {
  font-size: 2.15rem;
  letter-spacing: -0.03em;
}

.pricing-card .price span {
  color: var(--text-muted);
  font-weight: 600;
}

.pricing-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.pricing-features li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text-secondary, var(--text));
  font-size: 0.9rem;
  line-height: 1.35;
}

.pricing-features i {
  color: var(--primary, #0f766e);
  margin-top: 2px;
}

.pricing-card .btn-block {
  margin-top: auto;
}

.pricing-trust {
  margin-top: 22px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  overflow: hidden;
  padding: 0 !important;
}

.pricing-trust-copy {
  padding: 28px 26px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary, #0f766e) 10%, transparent), transparent 70%),
    var(--panel-bg, #fff);
}

.pricing-trust-copy h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

.pricing-trust-copy p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.55;
  max-width: 40ch;
}

.pricing-trust-media {
  min-height: 220px;
}

@media (max-width: 1100px) {
  .pricing-hero,
  .pricing-trust {
    grid-template-columns: 1fr;
  }

  .pricing-hero-media {
    min-height: 200px;
    max-height: 260px;
  }
}

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

  .mail-layout {
    grid-template-columns: 1fr;
  }

  .mail-folders,
  .mail-list {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .pricing-grid,
  .kanban-board {
    grid-template-columns: 1fr;
  }

  .chat-layout,
  .chat-app {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .chat-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    max-height: 360px;
  }

  .chat-list,
  .chat-contacts {
    border-right: 0;
  }

  .chat-thread {
    min-height: 480px;
  }
}

@media (max-width: 600px) {
  body.customizer-open .customize-tab {
    right: 0;
    opacity: 0;
    pointer-events: none;
  }

  .customizer {
    width: 100%;
  }
}

/* Project — lead activity timeline */
.activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.activity-list li {
  display: flex;
  gap: 14px;
  position: relative;
  padding-bottom: 18px;
}

.activity-list li:last-child {
  padding-bottom: 0;
}

.activity-list li:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 14px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.activity-dot {
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
  flex-shrink: 0;
  z-index: 1;
}

.activity-list strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.activity-list p {
  margin: 0 0 4px;
  color: var(--text-secondary);
  font-size: 0.84rem;
}

.activity-list em {
  font-style: normal;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* —— Products page —— */
.products-panel {
  padding: 0;
  overflow: hidden;
}

.status-tabs {
  display: flex;
  gap: 4px;
  padding: 14px 18px 0;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.status-tab {
  border: 0;
  background: transparent;
  padding: 10px 14px 12px;
  color: var(--text-muted);
  font: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.status-tab em {
  font-style: normal;
  font-weight: 700;
  color: var(--text-secondary);
  margin-left: 4px;
}

.status-tab:hover {
  color: var(--text);
}

.status-tab.active {
  color: var(--primary);
}

.status-tab.active em {
  color: var(--primary);
}

.status-tab.active::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--primary);
}

.products-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.products-search {
  max-width: 240px;
  margin: 0;
  flex: 1 1 200px;
}

.products-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.products-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
}

.products-actions .btn-primary,
.products-actions .btn-secondary {
  margin-top: 0;
  gap: 6px;
}

.products-table {
  min-width: 1100px;
}

.products-table td {
  vertical-align: middle;
}

.product-thumb {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--surface-muted);
}

.product-name {
  display: block;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.88rem;
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-name:hover {
  text-decoration: underline;
}

.product-desc {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 220px;
}

.tag {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.fav-btn {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: color var(--ease), background var(--ease);
}

.fav-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.fav-btn.active {
  color: var(--accent);
}

.vendor-link {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.86rem;
  white-space: nowrap;
}

.vendor-link:hover {
  text-decoration: underline;
}

.dropdown-row-actions {
  width: 150px;
  padding: 6px;
  right: 0;
}

.dropdown-row-actions a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.dropdown-row-actions a:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.dropdown-row-actions a.danger {
  color: var(--danger);
}

.dropdown-row-actions a.danger:hover {
  background: var(--danger-soft);
}

.products-footer {
  border-top: 1px solid var(--border);
}

@media (max-width: 900px) {
  .products-actions {
    margin-left: 0;
    width: 100%;
  }

  .products-search {
    max-width: none;
    flex: 1 1 100%;
  }
}

/* —— Customers page —— */
.customers-table {
  min-width: 1000px;
}

.customers-table th {
  white-space: nowrap;
}

.sort-ico {
  font-size: 0.7rem;
  opacity: 0.45;
  margin-left: 4px;
}

.customer-link {
  color: inherit;
}

.customer-link span {
  font-weight: 600;
}

.customer-link:hover span {
  color: var(--primary);
}

.email-link {
  color: var(--primary);
  font-weight: 500;
  font-size: 0.86rem;
}

.email-link:hover {
  text-decoration: underline;
}

.company-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
}

.company-cell strong {
  display: block;
  font-size: 0.9rem;
}

.company-cell span:not(.company-avatar) {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.company-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
  background: var(--av, var(--primary));
}

.company-avatar.lg {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  font-size: 1.15rem;
}

.link-primary {
  color: var(--primary);
  font-weight: 600;
}

.link-primary:hover {
  text-decoration: underline;
}

.filter-dropdown {
  position: relative;
}

.dropdown-filter {
  width: 160px;
  padding: 6px;
  left: 0;
  right: auto;
}

.filter-option {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  border-radius: 8px;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
}

.filter-option:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.customers-footer {
  gap: 12px;
  flex-wrap: wrap;
}

.footer-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.link-primary {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.link-primary:hover {
  text-decoration: underline;
}

.pager.numbered {
  align-items: center;
}

.pager-btn.page,
.pager-btn.icon {
  min-width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.pager-btn.page.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* —— Orders page —— */
.orders-table {
  min-width: 1100px;
}

.orders-table th {
  white-space: nowrap;
}

.order-link {
  color: var(--primary);
  font-weight: 700;
  font-size: 0.88rem;
}

.order-link:hover {
  text-decoration: underline;
}

.pill.info {
  background: color-mix(in srgb, var(--primary) 14%, var(--primary-soft));
  color: var(--primary);
}

.pill.muted {
  background: var(--surface-muted);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* Filter dropdown enhancements */
.filter-dropdown.open .range-select {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.filter-dropdown.open .range-select .bi-chevron-down {
  transform: rotate(180deg);
}

.filter-dropdown .range-select .bi-chevron-down {
  display: inline-block;
  transition: transform var(--ease);
}

.dropdown-filter-wide {
  width: 200px;
}

.filter-group-label {
  margin: 8px 10px 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.filter-group-label:first-child {
  margin-top: 4px;
}

.filter-option.selected {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
}

/* —— Refund page —— */
.refund-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.refund-meta {
  margin: 6px 0 0 !important;
  color: var(--text-secondary) !important;
  font-size: 0.9rem !important;
}

.refund-meta .meta-sep {
  margin-left: 14px;
}

.refund-meta strong {
  color: var(--text);
  font-weight: 700;
}

.refund-layout {
  display: grid;
  grid-template-columns: 1.55fr 0.7fr;
  gap: 16px;
  align-items: start;
}

.refund-table-panel {
  overflow: hidden;
}

.refund-table {
  min-width: 720px;
}

.refund-table .product-cell {
  max-width: 280px;
}

.refund-table .product-name {
  max-width: 200px;
}

.refund-table tfoot td {
  background: var(--bg-elevated);
  border-bottom: 0;
  font-weight: 600;
}

.subtotal-label {
  text-align: right;
  color: var(--text-secondary);
}

.subtotal-value {
  font-weight: 800 !important;
  letter-spacing: -0.02em;
}

.refund-aside {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.summary-card h2,
.refund-amount-card h2 {
  margin: 0 0 16px;
  font-size: 1rem;
  font-weight: 800;
}

.summary-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.summary-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.summary-list strong {
  color: var(--text);
  font-weight: 700;
}

.text-danger {
  color: var(--danger) !important;
}

.summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
}

.summary-total strong {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.refund-amount-card .field {
  margin-bottom: 14px;
}

.refund-amount-card .btn-primary {
  margin-top: 0;
}

@media (max-width: 1100px) {
  .refund-layout {
    grid-template-columns: 1fr;
  }
}

/* —— Analytics page —— */
.analytics-stats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.analytics-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 14px;
  text-align: center;
}

.analytics-stat strong {
  display: block;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 6px;
}

.analytics-stat span {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.chart-card {
  display: flex;
  flex-direction: column;
  min-height: 360px;
}

.chart-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.chart-card-head h2 {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 800;
}

.chart-card-head p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.chart-box {
  position: relative;
  flex: 1;
  min-height: 260px;
}

.chart-radar {
  min-height: 240px;
}

.radar-layout {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 12px;
  align-items: center;
  flex: 1;
}

.campaign-stats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.campaign-stats li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.campaign-stats .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}

.campaign-stats .dot.online { background: var(--accent); }
.campaign-stats .dot.offline { background: var(--primary); }

.campaign-stats strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.campaign-stats em {
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 700;
}

.campaign-stats em.up {
  color: var(--success);
}

.campaign-stats span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

@media (max-width: 1200px) {
  .analytics-stats {
    grid-template-columns: repeat(3, 1fr);
  }
}

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

  .analytics-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* —— Lead list page —— */
.lead-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.lead-title-row h1 {
  margin: 0;
}

.lead-title-row .count {
  color: var(--text-muted);
  font-weight: 700;
}

.lead-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 4px 18px 0;
  border-bottom: 1px solid var(--border);
}

.lead-tabs {
  padding: 0;
  border-bottom: 0;
  overflow-x: auto;
}

.lead-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
}

.lead-tools .products-search {
  max-width: 200px;
  margin: 0;
}

.view-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}

.view-btn {
  width: 36px;
  height: 34px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.view-btn + .view-btn {
  border-left: 1px solid var(--border);
}

.view-btn:hover,
.view-btn.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.lead-table {
  min-width: 980px;
}

.lead-name {
  color: var(--primary);
  font-weight: 700;
  font-size: 0.92rem;
}

.lead-name:hover {
  text-decoration: underline;
}

.avatar-stack {
  display: flex;
  align-items: center;
}

.avatar-stack img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--surface);
  margin-left: -8px;
  background: var(--surface-muted);
}

.avatar-stack img:first-child {
  margin-left: 0;
}

.avatar-more {
  margin-left: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
}

.progress-cell {
  min-width: 110px;
}

.progress-cell span {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.progress-track {
  height: 4px;
  border-radius: 999px;
  background: var(--surface-muted);
  overflow: hidden;
}

.progress-bar {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.progress-bar.success { background: var(--success); }
.progress-bar.warning { background: var(--warning); }
.progress-bar.danger { background: var(--danger); }
.progress-bar.info { background: var(--primary); }
.progress-bar.muted { background: var(--border-strong); }

@media (max-width: 900px) {
  .lead-toolbar {
    align-items: stretch;
  }

  .lead-tools {
    width: 100%;
  }

  .lead-tools .products-search {
    flex: 1;
    max-width: none;
  }
}

/* —— Lead details —— */
.lead-profile-card {
  margin-bottom: 16px;
}

.lead-profile {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lead-profile img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
}

.lead-profile h1 {
  margin: 0 0 4px;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.lead-profile p {
  margin: 0;
  color: var(--text-secondary);
}

.company-link {
  color: var(--primary);
  font-weight: 700;
}

.company-link:hover {
  text-decoration: underline;
}

.lead-detail-layout {
  display: grid;
  grid-template-columns: 0.85fr 1.55fr;
  gap: 16px;
  align-items: start;
}

.about-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.about-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}

.about-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.about-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.about-list i {
  width: 18px;
  text-align: center;
  color: var(--text-muted);
  margin-top: 2px;
}

.about-list span {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.about-list strong {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.lead-tabs-panel {
  min-width: 0;
}

.lead-detail-tabs {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: 0;
  padding: 8px 14px 0;
  margin-bottom: 0;
}

.tab-pane {
  display: none;
}

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

.tab-pane > .panel,
.tab-pane > .products-panel {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.email-panel {
  overflow: hidden;
}

.email-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
}

.email-head {
  padding: 14px 18px 0;
}

.email-head h2 {
  margin: 0 0 4px;
  font-size: 1.15rem;
  font-weight: 800;
}

.email-subtabs {
  padding: 0;
  border-bottom: 0;
}

.emails-table {
  min-width: 860px;
}

.email-subject {
  display: block;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.88rem;
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email-subject:hover {
  text-decoration: underline;
}

.email-preview {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

@media (max-width: 1100px) {
  .lead-detail-layout {
    grid-template-columns: 1fr;
  }
}

/* Lead grid view */
.lead-empty {
  padding: 28px 18px;
  text-align: center;
  margin: 0;
}

.lead-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 16px 18px 18px;
}

.lead-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color var(--ease), transform var(--ease);
}

.lead-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.lead-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.lead-card-top .lead-name {
  font-size: 0.95rem;
  line-height: 1.35;
  white-space: normal;
}

.lead-card-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.lead-card-meta span {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.lead-card-meta strong {
  font-size: 0.78rem;
  font-weight: 700;
}

.lead-card .btn-secondary {
  margin-top: auto;
  align-self: flex-start;
}

@media (max-width: 1100px) {
  .lead-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  .lead-grid {
    grid-template-columns: 1fr;
  }
}

/* ========== Email app (Inbox / Detail / Compose) ========== */
.content-email {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 64px);
  padding-bottom: 0 !important;
}

.email-app {
  display: grid;
  grid-template-columns: 240px 1fr;
  flex: 1;
  min-height: calc(100vh - 100px);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel-bg, #fff);
  box-shadow: var(--shadow, 0 1px 2px rgba(15, 23, 42, 0.04));
}

.email-nav {
  border-right: 1px solid var(--border);
  padding: 16px 14px;
  overflow-y: auto;
  background: var(--panel-bg, #fff);
}

.email-compose-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 18px;
  text-decoration: none;
}

.email-nav-label {
  margin: 14px 8px 6px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.email-folder-list,
.email-label-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.email-folder,
.email-label {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-decoration: none;
  border-radius: 10px;
  padding: 9px 10px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  font-size: 0.88rem;
}

.email-folder:hover,
.email-label:hover {
  background: color-mix(in srgb, var(--primary, #0f766e) 8%, transparent);
}

.email-folder.active,
.email-label.active {
  background: color-mix(in srgb, var(--primary, #0f766e) 12%, transparent);
  color: var(--primary, #0f766e);
  font-weight: 600;
}

.email-folder i {
  width: 1.1rem;
  text-align: center;
  color: var(--text-muted);
}

.email-folder.active i {
  color: var(--primary, #0f766e);
}

.email-folder em {
  margin-left: auto;
  font-style: normal;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.email-folder.email-add {
  color: var(--primary, #0f766e);
}

.label-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--dot, #94a3b8);
  flex-shrink: 0;
}

.email-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--panel-bg, #fff);
}

.email-list-toolbar {
  padding: 14px 18px 8px;
}

.email-list-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 4px 18px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
}

.email-refresh {
  display: flex;
  align-items: center;
  gap: 4px;
}

.email-list-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.email-showing {
  margin-right: 6px;
}

.email-rows {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.email-row {
  display: grid;
  grid-template-columns: 36px 32px 1fr;
  align-items: start;
  gap: 4px;
  padding: 12px 14px 12px 10px;
  border-bottom: 1px solid var(--border);
}

.email-row:hover {
  background: color-mix(in srgb, var(--primary, #0f766e) 5%, transparent);
}

.email-row.unread .email-from strong,
.email-row.unread .email-subject-line b {
  font-weight: 800;
}

.email-check {
  display: grid;
  place-items: center;
  padding-top: 10px;
}

.email-star {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 8px 4px;
  line-height: 1;
}

.email-star.starred,
.email-star.starred i {
  color: #f59e0b;
}

.email-row-link {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 12px;
  align-items: start;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.email-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.email-from {
  min-width: 0;
}

.email-from strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.email-subject-line {
  display: block;
  font-size: 0.84rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email-subject-line em {
  color: var(--text-muted);
  font-style: normal;
  font-weight: 400;
}

.email-row-link time {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  padding-top: 2px;
}

.email-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg, #f8faf9);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attach-chip.large {
  border-radius: 12px;
  padding: 10px 12px;
  max-width: none;
}

.attach-chip.large span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.attach-chip.large span span {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.email-empty {
  padding: 24px;
  text-align: center;
}

/* Email detail */
.email-detail-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
}

.email-detail-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.email-detail {
  padding: 20px 28px 28px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.email-detail-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.email-detail-title h1 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 800;
}

.label-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: color-mix(in srgb, var(--chip, #f59e0b) 18%, transparent);
  color: var(--chip, #f59e0b);
}

.email-detail-sender {
  display: grid;
  grid-template-columns: 48px 1fr auto auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 22px;
}

.email-detail-sender img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.email-detail-sender strong {
  display: block;
  font-size: 0.95rem;
}

.email-detail-sender span,
.email-detail-sender em {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: normal;
}

.email-detail-sender time {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.email-detail-body {
  line-height: 1.65;
  font-size: 0.95rem;
}

.email-detail-body ul {
  padding-left: 1.2rem;
}

.email-detail-attachments {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.email-detail-attachments h3 {
  margin: 0 0 12px;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.email-detail-attachments h3 em {
  font-style: normal;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.email-detail-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.email-detail-foot .btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

/* Compose */
.email-compose-pane {
  padding: 0;
}

.compose-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
}

.compose-head h1 {
  margin: 0;
  font-size: 1.15rem;
}

.compose-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 8px 22px 18px;
}

.compose-field {
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}

.compose-field span {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.compose-field input,
.compose-field textarea {
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  width: 100%;
  resize: vertical;
}

.compose-body-field {
  grid-template-columns: 1fr;
  align-items: stretch;
  border-bottom: 0;
  flex: 1;
}

.compose-body-field textarea {
  min-height: 280px;
  padding: 12px 0;
  line-height: 1.55;
}

.compose-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.compose-actions {
  display: flex;
  gap: 8px;
}

.compose-toast {
  margin: 10px 0 0;
  color: var(--primary, #0f766e);
  font-size: 0.88rem;
  font-weight: 600;
}

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

@media (max-width: 960px) {
  .email-app {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .email-nav {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    max-height: 280px;
  }

  .email-detail-sender {
    grid-template-columns: 48px 1fr auto;
  }

  .email-detail-sender .email-star {
    grid-column: 3;
    grid-row: 1;
  }

  .compose-field {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
