:root {
  --bg: #f4efe9;
  --panel: #ffffff;
  --ink: #2b1d14;
  --muted: #7a6a5e;
  --line: #e4dbd2;
  --brand: #e30613;
  --brand-ink: #ffffff;
  --brown: #4a2c1a;
  --ok: #1e8e3e;
  --warn: #b26a00;
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

header.top {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 20px; background: var(--brown); color: #fff;
}
header.top h1 { font-size: 17px; margin: 0; font-weight: 600; }
header.top .spacer { flex: 1; }
header.top a { color: #f6d8c2; text-decoration: none; font-size: 13px; }
header.top a:hover { text-decoration: underline; }

.layout {
  display: grid; grid-template-columns: minmax(340px, 440px) 1fr; gap: 20px;
  padding: 20px; align-items: start;
}
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; padding: 12px; } }

.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 16px;
}
.panel h2 { font-size: 14px; margin: 0 0 12px; color: var(--brown); text-transform: uppercase; letter-spacing: .04em; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px 12px; }
.full { grid-column: 1 / -1; }

label.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
label.field > span { white-space: nowrap; }
input[type=number], input[type=text], input[type=password], select {
  font: inherit; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; width: 100%;
}
input:focus, select:focus { outline: 2px solid #f2a9ae; border-color: var(--brand); }
input:disabled { background: #f3f0ed; color: #a99d93; }
input[type=color] { width: 100%; height: 36px; border: 1px solid var(--line); border-radius: 7px; padding: 2px; background: #fff; }

.check { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; user-select: none; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }

button, .btn {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: 8px; padding: 9px 16px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
}
button:hover { border-color: #cbbcae; }
button.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
button.primary:hover { filter: brightness(.95); }
button.big { font-size: 17px; padding: 14px 20px; width: 100%; }
button:disabled { opacity: .5; cursor: not-allowed; }

.hint { font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.warn { color: var(--warn); }
.ok { color: var(--ok); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.preview-wrap { position: sticky; top: 16px; }
.preview-box {
  background: #d9d0c6; border-radius: var(--radius); padding: 24px;
  display: flex; justify-content: center;
}
.preview-box svg {
  width: 100%; max-width: 620px; height: auto; display: block;
  background: #fff; box-shadow: 0 6px 24px rgba(0, 0, 0, .18);
}
.preview-tools { display: flex; gap: 16px; flex-wrap: wrap; margin: 10px 2px 0; }

/* Kullanıcı sayfası: etiket satırları */
.slot {
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center;
  padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; background: #fff;
}
.slot.active { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.slot .num {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: #eee6de; color: var(--brown); font-weight: 700;
}
.slot.active .num { background: var(--brand); color: #fff; }
.slot .name input { font-size: 18px; padding: 9px 11px; }
.slot .size { display: flex; align-items: center; gap: 4px; }
.slot .size input { width: 64px; text-align: center; }
.slot .size button { padding: 6px 10px; }
.slot .info { grid-column: 2 / -1; font-size: 12px; color: var(--muted); min-height: 16px; margin-top: -4px; }
.slot .head { display: flex; align-items: center; gap: 8px; }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--brown); color: #fff; padding: 10px 18px; border-radius: 8px;
  opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 10;
}
.toast.show { opacity: 1; }

#print-area { display: none; }

/* Giriş ekranı: giriş yapılana kadar sayfa içeriği gizli */
body:not(.authed) > header.top, body:not(.authed) > .layout { display: none; }
.gate { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.gate-card {
  width: 100%; max-width: 360px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 28px 24px; display: flex; flex-direction: column; gap: 12px; text-align: center;
  box-shadow: 0 10px 30px rgba(74, 44, 26, .12);
}
.gate-card h1 { font-size: 18px; margin: 0 0 4px; color: var(--brown); }
.gate-card input { font-size: 16px; padding: 11px 12px; text-align: center; }
.gate-card .hint { min-height: 18px; margin: 0; }
header.top button.link { background: none; border: 0; color: #f6d8c2; font-weight: 400; font-size: 13px; padding: 0; }
header.top button.link:hover { text-decoration: underline; }

@page { size: A4 portrait; margin: 0; }
@media print {
  body { background: #fff; }
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block; width: 210mm; height: 297mm; overflow: hidden; }
  #print-area svg { display: block; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
