:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --blue: #1e5bf0;
  --blue-dark: #164bd7;
  --cyan: #06b6d4;
  --cyan-light: #e0f2fe;
  --gradient: linear-gradient(135deg, #164bd7 0%, #1e5bf0 50%, #06b6d4 100%);
  --gradient-btn: linear-gradient(135deg, #1e5bf0 0%, #06b6d4 100%);
  --on-primary: #ffffff;
  --success: #10b981;
  --success-bg: #ecfdf5;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --warn: #f59e0b;
  --warn-bg: #fffbeb;
  --shadow: 0 10px 25px -5px rgba(30, 91, 240, 0.07), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 35px -10px rgba(22, 75, 215, 0.16);
  --radius: 20px;
  --radius-sm: 12px;
  --font: "Cairo", system-ui, -apple-system, sans-serif;
  --num: "Cairo", "IBM Plex Sans", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  background-color: var(--bg);
  background-image: radial-gradient(at 0% 0%, rgba(30, 91, 240, 0.04) 0px, transparent 50%),
                    radial-gradient(at 100% 100%, rgba(6, 182, 212, 0.04) 0px, transparent 50%);
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button, [role="button"] { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.55; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* BRAND & TOP HEADER */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}
.brand { display: flex; align-items: center; gap: 12px; }
.mark {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 6px 16px rgba(30, 91, 240, 0.25);
}
.mark svg { width: 24px; height: 24px; fill: currentColor; }
.brand h1 { margin: 0; font-size: 19px; font-weight: 700; color: var(--ink); line-height: 1.2; }
.brand p { margin: 0; color: var(--muted); font-size: 12px; font-weight: 500; }
.who { display: flex; align-items: center; gap: 12px; }
.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--cyan-light);
  color: var(--blue-dark);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

/* BUTTONS */
.btn, .ghost, .icon-btn {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  min-height: 42px;
  padding: 8px 18px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}
.btn {
  background: var(--gradient-btn);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(30, 91, 240, 0.22);
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(30, 91, 240, 0.32);
}
.btn.block { width: 100%; }
.ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}
.ghost:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: transparent;
}
.danger:hover { background: #fee2e2; }
.btn-sm { min-height: 32px; padding: 4px 12px; font-size: 13px; }

/* SHELL & NAVIGATION */
.shell { max-width: 1280px; margin: 0 auto; padding: 20px 24px 48px; }
.nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 20px;
}
.nav a {
  flex: 0 0 auto;
  text-decoration: none;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  min-height: 42px;
  padding: 8px 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s ease;
}
.nav a:hover { color: var(--blue); border-color: var(--blue); }
.nav a.active {
  background: var(--gradient-btn);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(30, 91, 240, 0.2);
}
.nav svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }

