/* ============================================
   RAJANI STUDIO DEMO APP
   Light editorial theme · Crimson accent
   ============================================ */

:root {
  --bg: #fbf9f5;
  --bg-soft: #f5f1e8;
  --bg-card: #ffffff;
  --bg-dark: #1a1a1f;
  --text: #1a1a1f;
  --text-muted: #6b6864;
  --text-faint: #a09c95;
  --accent: #a01a25;
  --accent-soft: #fce4e6;
  --accent-dark: #821420;
  --border: #e6e2da;
  --border-strong: #c7c0b4;
  --success: #1a7e3e;
  --warn: #c97a0d;
  --danger: #c93838;
  --info: #2563eb;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 2px 8px rgba(26, 26, 31, 0.04);
  --shadow: 0 8px 24px rgba(26, 26, 31, 0.06);
  --shadow-lg: 0 16px 48px rgba(26, 26, 31, 0.08);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Consolas, monospace;
  --sidebar-w: 264px;
  --topbar-h: 64px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; padding: 0; }
input, select, textarea { font-family: inherit; }

/* ============================================
   LOGIN / AUTH PAGE
   ============================================ */

.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow-x: hidden;
}

.auth-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.auth-grain {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
  opacity: 0.04;
  mix-blend-mode: multiply;
}
.auth-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.25;
}
.auth-blob-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, var(--accent), transparent);
  top: -200px; right: -100px;
}
.auth-blob-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #f5e0a8, transparent);
  bottom: -150px; left: -100px;
}

.auth-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  padding: 40px 24px;
}

.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 99px;
  margin-bottom: 24px;
  transition: all 0.2s;
}
.auth-back:hover {
  background: var(--bg-card);
  color: var(--text);
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  box-shadow: var(--shadow-lg);
}

.auth-header {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px dashed var(--border);
}
.auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.auth-logo img {
  width: 44px; height: 44px;
}
.auth-logo > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.auth-brand {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  font-variation-settings: "opsz" 144;
}
.auth-brand em {
  font-style: italic;
  color: var(--accent);
  font-weight: 500;
}
.auth-sub {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-faint);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.auth-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 12px;
}

.auth-card h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.2rem);
  line-height: 1.1;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0 0 12px 0;
  font-variation-settings: "opsz" 144;
}
.auth-card h1 em {
  font-style: italic;
  color: var(--accent);
  font-weight: 500;
}

.auth-lead {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0 0 24px 0;
}

.demo-creds {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 24px;
  padding: 14px;
  background: var(--bg-soft);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}
.demo-cred {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}
.demo-label {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  flex-shrink: 0;
}
.demo-cred code {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  color: var(--accent);
  background: var(--bg-card);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-weight: 600;
  cursor: pointer;
  flex: 1;
  text-align: center;
  transition: all 0.2s;
}
.demo-cred code:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.demo-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: var(--text-faint);
  transition: all 0.2s;
  flex-shrink: 0;
}
.demo-copy:hover {
  background: var(--bg-card);
  color: var(--accent);
}
.demo-copy-done { color: var(--success) !important; }

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.auth-field input {
  padding: 12px 14px;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  transition: all 0.2s;
}
.auth-field input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-card);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.auth-field input::placeholder { color: var(--text-faint); }

.auth-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--accent-dark);
  font-size: 0.85rem;
  line-height: 1.4;
}
.auth-error svg { flex-shrink: 0; margin-top: 1px; }
.auth-error strong { font-weight: 600; }

.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  background: var(--bg-dark);
  color: white;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-top: 6px;
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}
.auth-btn:hover {
  background: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(160, 26, 37, 0.2);
}
.auth-btn-success {
  background: var(--success) !important;
  pointer-events: none;
}

.auth-form-shake {
  animation: shake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}
@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

