:root {
  color-scheme: light;
  /* Fluent Growth Theme: Indigo & Purple */
  --primary: #6366f1;
  /* Indigo 500 */
  --primary-hover: #4f46e5;
  /* Indigo 600 */
  --primary-weak: #e0e7ff;
  /* Indigo 100 */
  --primary-rgb: 99, 102, 241;

  --secondary: #a855f7;
  /* Purple 500 */
  --secondary-weak: #f3e8ff;
  /* Purple 100 */

  --success: #10b981;
  --success-weak: #d1fae5;
  --warning: #f59e0b;
  --warning-weak: #fef3c7;
  --danger: #ef4444;
  --danger-weak: #fee2e2;

  --bg-body: #f8fafc;
  --bg-card: rgba(255, 255, 255, 0.8);
  --bg-glass: rgba(255, 255, 255, 0.7);

  --text: #1e293b;
  /* Slate 800 */
  --text-muted: #64748b;
  /* Slate 500 */
  --text-light: #94a3b8;
  /* Slate 400 */

  --border: #e2e8f0;
  /* Slate 200 */
  --border-glass: rgba(255, 255, 255, 0.5);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-body);
  /* Subtle mesh gradient background */
  background-image:
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(168, 85, 247, 0.15) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  margin: 0;
  line-height: 1.5;
}

/* Fluent Utilities */
.glass-card {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-glass);
  border-radius: var(--radius-lg);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  font-weight: 700;
}

/* New Grid Utilities */
.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.gap-4 {
  gap: 16px;
}

.gap-6 {
  gap: 24px;
}

.col-span-2 {
  grid-column: span 2 / span 2;
}

/* Flex Utilities matched to Demo */
.items-start {
  align-items: flex-start;
}

.justify-between {
  justify-content: space-between;
}

.space-y-4>*+* {
  margin-top: 1rem;
}

/* Fluent Form Styles */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
select,
textarea {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text);
  background-color: rgba(255, 255, 255, 0.5);
  /* Semi-transparent inputs */
  background-clip: padding-box;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, background-color 0.15s;
}

input:focus,
select:focus,
textarea:focus {
  background-color: #fff;
  border-color: var(--primary);
  outline: 0;
  box-shadow: 0 0 0 3px var(--primary-weak);
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
}

.help-text {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-light);
}

/* Toggle Switch */
.toggle-checkbox {
  appearance: none;
  width: 40px;
  height: 24px;
  background: var(--border);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: background 0.3s;
}

.toggle-checkbox::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-checkbox:checked {
  background: var(--primary);
}

.toggle-checkbox:checked::after {
  transform: translateX(16px);
}

.space-y-8>*+* {
  margin-top: 2rem;
}

.space-x-4>*+* {
  margin-left: 1rem;
}

/* Text Utilities */
.text-2xl {
  font-size: 1.5rem;
  line-height: 2rem;
}

.font-bold {
  font-weight: 700;
}

.text-slate-500 {
  color: var(--text-muted);
}

.text-slate-800 {
  color: var(--text);
}

.text-emerald-500 {
  color: var(--success);
}

.text-rose-500 {
  color: var(--danger);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: all 0.2s;
}

a:hover {
  color: var(--primary-hover);
  text-decoration: none;
}

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

code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 6px;
  font-family: ui-monospace, monospace;
  font-size: 0.9em;
}

.container {
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 24px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  box-shadow: var(--shadow);
}

.card+.card {
  margin-top: 16px;
}

.alert {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.alert.success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.alert.danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.alert.warning {
  background: #fffbeb;
  border-color: #fef3c7;
  color: #92400e;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  border: 1px solid transparent;
  padding: 10px 20px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
  user-select: none;
}

.btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary-weak);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
}

.btn-ghost:hover {
  background: #f1f5f9;
  color: var(--text);
}

.btn-danger {
  background: var(--danger);
}

