:root {
  --blue: #00b4ff;
  --blue-light: #33c6ff;
  --blue-dark: #0090d4;
  --blue-glow: rgba(0, 180, 255, 0.35);
  --white: #ffffff;
  --gray-100: #e8eaed;
  --gray-300: #9aa0a6;
  --gray-500: #5f6368;
  --gray-700: #2d2f33;
  --gray-800: #1a1b1e;
  --gray-900: #0d0e10;
  --black: #000000;
  --green: #25d366;
  --yellow: #febc2e;
  --red: #ff5f57;
  --font-sans: 'Outfit', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --sidebar-w: 240px;
  --header-h: 60px;
  --banner-h: 40px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  overflow-x: hidden;
  max-width: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--black);
  color: var(--gray-100);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

a { color: inherit; text-decoration: none; }

button, input, select, textarea {
  font-family: inherit;
  border: none;
  outline: none;
}

ul { list-style: none; }

.demo-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--banner-h);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  background: rgba(0, 180, 255, 0.08);
  border-bottom: 1px solid rgba(0, 180, 255, 0.15);
  font-size: 0.78rem;
  color: var(--gray-300);
  text-align: center;
}

.demo-banner strong { color: var(--blue-light); }

.demo-app {
  display: flex;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  padding-top: var(--banner-h);
  overflow-x: hidden;
}

.demo-sidebar {
  width: var(--sidebar-w);
  background: var(--gray-900);
  border-right: 1px solid var(--gray-700);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: var(--banner-h);
  left: 0;
  bottom: 0;
  z-index: 100;
  overflow: hidden;
}

.demo-sidebar-brand {
  padding: 20px 18px;
  border-bottom: 1px solid var(--gray-700);
  display: flex;
  align-items: center;
  gap: 10px;
}

.demo-sidebar-brand img {
  height: 32px;
  width: auto;
}

.demo-sidebar-brand span {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.demo-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.demo-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-300);
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 4px;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.demo-nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.demo-nav-item:hover,
.demo-nav-item.active {
  background: rgba(0, 180, 255, 0.1);
  color: var(--white);
}

.demo-nav-item.active {
  border: 1px solid rgba(0, 180, 255, 0.25);
}

.demo-sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--gray-700);
}

.demo-back-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 0.8rem;
  color: var(--gray-500);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.demo-back-link:hover {
  color: var(--blue);
  background: rgba(0, 180, 255, 0.06);
}

.demo-back-link svg { width: 16px; height: 16px; }

.demo-main {
  flex: 1;
  width: calc(100% - var(--sidebar-w));
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--banner-h));
  min-width: 0;
  overflow-x: hidden;
}

.demo-header {
  height: var(--header-h);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(13, 14, 16, 0.9);
  border-bottom: 1px solid var(--gray-700);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.demo-header h1 {
  font-size: 1.15rem;
  font-weight: 700;
}

.demo-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.demo-badge {
  padding: 4px 10px;
  background: rgba(0, 180, 255, 0.1);
  border: 1px solid rgba(0, 180, 255, 0.25);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--blue-light);
}

.demo-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--white);
}

.demo-content {
  flex: 1;
  padding: 24px 28px 32px;
  min-width: 0;
  overflow-x: hidden;
}

.demo-content--flush {
  padding: 0 28px 28px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.demo-panel--padded {
  padding-top: 8px;
}

.demo-panel { display: none; }
.demo-panel.active { display: block; }

.demo-content--flush > .demo-panel.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.demo-content--flush > .demo-panel--padded.active {
  display: block;
}

.demo-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.demo-stat-card {
  padding: 20px;
  background: var(--gray-900);
  border: 1px solid var(--gray-700);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.demo-stat-card:hover {
  border-color: rgba(0, 180, 255, 0.2);
}

.demo-stat-label {
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-bottom: 6px;
}

.demo-stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--blue-light), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.demo-stat-change {
  font-size: 0.75rem;
  margin-top: 4px;
}

.demo-stat-change.up { color: #4ade80; }
.demo-stat-change.down { color: var(--red); }

.demo-card {
  background: var(--gray-900);
  border: 1px solid var(--gray-700);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.demo-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-700);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.demo-card-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
}

.demo-card-body { padding: 20px; }

.demo-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.demo-btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: var(--white);
}

