/* Packtrust Fuar Kayıt */
:root {
  --brand: #4a4081;
  --brand-dark: #3a3266;
  --brand-wash: #f1eff8;
  --ink: #272928;
  --soft: #5f615f;
  --line: #e2e1e6;
  --bg: #f7f7f9;
  --card: #fff;
  --ok: #1f7a4d;
  --ok-bg: #e7f5ee;
  --warn: #8a5a00;
  --warn-bg: #fff4dc;
  --err: #b42318;
  --err-bg: #fdecea;
  --r: 12px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
a { color: var(--brand); }
h1 { font-size: 1.5rem; line-height: 1.25; margin: 0 0 .35rem; text-wrap: balance; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
.muted { color: var(--soft); }
.small { font-size: .875rem; }
.center { text-align: center; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px max(16px, env(safe-area-inset-right)) 48px max(16px, env(safe-area-inset-left));
}
body.public .wrap { max-width: 720px; }

/* Üst menü */
.top {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.top .brand img { height: 34px; display: block; }
.top nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.top nav a, .top .me a {
  text-decoration: none; color: var(--ink); padding: 6px 10px; border-radius: 8px; font-size: .95rem;
}
.top nav a:hover, .top .me a:hover { background: var(--brand-wash); }
.top nav a.on { background: var(--brand); color: #fff; }
.top .me { display: flex; gap: 4px; align-items: center; }
.top .me .out { color: var(--soft); }
@media (max-width: 640px) {
  .top { gap: 8px; }
  .top .brand img { height: 28px; }
  .top nav { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .top nav a { white-space: nowrap; }
  .top .me { margin-left: auto; }
}

/* Kartlar ve formlar */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 20px; margin-bottom: 16px;
}
.card.narrow, .narrow { max-width: 440px; margin-left: auto; margin-right: auto; }
.logo-big { display: block; max-width: 220px; width: 60%; height: auto; margin: 0 0 18px; }
.card.center .logo-big { margin-left: auto; margin-right: auto; }

.form label { display: block; font-size: .9rem; font-weight: 600; margin-bottom: 14px; }
.form label b { color: var(--err); }
.form input:not([type=checkbox]), .form select, .form textarea, .filters input, .filters select, .menu input {
  display: block; width: 100%; margin-top: 6px;
  font: inherit; font-weight: 400; color: var(--ink);
  padding: 11px 12px; border: 1px solid #cfced6; border-radius: 10px; background: #fff;
  min-height: 46px;
}
.form textarea { min-height: 0; resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus, .filters input:focus, .filters select:focus {
  outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand);
}
.has-err input, .has-err select { border-color: var(--err); }
.err { display: block; color: var(--err); font-weight: 500; font-size: .85rem; margin-top: 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 600px) { .grid2 { grid-template-columns: 1fr; } }
.row2 { display: flex; gap: 8px; }
.form label.check, .form label.consent {
  display: flex; gap: 10px; align-items: flex-start; font-weight: 400; flex-wrap: wrap;
}
.form label.check input, .form label.consent input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--brand); }
.form label.consent span:first-of-type { flex: 1; min-width: 0; }
.form label.consent .err { flex-basis: 100%; }

fieldset { border: 0; padding: 0; margin: 4px 0 18px; min-width: 0; }
legend { font-size: .9rem; font-weight: 600; padding: 0; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { margin: 0 !important; font-weight: 400 !important; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-block; padding: 9px 14px; border: 1px solid #cfced6; border-radius: 999px;
  background: #fff; font-size: .95rem; user-select: none; transition: background .12s, color .12s;
}
.chip input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip input:checked + span::before { content: "✓ "; }
.chip input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  padding: 10px 18px; min-height: 44px; border-radius: 10px;
  background: var(--brand); color: #fff; border: 1px solid var(--brand);
}
.btn:hover { background: var(--brand-dark); }
.btn.ghost { background: #fff; color: var(--brand); }
.btn.ghost:hover { background: var(--brand-wash); }
.btn.big { width: 100%; padding: 14px; font-size: 1.05rem; margin-top: 4px; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); text-decoration: underline; cursor: pointer; }
.linkbtn.danger { color: var(--err); }
form.inline { display: inline; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.flash { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; background: var(--ok-bg); color: var(--ok); font-size: .95rem; }
.flash.err { background: var(--err-bg); color: var(--err); }
.flash.warn { background: var(--warn-bg); color: var(--warn); }

/* Ziyaretçi formu */
.form-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.lang { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; flex: none; }
.lang a { padding: 6px 12px; text-decoration: none; color: var(--soft); font-size: .85rem; font-weight: 600; }
.lang a.on { background: var(--brand); color: #fff; }
.visitor > p.muted { margin: 0 0 20px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.tick {
  width: 64px; height: 64px; border-radius: 50%; margin: 6px auto 12px;
  background: var(--ok-bg); color: var(--ok); font-size: 34px; line-height: 64px;
}
.foot { margin-top: 8px; }
.checks { list-style: none; padding: 0; margin: 12px 0; font-size: .9rem; }
.checks .ok { color: var(--ok); }
.checks .bad { color: var(--err); }

/* Panel */
.pagehead { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.pagehead p { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stats div { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.stats b { display: block; font-size: 1.6rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stats span { color: var(--soft); font-size: .85rem; }
@media (max-width: 600px) { .stats { grid-template-columns: repeat(2, 1fr); } }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.filters input, .filters select { margin: 0; width: auto; min-height: 42px; padding: 8px 10px; }
.filters input[type=search] { flex: 1 1 240px; }
.filters select { flex: 0 1 auto; max-width: 100%; }

.list { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.row {
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) 9rem; gap: 12px; align-items: center;
  padding: 12px 16px; border-top: 1px solid var(--line); text-decoration: none; color: inherit;
}
.row:first-child { border-top: 0; }
.row:hover { background: var(--brand-wash); }
.row .main b, .row .main span, .row .meta > span:first-child { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .main span, .row .meta { color: var(--soft); font-size: .9rem; }
.row .side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: .8rem; color: var(--soft); }
@media (max-width: 640px) {
  .row { grid-template-columns: minmax(0, 1fr) auto; }
  .row .meta { grid-column: 1; grid-row: 2; }
  .row .side { grid-row: 1 / span 2; grid-column: 2; }
}
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tags i { font-style: normal; font-size: .78rem; background: var(--brand-wash); color: var(--brand); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.row .tags { margin-top: 4px; }
.badge { padding: 2px 8px; border-radius: 999px; background: #eee; color: var(--ink); font-weight: 600; max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge.qr { background: var(--brand); color: #fff; }
.nomail { color: var(--warn); font-weight: 600; }
.empty { text-align: center; color: var(--soft); padding: 40px 20px; }

.detail dl { display: grid; grid-template-columns: 10rem minmax(0, 1fr); gap: 10px 16px; margin: 16px 0 0; }
.detail dt { color: var(--soft); font-size: .9rem; }
.detail dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { .detail dl { grid-template-columns: 1fr; gap: 2px; } .detail dd { margin-bottom: 10px; } }
.quick { display: flex; flex-wrap: wrap; gap: 8px; }
.danger-zone { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }

.tbl { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tbl th { text-align: left; font-size: .8rem; color: var(--soft); font-weight: 600; padding: 0 8px 8px; }
.tbl td { padding: 10px 8px; border-top: 1px solid var(--line); vertical-align: top; }
.tbl tr.off td { color: var(--soft); }
.tbl .ops { text-align: right; }
.tbl summary { cursor: pointer; color: var(--brand); font-size: .9rem; }
.menu { display: grid; gap: 10px; margin-top: 8px; min-width: 220px; text-align: left; }
.menu form { display: grid; gap: 6px; }
.menu input { margin: 0; min-height: 38px; padding: 6px 10px; }
@media (max-width: 640px) {
  .tbl thead { display: none; }
  .tbl tr { display: grid; grid-template-columns: 1fr auto; padding: 10px 0; border-top: 1px solid var(--line); }
  .tbl td { border: 0; padding: 2px 8px; }
  .tbl td:nth-child(3), .tbl td:nth-child(4) { display: none; }
  .tbl .ops { grid-column: 1 / -1; text-align: left; }
}

/* QR afiş */
.poster {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  max-width: 560px; margin: 0 auto 16px; padding: 32px 24px; text-align: center;
}
.poster-logo { width: 70%; max-width: 320px; height: auto; }
.poster h2 { font-size: 1.6rem; margin: 18px 0 8px; color: var(--ink); }
.poster h2 span { color: var(--brand); font-size: 1.15rem; }
.qr canvas { width: min(100%, 340px); height: auto; display: block; margin: 0 auto; image-rendering: pixelated; }
.poster-url { font-weight: 600; margin: 6px 0 4px; overflow-wrap: anywhere; }
.poster-sub { color: var(--soft); font-size: .9rem; margin: 0; }

@media print {
  .top, .noprint, .flash { display: none !important; }
  body { background: #fff; }
  .wrap { padding: 0; }
  .poster { border: 0; max-width: none; padding-top: 10mm; }
  .qr canvas { width: 120mm; }
  .poster-logo { max-width: 110mm; }
  .poster h2 { font-size: 26pt; }
}

/* Kartvizit / fotoğraf yükleme */
.upload {
  border: 1px dashed #c9c5dc; border-radius: var(--r); background: #fbfaff;
  padding: 14px; margin: 0 0 18px;
}
.up-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.up-head b { font-size: .95rem; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumbs:not(:empty) { margin-bottom: 10px; }
.thumb { position: relative; margin: 0; width: 92px; height: 92px; border-radius: 10px; overflow: hidden; background: #eee; border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .rm {
  position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%;
  border: 0; background: rgba(39, 41, 40, .75); color: #fff; font-size: 18px; line-height: 28px; padding: 0; cursor: pointer;
}
.up-btn { position: relative; overflow: hidden; }
.up-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.up-btn.full { display: none; }
.card-first .upload { background: var(--brand-wash); border-color: #b9b2d9; }
button.big:disabled { opacity: .7; cursor: progress; }

/* Kayıt detayında görseller */
.gallery { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.gallery figure { margin: 0; width: 160px; }
.gallery a.img { display: block; width: 160px; height: 120px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #eee; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery figcaption { display: flex; justify-content: space-between; gap: 6px; font-size: .8rem; color: var(--soft); margin-top: 4px; }
.gallery figcaption form { display: inline; }
.row .clip { font-size: .8rem; color: var(--brand); white-space: nowrap; }
.row .main b.pending { color: var(--warn); font-weight: 600; }
.att-section { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.att-add { margin-top: 12px; }
