:root {
  color-scheme: light;
  --ink: #171717;
  --muted: #6f7378;
  --line: #e7e9ed;
  --paper: #ffffff;
  --mist: #f7f8fa;
  --jade: #20242b;
  --gold: #9a7b32;
  --rose: #b9465b;
  --shadow: 0 24px 70px rgba(18, 24, 31, .10);
  --soft-shadow: 0 12px 36px rgba(18, 24, 31, .08);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, "Segoe UI", Tahoma, Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 0%, rgba(20, 24, 31, .06), transparent 32rem),
    radial-gradient(circle at 85% 10%, rgba(154, 123, 50, .10), transparent 26rem),
    linear-gradient(135deg, #ffffff, #f6f7f9 62%, #ffffff);
  letter-spacing: 0;
}

a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }

.public-page {
  display: grid;
  place-items: center;
  padding: 28px;
}

.card-shell {
  width: min(1040px, 100%);
}

.glass-panel {
  background: rgba(255, 255, 255, .82);
  border: 1px solid rgba(231, 233, 237, .86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.business-card {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  padding: clamp(22px, 4vw, 46px);
}

.business-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: linear-gradient(90deg, #171717, var(--gold), #8f949c);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 38px;
}

.brand-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(18, 24, 31, .12));
}

.brand-row strong,
.admin-brand span {
  display: block;
  font-size: 1.04rem;
}

.eyebrow, .kicker {
  margin: 0 0 4px;
  color: var(--gold);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.lang-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  margin-inline-start: auto;
  background: #fff;
  border-radius: 999px;
}

.lang-btn {
  min-width: 42px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.lang-btn.active {
  color: #fff;
  background: var(--jade);
}

.profile-grid {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: clamp(22px, 5vw, 52px);
  align-items: center;
}

.avatar {
  width: 190px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(145deg, #ffffff, #eef0f3);
  border: 1px solid #fff;
  box-shadow: var(--soft-shadow);
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar span {
  color: var(--jade);
  font-size: 3.4rem;
  font-weight: 900;
}

.identity h1 {
  margin: 0;
  font-size: clamp(2.1rem, 6vw, 4.8rem);
  line-height: 1.02;
  color: var(--ink);
  letter-spacing: 0;
}

.identity h2 {
  margin: 12px 0 20px;
  color: var(--jade);
  font-size: clamp(1.05rem, 2vw, 1.45rem);
  font-weight: 800;
}

.bio {
  width: min(680px, 100%);
  margin: 0;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.95;
}

.contact-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 38px;
}

.action {
  min-height: 116px;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 10px 24px rgba(21, 38, 34, .06);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.action:hover {
  transform: translateY(-3px);
  border-color: rgba(32, 36, 43, .28);
  box-shadow: var(--soft-shadow);
}

.action span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--jade);
}

.action.primary {
  background: linear-gradient(135deg, #171717, #3e444d);
  color: #fff;
}

.action.primary span {
  color: var(--jade);
  background: #fff;
}

.action small {
  color: inherit;
  opacity: .74;
  direction: ltr;
  overflow-wrap: anywhere;
}

.social-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.social {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-weight: 750;
}

.company-address,
.qr-box {
  margin-top: 22px;
  padding: 22px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .72);
}

.company-address span,
.qr-box span {
  color: var(--gold);
  font-weight: 850;
}

.company-address p,
.qr-box p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

.qr-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.qr-box img {
  width: 146px;
  height: 146px;
  border: 10px solid #fff;
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
}

html[dir="ltr"] .bio,
html[dir="ltr"] .company-address p { line-height: 1.7; }

.admin-login-page {
  display: grid;
  place-items: center;
  padding: 28px;
}

.login-shell { width: min(440px, 100%); }
.login-panel {
  display: grid;
  gap: 16px;
  border-radius: 8px;
  padding: 34px;
}

.login-panel img {
  width: 74px;
  height: 74px;
}

.login-panel h1,
.admin-header h1 {
  margin: 0;
  font-size: clamp(1.55rem, 4vw, 2.4rem);
}

label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 800;
}

input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  background: #fff;
  color: var(--ink);
  outline: 0;
}

textarea {
  min-height: 126px;
  resize: vertical;
}

input:focus, textarea:focus {
  border-color: var(--jade);
  box-shadow: 0 0 0 4px rgba(32, 36, 43, .10);
}

.form-error {
  min-height: 20px;
  margin: 0;
  color: var(--rose);
  font-weight: 800;
}

.admin-message {
  min-height: 0;
  margin: -8px 0 18px;
  padding: 0;
  color: var(--muted);
  font-weight: 850;
}

.admin-message:empty {
  display: none;
}

.admin-message.ok {
  padding: 12px 14px;
  border: 1px solid #d7dce2;
  border-radius: 8px;
  color: var(--jade);
  background: #fff;
}

