:root {
  --gd-purple: #613ea3;
  --gd-purple-light: #744bc4;
  --gd-purple-soft: #d3c1f7;
  --gd-purple-dark: #462a72;
  --gd-ink: #111111;
  --gd-body: #f5f7f8;
  --gd-border: #e4e6eb;
  --gd-muted: #6b7280;
  --gd-surface: #ffffff;
  --gd-green: #0b7a4b;
  --gd-amber: #a15c07;
  --gd-teal: #0f766e;
  --gd-blue: #1d4ed8;
  --gd-radius: 12px;
  --gd-radius-sm: 8px;
  --gd-shadow: 0 1px 2px rgba(17, 17, 17, 0.05), 0 6px 18px rgba(17, 17, 17, 0.06);
}

/* ============================================================ top bar */
.gd-body { background: var(--gd-body); }

.gd-topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  height: 64px;
  background: var(--gd-surface);
  border-bottom: 1px solid var(--gd-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px;
}
.gd-topbar-left, .gd-topbar-right { display: flex; align-items: center; gap: 14px; min-width: 0; }

.gd-brand { display: flex; align-items: center; gap: 10px; color: var(--gd-ink); font-weight: 800; }
.gd-brand:hover { color: var(--gd-purple); }
.gd-brand-mark {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--gd-purple); color: #fff; font-size: 0.85rem; font-weight: 800;
}
.gd-brand-name { white-space: nowrap; }