.auth-footer-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.auth-dot {
  width: 6px; height: 6px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.auth-disclaimer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.auth-disclaimer a {
  color: var(--accent);
  font-weight: 600;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}

@media (max-width: 480px) {
  .auth-shell { padding: 24px 16px; }
  .auth-card { padding: 28px 22px; }
  .demo-creds { grid-template-columns: 1fr; }
}

/* ============================================
   APP / DASHBOARD
   ============================================ */

.app-body {
  height: 100vh;
  overflow: hidden;
}

/* Demo banner */
.demo-banner {
  background: linear-gradient(135deg, #1a1a1f, #2a2a31);
  color: white;
  padding: 10px 0;
  font-size: 0.85rem;
  position: relative;
  z-index: 50;
  transition: all 0.3s;
}
.demo-banner-hidden {
  display: none;
}
.demo-banner-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: relative;
}
.demo-pulse {
  width: 8px; height: 8px;
  background: #4ade80;
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
  animation: pulseRing 1.5s ease-in-out infinite;
}
@keyframes pulseRing {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}
.demo-banner-text strong {
  font-weight: 600;
  color: #fbf9f5;
}
.demo-banner-text a {
  color: #fca5a5;
  border-bottom: 1px dashed currentColor;
  padding-bottom: 1px;
  margin-left: 4px;
  font-weight: 500;
}
.demo-banner-text a:hover { color: white; border-color: white; }
.demo-banner-close {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  opacity: 0.6;
  font-size: 1.4rem;
  width: 28px; height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.demo-banner-close:hover { opacity: 1; background: rgba(255,255,255,0.1); }

.app-shell {
  display: flex;
  height: calc(100vh - 0px);
  overflow: hidden;
}
.demo-banner + .app-shell {
  height: calc(100vh - 41px);
}

/* ============ SIDEBAR ============ */
.app-sidebar {
  width: var(--sidebar-w);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  padding: 20px 16px;
  gap: 24px;
  overflow-y: auto;
}

.app-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px;
  border-radius: var(--radius);
  transition: background 0.2s;
}
.app-logo:hover { background: var(--bg-soft); }
.app-logo img { width: 36px; height: 36px; flex-shrink: 0; }
.app-logo-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.app-brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--text);
  font-variation-settings: "opsz" 144;
}
.app-brand em { font-style: italic; color: var(--accent); font-weight: 500; }
.app-sub {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--text-faint);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.app-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.app-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
  transition: all 0.15s;
  position: relative;
}
.app-nav-item:hover {
  background: var(--bg-soft);
  color: var(--text);
}
.app-nav-item.app-nav-active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.app-nav-item svg { flex-shrink: 0; }
.app-nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: white;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 99px;
  min-width: 22px;
  text-align: center;
}

