/* Premium visual layer for the admin console.
   Loaded after admin.css: typography, colour, and gradients only. */

:root {
  --font-body: "General Sans", "Satoshi", "Avenir Next", Arial, sans-serif;
  --font-display: "Clash Display", "General Sans", "Satoshi", "Avenir Next", sans-serif;
  --ink: #1c2b23;
  --muted: #6b7b72;
  --grad-ink: linear-gradient(140deg, #3b5846 0%, #2a4233 50%, #1b2b22 100%);
  --grad-surface: linear-gradient(160deg, rgba(253, 254, 250, 0.92) 0%, rgba(244, 248, 240, 0.8) 100%);
  font-family: var(--font-body);
}

body {
  font-feature-settings: "ss01", "ss02";
  background:
    radial-gradient(1000px 600px at 100% 0%, rgba(246, 226, 182, 0.2), transparent 60%),
    radial-gradient(900px 700px at 0% 100%, rgba(176, 207, 206, 0.14), transparent 60%),
    linear-gradient(180deg, #eef3ea 0%, #e7eee3 100%);
  background-attachment: fixed;
}

:is(h1, h2, h3):not(#_),
.admin-brand,
.metric-grid strong,
.welcome-strip__orb strong {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.018em;
  word-spacing: 0.04em;
}

.admin-kicker,
.admin-table th,
.permission-table th,
.content-type,
.approval-kind {
  letter-spacing: 0.12em;
}

.admin-button--primary,
.filter-chip.is-active,
.account-avatar {
  background: var(--grad-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 8px 22px rgba(28, 43, 35, 0.16);
}

.admin-button--primary:hover {
  background: linear-gradient(140deg, #426350 0%, #2e4938 50%, #1d2e24 100%);
}

.admin-button--quiet,
.demo-accounts button,
.filter-chip,
.icon-control {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.46));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.login-card {
  background: linear-gradient(165deg, rgba(251, 252, 248, 0.94), rgba(242, 246, 238, 0.9));
}

.welcome-strip {
  background:
    radial-gradient(circle at 90% 20%, rgba(255, 244, 214, 0.6), transparent 40%),
    linear-gradient(120deg, rgba(246, 235, 205, 0.78), rgba(224, 237, 219, 0.86));
}

.metric-grid article,
.admin-section,
.data-card,
.permissions-card,
.content-item,
.approval-list article,
.activity-timeline {
  background: var(--grad-surface);
  box-shadow: 0 1px 2px rgba(38, 58, 45, 0.03), 0 14px 40px rgba(40, 59, 46, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.metric-icon {
  background: linear-gradient(150deg, rgba(84, 112, 90, 0.14), rgba(84, 112, 90, 0.05));
}

.progress i,
.inline-progress i {
  background: linear-gradient(90deg, #7c967d, #54705a);
}

.admin-sidebar {
  background: linear-gradient(180deg, rgba(248, 250, 245, 0.96), rgba(240, 245, 237, 0.94));
}

.admin-nav__item.is-active {
  background: linear-gradient(135deg, rgba(84, 112, 90, 0.16), rgba(84, 112, 90, 0.07));
}

.admin-dialog form {
  background: linear-gradient(165deg, #fbfcf8 0%, #f2f6ee 100%);
}

.admin-toast {
  background: linear-gradient(150deg, rgba(44, 66, 53, 0.96), rgba(24, 38, 30, 0.96));
}

/* Live & recordings ------------------------------------------------------ */

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.optional { color: var(--muted); font-weight: 400; }

.live-admin-intro p { font-size: 12px; }
.live-admin-intro strong { color: var(--ink); font-weight: 600; }

.live-connection {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  font-weight: 500;
}
.live-connection i { width: 8px; height: 8px; border-radius: 50%; background: #c9b27a; }
.live-connection[data-state="remote"] i { background: #5f9a67; box-shadow: 0 0 0 4px rgba(95, 154, 103, 0.14); }
.live-connection[data-state="local"] i { background: #d9a441; box-shadow: 0 0 0 4px rgba(217, 164, 65, 0.16); }
.live-connection[data-state="error"] { color: #a14f49; }
.live-connection[data-state="error"] i { background: #c8584c; }

.publishing-key {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 300px) auto auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding: 16px 20px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background: var(--grad-surface);
}
.publishing-key[hidden] { display: none; }
.publishing-key strong { font-size: 13px; font-weight: 600; }
.publishing-key p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.publishing-key code { font-size: 10px; }
.publishing-key input[type="password"] { height: 40px; border: 1px solid var(--line); border-radius: 11px; padding: 0 12px; background: #fff; font-size: 12px; }
.publishing-key__remember { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; white-space: nowrap; }

.live-admin-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 16px; align-items: start; }
.live-admin-grid .settings-card > header { grid-template-columns: 38px minmax(0, 1fr) auto; }
.live-admin-grid .form-error:empty { display: none; }
.status--live { background: rgba(224, 103, 79, 0.14); color: #a14a37; }
.live-admin-preview { padding: 12px 14px; border-radius: 14px; background: rgba(84, 112, 90, 0.07); }
.live-admin-preview p { margin: 4px 0 0; font-size: 12px; line-height: 1.5; }
.live-admin-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: auto; }

.recordings-list { display: grid; gap: 8px; }
.recordings-empty { padding: 28px 20px; border: 1px dashed rgba(39, 61, 47, 0.18); border-radius: 16px; text-align: center; }
.recordings-empty strong { font-size: 13px; font-weight: 600; }
.recordings-empty p { max-width: 360px; margin: 6px auto 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.recording-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 10px 12px 10px 10px;
  border: 1px solid rgba(39, 61, 47, 0.07);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
}
.recording-row.is-hidden { opacity: 0.68; }
.recording-row__thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 10px;
  background: radial-gradient(circle at 70% 30%, rgba(247, 222, 160, 0.9), transparent 50%), linear-gradient(160deg, #cfe0d2, #a9c4b1);
}
.recording-row__thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.recording-row__copy { min-width: 0; }
.recording-row__copy strong { display: block; overflow: hidden; font-size: 13px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.recording-row__copy small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.recording-row__actions { display: flex; align-items: center; gap: 2px; }
.recording-row__actions .row-action:disabled { opacity: 0.3; cursor: default; }

.recording-dialog { width: min(calc(100% - 32px), 620px); }
.recording-dialog .optional { font-size: 11px; }
.recording-source-switch { margin: 18px 0 6px; }
.recording-dropzone {
  position: relative;
  display: grid !important;
  justify-items: center;
  gap: 6px !important;
  margin: 10px 0 0 !important;
  padding: 26px 18px;
  border: 1.5px dashed rgba(84, 112, 90, 0.3);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  text-align: center;
}
.recording-dropzone:hover { border-color: rgba(84, 112, 90, 0.55); background: #fff; }
.recording-dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.recording-dropzone__icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 50%; background: rgba(84, 112, 90, 0.1); font-size: 18px; }
.recording-dropzone strong { font-size: 13px; font-weight: 500; }
.recording-dropzone small { color: var(--muted); font-size: 11px; }
#recording-upload-fields[data-disabled="true"] .recording-dropzone { opacity: 0.55; }
.recording-progress { position: relative; height: 26px; margin-top: 10px; overflow: hidden; border-radius: 999px; background: rgba(84, 112, 90, 0.1); }
.recording-progress i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, #7c967d, #54705a); transition: width 0.2s ease; }
.recording-progress span { position: relative; display: grid; height: 100%; place-items: center; font-size: 11px; font-weight: 600; }
.recording-published { display: flex !important; align-items: center; gap: 8px !important; }
.recording-published input { width: auto !important; }

@media (max-width: 1100px) {
  .live-admin-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .publishing-key { grid-template-columns: 1fr; }
  .recording-row { grid-template-columns: 64px minmax(0, 1fr); }
  .recording-row .status,
  .recording-row__actions { grid-column: 2; justify-self: start; }
}
.recording-dialog form { max-height: calc(100dvh - 32px); overflow-y: auto; }

/* Membership & access, Live members */
.card-help { margin: -4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.card-help strong { color: var(--ink); font-weight: 600; }
.status--live-only { background: rgba(201, 152, 72, 0.16); color: #8b6735; }
.member-add { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; }
.member-add input,
.member-search { height: 39px; border: 1px solid var(--line); border-radius: 11px; padding: 0 11px; background: rgba(255, 255, 255, 0.7); font-size: 11px; }
.member-search { width: 100%; }
.members-list { display: grid; max-height: 320px; gap: 6px; overflow-y: auto; }
.members-empty { margin: 4px 0; color: var(--muted); font-size: 11px; }
.member-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 8px 10px; border: 1px solid rgba(39, 61, 47, 0.07); border-radius: 13px; background: rgba(255, 255, 255, 0.72); }
.member-row__avatar { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: linear-gradient(145deg, #f3dca4, #d8ac5c); color: #4d3a17; font-size: 10px; font-weight: 700; }
.member-row strong { display: block; overflow: hidden; font-size: 12px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.member-row small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.live-admin-grid .form-error:empty { display: none; }
@media (max-width: 760px) { .member-add { grid-template-columns: 1fr; } }

/* Membership flag in People */
.membership-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  padding: 4px 2px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
}
.membership-toggle__track {
  position: relative;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: rgba(39, 61, 47, 0.14);
  transition: background 200ms ease;
}
.membership-toggle__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(20, 32, 26, 0.2);
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}
.membership-toggle[data-tier="live"] { color: #8b6735; }
.membership-toggle[data-tier="live"] .membership-toggle__track { background: linear-gradient(135deg, #e9c373, #c8963f); }
.membership-toggle[data-tier="live"] .membership-toggle__thumb { transform: translateX(14px); }
.membership-toggle:disabled { opacity: 0.5; }
.data-card:has(#people-table) { overflow-x: auto; }

.admin-google {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  padding: 16px 20px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background: var(--grad-surface);
}
.admin-google strong { font-size: 13px; font-weight: 600; }
.admin-google p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }

/* People: whether real sign-ins are loaded, with Google sign-in in place */
.directory-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding: 14px 20px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.46));
}
.directory-note p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.directory-note[data-state="ready"] p { color: #3f5a46; }
.directory-note[data-state="signin"] { border-color: rgba(214, 178, 96, 0.45); background: linear-gradient(160deg, rgba(255, 249, 232, 0.9), rgba(255, 255, 255, 0.55)); }
.directory-note[data-state="signin"] p { color: #6c5a2f; }
.directory-note[data-state="error"] { border-color: rgba(154, 79, 67, 0.3); }
.directory-note[data-state="error"] p { color: #9a4f43; }
.directory-note .admin-button { flex-shrink: 0; }
@media (max-width: 640px) {
  .directory-note { flex-direction: column; align-items: stretch; }
}

/* Access restricted page for Google accounts that aren't Super Admins */
.admin-denied .login-card { gap: 0; }
.admin-denied .admin-denied__kicker { color: #9a4f43; }
.admin-denied .login-card__intro strong { color: var(--ink, #1c2b23); font-weight: 600; word-break: break-all; }
.admin-denied a.admin-button { display: flex; align-items: center; justify-content: center; margin-top: 28px; text-decoration: none; }
.admin-denied .google-auth-button { margin-top: 12px; }

.login-card__intro + #google-signin { margin-top: 28px; }

/* People: real sign-ins only */
#people-table tr.is-filtered-out { display: none; }
.people-empty { margin: 0; padding: 36px 24px; color: var(--muted); font-size: 13px; text-align: center; }

/* Live link: inline publish state and locked fields once published */
.live-admin-actions { align-items: center; flex-wrap: wrap; }
.live-link-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 auto 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.live-link-state i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #b9c2bb;
  flex-shrink: 0;
}
.live-link-state[data-state="published"] { color: #3f6a4b; }
.live-link-state[data-state="published"] i { background: #4f8a5e; box-shadow: 0 0 0 4px rgba(79, 138, 94, 0.15); }
.live-link-state[data-state="changed"] { color: #8a6a24; }
.live-link-state[data-state="changed"] i { background: #d4a43c; box-shadow: 0 0 0 4px rgba(212, 164, 60, 0.16); }
.live-link-state[data-state="saving"] i { background: #8aa38a; animation: live-state-pulse 1s ease-in-out infinite; }
@keyframes live-state-pulse { 50% { opacity: 0.35; } }

#live-link-form[data-editing="false"] input {
  background: rgba(255, 255, 255, 0.35);
  border-color: transparent;
  color: var(--ink, #1c2b23);
  cursor: default;
}
#live-link-form[data-editing="false"] input:focus { box-shadow: none; outline: none; }
#live-link-submit:disabled { opacity: 0.55; cursor: not-allowed; }
@media (max-width: 560px) {
  .live-link-state { flex-basis: 100%; margin-bottom: 4px; }
}

/* Real-data empty states and the People group picker */
.admin-empty { margin: 0; padding: 22px 0 6px; color: var(--muted); font-size: 12px; }
.activity-timeline:empty, .content-grid:empty, .approval-list:empty { display: none; }
.nav-badge[hidden], .people-empty[hidden] { display: none; }
.group-select {
  min-height: 32px;
  max-width: 180px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 28px 0 12px;
  background: rgba(255, 255, 255, 0.7) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23748179' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 11px center;
  font-size: 11px;
  appearance: none;
  cursor: pointer;
}
.group-select:hover { border-color: rgba(84, 112, 90, 0.35); }
.group-select:disabled { opacity: 0.6; cursor: progress; }