.gd-topnav { display: flex; gap: 4px; margin-left: 10px; }
.gd-topnav a {
  padding: 8px 12px; border-radius: 999px; color: #374151; font-weight: 500; font-size: 0.9rem;
}
.gd-topnav a:hover { background: #f2eefb; color: var(--gd-purple); }

.gd-icon-btn {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 10px;
  border: none; background: transparent; color: #374151; cursor: pointer;
}
.gd-icon-btn:hover { background: #f2eefb; color: var(--gd-purple); }

.gd-search {
  display: flex; align-items: center; gap: 8px;
  background: #f1f2f4; border: 1px solid transparent; border-radius: 999px;
  padding: 7px 14px; color: var(--gd-muted); max-width: 280px;
}
.gd-search:focus-within { background: #fff; border-color: var(--gd-purple-soft); }
.gd-search input { border: none; background: transparent; outline: none; font: inherit; width: 100%; font-size: 0.9rem; }

.gd-user { display: flex; align-items: center; gap: 9px; padding-left: 6px; }
.gd-avatar {
  display: grid; place-items: center; width: 36px; height: 36px;
  border-radius: 50%; background: var(--gd-purple-soft); color: var(--gd-purple-dark);
  font-weight: 800; font-size: 0.9rem;
}
.gd-user-name { font-weight: 600; font-size: 0.9rem; white-space: nowrap; }

/* ============================================================= layout */
.gd-layout { display: grid; grid-template-columns: 244px 1fr; align-items: start; }

.gd-rail {
  position: sticky; top: 64px;
  height: calc(100vh - 64px);
  background: var(--gd-surface);
  border-right: 1px solid var(--gd-border);
  padding: 16px 12px;
  overflow-y: auto;
}
.gd-rail-nav { display: flex; flex-direction: column; gap: 2px; }
.gd-rail-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  color: #374151; font-weight: 500; font-size: 0.92rem;
}
.gd-rail-nav a svg { color: #6b7280; flex-shrink: 0; }
.gd-rail-nav a:hover { background: #f2eefb; color: var(--gd-purple); }
.gd-rail-nav a:hover svg { color: var(--gd-purple); }
.gd-rail-nav a.is-active { background: var(--gd-purple); color: #fff; }
.gd-rail-nav a.is-active svg { color: #fff; }
.gd-rail-sep { height: 1px; background: var(--gd-border); margin: 10px 4px; }

.gd-content { padding: 28px 32px 64px; min-width: 0; }

/* ========================================================= page header */
.gd-page-head { margin-bottom: 22px; }
.gd-page-head h1 { margin: 0; font-size: 1.6rem; font-weight: 800; letter-spacing: -0.01em; }
.gd-page-head p { margin: 6px 0 0; color: var(--gd-muted); }
.gd-page-head .gd-head-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ============================================================= buttons */
.gd-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-weight: 700; font-size: 0.9rem; cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.gd-btn-primary { background: var(--gd-purple); color: #fff; }
.gd-btn-primary:hover { background: var(--gd-purple-dark); color: #fff; }
.gd-btn-dark { background: var(--gd-ink); color: #fff; }
.gd-btn-dark:hover { background: #000; color: #fff; }
.gd-btn-ghost { background: #fff; border-color: var(--gd-border); color: var(--gd-ink); }
.gd-btn-ghost:hover { border-color: var(--gd-purple); color: var(--gd-purple); }
.gd-btn-sm { padding: 7px 14px; font-size: 0.82rem; }
.gd-btn-block { width: 100%; }

/* ============================================================== cards */
.gd-card {
  background: var(--gd-surface);
  border: 1px solid var(--gd-border);
  border-radius: var(--gd-radius);
  box-shadow: var(--gd-shadow);
}
.gd-section-title {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 30px 0 14px;
}
.gd-section-title h2 { margin: 0; font-size: 1.25rem; font-weight: 800; }
.gd-section-title a { font-weight: 600; font-size: 0.9rem; color: var(--gd-purple); }

/* ==================================================== recommendation cards */
.airo-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 300px);
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
}
.airo-card {
  scroll-snap-align: start;
  background: var(--gd-surface);
  border: 1px solid var(--gd-border);
  border-radius: var(--gd-radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: var(--gd-shadow);
}
.airo-media {
  height: 116px;
  display: grid; place-items: center;
  font-size: 2rem;
  background: linear-gradient(135deg, #efe9fb, #d3c1f7);
}
.airo-card.accent-amber .airo-media { background: linear-gradient(135deg, #fef3c7, #fde68a); }
.airo-card.accent-teal .airo-media { background: linear-gradient(135deg, #ccfbf1, #99f6e4); }
.airo-card.accent-blue .airo-media { background: linear-gradient(135deg, #dbeafe, #bfdbfe); }
.airo-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.airo-eyebrow {
  font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--gd-purple);
}
.airo-title { margin: 0; font-size: 1.02rem; font-weight: 700; line-height: 1.35; }
.airo-desc { margin: 0; color: var(--gd-muted); font-size: 0.9rem; flex: 1; }
.airo-cta {
  align-self: flex-start; margin-top: 4px;
  padding: 8px 16px; border-radius: 999px;
  background: #f2eefb; color: var(--gd-purple); font-weight: 700; font-size: 0.86rem;
}
.airo-cta:hover { background: var(--gd-purple); color: #fff; }

/* ============================================================ two cols */
.gd-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.gd-stack { display: flex; flex-direction: column; gap: 22px; }

/* ======================================================== website card */
.website-card { padding: 22px; }
.website-card .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.website-name { display: flex; align-items: center; gap: 12px; }
.website-thumb {
  width: 46px; height: 46px; border-radius: 10px;
  display: grid; place-items: center; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--gd-purple), var(--gd-purple-light));
}
.website-name strong { display: block; font-size: 1.02rem; }
.website-name small { color: var(--gd-muted); }
.website-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.website-meta { margin-top: 14px; color: var(--gd-muted); font-size: 0.84rem; }

.gd-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px; font-size: 0.78rem; font-weight: 700;
}
.gd-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.gd-badge-published { background: #e7f6ee; color: var(--gd-green); }
.gd-badge-draft { background: #f1f2f4; color: var(--gd-muted); }

/* ======================================================= metric tiles */
.metric-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; }
.metric-tile { padding: 18px; border-right: 1px solid var(--gd-border); }
.metric-tile:last-child { border-right: none; }
.metric-label { color: var(--gd-muted); font-size: 0.8rem; font-weight: 600; }
.metric-value { display: block; font-size: 1.7rem; font-weight: 800; margin-top: 6px; }
.metric-trend { font-size: 0.78rem; color: var(--gd-muted); margin-top: 4px; }

.perf-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px 0; }
.perf-head h2 { margin: 0; font-size: 1.15rem; }
.range-tabs { display: flex; background: #f1f2f4; border-radius: 999px; padding: 3px; }
.range-tabs button {
  border: none; background: transparent; font: inherit; font-weight: 600; font-size: 0.82rem;
  padding: 6px 14px; border-radius: 999px; cursor: pointer; color: var(--gd-muted);
}
.range-tabs button.is-active { background: #fff; color: var(--gd-ink); box-shadow: var(--gd-shadow); }
.perf-body { display: grid; grid-template-columns: 150px 1fr; gap: 18px; padding: 18px 22px 22px; align-items: center; }
.perf-score { text-align: center; }
.perf-score strong { display: block; font-size: 2.6rem; font-weight: 800; color: var(--gd-purple); }
.perf-score span { color: var(--gd-muted); font-size: 0.8rem; }
.chart-wrap { position: relative; height: 220px; }

/* ============================================================== feed */
.feed-item {
  display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--gd-border);
}
.feed-item:last-child { border-bottom: none; }
.feed-thumb {
  width: 54px; height: 54px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--gd-purple), var(--gd-purple-soft));
}
.feed-body { min-width: 0; }
.feed-body a { color: var(--gd-ink); font-weight: 600; }
.feed-body a:hover { color: var(--gd-purple); }
.feed-body p { margin: 2px 0 4px; color: var(--gd-muted); font-size: 0.86rem; }
.feed-body small { color: var(--gd-muted); font-size: 0.78rem; }

/* ============================================================ grow */
.grow-item {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px; border: 1px solid var(--gd-border); border-radius: var(--gd-radius);
  background: #fff; margin-bottom: 12px;
}
.grow-item:last-child { margin-bottom: 0; }
.grow-icon {
  width: 42px; height: 42px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 1.2rem;
  background: #f2eefb;
}
.grow-item h3 { margin: 0 0 4px; font-size: 0.98rem; }
.grow-item p { margin: 0 0 10px; color: var(--gd-muted); font-size: 0.86rem; }

/* ====================================================== legacy panels */
.panel {
  background: var(--gd-surface); border: 1px solid var(--gd-border);
  border-radius: var(--gd-radius); box-shadow: var(--gd-shadow);
  padding: 22px 24px; margin-bottom: 24px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.panel-head h2 { margin: 0; font-size: 1.12rem; font-weight: 800; }
.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; align-items: start; }

.admin-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px;
}
.admin-head h1 { margin: 0; font-size: 1.6rem; font-weight: 800; }
.admin-head p { margin: 4px 0 0; }

/* ============================================================== table */
.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th {
  text-align: left; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--gd-muted); padding: 10px 12px; border-bottom: 2px solid var(--gd-border); font-weight: 700;
}
.table td { padding: 12px; border-bottom: 1px solid var(--gd-border); vertical-align: middle; }
.table tbody tr:hover { background: #faf9fd; }
.table a { color: var(--gd-ink); font-weight: 600; }
.table a:hover { color: var(--gd-purple); }
.col-actions { white-space: nowrap; text-align: right; }

.status { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; }
.status-published { background: #e7f6ee; color: var(--gd-green); }
.status-draft { background: #f1f2f4; color: var(--gd-muted); }

.link { background: none; border: none; color: var(--gd-purple); font: inherit; font-weight: 600; cursor: pointer; padding: 0; }
.link:hover { color: var(--gd-purple-dark); }
.link-danger { color: #b91c1c; }
.inline-form { display: inline; margin-left: 10px; }

/* ============================================================ toolbar */
.toolbar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar input, .toolbar select, .gd-select {
  padding: 10px 14px; border: 1px solid var(--gd-border); border-radius: var(--gd-radius-sm);
  font: inherit; font-size: 0.9rem; background: #fff;
}
.toolbar input { flex: 1; min-width: 200px; }

/* =============================================================== form */
.form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-weight: 600; font-size: 0.88rem; }
.field em { color: #b91c1c; font-style: normal; }
.field input, .field select, .field textarea {
  padding: 10px 13px; border: 1px solid var(--gd-border); border-radius: var(--gd-radius-sm);
  font: inherit; font-size: 0.95rem; background: #fff; width: 100%;
}
.field textarea { resize: vertical; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--gd-purple); outline-offset: -1px; border-color: var(--gd-purple);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field-hint { color: var(--gd-muted); font-size: 0.8rem; }
.form-actions { display: flex; gap: 12px; padding-top: 6px; }

.alert { padding: 12px 16px; border-radius: var(--gd-radius-sm); margin-bottom: 18px; font-size: 0.9rem; }
.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.alert-success { background: #e7f6ee; border: 1px solid #bbf7d0; color: #065f46; }

/* ============================================================== login */
.login-body {
  min-height: 100vh; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--gd-purple-dark) 0%, var(--gd-purple) 100%); padding: 20px;
}
.login-card {
  background: #fff; border-radius: 16px; padding: 36px 32px; width: 100%; max-width: 400px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}
.login-brand { text-align: center; margin-bottom: 24px; }
.login-brand .brand-mark { margin: 0 auto 12px; background: var(--gd-purple); }
.login-brand h1 { margin: 0; font-size: 1.4rem; font-weight: 800; }
.login-brand p { margin: 4px 0 0; color: var(--gd-muted); font-size: 0.9rem; }
.login-back { display: block; text-align: center; margin-top: 18px; color: var(--gd-muted); font-size: 0.86rem; }

.disclaimer { color: var(--gd-muted); font-size: 0.76rem; margin-top: 26px; line-height: 1.6; }

/* ========================================================== responsive */
@media (max-width: 1080px) {
  .gd-grid { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .metric-tile { border-right: none; border-bottom: 1px solid var(--gd-border); }
}
@media (max-width: 860px) {
  .gd-layout { grid-template-columns: 1fr; }
  .gd-rail {
    position: fixed; left: 0; top: 64px; z-index: 55;
    width: 260px; transform: translateX(-100%); transition: transform 0.2s ease;
    box-shadow: var(--gd-shadow);
  }
  .gd-rail.is-open { transform: translateX(0); }
  .gd-topnav, .gd-search, .gd-user-name { display: none; }
  .two-col { grid-template-columns: 1fr; }
  .gd-content { padding: 20px; }
  .perf-body { grid-template-columns: 1fr; }
}

.field-check { flex-direction: row; align-items: center; gap: 10px; }
.field-check input { width: auto; }
.field-check > span { font-weight: 500; }
