/* THE GYM · Eğitmen ders yoklaması (mobil öncelikli) */
:root {
  --red: #D21A21;
  --red-soft: #FDECEC;
  --green: #1E7B34;
  --green-soft: #E6F4EA;
  --amber: #B45309;
  --amber-soft: #FEF3C7;
  --bg: #F5F6F4;
  --card: #FFFFFF;
  --text: #17191C;
  --text-2: #5A5D63;
  --muted: #8A8D93;
  --border: #E9EAEC;
  --night: #101114;
  --night-2: #1E2025;
  --input-bg: #FFFFFF;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B0C0E;
    --card: #17191D;
    --text: #F2F3F5;
    --text-2: #C9CBCF;
    --muted: #8A8D93;
    --border: #2C2F35;
    --red-soft: #3A1517;
    --green-soft: #12301B;
    --amber-soft: #3A2A0E;
    --input-bg: #1E2025;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
}
.hidden { display: none !important; }
button, input, select { font: inherit; }

.yk-top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--night); color: #fff;
}
.yk-brand { display: flex; flex-direction: column; line-height: 1.1; }
.yk-logo { font-weight: 900; letter-spacing: .06em; font-size: 17px; }
.yk-brand-sub { font-size: 11px; color: #FF5A66; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.yk-top-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.yk-staff { font-size: 12px; color: #C9CBCF; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
.yk-btn-ghost { background: transparent; color: #fff; border: 1px solid #3A3D44; border-radius: 10px; padding: 6px 10px; font-size: 12px; cursor: pointer; }

.yk-main { max-width: 640px; margin: 0 auto; padding: 12px 16px 24px; display: flex; flex-direction: column; gap: 12px; }
.yk-card { background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 14px; }
.yk-muted { color: var(--text-2); font-size: 13px; }
.yk-login h1 { margin: 0 0 4px; font-size: 22px; }
.yk-login { display: flex; flex-direction: column; gap: 12px; margin-top: 8vh; }

.yk-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.yk-field input, .yk-field select, .yk-code-row input {
  width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 12px;
  border: 1.5px solid var(--border); background: var(--input-bg); color: var(--text); font-size: 16px; font-weight: 500;
}
.yk-field select { appearance: auto; }
.yk-field input:focus, .yk-field select:focus, .yk-code-row input:focus { outline: 2px solid var(--red); outline-offset: 0; border-color: transparent; }
.yk-picker { display: flex; flex-direction: column; gap: 10px; }
.yk-picker-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.yk-btn-primary, .yk-btn-dark, .yk-btn-sm {
  border: 0; border-radius: 12px; cursor: pointer; font-weight: 700;
}
.yk-btn-primary { background: var(--red); color: #fff; min-height: 50px; padding: 0 18px; font-size: 16px; width: 100%; }
.yk-btn-primary.is-stop { background: var(--night-2); }
.yk-btn-dark { background: var(--night); color: #fff; min-height: 46px; padding: 0 16px; }
.yk-btn-sm { background: var(--night); color: #fff; min-height: 38px; padding: 0 12px; font-size: 13px; white-space: nowrap; }
.yk-btn-sm[disabled], .yk-btn-primary[disabled] { opacity: .45; cursor: default; }
@media (prefers-color-scheme: dark) { .yk-btn-sm, .yk-btn-dark { background: #33363D; } }

.yk-error { background: var(--red-soft); color: var(--red); border-radius: 10px; padding: 10px 12px; font-size: 14px; font-weight: 600; }
@media (prefers-color-scheme: dark) { .yk-error { color: #FF8A92; } }

.yk-session-info { font-size: 13px; color: var(--text-2); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.yk-pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--bg); border: 1px solid var(--border); color: var(--text-2); white-space: nowrap; }
.yk-pill.is-green { background: var(--green-soft); color: var(--green); border-color: transparent; }
.yk-pill.is-red { background: var(--red-soft); color: var(--red); border-color: transparent; }
.yk-pill.is-amber { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
@media (prefers-color-scheme: dark) {
  .yk-pill.is-green { color: #6FD38A; }
  .yk-pill.is-red { color: #FF8A92; }
  .yk-pill.is-amber { color: #F7C266; }
}

/* Büyük okuma sonucu */
.yk-result {
  border-radius: 18px; padding: 18px 16px; color: #fff; display: flex; flex-direction: column; gap: 4px;
  box-shadow: 0 10px 30px rgba(0,0,0,.18); animation: yk-pop .18s ease-out;
}
.yk-result.is-ok { background: var(--green); }
.yk-result.is-warn { background: #2F6B3A; }
.yk-result.is-err { background: var(--red); }
.yk-result-title { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; opacity: .9; }
.yk-result-name { font-size: 28px; font-weight: 900; line-height: 1.15; word-break: break-word; }
.yk-result-sub { font-size: 16px; font-weight: 600; }
.yk-result-spot { display: inline-block; margin-top: 4px; background: rgba(255,255,255,.2); border-radius: 10px; padding: 4px 10px; font-size: 20px; font-weight: 900; align-self: flex-start; }
@keyframes yk-pop { from { transform: scale(.97); opacity: .4; } to { transform: none; opacity: 1; } }

.yk-scan { display: flex; flex-direction: column; gap: 12px; }
.yk-counter { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.yk-counter > div:first-child { font-size: 30px; font-weight: 900; }
.yk-counter-num { color: var(--green); }
.yk-counter-sep { color: var(--muted); margin: 0 4px; }
.yk-counter-label { font-size: 12px; color: var(--text-2); font-weight: 600; }
.yk-cam { position: relative; width: 100%; aspect-ratio: 1 / 1; max-height: 70vh; border-radius: 16px; overflow: hidden; background: #000; }
.yk-cam video { width: 100%; height: 100%; object-fit: cover; display: block; }
.yk-cam-frame { position: absolute; inset: 14%; border: 3px solid rgba(255,255,255,.85); border-radius: 18px; box-shadow: 0 0 0 9999px rgba(0,0,0,.28); pointer-events: none; }
.yk-cam.is-busy .yk-cam-frame { border-color: #FFD24D; }
.yk-cam-msg { background: var(--amber-soft); color: var(--amber); border-radius: 12px; padding: 10px 12px; font-size: 14px; font-weight: 600; line-height: 1.4; }
@media (prefers-color-scheme: dark) { .yk-cam-msg { color: #F7C266; } }
.yk-manual-code summary { cursor: pointer; font-size: 13px; color: var(--text-2); font-weight: 600; }
.yk-code-row { display: flex; gap: 8px; margin-top: 8px; }

.yk-section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.yk-section-head h2, .yk-sub-title { margin: 0; font-size: 16px; }
.yk-sub-title { font-size: 13px; color: var(--text-2); margin: 14px 0 6px; text-transform: uppercase; letter-spacing: .05em; }
.yk-list { display: flex; flex-direction: column; }
.yk-row { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-top: 1px solid var(--border); min-height: 56px; }
.yk-row:first-child { border-top: 0; }
.yk-row.is-in { background: linear-gradient(90deg, var(--green-soft), transparent 70%); }
.yk-spot { flex: 0 0 auto; min-width: 38px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; background: var(--bg); border: 1px solid var(--border); font-size: 12px; font-weight: 800; color: var(--text-2); }
.yk-row-main { flex: 1; min-width: 0; }
.yk-row-name { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yk-row-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.yk-empty { color: var(--muted); font-size: 14px; padding: 8px 0; }
.yk-foot { font-size: 12px; text-align: center; margin: 4px 8px 0; }

.yk-toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--night); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; max-width: calc(100vw - 32px); z-index: 50; box-shadow: 0 8px 24px rgba(0,0,0,.25); }

@media (min-width: 720px) {
  .yk-main { padding-top: 20px; }
  .yk-cam { max-width: 480px; margin: 0 auto; }
}
