:root {
  --ink: #FBFBFC;
  --muted: #BBBDC1;
  --bg: #1A1A1D;
  --card: #2A2A2E;
  --accent: #7C919C;
  --accent-strong: #7C919C;
  --accent-glow: rgba(124, 145, 156, 0.18);
  --border: rgba(251, 251, 252, 0.10);
  --shadow: 0 20px 60px rgba(26, 26, 29, 0.34);
  --gallery-signature-shadow: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.55));
  --radius: 18px;

  color-scheme: dark;
  accent-color: var(--accent);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans", "Helvetica Neue", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1300px 800px at 50% -25%, rgba(124, 145, 156, 0.10), transparent 60%),
    linear-gradient(180deg, #2A2A2E 0%, #1A1A1D 100%);
  padding: 48px 20px 72px;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.app-logo {
  width: 168px;
  height: auto;
  display: block;
}

.shell {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  gap: 26px;
}

header h1 {
  font-family: "Space Grotesk", sans-serif;
  margin: 0 0 10px;
  font-size: clamp(2.1rem, 3.2vw, 2.85rem);
  letter-spacing: -0.02em;
}

header p {
  margin: 0;
  color: var(--muted);
  max-width: 720px;
  line-height: 1.6;
}

.panel {
  background: rgba(42, 42, 46, 0.96);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 22px;
  position: relative;
  overflow: hidden;
}

.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.07);
  pointer-events: none;
  opacity: 0.6;
}

.panel h2 {
  margin: 0 0 14px;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--muted);
}

input,
select,
textarea {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(251, 251, 252, 0.10);
  font: inherit;
  background: rgba(26, 26, 29, 0.9);
  color: var(--ink);
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(124, 145, 156, 0.55);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: rgba(30, 30, 34, 0.95);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(251, 251, 252, 0.14);
  background: rgba(251, 251, 252, 0.06);
  color: var(--ink);
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  background: rgba(251, 251, 252, 0.11);
  border-color: rgba(251, 251, 252, 0.24);
}

.muted {
  color: var(--muted);
  font-size: 0.85rem;
}

.app-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.app-nav a {
  text-decoration: none;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.8rem;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid rgba(124, 145, 156, 0.24);
  background: rgba(26, 26, 29, 0.7);
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}

.app-nav a:hover {
  transform: translateY(-1px);
  background: rgba(30, 30, 34, 0.9);
  border-color: rgba(124, 145, 156, 0.44);
}

.app-nav a.active {
  color: var(--accent-strong);
  border-color: rgba(124, 145, 156, 0.52);
  background: rgba(124, 145, 156, 0.14);
}

.app-nav a.admin-home-link {
  min-width: 54px;
  padding: 2px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.app-nav a.admin-home-link .admin-home-icon {
  width: 21px;
  height: 21px;
  display: block;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.app-nav a.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

.share-icon-trigger {
  display: none;
}

.topbar-inner,
.header-info {
  position: relative;
}

.topbar-inner .app-nav,
.header-info .app-nav {
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translate(-50%, -50%);
}

.topbar + .wrap {
  margin-top: 24px;
}

@media (max-width: 820px) {
  .topbar-inner .app-nav,
  .header-info .app-nav {
    position: static;
    transform: none;
  }
}

@media (max-width: 600px) {
  .app-nav {
    flex-wrap: nowrap;
    gap: 8px;
  }
  .app-nav a {
    font-size: 0.72rem;
    padding: 2px 8px;
    white-space: nowrap;
  }
  .app-nav a#sharePublicLink {
    display: none;
  }
  .share-icon-trigger {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid rgba(124, 145, 156, 0.24);
    background: rgba(26, 26, 29, 0.7);
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    z-index: 6;
    transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
  }
  .share-icon-trigger:hover {
    transform: translateY(-1px);
    background: rgba(30, 30, 34, 0.9);
    border-color: rgba(124, 145, 156, 0.44);
  }
  .share-icon-trigger svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .share-icon-trigger .share-icon-label {
    position: absolute;
    top: calc(100% + 3px);
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    line-height: 1.05;
    text-align: center;
    letter-spacing: 0.02em;
    text-transform: lowercase;
    white-space: normal;
    color: var(--muted);
    pointer-events: none;
  }
}

@media (max-width: 700px) {
  .title.title-stacked {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
    max-width: 100%;
    flex: 1 1 auto;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.2;
  }

  .title.title-stacked .title-client {
    font-size: 0.78em;
    letter-spacing: 0.14em;
    opacity: 0.92;
  }

  .title.title-stacked .title-event {
    font-size: 1em;
    letter-spacing: 0.18em;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

body.overlay-open {
  overflow: hidden;
}

.public-share-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background: rgba(8, 10, 12, 0.55);
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  z-index: 1100;
}

.public-share-overlay.is-open {
  display: flex;
}

.public-share-backdrop {
  position: absolute;
  inset: 0;
}

.public-share-panel {
  position: relative;
  width: min(480px, 92vw);
  border-radius: 22px;
  background: rgba(42, 42, 46, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
  padding: 22px 20px 20px;
  z-index: 1;
}

.public-share-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.public-share-title {
  margin: 0 0 10px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.15rem, 2.2vw, 1.35rem);
}

.public-share-copy {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.92rem;
}

.public-share-qr-wrap {
  position: relative;
  margin: 0 auto 14px;
  width: fit-content;
  border-radius: 14px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.96);
}

.public-share-qr {
  display: block;
  width: min(320px, 68vw);
  aspect-ratio: 1 / 1;
  height: auto;
  border-radius: 8px;
}

.public-share-qr-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24%;
  max-width: 74px;
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  object-fit: contain;
  padding: 2px;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14);
  pointer-events: none;
}

.public-share-hint {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.public-share-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.public-share-actions .action-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(251, 251, 252, 0.14);
  background: rgba(251, 251, 252, 0.06);
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
  user-select: none;
}

.public-share-actions .action-btn:hover {
  background: rgba(251, 251, 252, 0.11);
  border-color: rgba(251, 251, 252, 0.24);
  transform: translateY(-1px);
}

.public-share-actions .action-btn:active {
  transform: translateY(0px);
}

.action-btn.public-share-copy-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(187, 189, 193, 0.48);
  background: rgba(42, 42, 46, 0.72);
  border-radius: 14px;
  flex: 0 0 auto;
}

.public-share-copy-icon {
  width: 22px;
  height: 22px;
  display: block;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: translateX(1px);
}

.action-btn.public-share-copy-btn:hover {
  border-color: rgba(187, 189, 193, 0.58);
  background: rgba(42, 42, 46, 0.84);
}

.action-btn.public-share-copy-btn.is-copied {
  background: rgba(124, 145, 156, 0.32);
  border-color: rgba(187, 189, 193, 0.58);
}

.public-share-copy-btn.is-copied::before,
.public-share-copy-btn.is-copied::after {
  position: absolute;
  left: 50%;
  pointer-events: none;
  z-index: 2;
}

.public-share-copy-btn.is-copied::before {
  content: "";
  bottom: calc(100% + 5px);
  width: 10px;
  height: 10px;
  background: rgba(251, 251, 252, 0.94);
  transform: translateX(-50%) rotate(45deg);
}

.public-share-copy-btn.is-copied::after {
  content: attr(aria-label);
  bottom: calc(100% + 10px);
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(251, 251, 252, 0.94);
  color: #1A1A1D;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
  transform: translateX(-50%);
}

.public-share-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.75);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.16s ease, transform 0.16s ease;
}

.public-share-close svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.public-share-close:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}