.demo-btn-primary:hover {
  box-shadow: 0 4px 16px var(--blue-glow);
}

.demo-btn-ghost {
  background: transparent;
  color: var(--gray-300);
  border: 1px solid var(--gray-700);
}

.demo-btn-ghost:hover {
  border-color: var(--blue);
  color: var(--blue-light);
}

.demo-table-wrap { overflow-x: auto; }

.demo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.demo-table th {
  text-align: left;
  padding: 12px 16px;
  color: var(--gray-500);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--gray-700);
}

.demo-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-800);
  color: var(--gray-100);
}

.demo-table tr:hover td {
  background: rgba(0, 180, 255, 0.03);
}

.demo-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
}

.demo-tag-blue {
  background: rgba(0, 180, 255, 0.12);
  color: var(--blue-light);
  border: 1px solid rgba(0, 180, 255, 0.2);
}

.demo-tag-green {
  background: rgba(74, 222, 128, 0.12);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.2);
}

.demo-tag-yellow {
  background: rgba(254, 188, 46, 0.12);
  color: var(--yellow);
  border: 1px solid rgba(254, 188, 46, 0.2);
}

.demo-tag-red {
  background: rgba(255, 95, 87, 0.12);
  color: var(--red);
  border: 1px solid rgba(255, 95, 87, 0.2);
}

.demo-search {
  padding: 8px 14px;
  background: var(--gray-800);
  border: 1px solid var(--gray-700);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-size: 0.85rem;
  width: 220px;
}

.demo-search::placeholder { color: var(--gray-500); }

.demo-search:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 180, 255, 0.12);
}

@media (max-width: 1024px) {
  .demo-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .demo-sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition);
    width: min(280px, 85vw);
    z-index: 150;
  }

  .demo-sidebar.open { transform: translateX(0); }

  .demo-main {
    width: 100%;
    margin-left: 0;
  }

  .demo-header {
    padding: 0 12px;
    height: 52px;
    min-height: 52px;
  }

  .demo-header h1 {
    font-size: 0.95rem;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .demo-header-actions .demo-badge {
    display: none;
  }

  .demo-content,
  .demo-content--flush {
    padding: 12px;
  }

  .demo-stats {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .demo-stat-card {
    padding: 16px 14px;
  }

  .demo-stat-value {
    font-size: 1.35rem;
  }

  .demo-stat-label {
    font-size: 0.72rem;
  }

  .demo-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--gray-800);
    border: 1px solid var(--gray-700);
    border-radius: var(--radius-sm);
    color: var(--white);
    cursor: pointer;
    flex-shrink: 0;
  }

  .demo-card-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .demo-card-header .demo-btn {
    width: 100%;
    justify-content: center;
  }

  .demo-card-body {
    padding: 16px;
  }

  .demo-search {
    width: 100%;
    font-size: 16px;
  }

  .demo-table-wrap {
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-sm);
  }

  .demo-table {
    min-width: 520px;
  }

  .demo-table th,
  .demo-table td {
    padding: 12px 14px;
    font-size: 0.8rem;
  }

  .demo-btn {
    min-height: 44px;
  }

  .demo-banner {
    font-size: 0.68rem;
    padding: 0 10px;
  }
}

@media (max-width: 400px) {
  .demo-stats {
    grid-template-columns: 1fr;
  }

  .demo-header h1 {
    max-width: 120px;
  }
}

@media (min-width: 769px) {
  .demo-menu-toggle { display: none; }
}

.demo-overlay {
  display: none;
  position: fixed;
  inset: 0;
  top: var(--banner-h);
  background: rgba(0, 0, 0, 0.5);
  z-index: 140;
}

.demo-overlay.active { display: block; }