.app-sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px dashed var(--border);
  margin-top: auto;
}
.app-user { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.app-user-avatar {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.app-user-info { min-width: 0; }
.app-user-name { font-size: 0.86rem; font-weight: 600; color: var(--text); }
.app-user-role { font-size: 0.7rem; color: var(--text-faint); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; }
.app-logout {
  width: 32px; height: 32px;
  border-radius: 8px;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.app-logout:hover { background: var(--accent-soft); color: var(--accent); }

/* ============ MAIN ============ */
.app-main {
  flex: 1;
  overflow-y: auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.app-topbar {
  height: var(--topbar-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 32px;
  gap: 20px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 10;
}
.app-menu-toggle {
  display: none;
  width: 40px; height: 40px;
  border-radius: 8px;
  color: var(--text-muted);
  align-items: center;
  justify-content: center;
}
.app-menu-toggle:hover { background: var(--bg-soft); color: var(--text); }

.app-topbar-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
}

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

.app-search {
  position: relative;
  display: flex;
  align-items: center;
}
.app-search svg {
  position: absolute;
  left: 12px;
  color: var(--text-faint);
  pointer-events: none;
}
.app-search input {
  padding: 8px 60px 8px 36px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text);
  width: 280px;
  transition: all 0.2s;
}
.app-search input:focus {
  outline: none;
  background: var(--bg-card);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.app-search input::placeholder { color: var(--text-faint); }
.app-search kbd {
  position: absolute;
  right: 8px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-faint);
  background: var(--bg-card);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.app-icon-btn {
  width: 38px; height: 38px;
  border-radius: 8px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.2s;
}
.app-icon-btn:hover { background: var(--bg-soft); color: var(--text); }
.app-icon-badge {
  position: absolute;
  top: 8px; right: 9px;
  width: 8px; height: 8px;
  background: var(--accent);
  border: 2px solid var(--bg-card);
  border-radius: 50%;
}

/* ============ VIEW ============ */
.app-view {
  display: none;
  padding: 32px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}
.app-view-active { display: block; }

.app-view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.app-view-head h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 6px 0;
  font-variation-settings: "opsz" 144;
}
.app-view-head h1 em { font-style: italic; color: var(--accent); font-weight: 500; }
.app-view-sub {
  color: var(--text-muted);
  font-size: 0.96rem;
  margin: 0;
}

.app-date-range, .app-toolbar {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.app-toolbar { margin-bottom: 20px; }

.app-pill {
  padding: 7px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}
.app-pill:hover {
  border-color: var(--border-strong);
  color: var(--text);
}
.app-pill-active {
  background: var(--text);
  color: white;
  border-color: var(--text);
}
.app-pill-active:hover { color: white; }
.app-pill-count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  background: var(--bg-soft);
  padding: 1px 6px;
  border-radius: 99px;
  font-weight: 600;
}
.app-pill-active .app-pill-count {
  color: var(--text);
  background: white;
}

.app-btn-primary {
  padding: 9px 16px;
  background: var(--text);
  color: white;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.2s;
}
.app-btn-primary:hover { background: var(--accent); transform: translateY(-1px); }

.app-btn-outline {
  padding: 9px 16px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.2s;
}
.app-btn-outline:hover { border-color: var(--accent); color: var(--accent); }

/* ============ KPI CARDS ============ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-grid-3 { grid-template-columns: repeat(3, 1fr); }
.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all 0.3s;
}
.kpi-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}
.kpi-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-bottom: 8px;
}
.kpi-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variation-settings: "opsz" 144;
  margin-bottom: 6px;
  line-height: 1;
}
.kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 500;
}
.kpi-trend-up { color: var(--success); }
.kpi-trend-down { color: var(--danger); }

/* ============ DASH GRID ============ */
.dash-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.dash-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.dash-card-head h3 {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 4px 0;
}
.dash-card-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
}

.dash-link {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.legend-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 2px;
}
.legend-dot-primary { background: var(--accent); }
.legend-dot-muted { background: var(--border-strong); }
.legend > span:not(.legend-dot) { margin-right: 12px; }

.dash-chart {
  position: relative;
  height: 220px;
  width: 100%;
}
.dash-chart svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.chart-x-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-faint);
}

.activity-list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.activity-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.activity-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}
.activity-dot-success { background: var(--success); box-shadow: 0 0 0 4px rgba(26, 126, 62, 0.15); }
.activity-dot-info { background: var(--info); box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15); }
.activity-dot-warn { background: var(--warn); box-shadow: 0 0 0 4px rgba(201, 122, 13, 0.15); }
.activity-title {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 2px;
}
.activity-meta {
  font-size: 0.78rem;
  color: var(--text-faint);
  font-family: var(--font-mono);
}