.admin-message.error {
  padding: 12px 14px;
  border: 1px solid #ffd5dc;
  border-radius: 8px;
  color: var(--rose);
  background: #fff6f7;
}

.submit-btn,
.ghost-link,
.actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  color: #fff;
  background: var(--jade);
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(18, 24, 31, .16);
}

.submit-btn.compact,
.ghost-link {
  min-height: 40px;
}

.ghost-link {
  color: var(--jade);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: none;
}

.admin-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 28px;
  padding: 24px;
  background: rgba(255, 255, 255, .9);
  border-inline-end: 1px solid var(--line);
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
}

.admin-brand img {
  width: 44px;
  height: 44px;
}

.admin-sidebar nav {
  display: grid;
  align-content: start;
  gap: 8px;
}

.admin-sidebar nav a {
  padding: 13px 14px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 850;
}

.admin-sidebar nav a.active {
  color: var(--jade);
  background: #f0f1f3;
}

.admin-user {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.admin-user a { color: var(--rose); font-weight: 850; }
.admin-main { padding: clamp(22px, 4vw, 42px); }

.admin-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 24px;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.metric,
.table-panel,
.form-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .86);
  box-shadow: var(--soft-shadow);
}

.metric {
  padding: 18px;
}

.metric span {
  display: block;
  font-size: 1.8rem;
  font-weight: 950;
}

.metric small {
  color: var(--muted);
  font-weight: 750;
}

.table-panel {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

th, td {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  text-align: start;
}

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

td span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.pill {
  display: inline-flex;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 850;
}

.pill.ok {
  color: var(--jade);
  background: #f0f1f3;
}

.pill.muted {
  color: var(--muted);
  background: #eef1f0;
}

.actions {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.actions form { display: inline; }
.actions button {
  min-height: 34px;
  padding: 0 12px;
  background: #f2f3f5;
  color: var(--jade);
  box-shadow: none;
}

.actions button.danger {
  color: var(--rose);
  background: #fff0f2;
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
}

.url-row td {
  padding-top: 0;
  color: var(--muted);
  font-size: .84rem;
  direction: ltr;
}

.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: 18px;
}

.editor-grid.single {
  grid-template-columns: minmax(0, 820px);
}

.form-section {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 22px;
}

.form-section h2 {
  margin: 0;
  font-size: 1.2rem;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.check-row input {
  width: 18px;
  height: 18px;
}

.not-found {
  display: grid;
  justify-items: start;
  gap: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: light;
    --ink: #171717;
    --muted: #6f7378;
    --line: #e7e9ed;
    --paper: #ffffff;
    --mist: #f7f8fa;
  }
  body {
    background:
      radial-gradient(circle at 20% 0%, rgba(20, 24, 31, .06), transparent 32rem),
      radial-gradient(circle at 85% 10%, rgba(154, 123, 50, .10), transparent 26rem),
      linear-gradient(135deg, #ffffff, #f6f7f9 62%, #ffffff);
  }
  .glass-panel,
  .admin-sidebar,
  .metric,
  .table-panel,
  .form-section,
  .company-address,
  .qr-box,
  .action {
    background: rgba(255, 255, 255, .88);
  }
  input, textarea, .lang-switch, .social, .ghost-link, .icon-btn {
    background: #fff;
    color: var(--ink);
  }
}

@media (max-width: 860px) {
  .public-page { padding: 14px; }
  .brand-row { flex-wrap: wrap; margin-bottom: 28px; }
  .profile-grid {
    grid-template-columns: 1fr;
  }
  .avatar {
    width: min(190px, 56vw);
  }
  .contact-actions,
  .metric-row,
  .editor-grid,
  .two-col {
    grid-template-columns: 1fr;
  }
  .qr-box {
    align-items: flex-start;
    flex-direction: column;
  }
  .admin-page {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    position: static;
    height: auto;
    grid-template-rows: auto auto auto;
    gap: 14px;
    padding: 16px;
  }
  .admin-sidebar nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .admin-sidebar nav a {
    text-align: center;
  }
  .admin-user {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }
  .admin-main {
    padding: 16px;
  }
  .admin-header {
    align-items: flex-start;
    flex-direction: column;
  }
  table {
    min-width: 620px;
  }
  .actions {
    flex-wrap: wrap;
    white-space: normal;
  }
  .actions button {
    min-height: 38px;
  }
}

@media (max-width: 520px) {
  .business-card {
    padding: 18px;
  }
  .brand-logo {
    width: 48px;
    height: 48px;
  }
  .login-panel {
    padding: 24px;
  }
  .admin-brand span {
    font-size: .95rem;
  }
  .metric span {
    font-size: 1.35rem;
  }
  .table-panel {
    margin-inline: -16px;
    border-radius: 0;
    border-inline: 0;
  }
  th, td {
    padding: 13px 12px;
  }
  .submit-btn,
  .ghost-link {
    width: 100%;
  }
}