/* HEADINGS & GRIDS */
.page-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; margin-bottom: 20px; }
.page-head h2 { margin: 0; font-size: 24px; font-weight: 700; color: var(--ink); }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.stats { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* CARDS */
.stat, .card, .strip, .user, .callout {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.stat {
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}
.stat span { color: var(--muted); font-size: 13px; font-weight: 600; }
.stat b {
  display: block;
  margin-top: 8px;
  font-size: 30px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
}
.stat.mint {
  background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
  border-color: #bbf7d0;
}
.stat.mint b { color: #166534; }
.stat.blue {
  background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);
  border-color: #bae6fd;
}
.stat.blue b { color: var(--blue-dark); }

.card { padding: 22px; margin-bottom: 16px; }
.card h3, .strip h3, .user h3 { margin: 0 0 12px; font-size: 18px; font-weight: 700; }
.card.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* FLASH MESSAGES */
.flash {
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 18px;
  font-weight: 600;
}
.flash.ok { background: var(--success-bg); color: #065f46; border: 1px solid #a7f3d0; }
.flash.bad { background: var(--danger-bg); color: #991b1b; border: 1px solid #fecaca; }

/* FORMS */
.form-grid { display: flex; flex-direction: column; gap: 14px; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; color: var(--ink); }
input, select, textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  background: #ffffff;
  color: var(--ink);
  transition: all 0.2s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(30, 91, 240, 0.12);
  outline: none;
}
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }

/* TABLES */
.table-wrap { overflow-x: auto; margin-top: 10px; }
table { width: 100%; border-collapse: collapse; text-align: right; font-size: 14px; }
th { padding: 12px 14px; background: #f8fafc; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); }
td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:hover td { background: #f8fafc; }

/* PILLS & BADGES */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.pill.ok { background: var(--success-bg); color: #065f46; }
.pill.bad { background: var(--danger-bg); color: #991b1b; }
.pill.wait { background: var(--warn-bg); color: #92400e; }
.pill.blue { background: var(--cyan-light); color: var(--blue-dark); }

/* STRIP CARD */
.strip { padding: 20px; }
.strip-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.strip-meta { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; font-size: 13px; color: var(--muted); }
.outlets-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.outlet-btn {
  padding: 14px 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  transition: all 0.2s ease;
}
.outlet-btn.on {
  background: linear-gradient(135deg, #eff6ff 0%, #e0f2fe 100%);
  border-color: #38bdf8;
  color: var(--blue-dark);
}
.outlet-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

/* TOKEN BOX */
.token-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #f1f5f9;
  border-radius: var(--radius-sm);
  border: 1px dashed #cbd5e1;
  font-family: monospace;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
}

/* PUBLIC LANDING PAGE */
.landing-hero {
  position: relative;
  overflow: hidden;
  padding: 60px 20px 80px;
  text-align: center;
  background: radial-gradient(circle at 50% 20%, rgba(30, 91, 240, 0.12) 0%, rgba(6, 182, 212, 0.05) 40%, transparent 70%);
}
.landing-hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(30, 91, 240, 0.08);
  border: 1px solid rgba(30, 91, 240, 0.2);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 20px;
}
.landing-hero h1 {
  font-size: 46px;
  font-weight: 800;
  line-height: 1.2;
  margin: 0 auto 18px;
  max-width: 780px;
  color: var(--ink);
}
.landing-hero h1 span {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.landing-hero p {
  font-size: 18px;
  color: var(--muted);
  max-width: 620px;
  margin: 0 auto 32px;
}
.landing-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 40px;
}
.feature-card {
  padding: 26px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--cyan-light);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.feature-icon svg { width: 28px; height: 28px; }

/* PRICING CARDS */
.plan-card {
  padding: 28px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.2s ease;
}
.plan-card.featured {
  border: 2px solid var(--blue);
  box-shadow: var(--shadow-lg);
  transform: scale(1.02);
}
.plan-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gradient-btn);
  color: #fff;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.plan-price { font-size: 34px; font-weight: 800; color: var(--blue-dark); margin: 14px 0; }
.plan-features { list-style: none; padding: 0; margin: 18px 0 24px; flex: 1; }
.plan-features li { padding: 8px 0; border-bottom: 1px dashed var(--line); display: flex; align-items: center; gap: 8px; }

/* AUTH CARD */
.auth-wrap {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 32px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}

/* RESPONSIVE DESIGN BREAKPOINTS */

/* Tablet & Smaller Desktop (max-width: 1024px) */
@media (max-width: 1024px) {
  .shell { padding: 18px 20px 40px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .outlets-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Mobile Devices & Small Tablets (max-width: 768px) */
@media (max-width: 768px) {
  .top {
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 12px;
  }
  .brand h1 { font-size: 17px; }
  .brand p { font-size: 11px; }
  .mark { width: 40px; height: 40px; border-radius: 12px; }
  .mark svg { width: 20px; height: 20px; }

  .landing-hero { padding: 40px 16px 50px; }
  .landing-hero h1 { font-size: 30px; }
  .landing-hero p { font-size: 16px; margin-bottom: 24px; }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .shell { padding: 14px 14px 36px; }

  .table-wrap table { min-width: 580px; }

  .strip-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .strip-head form { width: 100%; }
  .strip-head button { width: 100%; }

  .cap { flex-direction: column; align-items: flex-start; gap: 10px; }
  .cap form, .cap button { width: 100%; }
}

/* Extra Small Phones (max-width: 480px) */
@media (max-width: 480px) {
  body { font-size: 14px; }
  .top { padding: 10px 12px; }
  .brand h1 { font-size: 16px; }
  .brand p { display: none; }
  .who { gap: 8px; }
  .user-badge { padding: 4px 10px; font-size: 12px; }

  .landing-hero h1 { font-size: 25px; }
  .landing-hero p { font-size: 14px; }
  .landing-actions { flex-direction: column; width: 100%; max-width: 280px; margin: 0 auto 24px; }
  .landing-actions .btn, .landing-actions .ghost { width: 100%; }

  .auth-wrap { padding: 16px 12px; }
  .auth-card { padding: 22px 16px; border-radius: 16px; }

  .card { padding: 16px 14px; border-radius: 16px; }
  .stat { padding: 14px; border-radius: 16px; }
  .stat b { font-size: 24px; }

  .outlets-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .outlet-btn { padding: 12px 8px; font-size: 13px; }

  .plan-card { padding: 20px 16px; }
  .plan-price { font-size: 28px; }

  .btn, .ghost { min-height: 38px; padding: 6px 14px; font-size: 13px; }
}

/* ==========================================================================
   APP LAYOUT & RESPONSIVE RTL SIDEBAR
   ========================================================================== */
.app-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  background: var(--bg);
}

.content-wrapper {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(16, 31, 57, 0.04);
}

.top-bar-start {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hamburger-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hamburger-btn span {
  display: block;
  width: 20px;
  height: 2.2px;
  background: var(--ink);
  border-radius: 2px;
  transition: all 0.25s ease;
}

.hamburger-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.top-bar-end {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-quick-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 6px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.mini-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gradient-btn);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(30, 91, 240, 0.25);
}

.user-quick-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-quick-meta .uname {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.user-quick-meta .urole {
  font-size: 10px;
  color: var(--muted);
}

.top-logout-btn {
  padding: 6px 14px;
  font-size: 13px;
  border-radius: 999px;
  min-height: 36px;
}

/* RTL SIDEBAR */
.sidebar {
  width: 270px;
  flex: 0 0 270px;
  background: var(--surface);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 1050;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -4px 0 24px rgba(16, 31, 57, 0.04);
}

.sidebar-header {
  padding: 22px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.sidebar-avatar-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-avatar {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, #1756c3, #1dcac1);
  color: white;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(23, 86, 195, 0.22);
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
}

.sidebar-user-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
}

.sidebar-user-role {
  font-size: 11px;
  font-weight: 700;
  margin-top: 3px;
  padding: 2px 8px;
  border-radius: 999px;
  display: inline-block;
  width: fit-content;
}

.role-admin {
  background: #fef3c7;
  color: #92400e;
}

.role-user {
  background: #e0f2fe;
  color: #0369a1;
}

.sidebar-close-btn {
  display: none;
  background: transparent;
  border: 0;
  font-size: 18px;
  color: var(--muted);
  cursor: pointer;
  padding: 6px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  color: #475569;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.sidebar-nav a:hover {
  background: #f1f5f9;
  color: #1756c3;
  transform: translateX(-3px);
}

.sidebar-nav a.active {
  background: linear-gradient(135deg, #1756c3, #1b8fc9);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(23, 86, 195, 0.25);
}

.sidebar-nav a svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--line);
  background: #fafcff;
}

.sidebar-logout-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  background: #fff;
  border: 1px solid #fee2e2;
  color: #dc2626;
  border-radius: 12px;
  font-weight: 700;
  font-size: 13px;
  transition: all 0.2s ease;
}

.sidebar-logout-btn:hover {
  background: #fee2e2;
}

.sidebar-brand-tag {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 11px;
  color: var(--muted);
}

.mini-mark {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: var(--gradient-btn);
  color: #fff;
  display: grid;
  place-items: center;
}

.mini-mark svg {
  width: 11px;
  height: 11px;
}

.main-content {
  flex: 1;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(16, 31, 57, 0.45);
  backdrop-filter: blur(4px);
  z-index: 1040;
}

/* Sidebar collapsed state on desktop */
.app-layout.sidebar-collapsed .sidebar {
  width: 0;
  flex: 0 0 0;
  transform: translateX(100%);
  overflow: hidden;
  border-left-width: 0;
}

/* Responsive sidebar for tablet and mobile */
@media (max-width: 960px) {
  .sidebar {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    transform: translateX(100%);
    box-shadow: -8px 0 32px rgba(16, 31, 57, 0.18);
  }

  .sidebar-close-btn {
    display: block;
  }

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

  .app-layout.sidebar-open .sidebar-backdrop {
    display: block;
  }

  .hide-mobile {
    display: none;
  }
}

/* ==========================================================================
   ANALYTICS DASHBOARD (MATCHING banx-power-analytics-reference.html)
   ========================================================================== */
.analytics-dashboard-shell {
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 22px 60px rgba(16, 31, 57, 0.08);
  backdrop-filter: blur(18px);
  margin-bottom: 24px;
}

.dashboard-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.heading-kicker {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #1756c3;
  font-size: 12px;
  font-weight: 800;
}

.heading-kicker svg {
  width: 18px;
  height: 18px;
}

.dashboard-header h1 {
  margin: 6px 0 2px;
  font-size: clamp(24px, 2.5vw, 34px);
  font-weight: 900;
  color: #101f39;
  line-height: 1.3;
}

.dashboard-header p {
  margin: 0;
  color: #708098;
  font-size: 13px;
  font-weight: 500;
}

.period-filter {
  padding: 5px;
  border: 1px solid #e6edf5;
  border-radius: 16px;
  display: flex;
  gap: 4px;
  background: #f4f7fa;
}

.period-filter button {
  min-height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  color: #64748b;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  transition: all 0.2s ease;
}

.period-filter button:hover {
  color: #1756c3;
}

.period-filter button[aria-pressed="true"] {
  color: white;
  background: linear-gradient(135deg, #1756c3, #1b8fc9);
  box-shadow: 0 6px 16px rgba(23, 86, 195, 0.24);
}

.custom-range {
  margin-top: 18px;
  padding: 14px 18px;
  border: 1px solid #e6edf5;
  border-radius: 16px;
  display: none;
  align-items: flex-end;
  gap: 12px;
  background: #f8fafd;
}

.custom-range.is-visible {
  display: flex;
}

.custom-range label {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.custom-range label span {
  color: #708098;
  font-size: 11px;
  font-weight: 700;
}

.custom-range input {
  height: 40px;
  padding: 0 12px;
  border: 1px solid #dce5ef;
  border-radius: 10px;
  color: #101f39;
  background: white;
  font-size: 12px;
  font-weight: 600;
}

.apply-button {
  height: 40px;
  padding: 0 20px;
  border: 0;
  border-radius: 10px;
  color: white;
  background: #1756c3;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

.apply-button:hover {
  background: #1549a7;
}

/* Metric Cards */
.metric-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.metric-card {
  position: relative;
  min-height: 200px;
  padding: 22px;
  border: 1px solid #e6edf5;
  border-radius: 22px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 12px 35px rgba(16, 31, 57, 0.05);
}

.metric-card::after {
  content: "";
  position: absolute;
  width: 110px;
  height: 110px;
  top: -50px;
  left: -40px;
  border-radius: 50%;
  background: rgba(23, 86, 195, 0.05);
}

.metric-card[data-metric="orders"]::after {
  background: rgba(29, 202, 193, 0.08);
}

.metric-card[data-metric="users"]::after {
  background: rgba(255, 189, 23, 0.09);
}

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

.metric-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #1756c3;
  background: #e7f0ff;
}

[data-metric="orders"] .metric-icon {
  color: #0c9d96;
  background: #def7f4;
}

[data-metric="users"] .metric-icon {
  color: #d79800;
  background: #fff3c7;
}

.metric-icon svg {
  width: 22px;
  height: 22px;
}

.change {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #109c70;
  font-size: 11px;
  font-weight: 800;
}

.change svg {
  width: 14px;
  height: 14px;
}

.metric-label {
  margin-top: 14px;
  display: block;
  color: #708098;
  font-size: 12px;
  font-weight: 600;
}

.metric-value {
  display: block;
  font-size: 34px;
  line-height: 1.3;
  font-weight: 900;
  color: #101f39;
}

.metric-description {
  margin: 0;
  color: #9aa6b5;
  font-size: 11px;
}

.progress-track {
  height: 7px;
  margin-top: 16px;
  border-radius: 999px;
  overflow: hidden;
  background: #e9eef4;
}

.progress-value {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, #1756c3, #1b8fc9);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.mini-bars {
  height: 28px;
  margin-top: 10px;
  display: flex;
  align-items: flex-end;
  gap: 5px;
}

.mini-bars i {
  width: 15px;
  border-radius: 3px 3px 1px 1px;
  background: linear-gradient(to top, #1b91b9, #1dcac1);
  transition: height 0.5s ease;
}

.user-stack {
  margin-top: 11px;
  display: flex;
  align-items: center;
  direction: ltr;
}

.user-stack span {
  width: 28px;
  height: 28px;
  margin-right: -7px;
  border: 2px solid white;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  background: #1756c3;
  font-size: 9px;
  font-weight: 800;
}

.user-stack span:nth-child(2) { background: #2ed095; }
.user-stack span:nth-child(3) { background: #7d62cc; }
.user-stack span:nth-child(4) { background: #ffbd17; }

.user-stack b {
  margin-left: 12px;
  color: #1756c3;
  font-size: 11px;
}

/* Charts Grid */
.chart-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1.75fr 0.85fr;
  gap: 18px;
}

.chart-card {
  min-height: 360px;
  padding: 24px;
  border: 1px solid #e6edf5;
  border-radius: 22px;
  background: white;
  box-shadow: 0 12px 35px rgba(16, 31, 57, 0.05);
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.chart-title {
  display: flex;
  flex-direction: column;
}

.chart-title strong {
  font-size: 16px;
  font-weight: 800;
  color: #101f39;
}

.chart-title small {
  margin-top: 3px;
  color: #708098;
  font-size: 11px;
}

.legend {
  display: flex;
  gap: 14px;
}

.legend span,
.connection-row span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #708098;
  font-size: 11px;
}

.legend i,
.connection-row i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1dcac1;
}

.legend span:last-child i {
  background: #1756c3;
}

.line-chart {
  position: relative;
  height: 230px;
  margin-top: 24px;
}

.grid-lines {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.grid-lines i {
  width: 100%;
  border-top: 1px dashed #e5ebf2;
}

.line-chart svg {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.axis-labels {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  color: #9ba6b5;
  font-size: 10px;
}

.live-badge {
  padding: 6px 12px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #0b986c;
  background: #dff8ee;
  font-size: 10px;
  font-weight: 800;
}

.live-badge i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2ed095;
  box-shadow: 0 0 0 3px rgba(46, 208, 149, 0.2);
}

.donut-wrap {
  padding: 26px 0 20px;
  display: grid;
  place-items: center;
}

.donut {
  --connected-angle: 309.6deg;
  position: relative;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(
    #1dcac1 0deg,
    #1756c3 var(--connected-angle),
    #e8edf3 var(--connected-angle),
    #e8edf3 360deg
  );
  box-shadow: 0 16px 35px rgba(23, 86, 195, 0.12);
  transition: background 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.donut::before {
  content: "";
  position: absolute;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background: white;
}

.donut-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.donut-copy strong {
  font-size: 28px;
  font-weight: 900;
  color: #101f39;
}

.donut-copy small {
  color: #708098;
  font-size: 11px;
}

.connection-list {
  padding-top: 15px;
  border-top: 1px solid #edf1f5;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.connection-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.connection-row.offline i {
  background: #d7dee7;
}

.connection-row strong {
  font-size: 15px;
  font-weight: 800;
  color: #101f39;
}

/* RECENT ACTIVITIES CARD (REPLACING AI CONTRACT) */
.recent-activities-card {
  padding: 26px;
  border: 1px solid #e6edf5;
  border-radius: 22px;
  background: white;
  box-shadow: 0 12px 35px rgba(16, 31, 57, 0.05);
}

.recent-activities-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.recent-activities-header h3 {
  margin: 4px 0 0;
  font-size: 18px;
  font-weight: 800;
  color: #101f39;
}

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

.activity-log-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f8fafd;
  border: 1px solid #edf2f8;
  transition: all 0.2s ease;
}

.activity-log-row:hover {
  background: #f0f7ff;
  border-color: #dbeafe;
}

.log-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #e9f2ff;
  color: #1756c3;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.log-badge svg {
  width: 17px;
  height: 17px;
}

.log-content {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.log-msg {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
}

.log-time {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
}

.empty-logs {
  padding: 24px;
  text-align: center;
}

@media (max-width: 900px) {
  .dashboard-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .period-filter {
    width: 100%;
    overflow-x: auto;
  }

  .period-filter button {
    flex: 1;
    white-space: nowrap;
  }

  .metric-grid,
  .chart-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 580px) {
  .analytics-dashboard-shell {
    padding: 18px;
    border-radius: 20px;
  }

  .period-filter {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .period-filter button:last-child {
    grid-column: 1 / -1;
  }

  .custom-range {
    align-items: stretch;
    flex-direction: column;
  }

  .custom-range input,
  .apply-button {
    width: 100%;
  }

  .chart-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .line-chart {
    height: 180px;
  }

  .axis-labels span:nth-child(even) {
    display: none;
  }
}