/* ============ CHANNELS ============ */
.channel-list { display: flex; flex-direction: column; gap: 14px; }
.channel-row {
  display: grid;
  grid-template-columns: 160px 1fr auto auto;
  gap: 14px;
  align-items: center;
}
.channel-info { display: flex; align-items: center; gap: 10px; }
.channel-icon {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.78rem;
  color: white;
}
.channel-shopify { background: #95bf47; }
.channel-amazon { background: #ff9900; color: #131921; }
.channel-tiktok { background: #000; }
.channel-ebay { background: #e53238; }
.channel-etsy { background: #f1641e; }

.channel-name { font-size: 0.9rem; font-weight: 500; }
.channel-bar {
  height: 8px;
  background: var(--bg-soft);
  border-radius: 99px;
  overflow: hidden;
}
.channel-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  border-radius: 99px;
  transition: width 1s cubic-bezier(0.23, 1, 0.32, 1);
}
.channel-value {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  text-align: right;
  min-width: 70px;
}
.channel-percent {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
  font-weight: 600;
  min-width: 40px;
  text-align: right;
}

/* ============ TABLE ============ */
.app-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.app-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.app-table thead {
  background: var(--bg-soft);
}
.app-table th {
  text-align: left;
  padding: 12px 18px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.app-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.app-table tbody tr {
  transition: background 0.15s;
  cursor: pointer;
}
.app-table tbody tr:hover { background: var(--bg-soft); }
.app-table tbody tr:last-child td { border-bottom: none; }
.app-table tbody tr.app-row-clicked { background: var(--accent-soft); }

.app-row-action {
  width: 26px; height: 26px;
  border-radius: 6px;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.2s;
}
.app-row-action:hover { background: var(--bg-soft); color: var(--accent); }

.ch-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 0.74rem;
  font-weight: 600;
}
.ch-tag-shopify { background: rgba(149, 191, 71, 0.18); color: #5e8a1c; }
.ch-tag-amazon { background: rgba(255, 153, 0, 0.18); color: #b56f00; }
.ch-tag-tiktok { background: rgba(0, 0, 0, 0.08); color: #1a1a1f; }
.ch-tag-ebay { background: rgba(229, 50, 56, 0.15); color: #b21e25; }
.ch-tag-etsy { background: rgba(241, 100, 30, 0.18); color: #b14a14; }

.status-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.74rem;
  font-weight: 600;
}
.status-new { background: rgba(37, 99, 235, 0.15); color: #1e4ec5; }
.status-picking { background: rgba(201, 122, 13, 0.18); color: #92590a; }
.status-packed { background: rgba(110, 110, 145, 0.15); color: #4a4a5e; }
.status-shipped { background: rgba(26, 126, 62, 0.15); color: #155f2c; }

/* ============ INVENTORY ============ */
.inventory-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.inv-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.3s;
}
.inv-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.inv-image {
  height: 140px;
  background: var(--bg-soft);
  position: relative;
  overflow: hidden;
}
.inv-image-1 { background: linear-gradient(135deg, #fce4e6, #f5d4d8); }
.inv-image-1::before { content: "🎴"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 4rem; opacity: 0.5; }
.inv-image-2 { background: linear-gradient(135deg, #f3e8ff, #e9d5ff); }
.inv-image-2::before { content: "✨"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 4rem; opacity: 0.5; }
.inv-image-3 { background: linear-gradient(135deg, #fef3c7, #fde68a); }
.inv-image-3::before { content: "📦"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 4rem; opacity: 0.5; }
.inv-image-4 { background: linear-gradient(135deg, #dbeafe, #bfdbfe); }
.inv-image-4::before { content: "🖼️"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 4rem; opacity: 0.5; }
.inv-image-5 { background: linear-gradient(135deg, #d1fae5, #a7f3d0); }
.inv-image-5::before { content: "📔"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 4rem; opacity: 0.5; }
.inv-image-6 { background: linear-gradient(135deg, #fed7d7, #feb2b2); }
.inv-image-6::before { content: "🎁"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 4rem; opacity: 0.5; }

.inv-body { padding: 16px; }
.inv-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}
.inv-sku {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}
.inv-stock-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}
.inv-stock { font-size: 0.82rem; color: var(--text-muted); }
.inv-stock-num { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; margin-right: 4px; }
.inv-stock-ok { color: var(--success); }
.inv-stock-low { color: var(--warn); }
.inv-stock-out { color: var(--danger); }
.inv-price {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--accent);
  font-size: 1.1rem;
}

.inv-channels {
  display: flex;
  gap: 4px;
  align-items: center;
}
.ch-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid var(--bg-card);
  box-shadow: 0 0 0 1px var(--border);
}
.ch-shopify { background: #95bf47; }
.ch-amazon { background: #ff9900; }
.ch-tiktok { background: #000; }
.ch-ebay { background: #e53238; }
.ch-etsy { background: #f1641e; }

/* ============ CUSTOMERS ============ */
.customer-list { display: flex; flex-direction: column; gap: 12px; }
.customer-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--bg-soft);
  transition: all 0.2s;
}
.customer-row:hover { background: var(--accent-soft); }
.customer-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex-shrink: 0;
}
.customer-info { flex: 1; }
.customer-name { font-weight: 600; font-size: 0.92rem; }
.customer-meta { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.customer-spend {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--accent);
}

/* ============ REPORTS ============ */
.reports-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.report-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all 0.3s;
}
.report-card:hover { border-color: var(--border-strong); }
.report-head {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}
.report-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.report-icon-revenue { background: var(--accent-soft); color: var(--accent); font-family: var(--font-display); font-weight: 700; }
.report-icon-inventory, .report-icon-sales, .report-icon-customer { background: var(--bg-soft); }

.report-name { font-family: var(--font-display); font-weight: 600; font-size: 1rem; margin-bottom: 2px; }
.report-meta { font-size: 0.78rem; color: var(--text-muted); font-family: var(--font-mono); }

.report-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  width: 100%;
}
.report-status-active { background: rgba(26, 126, 62, 0.1); color: var(--success); }
.report-status-paused { background: var(--bg-soft); color: var(--text-muted); }
.report-pulse {
  width: 6px; height: 6px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

/* ============ SETTINGS ============ */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.setting-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.setting-card h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  margin: 0 0 6px 0;
  letter-spacing: -0.01em;
}
.setting-desc {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin: 0 0 16px 0;
}
.setting-channels { display: flex; flex-direction: column; gap: 8px; }
.setting-channel {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-soft);
  border-radius: 8px;
  font-size: 0.88rem;
}
.setting-status {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--success);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.team-list { display: flex; flex-direction: column; gap: 10px; }
.team-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--bg-soft);
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
}
.team-row .customer-avatar { width: 28px; height: 28px; font-size: 0.78rem; }
.setting-tag {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 99px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.setting-tag-light {
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-grid-3 { grid-template-columns: 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
  .reports-grid { grid-template-columns: 1fr; }
  .inventory-grid { grid-template-columns: repeat(2, 1fr); }
  .channel-row { grid-template-columns: 130px 1fr auto; }
  .channel-percent { display: none; }
  .app-search input { width: 200px; }
}

@media (max-width: 880px) {
  .app-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 100;
    box-shadow: var(--shadow-lg);
  }
  .app-sidebar.open { transform: translateX(0); }
  .app-menu-toggle { display: flex; }
  .app-search { display: none; }
  .app-view { padding: 20px 16px; }
  .app-topbar { padding: 0 16px; }
  .app-table th:nth-child(3),
  .app-table td:nth-child(3),
  .app-table th:nth-child(4),
  .app-table td:nth-child(4) {
    display: none;
  }
}

@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .inventory-grid { grid-template-columns: 1fr; }
  .app-view-head { flex-direction: column; align-items: stretch; }
  .demo-banner-text { font-size: 0.78rem; }
  .demo-banner-close { right: 8px; }
  .demo-banner-inner { padding-right: 36px; }
}

@media (max-width: 480px) {
  .app-view { padding: 16px 12px; }
  .channel-row { grid-template-columns: 1fr auto; }
  .channel-bar { display: none; }
}
