:root {
  --header: #191d21;
  --accent: #f08600;
  --card: #fff;
  --text: #191d21;
  --label: #6b7280;
  --font-label: Inter, system-ui, sans-serif;
  --font-content: Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font-content);
  color: var(--text);
}

a { color: inherit; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }

.public-body {
  min-height: 100vh;
  position: relative;
  background-color: var(--page-bg-color, #2b241c);
}
.public-body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-color: var(--page-bg-color, #2b241c);
  background-image: var(--page-bg-image, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.public-body.has-bg-image::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: rgba(16, 12, 8, 0.4);
  pointer-events: none;
}

.home-splash {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 24px;
}
.home-splash__logo {
  width: min(280px, 72vw);
  height: auto;
  max-height: 36vh;
  object-fit: contain;
  filter: drop-shadow(0 8px 28px rgba(0, 0, 0, 0.35));
}
.home-splash__name {
  margin: 0;
  color: #fff;
  font-family: var(--font-header, var(--font-label));
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  text-align: center;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
}

.wrap {
  width: min(420px, calc(100% - 24px));
  margin: 20px auto 40px;
}

.card-shell {
  background: var(--card);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

.card-photo {
  position: relative;
  height: 280px;
  background: var(--header);
}
.card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.card-photo::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 5px;
  background: var(--accent);
}
.card-photo__empty {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 4rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.card-main { padding: 18px 20px 8px; }

.card-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 16px;
}
.card-identity h1 {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.card-role {
  margin: 5px 0 0;
  color: var(--accent);
  font-weight: 600;
  font-size: .95rem;
}
.card-company {
  margin: 3px 0 0;
  color: var(--label);
  font-family: var(--font-label);
  font-size: .9rem;
}

.brand-logo {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #0b2e4f;
  border: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.brand-logo img {
  max-width: 72%;
  max-height: 72%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0 0 8px;
}
.list li + li { margin-top: 4px; }
.list a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 10px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  background: transparent;
  box-shadow: 0 0 0 0 transparent;
  transform: translateY(0);
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, color .18s ease;
}
.list a .ico {
  transition: background-color .18s ease, transform .18s ease;
}

.ico {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  flex: 0 0 38px;
}
.ico svg { width: 17px; height: 17px; }

.row-text {
  font-size: .95rem;
  overflow-wrap: break-word;
  word-break: normal;
}
.row-text--address {
  white-space: pre-line;
  line-height: 1.2;
}
@media (max-width: 1059px) {
  .row-text--email .email-domain {
    display: block;
  }
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 0 16px;
}
.card-shell .btn {
  min-height: 38px;
  padding: 0 14px;
  font-size: .86rem;
  width: auto;
  flex: 0 1 auto;
  white-space: nowrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: var(--header);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { filter: brightness(1.08); }
.btn--ghost { background: #fff; color: var(--header); border: 1px solid #d7dce2; }
.btn--tiny { min-height: 32px; padding: 0 10px; font-size: .78rem; flex: 0 0 auto; }

.card-qr {
  padding: 8px 20px 20px;
  text-align: center;
  border-top: 1px solid #f0eee9;
}
.card-qr__label {
  margin: 0 0 10px;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--label);
  font-family: var(--font-label);
}
.card-qr img {
  width: min(200px, 70%);
  margin: 0 auto 12px;
}
.qr-dl { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

.foot {
  margin: 18px 0 0;
  text-align: center;
  color: #fff;
  font-size: .8rem;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

.share-panel[hidden] { display: none; }
.share-panel {
  position: fixed;
  inset: 0;
  background: rgba(16, 15, 15, .55);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 20;
}
.share-box {
  width: min(360px, 100%);
  background: #fff;
  border-radius: 14px;
  padding: 16px;
}
.share-box h3 { margin: 0 0 12px; }
.share-links { display: flex; flex-wrap: wrap; gap: 8px; }
.share-links a { flex: 1 1 40%; }

@media (hover: hover) and (pointer: fine) {
  .list a:hover {
    transform: translateY(-3px);
    background: color-mix(in srgb, var(--accent) 12%, #fff);
    box-shadow: 0 10px 22px rgba(25, 29, 33, 0.12);
    color: var(--header);
  }
  .list a:hover .ico {
    background: var(--header);
    transform: scale(1.06);
  }
}

@media (min-width: 880px) {
  .wrap {
    width: min(1240px, calc(100% - 48px));
    margin: 48px auto 64px;
  }
  .card-shell {
    display: grid;
    grid-template-columns: 340px minmax(320px, 1fr) 220px;
    align-items: stretch;
    min-height: 420px;
    border-radius: 24px;
  }
  .card-photo {
    height: auto;
    min-height: 100%;
  }
  .card-photo img {
    object-position: center;
  }
  .card-photo::after {
    width: 5px;
    height: auto;
    top: 0;
    left: auto;
    right: 0;
    bottom: 0;
  }
  .card-main {
    padding: 28px 26px 20px;
    display: flex;
    flex-direction: column;
  }
  .card-identity h1 { font-size: 1.85rem; }
  .list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 12px;
    flex: 1;
    min-width: 0;
  }
  .list li + li { margin-top: 0; }
  .actions {
    margin-top: auto;
    max-width: none;
  }
  .card-qr {
    border-top: 0;
    border-left: 1px solid #f0eee9;
    padding: 28px 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .card-qr img { width: 168px; }
}

@media (prefers-reduced-motion: reduce) {
  .list a, .list a .ico { transition: none; }
}

/* Admin */
.admin-body { background: #f4f5f7; color: #1a1d21; }
.admin {
  width: min(920px, calc(100% - 24px));
  margin: 0 auto 48px;
}
.admin-nav {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}
.admin-nav a { text-decoration: none; color: #1a1d21; font-weight: 600; }
.panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 18px;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 700px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
label { display: block; font-size: .85rem; color: #4b5563; margin: 0 0 4px; font-family: var(--font-label); }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="color"], select, textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
}
.flash { padding: 10px 12px; border-radius: 8px; margin: 0 0 14px; }
.flash-ok { background: #ecfdf3; }
.flash-error { background: #fef2f2; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #eee; }
.muted { color: #6b7280; }
.field { margin: 0 0 12px; }
.stack { display: grid; gap: 14px; }

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-wrap .panel { width: min(420px, 100%); }
.login-wrap h1 { margin: 0 0 8px; font-size: 1.4rem; }
.admin-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
}
.admin-heading h1,
.panel > h1 { margin: 0 0 16px; font-size: 1.4rem; }
.admin-heading h1 { margin: 0; }
.h2 { font-size: 1.05rem; margin: 8px 0 0; }
.hint { font-size: .8rem; color: #6b7280; margin: 4px 0 0; }
.thumb {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 10px;
  margin: 0 0 8px;
}
.thumb--wide { width: 160px; height: 90px; }
.thumb--logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  background: #f8f8f8;
  padding: 8px;
}
.table-actions { display: flex; gap: 10px; align-items: center; }
.table-actions form { display: inline; margin: 0; }
.link-danger {
  background: none;
  border: 0;
  color: #b91c1c;
  cursor: pointer;
  padding: 0;
  font: inherit;
}
.link-action {
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  padding: 0;
  font: inherit;
  font-weight: 600;
}
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-nav__links { display: flex; gap: 16px; flex-wrap: wrap; }
.admin-nav__user { display: flex; gap: 12px; align-items: center; }
.logo-choice {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.logo-choice label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  cursor: pointer;
  color: inherit;
  font-size: .9rem;
}
.logo-choice input { width: auto; min-height: 0; }
.qr-preview {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #eee;
}
.qr-preview img {
  width: 180px;
  height: auto;
}
fieldset.field {
  border: 0;
  padding: 0;
  margin: 0 0 12px;
}
fieldset.field legend {
  font-size: .85rem;
  color: #4b5563;
  margin: 0 0 8px;
  font-family: var(--font-label);
}
