:root {
  --md-surface: var(--milk, #faf5f6);
  --md-surface-strong: var(--surface, #fffaf3);
  --md-surface-muted: var(--surface-muted, #f6e7eb);
  --md-elevated: 0 18px 42px rgba(118, 7, 4, 0.13);
  --md-outline: var(--border, rgba(118, 7, 4, 0.18));
  --md-outline-strong: var(--border-strong, rgba(118, 7, 4, 0.3));
  --md-primary: var(--cabernet, #760704);
  --md-primary-soft: var(--accent-soft, rgba(118, 7, 4, 0.18));
  --md-on-primary: var(--surface, #fffaf3);
  --md-text: var(--text, #760704);
  --md-muted: var(--text-soft, #a44c5b);
  --md-cream: var(--cream, #efe5d6);
}

body.youme-page.admin-surface {
  min-height: 100vh;
  background:
    linear-gradient(rgba(250, 245, 246, 0.86), rgba(250, 245, 246, 0.94)),
    url('../assets/images/Background2.png') center / cover fixed,
    var(--md-surface);
  color: var(--md-text);
  font-family: var(--text-body, 'Montserrat', 'Helvetica Neue', Arial, sans-serif);
}

body.youme-page.admin-surface.legal-page {
  padding-bottom: 86px;
}

.admin-shell {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: clamp(14px, 2.4vw, 24px) 0 clamp(28px, 5vw, 48px);
  display: grid;
  gap: 16px;
}

.admin-app-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 4px 2px 8px;
}

.admin-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.admin-brand__logo {
  position: relative;
  width: 130px;
  height: 46px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 0;
}

.admin-brand__logo img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 30px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  filter:
    contrast(1.2)
    drop-shadow(0.65px 0 0 rgba(118, 7, 4, 0.75))
    drop-shadow(-0.65px 0 0 rgba(118, 7, 4, 0.75))
    drop-shadow(0 1px 8px rgba(255, 250, 243, 0.55));
}

body.hosting-page .admin-brand__logo img {
  filter:
    brightness(0)
    invert(1)
    contrast(1.22)
    drop-shadow(0.8px 0 0 rgba(255, 250, 243, 0.86))
    drop-shadow(-0.8px 0 0 rgba(255, 250, 243, 0.86))
    drop-shadow(0 2px 10px rgba(0, 0, 0, 0.24));
}

body.hosting-page .admin-brand__beta {
  display: none;
}

.admin-brand__beta {
  position: absolute;
  right: -2px;
  bottom: 0;
  padding: 2px 4px;
  border: 1px solid rgba(207, 43, 37, 0.22);
  border-radius: 4px;
  background: #fff;
  color: var(--tomato, #cf2b25);
  font-size: 0.5rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.14);
}

.admin-brand .meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.admin-brand .eyebrow {
  margin: 0;
  color: var(--md-muted);
  font-family: var(--text-caps, 'Montserrat', sans-serif);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.1;
  text-transform: uppercase;
}

.admin-brand strong {
  display: block;
  overflow: hidden;
  color: var(--md-text);
  font-size: 1rem;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-nav {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

body:not(.is-signed-in) .admin-nav {
  display: none;
}

.admin-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--md-text);
  font-size: 0.94rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  text-decoration: none;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease;
}

.admin-nav a:hover {
  border-color: var(--md-outline);
  background: rgba(118, 7, 4, 0.06);
}

.admin-nav a.active {
  border-color: color-mix(in srgb, var(--md-primary) 26%, var(--md-outline));
  background: rgba(118, 7, 4, 0.1);
  color: var(--md-primary);
}

.admin-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.admin-profile-menu {
  position: relative;
}

.admin-profile-menu .md-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.avatar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.avatar-icon svg,
.avatar-icon i {
  width: 100%;
  height: 100%;
}

.avatar-icon i {
  font-size: 18px;
  line-height: 20px;
}

.md-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  gap: 8px;
  border: 1px solid rgba(255, 250, 243, 0.58);
  border-radius: 8px;
  padding: 10px 14px;
  background: rgba(255, 250, 243, 0.92);
  color: var(--md-text);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  text-decoration: none;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    color 140ms ease;
}

.md-button:hover:not(:disabled) {
  border-color: var(--md-outline-strong);
  box-shadow: 0 8px 18px rgba(118, 7, 4, 0.12);
}

.md-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.md-button.primary {
  border-color: var(--md-primary);
  background: var(--md-primary);
  color: var(--md-on-primary);
}

.md-button.tonal,
.md-button.ghost {
  background: rgba(255, 250, 243, 0.92);
  box-shadow: none;
}

.md-avatar {
  width: 40px;
  height: 40px;
  border: 1px solid var(--md-outline);
  border-radius: 8px;
  background: var(--md-surface-strong);
  color: var(--md-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  letter-spacing: 0;
}

.profile-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 10;
  min-width: 240px;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--md-outline);
  border-radius: 8px;
  background: var(--md-surface-strong);
  box-shadow: var(--md-elevated);
}

.profile-dropdown[hidden] {
  display: none !important;
}

.profile-menu-meta {
  padding: 4px 6px 8px;
  border-bottom: 1px solid var(--md-outline);
}

.profile-menu-meta .menu-label {
  margin: 0 0 4px;
  color: var(--md-muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.profile-menu-meta .menu-name {
  margin: 0;
  font-weight: 800;
}

.profile-menu-meta .menu-email {
  margin: 2px 0 0;
  font-size: 0.9rem;
}

.profile-menu-links {
  display: grid;
  gap: 4px;
}

.profile-menu-links a,
.menu-signout {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--md-text);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  letter-spacing: 0;
  text-align: left;
  text-decoration: none;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease;
}

.profile-menu-links a:hover,
.menu-signout:hover {
  border-color: var(--md-outline);
  background: rgba(118, 7, 4, 0.06);
}

.profile-menu-links a.active {
  border-color: var(--md-outline-strong);
  background: var(--md-primary-soft);
  color: var(--md-primary);
}

.menu-signout {
  border-color: var(--md-outline);
}

.menu-signout:hover {
  border-color: color-mix(in srgb, var(--tomato, #cf2b25) 42%, transparent);
  background: rgba(207, 43, 37, 0.08);
  color: var(--tomato, #cf2b25);
}

.admin-footer {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto 22px;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(260px, auto) auto;
  align-items: end;
  gap: 18px;
  padding: 18px 0 0;
  border-top: 1px solid rgba(255, 250, 243, 0.32);
  color: #fffaf0;
}

.legal-page .admin-footer {
  position: fixed;
  right: 0;
  bottom: 14px;
  left: 0;
  z-index: 20;
  background: rgba(255, 250, 243, 0.96);
  color: var(--md-text);
  box-shadow: 0 14px 36px rgba(118, 7, 4, 0.16);
}

.legal-page .admin-footer__brand strong {
  color: var(--md-text);
}

.legal-page .admin-footer small {
  color: var(--md-muted);
}

.legal-page .admin-footer .chip {
  border-color: var(--md-outline);
  background: var(--md-surface-strong);
  color: var(--md-text);
}

.admin-footer__brand {
  display: grid;
  gap: 5px;
}

.admin-footer__brand strong {
  color: #fffaf0;
  font-size: 1.05rem;
  line-height: 1.1;
}

.admin-footer small {
  color: rgba(255, 250, 240, 0.72);
}

.admin-footer__links,
.admin-footer__socials {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.admin-footer__links {
  justify-content: center;
}

.admin-footer__socials {
  justify-content: flex-end;
}

.admin-footer__socials .chip {
  width: 36px;
  padding: 7px;
  justify-content: center;
}

@media (max-width: 720px) {
  body.youme-page.admin-surface.legal-page {
    padding-bottom: 142px;
  }

  .admin-footer {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .legal-page .admin-footer {
    bottom: 10px;
  }

  .admin-footer__links {
    display: flex;
  }
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  gap: 6px;
  padding: 7px 11px;
  border: 1px solid rgba(255, 250, 243, 0.34);
  border-radius: 8px;
  background: rgba(255, 250, 243, 0.12);
  color: #fffaf0;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  text-decoration: none;
}

.chip[href]:hover {
  border-color: rgba(255, 250, 243, 0.62);
}

.card-surface {
  padding: 16px;
  border: 1px solid var(--md-outline);
  border-radius: 8px;
  background: var(--md-surface-strong);
  box-shadow: var(--md-elevated);
}

.overline {
  color: var(--md-muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.muted {
  color: var(--md-muted);
}

@media (max-width: 840px) {
  .admin-footer {
    align-items: flex-start;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .admin-footer__links,
  .admin-footer__socials {
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  .admin-brand .meta {
    display: none;
  }
}

@media (max-width: 500px) {
  .admin-app-bar {
    grid-template-columns: 1fr auto;
  }

  .admin-nav {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .admin-actions {
    width: 100%;
    justify-content: flex-start;
  }
}
