/* ===== Admin dashboard ===== */

.ad-shell {
  display: grid;
  grid-template-columns: 256px 1fr;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.ad-side {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 16px 14px;
  display: flex; flex-direction: column;
  gap: 10px;
  position: sticky; top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand-wrap { position: relative; }
.brand-btn {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  text-align: left;
}
.brand-btn:hover { border-color: var(--ink-2); }
.brand-mark {
  width: 36px; height: 36px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px;
  flex-shrink: 0;
}
.brand-mark.sm { width: 28px; height: 28px; font-size: 13px; border-radius: 7px; }
.brand-mark.md { width: 44px; height: 44px; font-size: 18px; border-radius: 10px; }
.brand-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.brand-name { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-tag  { font-size: 11.5px; color: var(--muted); }
.brand-btn > svg:last-child { color: var(--muted); flex-shrink: 0; }

.brand-pop {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30;
  padding: 8px;
  box-shadow: 0 8px 32px rgba(15,27,45,0.10), 0 1px 3px rgba(15,27,45,0.06);
}
.brand-pop-head { font-size: 11px; font-weight: 600; color: var(--muted-2); padding: 6px 8px 8px; text-transform: uppercase; letter-spacing: 0.06em; }
.brand-pop-item {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
  border-radius: 8px;
  background: transparent;
  text-align: left;
}
.brand-pop-item:hover { background: var(--bg-2); }
.brand-pop-item.is-active { background: var(--bg-2); }
.brand-pop-item svg { color: var(--ink); margin-left: auto; }
.brand-pop-item > span:nth-child(2) { flex: 1; min-width: 0; }

/* nav */
.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px; font-weight: 500;
  color: var(--muted);
  text-align: left;
}
.nav-item:hover { background: var(--bg-2); color: var(--ink); }
.nav-item.is-active { background: var(--ink); color: #fff; }
.nav-item.is-active .nav-icon { color: #fff; }
.nav-icon { display: inline-flex; color: var(--muted); }
.nav-label { flex: 1; }
.nav-badge {
  background: var(--accent); color: var(--accent-ink);
  font-size: 11px; font-weight: 700;
  padding: 2px 7px; border-radius: 999px;
}

/* plan card */
.plan-card { padding: 14px; margin-top: auto; }
.plan-head { display: flex; align-items: baseline; gap: 6px; }
.plan-tag {
  background: var(--ink); color: #fff;
  font-size: 10.5px; font-weight: 700;
  padding: 2px 7px; border-radius: 4px;
}
.plan-name { font-size: 13px; font-weight: 600; }
.plan-meta { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.plan-bar {
  margin-top: 8px;
  height: 5px; background: var(--bg-2); border-radius: 999px; overflow: hidden;
}
.plan-bar-fill { height: 100%; background: var(--ink); border-radius: 999px; }
.plan-btn { width: 100%; margin-top: 10px; }

.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px;
}
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--ink); color: #fff;
  font-weight: 700; font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; color: var(--ink); }
.user-mail { font-size: 11.5px; color: var(--muted); }
.user-card svg { color: var(--muted); }

/* ---------- Top bar ---------- */
.ad-top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 28px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.ad-search {
  flex: 1; max-width: 540px;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: var(--bg-2);
  border-radius: 8px;
  color: var(--muted);
}
.ad-search input {
  flex: 1; background: none; border: 0; outline: none;
  font-family: inherit; font-size: 13px; color: var(--ink);
}
.ad-search kbd {
  font-family: inherit; font-size: 11px; font-weight: 600;
  background: #fff; padding: 2px 6px; border-radius: 4px;
  border: 1px solid var(--line); color: var(--muted);
}
.ad-top-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.cal-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  background: var(--bg-2); border-radius: 8px;
  font-size: 12.5px; color: var(--ink);
}
.icon-btn {
  position: relative;
  width: 36px; height: 36px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted);
}
.icon-btn:hover { background: var(--bg-2); color: var(--ink); }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; }
.top-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--ink); color: #fff; font-weight: 700; font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ---------- Body ---------- */
.ad-body { padding: 24px 28px 48px; }

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  margin-bottom: 20px;
}
.page-title { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; margin: 4px 0 4px; }
.page-sub { font-size: 13.5px; color: var(--muted); }
.page-actions { display: flex; gap: 8px; }

/* grid */
.grid-12 { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.span-4 { grid-column: span 4; }
.span-8 { grid-column: span 8; }
.stack { display: flex; flex-direction: column; gap: 16px; }

.sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sec-actions { display: flex; align-items: center; gap: 12px; }
.sec-sub { font-size: 12.5px; color: var(--muted); font-weight: 400; }

/* ---------- Event types ---------- */
.ev-section .card { padding: 18px; }
.ev-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.ev-card { padding: 14px; }
.ev-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.ev-title { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.ev-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.ev-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.ev-dur { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); }
.ev-price { font-size: 13.5px; font-weight: 700; }
.ev-price.is-free { color: var(--green-ink); }
.ev-price.is-paid { color: var(--ink); }

/* switch */
.switch {
  width: 32px; height: 18px; border-radius: 999px;
  background: #D1D5DB; position: relative;
  transition: background 120ms ease;
}
.switch.is-on { background: var(--green); }
.switch-knob {
  position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff;
  transition: transform 120ms ease;
}
.switch.is-on .switch-knob { transform: translateX(14px); }

/* ---------- Quick actions ---------- */
.qa-card { padding: 18px; }
.qa-row {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px; font-weight: 500; color: var(--ink);
  margin-top: 4px;
}
.qa-row:hover { background: var(--bg-2); }
.qa-icn {
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--bg-2); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
}
.qa-row.is-accent .qa-icn { background: var(--accent); color: var(--accent-ink); }
.qa-row.is-accent { color: var(--ink); font-weight: 600; }