.btn-danger:hover {
  background: #dc2626;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.btn-sm {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="url"],
input[type="search"],
input[type="date"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
}

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

input::placeholder,
textarea::placeholder {
  color: #94a3b8;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: var(--ring);
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

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

.table th {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #f8fafc;
}

.table tr:last-child td {
  border-bottom: none;
}

.table tr:hover td {
  background: #f1f5f9;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.badge-success {
  background: #dcfce7;
  color: #166534;
}

.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

.badge-neutral {
  background: #f1f5f9;
  color: #334155;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.stat-card .icon-box {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.stat-card.primary .icon-box {
  background: var(--primary-weak);
  color: var(--primary);
}

.stat-card.success .icon-box {
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
}

.stat-card.warning .icon-box {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.stat-card.danger .icon-box {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.stat-card .label {
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  margin-bottom: 4px;
}

.stat-card .value {
  font-size: 28px;
  font-weight: 850;
  color: var(--text);
  letter-spacing: -0.03em;
}

.stat-card .trend {
  margin-top: 12px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-card .trend.up {
  color: var(--success);
}

.stat-card .trend.down {
  color: var(--danger);
}

.chart-container {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px;
  margin-bottom: 24px;
}

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

.chart-title {
  font-size: 18px;
  font-weight: 850;
  color: var(--text);
}

.chart-body {
  height: 350px;
  width: 100%;
}

.data-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 0;
  overflow: hidden;
}

.data-panel .panel-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.data-panel .panel-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

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

.stack {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 120px;
  padding: 10px 0;
}

.bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.bar .col {
  width: 100%;
  height: var(--h, 0%);
  background: var(--primary);
  border-radius: 4px 4px 0 0;
  min-height: 2px;
  transition: height 0.3s ease;
}

.bar .x {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

/* ========== Console Layout ========== */
.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: var(--sidebar);
  color: #fff;
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  margin-bottom: 24px;
}

.brand .logo-img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #fff;
  padding: 4px;
}

.brand .name {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.brand .desc {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 2px;
}

.nav .section {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  padding: 12px;
  margin-top: 16px;
  letter-spacing: 0.1em;
}

.nav a {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
  transition: all 0.2s;
}

.nav a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.nav a.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.nav .icon {
  width: 20px;
  opacity: 0.8;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.page-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}

/* ========== Front ========== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.site-header .inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.site-brand .logo-img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.site-brand .name {
  font-weight: 800;
  font-size: 20px;
  color: var(--text);
}

.front-home-hero {
  padding: 80px 24px;
  margin-bottom: 40px;
  border-radius: 24px;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  color: #fff;
}

.front-home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.4));
}

.front-home-hero .content {
  position: relative;
  z-index: 1;
  max-width: 800px;
}

.front-home-hero h1 {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 900;
  line-height: 1.1;
  margin: 0;
}

.front-home-hero .sub {
  font-size: 18px;
  margin-top: 24px;
  opacity: 0.9;
  line-height: 1.6;
}

.front-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.front-feature {
  background: #fff;
  padding: 32px;
  border-radius: 20px;
  border: 1px solid var(--border);
  transition: all 0.3s;
}

.front-feature:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.front-feature .icon-box {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--primary-weak);
  color: var(--primary);
  display: grid;
  place-items: center;
  margin-bottom: 20px;
}

.front-feature h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
}

.front-feature p {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.group-card {
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all 0.3s;
}

.group-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.group-card .cover {
  height: 180px;
  position: relative;
}

.group-card .cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.group-card .body {
  padding: 20px;
}

.group-card .title {
  font-size: 18px;
  font-weight: 800;
  margin: 0;
}

.group-card .price {
  font-size: 24px;
  font-weight: 900;
  color: var(--primary);
  margin-top: 12px;
}

@media (max-width: 768px) {
  .container {
    padding: 16px;
  }
}

/* ========== Group Landing Page Refined ========== */
.front-group {
  max-width: 600px;
  margin: 0 auto;
  padding-bottom: 80px;
}

.front-group .hero {
  position: relative;
  height: 200px;
}

.front-group .hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.front-group .hero .mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.4));
}

.landing-head-card {
  margin-top: -24px;
  position: relative;
  z-index: 10;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.landing-info {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.landing-info .avatar {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  background: #fff;
  box-shadow: var(--shadow-sm);
  border: 2px solid #fff;
}

.landing-info .title {
  font-size: 20px;
  font-weight: 850;
  line-height: 1.3;
}

.landing-info .price-tag {
  color: var(--danger);
  font-size: 20px;
  font-weight: 900;
}

.landing-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.landing-stat-item {
  background: #fff;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
}

.landing-stat-item .label {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
  display: block;
}

.landing-stat-item .value {
  font-size: 18px;
  font-weight: 850;
  color: var(--text);
}

.landing-section-title {
  font-size: 16px;
  font-weight: 850;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.landing-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 16px;
}

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

.member-item {
  text-align: center;
}

.member-item .avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 6px;
  border: 1px solid var(--border);
  padding: 2px;
  background: #fff;
}

.member-item .name {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.gallery-item img {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.video-item video {
  width: 100%;
  border-radius: 12px;
  background: #000;
}

.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 12px 20px env(safe-area-inset-bottom);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
}

.bottom-bar .price {
  font-size: 22px;
  font-weight: 900;
  color: var(--text);
}

.bottom-bar .btn {
  padding: 12px 28px;
  border-radius: 14px;
  font-size: 15px;
}