:root {
  /* Brand Colors - Blue & Gold */
  --primary: #0098DA;
  --primary-variant: #0078AA;
  --secondary: #C9A85E;
  --secondary-variant: #A08040;

  /* Neutral Colors */
  --background: #F7F9FC;
  --surface: #FFFFFF;
  --error: #B00020;

  /* On Colors */
  --on-primary: #FFFFFF;
  --on-secondary: #FFFFFF;
  --on-background: #0F172A;
  --on-surface: #0F172A;
  --on-error: #FFFFFF;

  /* Borders & Shadows */
  --border: #E2E8F0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

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

body {
  font-family: 'Roboto', system-ui, -apple-system, "Segoe UI", sans-serif;
  margin: 0;
  background: var(--background);
  color: var(--on-background);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

/* ===== HEADER ===== */
header {
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--border);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  padding: 0 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-img {
  height: 42px;
  width: auto;
}

.brand-sub {
  font-size: 12px;
  color: #64748B;
  margin-top: 4px;
}

.nav {
  display: flex;
  gap: 12px;
}

.nav a {
  color: #334155;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 15px;
  text-transform: none;
}

.nav a:hover {
  background: #F1F5F9;
  color: var(--primary);
  text-decoration: none;
}

.nav a.nav-cta {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: var(--shadow-sm);
}

.nav a.nav-cta:hover {
  background: var(--primary-variant);
  box-shadow: var(--shadow-md);
  color: var(--on-primary);
}

/* ===== LAYOUT ===== */
.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}

.grid {
  display: grid;
  gap: 32px;
}

.grid-2 {
  grid-template-columns: 2fr 1fr;
}

@media (max-width: 900px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .nav {
    display: none;
  }
  .wrap {
    padding: 20px;
  }
}

/* ===== HERO ===== */
.hero {
  display: block; /* Essential for <a> tag to behave like a box */
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--on-primary);
  border-radius: 12px;
  padding: 48px;
  box-shadow: var(--shadow-md);
  margin-bottom: 32px;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.hero:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.hero-content {
  max-width: 700px;
}

.hero h1 {
  font-size: 36px;
  margin: 0 0 16px;
  font-weight: 700;
  color: inherit;
}

.hero p {
  font-size: 18px;
  opacity: 0.95;
  max-width: 700px;
  margin-bottom: 24px;
  line-height: 1.5;
  color: inherit;
}

/* ===== CARDS & TOOLS ===== */
.card, .tool-card, .dashboard-card, .banner-card {
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  padding: 24px;
  transition: box-shadow 0.2s, transform 0.2s;
  border: 1px solid var(--border);
  margin-bottom: 24px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

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

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

/* Remove margin from cards inside grid to avoid double spacing with gap */
.tools-grid .tool-card {
  margin-bottom: 0;
}

.tool-icon {
  font-size: 40px;
  color: var(--primary);
  margin-bottom: 16px;
}

.tool-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
  color: var(--on-surface);
}

.tool-card p {
  color: #475569;
  font-size: 14px;
  flex-grow: 1;
  margin-bottom: 16px;
  line-height: 1.5;
}

.tool-card a {
  color: var(--primary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.5px;
}

/* ===== BUTTONS & FORMS ===== */
.btn {
  background: var(--primary);
  color: var(--on-primary);
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
  display: inline-block;
  text-align: center;
}

.btn:hover {
  background: var(--primary-variant);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  color: var(--on-primary);
}

.btn-secondary {
  background: #E2E8F0;
  color: #1E293B;
}

.btn-secondary:hover {
  background: #CBD5E1;
  color: #0F172A;
}

.btn-warning {
  background: #F59E0B;
  color: #fff;
}
.btn-warning:hover {
  background: #D97706;
}

input, select, textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #CBD5E1;
  background: #FFFFFF;
  font-size: 15px;
  transition: border-color 0.2s, box-shadow 0.2s;
  color: var(--on-surface);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 152, 218, 0.1);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  color: #334155;
  font-size: 14px;
  font-weight: 600;
}

/* ===== UTILITIES ===== */
.text-center { text-align: center; }
.mb-30 { margin-bottom: 30px; }
.mt-30 { margin-top: 30px; }
.mb-10 { margin-bottom: 10px; }
.mt-10 { margin-top: 10px; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.ml-10 { margin-left: 10px; }
.mb-8 { margin-bottom: 8px; }

.g-30 { gap: 30px; }
.g-12 { gap: 12px; }

.badge {
  display: inline-block;
  background: #F1F5F9;
  color: #475569;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-primary {
  background: rgba(0, 152, 218, 0.1);
  color: var(--primary);
}

.admin-topbar {
  background: #0F172A;
  color: #fff;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 14px;
  box-shadow: var(--shadow-md);
}

.admin-topbar a {
  color: #E2E8F0;
  font-weight: 500;
}

.admin-topbar a:hover {
  color: #fff;
}

/* Carousel */
.carousel-wrap { display: flex; align-items: center; gap: 16px; }
.carousel {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 16px;
  scroll-snap-type: x mandatory;
}
.carousel-item {
  min-width: 240px;
  scroll-snap-align: start;
  background: var(--surface);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

/* Banner */
.banner-card {
  border-left: 4px solid var(--primary);
}
.banner-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.banner-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--primary);
  margin: 0 0 4px;
}
.banner-desc {
  margin: 0;
  color: #475569;
  font-size: 14px;
}

/* Footer */
footer {
  background: #FFFFFF;
  padding: 48px 0;
  margin-top: 64px;
  border-top: 1px solid var(--border);
  color: #64748B;
}

/* Flex helpers */
.flex-align-center {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

/* Stack column helper */
.stack-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Remove margin from cards inside stack-col to avoid double spacing with gap */
.stack-col > .card,
.stack-col > .banner-card {
  margin-bottom: 0;
}

/* Sidebar sticky */
.sidebar-sticky {
  position: sticky;
  top: 90px;
}

/* Form grid */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

/* Result box */
.result {
  margin-top: 24px;
  display: none;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 24px;
}
.result.is-visible {
  display: block;
}

/* Muted text */
.muted {
  color: #64748B;
  font-size: 14px;
}

/* Table */
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th, .table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.table th {
  font-weight: 600;
  color: #475569;
  background: #F8FAFC;
}

/* Error message */
.err {
  background: #FEF2F2;
  color: #991B1B;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  border: 1px solid #FECACA;
}

/* Card compact */
.card--compact {
  padding: 16px;
}

/* Card section */
.card--section {
  margin-top: 24px;
}

/* Hidden */
.is-hidden {
  display: none;
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.dashboard-grid .dashboard-card {
  margin-bottom: 0;
}

/* Ad Slot */
.ad-slot {
  min-height: 100px;
  border: 2px dashed #E2E8F0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: #F8FAFC;
}

/* Logos */
.product-logo {
  max-width: 160px;
  max-height: 48px;
  object-fit: contain;
  display: block;
}
.partner-logo {
  max-width: 140px;
  max-height: 40px;
  object-fit: contain;
}

/* Tool Title/Desc */
.tool-title {
  font-size: 28px;
  margin-bottom: 12px;
  color: var(--on-surface);
}
.tool-desc {
  font-size: 16px;
  color: #475569;
  line-height: 1.6;
}

/* Stats */
.stat { font-size: 24px; font-weight: 700; color: var(--primary); }
.stat-large { font-size: 32px; font-weight: 700; color: var(--primary); }
.pomo-time { font-size: 48px; font-weight: 700; color: var(--on-surface); margin: 16px 0; }