/* ---------- Availability ---------- */
.avail-card { padding: 18px; }
.avail-grid {
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr);
  gap: 4px;
  margin-top: 4px;
}
.avail-cell { display: flex; align-items: center; justify-content: center; height: 32px; font-size: 12px; }
.avail-corner, .avail-time { color: var(--muted-2); font-weight: 600; font-size: 11px; letter-spacing: 0.04em; }
.avail-corner { justify-content: flex-start; }
.avail-time { justify-content: flex-start; padding-left: 4px; }
.avail-dow { color: var(--muted-2); font-weight: 600; font-size: 11px; letter-spacing: 0.04em; }
.avail-slot { border-radius: 6px; }
.avail-slot.is-open { background: rgba(16, 185, 129, 0.08); }
.avail-tick {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--green); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
}
.avail-tick svg { width: 10px; height: 10px; }
.avail-dash { color: var(--muted-2); font-size: 11px; }
.avail-foot {
  margin-top: 14px;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  background: var(--bg-2);
  border-radius: 8px;
  font-size: 12.5px; color: var(--muted);
}
.avail-foot span { flex: 1; }

/* ---------- Reminders ---------- */
.reminders-card { padding: 18px; }
.reminder-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-2);
}
.reminder-row:last-child { border-bottom: 0; }
.reminder-icn {
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--bg-2); color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
}
.reminder-info { flex: 1; }
.reminder-title { font-size: 13px; font-weight: 500; color: var(--ink); }
.reminder-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.reminder-state {
  font-size: 11.5px; font-weight: 600;
  padding: 3px 9px; border-radius: 999px;
  background: var(--green-soft); color: var(--green-ink);
}

/* ---------- Calendar Sync ---------- */
.sync-card { padding: 18px; }
.sync-row { display: flex; align-items: center; gap: 10px; }
.sync-info { flex: 1; }
.sync-title { font-size: 13px; font-weight: 600; }
.sync-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.sync-foot {
  margin-top: 14px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--muted);
}
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* prevent CTA text wrapping */
.btn-ink, .btn-ghost { white-space: nowrap; }

/* ---------- Bookings ---------- */
.bookings-card { padding: 18px; }
.bk-filters { display: flex; align-items: center; gap: 6px; }
.pill {
  font-size: 12px; font-weight: 500;
  padding: 5px 10px; border-radius: 999px;
  color: var(--muted);
  background: transparent;
}
.pill:hover { background: var(--bg-2); color: var(--ink); }
.pill.is-on { background: var(--ink); color: #fff; }

.bk-table { width: 100%; border-collapse: collapse; }
.bk-table th {
  text-align: left;
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted-2);
  padding: 10px 10px;
  border-bottom: 1px solid var(--line);
}
.bk-table td {
  font-size: 13px;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line-2);
  color: var(--ink);
}
.bk-table tr:last-child td { border-bottom: 0; }
.bk-date { font-weight: 500; }
.bk-paid { font-weight: 600; }
.bk-free { color: var(--muted); }
.bk-cust { display: flex; align-items: center; gap: 8px; }
.bk-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--bg-2); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 600;
}

/* ---------- Analytics ---------- */
.analytics-card { padding: 18px; }
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.stat { padding: 12px; border: 1px solid var(--line-2); border-radius: 10px; }
.stat-label { font-size: 11.5px; color: var(--muted); }
.stat-row { display: flex; align-items: baseline; justify-content: space-between; margin-top: 4px; }
.stat-val { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.stat-val.is-amber { color: #92400E; }
.stat-trend { font-size: 11.5px; font-weight: 600; }
.stat-trend.up { color: var(--green-ink); }
.stat-trend.down { color: #B91C1C; }
.spark { display: block; margin-top: 8px; }

/* ---------- Link/Brand/Embed ---------- */
.linkcard, .brandcard, .embedcard { padding: 18px; }
.lc-sub { font-size: 12.5px; color: var(--muted); margin: 6px 0 12px; }
.lc-url {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  background: var(--bg-2); border-radius: 8px;
  font-size: 12.5px; color: var(--muted);
}
.lc-url span { flex: 1; }
.lc-link { display: inline-block; margin-top: 12px; font-size: 12.5px; }

.brand-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-2);
}
.brand-row:last-child { border-bottom: 0; }
.brand-row-label { font-size: 12.5px; color: var(--muted); }
.swatch {
  width: 32px; height: 28px; border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.06);
}

.embed-sub { font-size: 12.5px; color: var(--muted); margin: 6px 0 10px; }
.embed-code {
  background: #0F172A; color: #E5E7EB;
  padding: 12px;
  border-radius: 8px;
  font-family: 'SF Mono', ui-monospace, Menlo, Consolas, monospace;
  font-size: 11.5px; line-height: 1.55;
  overflow: auto;
  margin: 0;
}
.embed-code code { white-space: pre; }
