/* Personel uygulaması (docs/personel-uygulamasi, onay 2026-10-21): açık tema, en az 20 px gövde, 44 px+ dokunma,
   renk tek başına anlam taşımaz. Değerler onaylı taslaktan (Main.dc.html). */
:root {
    --p-bg: #F3F5F2;
    --p-text: #14201B;
    --p-muted: #4A5751;
    --p-soft: #3A4641;
    --p-line: #D6DDD8;
    --p-line-2: #EDF1EE;
    --p-card: #FFFFFF;
    --p-green: #0A6B45;
    --p-green-dark: #064A2F;
    --p-green-bg: #E3F1EA;
    --p-green-line: #9CCFB4;
    --p-orange: #B23E0C;
    --p-orange-dark: #7A2A07;
    --p-red: #B42318;
    --p-red-dark: #7A1A12;
    --p-red-bg: #FFF6F4;
    --p-warn: #8A3B00;
    --p-keys: #E7ECE8;
    --p-scan: #101815;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--p-bg); }
body {
    color: var(--p-text);
    font-family: 'Atkinson Hyperlegible', system-ui, sans-serif;
    font-size: 20px;
    line-height: 1.4;
    -webkit-text-size-adjust: 100%;
}
button { font-family: inherit; cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 4px solid #1F4E8C; outline-offset: 3px; }
.p-scan :focus-visible, .p-full-ok :focus-visible { outline-color: #FFD27A; }
a { color: #0A5C3B; }
[x-cloak] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Ekran yüksekliği sabit: içerik kayar, alt menü ve tuş takımı hep görünür. */
.p-app { height: 100vh; height: 100dvh; max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; }
.p-main { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
/* Büyük yazı: ekranın tamamı yaklaşık %18 büyür (taslaktaki gibi). */
.buyuk-yazi .p-main { zoom: 1.18; }
.p-page { padding: 28px 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.p-page-top { padding: 40px 24px 16px; display: flex; flex-direction: column; gap: 20px; }

.p-h1 { margin: 0; font-size: 30px; line-height: 1.2; font-weight: 700; }
.p-h1-lg { margin: 8px 0 0; font-size: 32px; line-height: 1.2; font-weight: 700; }
.p-muted { color: var(--p-muted); font-size: 18px; margin: 0; }
.p-small { font-size: 16px; color: var(--p-muted); }
.p-brand { display: flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 700; }
.p-brand-mark { width: 48px; height: 48px; border-radius: 14px; background: var(--p-green); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px; overflow: hidden; }
.p-brand-mark img { width: 100%; height: 100%; object-fit: contain; background: #fff; }

.p-card { padding: 16px; border-radius: 16px; background: var(--p-card); border: 2px solid var(--p-line); display: flex; flex-direction: column; gap: 4px; }
.p-card-label { font-size: 16px; color: var(--p-muted); }
.p-card-value { font-size: clamp(20px, 6vw, 24px); font-weight: 700; }
.p-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.p-notice { padding: 14px 16px; border-radius: 16px; border: 2px solid; font-size: 19px; display: flex; flex-direction: column; gap: 6px; }
.p-notice-error { background: var(--p-red-bg); border-color: #F1B8B0; color: var(--p-red-dark); }
.p-notice-warn { background: #FFF7E8; border-color: #F0C77A; color: #5C3300; }
.p-notice-info { background: var(--p-green-bg); border-color: var(--p-green-line); color: #0A3D27; }

/* Telefon / PIN göstergesi ve tuş takımı */
.p-display { display: flex; align-items: center; min-height: 72px; padding: 0 20px; border: 3px solid var(--p-green); border-radius: 16px; background: #fff; font-size: 32px; font-weight: 700; letter-spacing: 1px; }
.p-display-empty { color: #6B7771; font-weight: 400; font-size: 24px; }
.p-dots { display: flex; gap: 16px; justify-content: center; padding: 12px 0; }
.p-dot { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--p-green); background: #fff; }
.p-dot.on { background: var(--p-green); }
.p-keypad { flex: none; padding: 12px 16px 20px; background: var(--p-keys); display: flex; flex-direction: column; gap: 12px; }
.p-keys { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.p-key { min-height: 66px; border: none; border-radius: 14px; background: #fff; color: var(--p-text); font-size: 30px; font-weight: 700; box-shadow: 0 2px 0 #C3CCC6; }
.p-key:active { transform: translateY(2px); box-shadow: none; }
.p-key-del { background: transparent; box-shadow: none; display: flex; align-items: center; justify-content: center; }
.p-back { align-self: flex-start; display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 16px 0 8px; border: 2px solid var(--p-line); border-radius: 12px; background: #fff; color: var(--p-text); font-size: 18px; }

/* Düğmeler */
.p-btn { min-height: 64px; border-radius: 16px; font-size: 22px; font-weight: 700; border: none; padding: 0 16px; }
.p-btn-green { background: var(--p-green); color: #fff; }
.p-btn-green:disabled { background: #8FA39A; }
.p-btn-dark { background: var(--p-text); color: #fff; min-height: 68px; font-size: 24px; border-radius: 18px; }
.p-btn-outline { background: transparent; border: 2px solid var(--p-text); color: var(--p-text); font-size: 21px; font-weight: 400; min-height: 60px; border-radius: 18px; }
.p-btn-white { background: #fff; color: var(--p-text); min-height: 68px; font-size: 24px; border-radius: 18px; width: 100%; }
.p-btn-ghost { background: #fff; border: 2px solid var(--p-line); color: var(--p-text); font-weight: 400; font-size: 20px; }
.p-btn-danger-outline { background: transparent; border: 2px solid var(--p-red); color: var(--p-red); font-size: 20px; min-height: 60px; }
.p-big-action { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 230px; width: 100%; border: none; border-radius: 28px; color: #fff; }
.p-big-action.in { background: var(--p-green); box-shadow: 0 6px 0 var(--p-green-dark); }
.p-big-action.out { background: var(--p-orange); box-shadow: 0 6px 0 var(--p-orange-dark); }
.p-big-action:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0,0,0,.3); }
.p-big-action:disabled { opacity: .6; }
.p-big-label { font-size: 34px; font-weight: 700; letter-spacing: .5px; }
.p-big-sub { font-size: 18px; opacity: .95; }

.p-choice { display: flex; align-items: center; gap: 16px; min-height: 104px; padding: 16px 20px; border: 3px solid var(--p-line); border-radius: 18px; background: #fff; color: var(--p-text); text-align: left; width: 100%; }
.p-choice-mark { width: 56px; height: 56px; flex: none; border-radius: 14px; background: var(--p-green-bg); color: var(--p-green); display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; }
.p-choice-title { font-size: 22px; font-weight: 700; display: block; }
.p-choice-sub { font-size: 18px; color: var(--p-muted); display: block; }

/* Durum kartı */
.p-status { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 16px; background: #fff; border: 2px solid var(--p-line); }
.p-status.in { background: var(--p-green-bg); border-color: var(--p-green-line); }
.p-status-dot { width: 16px; height: 16px; flex: none; border-radius: 50%; background: #8FA39A; }
.p-status.in .p-status-dot { background: var(--p-green); }
.p-status-title { font-size: 22px; font-weight: 700; display: block; }
.p-status-sub { font-size: 18px; color: var(--p-soft); display: block; }

/* Liste satırları (Ben) */
.p-list { border-radius: 16px; background: #fff; border: 2px solid var(--p-line); display: flex; flex-direction: column; }
.p-list-row { display: flex; justify-content: space-between; gap: 8px; padding: 14px 16px; border-bottom: 2px solid var(--p-line-2); font-size: 19px; }
.p-list-row:last-child { border-bottom: none; }
.p-list-row span:first-child { color: var(--p-muted); }
.p-row-btn { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; padding: 0 16px; border-radius: 16px; background: #fff; border: 2px solid var(--p-line); color: var(--p-text); font-size: 20px; width: 100%; text-align: left; text-decoration: none; }
.p-switch { display: inline-flex; align-items: center; width: 64px; height: 36px; border-radius: 18px; background: #B8C4BE; justify-content: flex-start; padding: 0 4px; flex: none; }
.p-switch::after { content: ''; width: 28px; height: 28px; border-radius: 50%; background: #fff; }
.p-switch.on { background: var(--p-green); justify-content: flex-end; }
.p-avatar { width: 72px; height: 72px; border-radius: 50%; background: var(--p-green); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 700; flex: none; }

/* Geçmişim */
.p-day { padding: 14px 16px; border-radius: 16px; background: #fff; border: 2px solid var(--p-line); display: flex; flex-direction: column; gap: 6px; }
.p-day-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.p-day-name { font-size: 21px; font-weight: 700; }
.p-day-total { font-size: 18px; color: var(--p-muted); }
.p-day-times { font-size: 19px; }
.p-day-note { font-size: 17px; color: var(--p-warn); font-weight: 700; }
.p-day-calm { font-size: 18px; color: var(--p-muted); }
.p-month-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.p-month-nav button { min-width: 56px; min-height: 56px; border-radius: 14px; border: 2px solid var(--p-line); background: #fff; color: var(--p-text); display: flex; align-items: center; justify-content: center; }
.p-month-nav button:disabled { opacity: .35; }
.p-month-name { font-size: 22px; font-weight: 700; }

/* Alt gezinme */
.p-tabs { flex: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: #fff; border-top: 2px solid var(--p-line); padding-bottom: env(safe-area-inset-bottom); }
.p-tab { min-height: 80px; border: none; background: #fff; color: var(--p-muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 17px; font-weight: 700; }
.p-tab[aria-current="page"] { background: var(--p-green-bg); color: #0A5C3B; }

/* Tam ekran: QR, onay, hata, duyuru */
.p-full { position: fixed; inset: 0; z-index: 50; overflow-y: auto; }
.p-full-inner { min-height: 100%; max-width: 480px; margin: 0 auto; padding: 64px 28px 32px; display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.p-full-ok { color: #fff; }
.p-full-ok.in { background: var(--p-green); }
.p-full-ok.out { background: var(--p-orange); }
.p-full-err { background: var(--p-red-bg); }
.p-full-info { background: var(--p-bg); }
.p-icon-circle { width: 140px; height: 140px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; }
.p-full-ok.in .p-icon-circle { color: var(--p-green); }
.p-full-ok.out .p-icon-circle { color: var(--p-orange); }
.p-err-circle { width: 120px; height: 120px; border-radius: 50%; background: var(--p-red); color: #fff; display: flex; align-items: center; justify-content: center; }
.p-ok-title { margin: 8px 0 0; font-size: 40px; }
.p-ok-time { font-size: 64px; font-weight: 700; line-height: 1; }
.p-err-title { margin: 8px 0 0; font-size: 32px; line-height: 1.2; color: var(--p-red-dark); }
.p-err-text { margin: 0; font-size: 21px; line-height: 1.45; color: #3A2B28; }
.p-full-actions { margin-top: auto; width: 100%; display: flex; flex-direction: column; gap: 12px; }

.p-scan { background: var(--p-scan); color: #fff; }
.p-scan .p-full-inner { padding: 28px 20px 24px; align-items: stretch; text-align: left; }
.p-scan h1 { margin: 0; font-size: 28px; line-height: 1.25; }
.p-steps { display: flex; gap: 10px; }
.p-step { flex: 1; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: #2A3330; font-size: 17px; }
.p-step.done { background: #1E3A2D; }
.p-step.bad { background: #4A1F1A; }
.p-step-ring { width: 14px; height: 14px; border-radius: 50%; border: 3px solid #FFD27A; flex: none; }
.p-camera { position: relative; align-self: center; width: min(300px, 80vw); aspect-ratio: 1; border-radius: 28px; border: 4px solid #fff; background: #22302A; overflow: hidden; }
.p-camera #qr-reader, .p-camera #qr-reader video { width: 100% !important; height: 100% !important; object-fit: cover; }
.p-camera-wait { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #CFE1D8; font-size: 18px; text-align: center; padding: 16px; }
.p-scan-hint { margin: 0; font-size: 18px; line-height: 1.4; color: #E3ECE7; text-align: center; }
.p-scan .p-btn-cancel { margin-top: auto; min-height: 60px; border: 2px solid #fff; border-radius: 16px; background: transparent; color: #fff; font-size: 22px; font-weight: 700; }
.p-invalid { position: absolute; inset: 0; background: rgba(180, 35, 24, .92); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 16px; text-align: center; font-size: 20px; font-weight: 700; }
.p-spinner { width: 72px; height: 72px; border-radius: 50%; border: 8px solid rgba(255,255,255,.25); border-top-color: #fff; animation: p-spin 1s linear infinite; }
.p-full-info .p-spinner { border-color: var(--p-line); border-top-color: var(--p-green); }
@keyframes p-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .p-spinner { animation-duration: 3s; } .p-key:active, .p-big-action:active { transform: none; } }

/* Kişisel verilerim (kvkk K3/K4): seçili tür, yazı alanı, uzun metin */
.p-choice[aria-pressed="true"] { border-color: var(--p-green); background: var(--p-green-bg); }
.p-textarea { width: 100%; min-height: 140px; padding: 14px 16px; border: 3px solid var(--p-line); border-radius: 16px; font: inherit; font-size: 20px; color: var(--p-text); background: #fff; resize: vertical; }
.p-textarea:focus { outline: 3px solid var(--p-green); outline-offset: 2px; }
.p-doc { background: #fff; border: 2px solid var(--p-line); border-radius: 16px; padding: 16px 18px; font-size: 18px; line-height: 1.55; }
.p-doc h2, .p-doc h3 { font-size: 20px; margin: 16px 0 6px; }
.p-doc table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 16px; } /* dar ekranda kutu içinde kayar, kırpılmaz */
.p-doc th, .p-doc td { border-top: 1px solid var(--p-line); padding: 6px 4px; text-align: left; vertical-align: top; }
