@font-face {
  font-family: 'Saira Condensed';
  src: url('/static/fonts/SairaCondensed-Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #0b1a2e;
  --bg2: #10284a;
  --card: #ffffff;
  --ink: #13263f;
  --muted: #5a6f88;
  --line: #d6e4f0;
  --accent: #2f8fd8;
  --accent-dark: #1d6fb0;
  --ice: #bfe3ff;
  --ok: #17a05d;
  --warn: #e3a008;
  --bad: #d64545;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  color: var(--ink);
  background: radial-gradient(1200px 600px at 20% -10%, #1d5a6e55, transparent 60%),
    radial-gradient(1000px 600px at 90% 0%, #4b3f9a55, transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
  background-color: var(--bg);
  min-height: 100vh;
  line-height: 1.5;
}

a { color: var(--accent-dark); }

.wrap { max-width: 720px; margin: 0 auto; padding: 24px 16px 64px; }
.wrap.wide { max-width: 1200px; }

.hero { text-align: center; color: #fff; margin-bottom: 18px; }
.hero img.logo { width: min(260px, 70vw); height: auto; filter: drop-shadow(0 10px 30px #4fb4ff40); }
.hero .kicker {
  font-family: 'Saira Condensed', sans-serif; letter-spacing: .35em; color: var(--ice); font-size: 14px; margin: 0 0 6px;
}
.facts { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.facts span {
  font-family: 'Saira Condensed', sans-serif; font-size: 18px; color: #fff; letter-spacing: .04em;
  background: #ffffff14; border: 1px solid #ffffff2a; padding: 6px 14px; border-radius: 999px;
}

.card {
  background: var(--card); border-radius: var(--radius); padding: 22px; box-shadow: 0 20px 50px #00000040;
  margin-bottom: 16px;
}
.card h1, .card h2 { font-family: 'Saira Condensed', sans-serif; letter-spacing: .02em; margin: 0 0 12px; }
.card h1 { font-size: 30px; }
.card h2 { font-size: 22px; }

label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 10px 0 4px; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=search], select, textarea {
  width: 100%; font: inherit; font-size: 16px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #f8fbfe; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; background: #fff; }

.person { border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px 14px; margin-top: 14px; }
.person h3 { font-size: 15px; margin: 10px 0 0; color: var(--accent-dark); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }

.hint { font-size: 13px; color: var(--muted); }
.notice {
  display: flex; gap: 10px; align-items: flex-start; background: #eaf5ff; border: 1px solid #c4e1fa; color: #164a75;
  border-radius: 10px; padding: 10px 12px; font-size: 14px; margin: 12px 0;
}
.notice.warn { background: #fff6e0; border-color: #f3dc9c; color: #6b4d00; }
.notice.error { background: #fdecec; border-color: #f2b8b8; color: #8a1f1f; }
.notice.success { background: #e7f7ee; border-color: #a9e0c2; color: #0f5a35; }
.notice ul { margin: 0; padding-left: 18px; }

.check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: var(--ink); font-weight: normal; margin-top: 14px; }
.check input { margin-top: 3px; width: 18px; height: 18px; flex: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; text-decoration: none;
  font: inherit; font-weight: 700; font-size: 16px; padding: 12px 20px; border-radius: 10px; background: var(--accent); color: #fff;
}
.btn:hover { background: var(--accent-dark); }
.btn.block { width: 100%; margin-top: 16px; font-size: 18px; padding: 14px; }
.btn.small { font-size: 13px; padding: 7px 12px; border-radius: 8px; }
.btn.ok { background: var(--ok); }
.btn.ok:hover { background: #128a4f; }
.btn.bad { background: var(--bad); }
.btn.bad:hover { background: #b83737; }
.btn.ghost { background: transparent; color: var(--accent-dark); border: 1px solid var(--line); }
.btn.ghost:hover { background: #f1f7fd; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }


.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.badge.pending { background: #fff3cd; color: #7a5a00; }
.badge.approved { background: #d9f5e5; color: #0f6b3c; }
.badge.rejected { background: #fde2e2; color: #932626; }
.badge.used { background: #e3e8ef; color: #3b4b60; }

.foot { text-align: center; color: #9fb6d2; font-size: 13px; margin-top: 24px; }

/* ---------- Yönetim ---------- */
.topbar { display: flex; justify-content: space-between; align-items: center; color: #fff; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.topbar .brand { font-family: 'Saira Condensed', sans-serif; font-size: 24px; color: #fff; text-decoration: none; letter-spacing: .03em; }
.topbar nav { display: flex; gap: 8px; flex-wrap: wrap; }
.topbar nav a, .topbar nav button { color: var(--ice); background: #ffffff14; border: 1px solid #ffffff26; padding: 7px 12px; border-radius: 8px; text-decoration: none; font: inherit; font-size: 14px; cursor: pointer; }
.topbar form { margin: 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: #ffffff12; border: 1px solid #ffffff22; border-radius: 12px; padding: 12px 14px; color: #fff; }
.stat .n { font-family: 'Saira Condensed', sans-serif; font-size: 28px; line-height: 1.1; }
.stat.bad { background: #d6454533; border-color: #d6454588; }
.stat .l { font-size: 12px; color: var(--ice); text-transform: uppercase; letter-spacing: .08em; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a { padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px; }
.tabs a.on { background: #eaf4fd; color: var(--accent-dark); }
.toolbar form { display: flex; gap: 6px; margin-left: auto; }
.toolbar input[type=search] { width: 240px; padding: 8px 10px; font-size: 14px; }

.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: left; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 8px; border-bottom: 2px solid var(--line); white-space: nowrap; }
table.list td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tr:hover td { background: #f7fbff; }
table.list .code { font-family: 'Saira Condensed', sans-serif; font-size: 18px; letter-spacing: .04em; white-space: nowrap; }
table.list .actions { display: flex; gap: 6px; justify-content: flex-end; }
table.list .actions form { margin: 0; }
.empty { text-align: center; color: var(--muted); padding: 30px; }
.err-text { color: var(--bad); font-size: 12px; }

.detail-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 15px; margin: 8px 0 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.action-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; align-items: flex-end; }
.action-row form { margin: 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.action-row input[type=text] { width: 240px; padding: 9px 10px; font-size: 14px; }

/* ---------- Doğrulama ---------- */
.verdict { text-align: center; padding: 34px 20px; }
.verdict .icon { font-size: 64px; line-height: 1; }
.verdict h1 { font-size: 34px; margin: 10px 0 4px; }
.verdict.ok h1 { color: var(--ok); }
.verdict.bad h1 { color: var(--bad); }
.verdict.warn h1 { color: #b07a00; }
.verdict .name { font-size: 22px; font-weight: 700; margin-top: 6px; }

/* ---------- Görevli tarayıcı ---------- */
body.scan-page { background: #071324; }
.scan-wrap { max-width: 520px; margin: 0 auto; padding: 16px; min-height: 100vh; display: flex; flex-direction: column; }
.scan-top { display: flex; justify-content: space-between; align-items: center; color: var(--ice); margin-bottom: 12px; }
.scan-top form { margin: 0; }
.scan-top button { background: none; border: 1px solid #ffffff30; color: var(--ice); border-radius: 8px; padding: 6px 10px; font: inherit; font-size: 13px; }
#reader { position: relative; width: 100%; border-radius: 16px; overflow: hidden; background: #000; display: none; }
#reader.on { display: block; }
#reader video { width: 100%; display: block; }
#reader .aim { position: absolute; inset: 12%; border: 3px solid #ffffffb0; border-radius: 18px; box-shadow: 0 0 0 999px #00000040; pointer-events: none; }
.scan-btn {
  flex: 1; min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  font-family: 'Saira Condensed', sans-serif; font-size: 40px; letter-spacing: .06em;
  background: linear-gradient(160deg, #2f8fd8, #1a5d99); color: #fff; border: 0; border-radius: 24px; cursor: pointer;
  box-shadow: 0 20px 50px #2f8fd840;
}
.scan-btn svg { width: 96px; height: 96px; }
.scan-btn.hidden { display: none; }
.stop-btn { margin-top: 12px; background: #ffffff14; color: var(--ice); border: 1px solid #ffffff30; }
.stop-btn:hover { background: #ffffff24; }
.stop-btn[hidden] { display: none; }
.result {
  position: fixed; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 24px; color: #fff; z-index: 50; cursor: pointer;
}
.result.show { display: flex; }
.result.ok { background: #0f8a4c; }
.result.used { background: #c27c00; }
.result.invalid, .result.cancelled, .result.error { background: #b52f2f; }
.result .big { font-size: 110px; line-height: 1; }
.result .msg { font-family: 'Saira Condensed', sans-serif; font-size: 40px; line-height: 1.1; margin-top: 16px; }
.result .who { font-size: 26px; font-weight: 700; margin-top: 18px; }
.result .sub { font-size: 18px; opacity: .9; margin-top: 6px; }
.result .tap { position: absolute; bottom: 28px; left: 0; right: 0; font-size: 16px; opacity: .85; }
.cam-err { color: #ffb4b4; text-align: center; margin-top: 12px; font-size: 15px; }

.send-cta { font-size: 18px; padding: 14px 24px; margin-bottom: 16px; background: var(--ok); box-shadow: 0 10px 30px #17a05d40; }
.send-cta:hover { background: #128a4f; }
.person-line { padding: 2px 0; }
.person-line .badge { margin-left: 4px; }
