* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: #f5f5f5;
  color: #1a1a1a;
}
/* Home page uses a pure white background instead of the app's light grey. */
body.page-home {
  background: #ffffff;
}

/* Top bar */
.topbar {
  background: #1565c0;
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar .logo {
  color: #fff;
  text-decoration: none;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.topbar .logo .badge {
  background: #2e7d32;
  color: #fff;
  border-radius: 5px;
  padding: 1px 8px;
  margin-left: 2px;
}

/* App shell: sidebar + content */
.app-shell {
  display: flex;
  min-height: calc(100vh - 56px);
}
.sidebar {
  width: 230px;
  background: #ffffff;
  border-right: 1px solid #e6e6e6;
  padding: 18px 0;
  flex-shrink: 0;
}
.sidebar a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 22px;
  color: #333;
  text-decoration: none;
  font-size: 15px;
}
.sidebar a .icon {
  width: 20px;
  text-align: center;
  color: #607d8b;
}
.sidebar a:hover { background: #e8f5e9; }
.sidebar a.active { color: #1565c0; font-weight: 600; background: #e3f2fd; }
.sidebar form { margin: 0; }
.sidebar .side-footer {
  margin-top: 30px;
  padding: 0 22px;
  font-size: 12px;
  color: #999;
}
.sidebar .side-footer a { display: inline; padding: 0; font-size: 12px; color: #999; text-decoration: underline; }

/* Content area */
.content {
  flex: 1;
  padding: 30px;
}
.breadcrumb {
  background: #fff;
  border-radius: 6px;
  padding: 16px 20px;
  margin-bottom: 18px;
  font-size: 14px;
  color: #555;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.breadcrumb a { color: #1565c0; text-decoration: none; }

.card {
  background: #fff;
  border-radius: 6px;
  padding: 28px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  margin-bottom: 24px;
  max-width: 640px;
}

.balance {
  font-size: 42px;
  font-weight: 700;
  color: #2e7d32;
}

/* Auth pages (no sidebar) */
.center-wrap {
  max-width: 420px;
  margin: 60px auto;
  padding: 0 20px;
}

label {
  display: block;
  margin-top: 14px;
  margin-bottom: 6px;
  font-size: 13px;
  color: #555;
}
input[type=email], input[type=password], input[type=number], input[type=text] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 15px;
}
button, .btn {
  display: inline-block;
  background: #1565c0;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  margin-top: 18px;
  text-decoration: none;
}
button:hover, .btn:hover { background: #0d47a1; }
.link-btn {
  background: transparent;
  color: #607d8b;
  text-decoration: underline;
  padding: 0;
  margin: 0;
  font-size: 14px;
}
.error { color: #c62828; margin-top: 12px; font-size: 14px; }
.success { color: #2e7d32; margin-top: 12px; font-size: 14px; }
table { width: 100%; border-collapse: collapse; margin-top: 10px; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid #eee; font-size: 14px; }
.muted { color: #777; font-size: 13px; }
iframe.offerwall { width: 100%; height: 720px; border: none; border-radius: 6px; }

/* Offerwall network tabs (Earn page) */
.offerwall-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid #e6e6e6;
  margin-bottom: 18px;
}
.offerwall-tabs .offerwall-tab {
  background: transparent;
  color: #555;
  border: none;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  padding: 10px 16px;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.offerwall-tabs .offerwall-tab:hover { background: #f5f5f5; color: #1565c0; }
.offerwall-tabs .offerwall-tab.active { color: #1565c0; border-bottom-color: #1565c0; }

/* ---------------------------------------------------------------- */
/* Home page hero + network showcase                                */
/* ---------------------------------------------------------------- */
.hero-section {
  background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%);
  padding: 64px 20px 72px;
  text-align: center;
  color: #fff;
}
.hero-section h1 {
  font-size: 36px;
  margin: 0 0 14px;
  letter-spacing: -0.5px;
}
.hero-section p {
  font-size: 17px;
  color: #dbe8fb;
  max-width: 520px;
  margin: 0 auto 28px;
}
.hero-section .btn {
  margin: 0 6px;
}
.hero-section .btn-outline {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.7);
  color: #fff;
}
.hero-section .btn-outline:hover { background: rgba(255,255,255,0.12); }

.home-section {
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 20px 56px;
}
.home-section h2 {
  text-align: center;
  font-size: 22px;
  margin-bottom: 6px;
}
.home-section .section-sub {
  text-align: center;
  color: #777;
  font-size: 14px;
  margin-bottom: 28px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 48px;
}
.step {
  background: #fff;
  border-radius: 8px;
  padding: 24px 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  text-align: center;
}
.step .step-number {
  width: 32px;
  height: 32px;
  line-height: 32px;
  border-radius: 50%;
  background: #e3f2fd;
  color: #1565c0;
  font-weight: 700;
  margin: 0 auto 12px;
}
.step h3 { margin: 0 0 8px; font-size: 15px; }
.step p { margin: 0; color: #777; font-size: 13px; }

.site-footer {
  text-align: center;
  padding: 28px 20px;
  color: #999;
  font-size: 13px;
}

/* ---------------------------------------------------------------- */
/* Network tiles -- used on both the home page and the dashboard    */
/* ---------------------------------------------------------------- */
.network-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}
.network-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 10px;
  padding: 22px 14px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.network-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.1);
  border-color: transparent;
}
.network-tile-badge {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--tile-color, #1565c0);
  color: #fff;
  font-weight: 700;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.network-tile-name {
  font-weight: 700;
  font-size: 14px;
  color: #1a1a1a;
}
.network-tile-tagline {
  font-size: 12px;
  color: #888;
  line-height: 1.4;
}
.network-tile-cta {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--tile-color, #1565c0);
}

/* Home page tiles: solid brand-color box with white text, per request. */
.network-tile-solid {
  background: var(--tile-color, #1565c0);
  border: none;
}
.network-tile-solid .network-tile-badge {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}
.network-tile-solid .network-tile-name {
  color: #fff;
}
.network-tile-solid .network-tile-tagline {
  color: rgba(255, 255, 255, 0.85);
}
.network-tile-solid .network-tile-cta {
  color: #fff;
  text-decoration: underline;
}
.network-tile-solid:hover {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

/* ---------------------------------------------------------------- */
/* Public site nav bar + footer links                               */
/* (used on home, about, faq, support, terms, compliance, blog,     */
/* testimonials -- any page that isn't the logged-in app shell)     */
/* ---------------------------------------------------------------- */
.topbar.public-topbar {
  height: auto;
  min-height: 56px;
  flex-wrap: wrap;
  row-gap: 8px;
  padding: 12px 20px;
}
.public-nav-links {
  display: flex;
  gap: 24px;
  margin-left: 36px;
  flex-wrap: wrap;
}
.public-nav-links a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.public-nav-links a:hover,
.public-nav-links a.active {
  color: #fff;
}
.public-nav-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-left: auto;
}
.public-nav-actions .btn {
  margin-top: 0;
  padding: 8px 16px;
  font-size: 13px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.footer-links a {
  color: #666;
  text-decoration: none;
  font-size: 13px;
}
.footer-links a:hover {
  color: #1565c0;
  text-decoration: underline;
}

/* Generic static content page (About, FAQ, Support, Terms, Compliance) */
.static-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 20px 64px;
}
.static-page h1 {
  font-size: 30px;
  margin-bottom: 8px;
}
.static-page .page-sub {
  color: #777;
  margin-bottom: 32px;
}
.static-page h2 {
  font-size: 19px;
  margin-top: 32px;
}
.static-page p, .static-page li {
  color: #444;
  line-height: 1.7;
  font-size: 15px;
}
.faq-item {
  background: #fff;
  border-radius: 8px;
  padding: 18px 22px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.faq-item h3 {
  margin: 0 0 8px;
  font-size: 15px;
}
.faq-item p {
  margin: 0;
  font-size: 14px;
}
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: #888;
}

/* ---------------------------------------------------------------- */
/* Admin CRUD: tables, forms, badges                                */
/* ---------------------------------------------------------------- */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
}
.admin-table th {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 2px solid #eee;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #888;
}
.admin-table td {
  padding: 12px 8px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
  vertical-align: middle;
}

.table-thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  display: inline-block;
}
.table-thumb-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
}

.badge-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge-active { background: #e3f6e8; color: #2e7d32; }
.badge-inactive { background: #f2f2f2; color: #888; }

.btn-sm {
  display: inline-block;
  background: #eef3fb;
  color: #1565c0;
  border: none;
  padding: 6px 12px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn-sm:hover { background: #dbe8fb; }
.btn-sm:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-sm.btn-danger { background: #fdecea; color: #c62828; }
.btn-sm.btn-danger:hover { background: #fbd8d5; }

.form-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 560px;
  margin-top: 10px;
}
.form-grid label {
  margin-top: 0;
}
.form-grid textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}
.form-grid select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 15px;
  background: #fff;
}

.network-tile-badge-img {
  padding: 0;
  overflow: hidden;
}
.network-tile-badge-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.post-body {
  margin-top: 20px;
  line-height: 1.7;
  color: #333;
}
.post-body p { margin: 0 0 16px; }

/* ---------------------------------------------------------------- */
/* Main site footer (public pages) -- multi-column, like TimeWall/  */
/* Swagbucks/CPX Research style footers.                            */
/* ---------------------------------------------------------------- */
.site-footer-main {
  background: #14213d;
  color: #b7c0d8;
  margin-top: 40px;
}
.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 48px 24px 32px;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 32px;
}
.footer-col-brand .footer-logo {
  font-size: 22px;
  display: inline-block;
  margin-bottom: 12px;
}
.footer-tagline {
  color: #93a0c2;
  font-size: 13px;
  line-height: 1.6;
  max-width: 280px;
  margin: 0;
}
.footer-col h4 {
  color: #fff;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 14px;
}
.footer-col a {
  display: block;
  color: #b7c0d8;
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 10px;
}
.footer-col a:hover {
  color: #fff;
  text-decoration: underline;
}
.footer-bottom-bar {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 18px 24px;
  text-align: center;
  font-size: 12px;
  color: #7c88a8;
}

@media (max-width: 720px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
  .footer-col-brand {
    grid-column: 1 / -1;
  }
}
