/* Rüya Ailem V2.0.17 — R7.8.3 CLEAN FULL REV-E1 */
/* Preserve R7.8.2 UI helpers. */
.ruya-r78-childLine{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;padding:8px 0}.ruya-r78-childActions{display:flex;gap:8px;flex-wrap:wrap}.ruya-r78-editBtn,.ruya-r78-unlinkBtn,.ruya-r78-classDelete{border:0;border-radius:10px;padding:9px 12px;font-weight:700;cursor:pointer}.ruya-r78-unlinkBtn,.ruya-r78-classDelete{background:#fff1f1;color:#a51d2d}.ruya-r78-editBtn{background:#f0ebf7;color:#5e3f88}.ruya-r78-editForm{display:grid;gap:12px}.ruya-r78-editForm label{display:grid;gap:6px}.ruya-r78-modalActions{display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap}.ruya-r78-classActions{display:flex;gap:8px;flex-wrap:wrap}.ruya-r78-classDelete{background:#fff1f1!important;color:#a51d2d!important}.ruya-r78-unsaved{font-size:12px;color:#8a4b11}
.ruya-r781-teacherClassField{margin-top:12px}.ruya-r781-teacherClassField select{width:100%;min-height:46px}
.ruya-r782-teacherClassBadge{display:inline-flex;align-items:center;gap:5px;margin-top:7px;padding:5px 9px;border-radius:999px;background:#f3f1f8;color:#4d4561;font-size:12px;font-weight:700;line-height:1.2}.ruya-r782-classTeacher{display:block;margin-top:6px;font-size:13px;color:#596174;font-weight:650}

/* R7.8.3: modal must be bound to the browser viewport, not a short page/card container. */
html:has(.modalBack),body:has(.modalBack){overflow:hidden!important}
body .modalBack{
  position:fixed!important;inset:0!important;top:0!important;right:0!important;bottom:0!important;left:0!important;
  width:100vw!important;height:100dvh!important;min-height:100dvh!important;max-height:none!important;
  z-index:2147483000!important;box-sizing:border-box!important;
  display:flex!important;justify-content:center!important;align-items:flex-start!important;
  overflow-y:auto!important;overflow-x:hidden!important;overscroll-behavior:contain!important;
  padding:clamp(14px,2.5vh,28px) clamp(12px,2vw,28px)!important;
  isolation:isolate!important;
}
body .modalBack>.modal,body .modalBack>form.modal{
  position:relative!important;top:auto!important;left:auto!important;right:auto!important;bottom:auto!important;
  transform:none!important;box-sizing:border-box!important;
  max-width:calc(100vw - 24px)!important;max-height:calc(100dvh - 28px)!important;
  min-height:0!important;height:auto!important;
  overflow-y:auto!important;overflow-x:hidden!important;overscroll-behavior:contain!important;
  scrollbar-gutter:stable;padding-bottom:max(88px,calc(env(safe-area-inset-bottom,0px) + 72px))!important;
  margin:0 auto!important;
}
/* Long V5 survey/gallery/staff dialogs get a little more usable vertical room. */
body .modalBack>.v5Modal,body .modalBack>form.v5Modal,body .modalBack>.teacherRegistrationModal,body .modalBack>form.teacherRegistrationModal,body .modalBack>.staffAccountModal,body .modalBack>form.staffAccountModal{
  max-height:calc(100dvh - 28px)!important;
}
/* Keep final actions reachable while the form body scrolls. */
body .modalBack .teacherRegistrationFooter,
body .modalBack form.modal>footer:last-child,
body .modalBack form.modal>.modalFooter:last-child,
body .modalBack form.modal>.actions:last-child,
body .modalBack form.modal>button:last-child,
body .modalBack form.modal>.btn:last-child{
  position:sticky!important;bottom:0!important;z-index:30!important;
  background:rgba(255,255,255,.98)!important;backdrop-filter:blur(10px);
  padding-top:12px!important;padding-bottom:max(12px,env(safe-area-inset-bottom,0px))!important;
  margin-top:14px!important;box-shadow:0 -12px 24px rgba(19,28,55,.09)!important;
}
body .modalBack .teacherRegistrationPanel,body .modalBack .teacherReferencePanel,body .modalBack .childCandidateList{min-height:0!important}
/* Avoid page/card clipping inherited from dashboard wrappers. */
body .v5Page:has(>.modalBack),body main:has(.modalBack),body .content:has(.modalBack){overflow:visible!important;contain:none!important}

@media (max-width:640px){
  .ruya-r78-childActions{width:100%}.ruya-r78-childActions button{flex:1;min-height:42px}.ruya-r78-classActions{width:100%}.ruya-r78-classActions>*{flex:1;min-height:42px}.ruya-r78-classDelete{min-height:42px}.ruya-r781-teacherClassField{grid-column:1/-1}
  body .modalBack{padding:8px!important;padding-bottom:max(8px,env(safe-area-inset-bottom,0px))!important}
  body .modalBack>.modal,body .modalBack>form.modal{width:calc(100vw - 16px)!important;max-width:calc(100vw - 16px)!important;max-height:calc(100dvh - 16px)!important;padding-bottom:max(104px,calc(env(safe-area-inset-bottom,0px) + 88px))!important}
}

/* R7.8.4 — Yeni Anket gerçek footer / submit */
body .modalBack .ruya-r784-surveyModal{display:flex!important;flex-direction:column!important;overflow:hidden!important;padding-bottom:0!important;max-height:calc(100dvh - 28px)!important;}
body .modalBack .ruya-r784-surveyBody{min-height:0!important;overflow-y:auto!important;padding:2px 2px 18px!important;flex:1 1 auto!important;}
body .modalBack .ruya-r784-surveyGrid{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;gap:12px!important;}
body .modalBack .ruya-r784-surveyFooter{position:sticky!important;bottom:0!important;z-index:80!important;display:grid!important;grid-template-columns:minmax(150px,.7fr) minmax(220px,1.3fr)!important;gap:10px!important;background:#fff!important;padding:16px 0 max(16px,env(safe-area-inset-bottom,0px))!important;margin-top:auto!important;border-top:1px solid rgba(25,38,70,.10)!important;box-shadow:0 -12px 26px rgba(19,28,55,.08)!important;}
body .modalBack .ruya-r784-surveyFooter button{min-height:48px!important;border-radius:12px!important;font-weight:800!important;font-size:15px!important;cursor:pointer!important;}
body .modalBack .ruya-r784-surveyCancel{background:#fff!important;border:1px solid #dce2ec!important;color:#26344c!important;}
body .modalBack .ruya-r784-surveySubmit{border:0!important;color:#fff!important;background:linear-gradient(100deg,#6f23ef,#173f99)!important;}
body .modalBack .ruya-r784-surveySubmit:disabled,body .modalBack .ruya-r784-surveyCancel:disabled{opacity:.55!important;cursor:not-allowed!important;}
@media(max-width:640px){body .modalBack .ruya-r784-surveyGrid{grid-template-columns:1fr!important}body .modalBack .ruya-r784-surveyFooter{grid-template-columns:1fr!important;padding-bottom:max(16px,env(safe-area-inset-bottom,0px))!important}}

/* R7.8.5 — survey management + infographic + parent delete + mobile full-screen survey */
.ruya-r785-surveyTarget{display:inline-flex;align-items:center;gap:6px;margin-top:8px;padding:6px 9px;border-radius:999px;background:#f2f5fb;color:#4c5870;font-size:12px;font-weight:750}
.ruya-r785-surveyActions{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px;padding-top:12px;border-top:1px solid rgba(31,46,80,.09)}
.ruya-r785-surveyActions button{min-height:38px;border-radius:10px;border:1px solid #dce3ee;background:#fff;color:#26344c;padding:8px 11px;font-weight:750;cursor:pointer}
.ruya-r785-surveyActions .primary{background:linear-gradient(100deg,#6f23ef,#173f99);border:0;color:#fff}.ruya-r785-surveyActions .danger{background:#fff0f1;border-color:#ffd5da;color:#b32636}.ruya-r785-surveyActions .warning{background:#fff8e7;border-color:#f6df9e;color:#8b6500}
.ruya-r785-parentDelete{border:1px solid #ffd4d8!important;background:#fff1f2!important;color:#b32636!important;border-radius:10px!important;padding:9px 12px!important;font-weight:800!important;cursor:pointer!important}
.ruya-r785-familyActions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}.ruya-r785-familyActions>*{min-height:40px}

.ruya-r785-resultsModal{width:min(900px,calc(100vw - 32px))!important;display:flex!important;flex-direction:column!important;overflow:hidden!important;padding-bottom:0!important;max-height:calc(100dvh - 28px)!important}
.ruya-r785-resultsBody{min-height:0;overflow:auto;-webkit-overflow-scrolling:touch;padding:0 2px 20px}
.ruya-r785-resultTitle{margin:0 0 4px;font-size:22px}.ruya-r785-resultSub{margin:0 0 16px;color:#778198}
.ruya-r785-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:12px 0 16px}.ruya-r785-kpi{border:1px solid #e4e8f0;border-radius:16px;padding:14px;background:#fff;min-width:0}.ruya-r785-kpi small{display:block;color:#7a859b;font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.04em}.ruya-r785-kpi b{display:block;margin-top:6px;font-size:24px;color:#172d64}.ruya-r785-kpi span{display:block;margin-top:3px;font-size:11px;color:#8690a4}
.ruya-r785-infographic{display:grid;grid-template-columns:minmax(190px,.7fr) minmax(0,1.3fr);gap:16px;align-items:stretch}.ruya-r785-ringCard,.ruya-r785-barsCard,.ruya-r785-responseList{border:1px solid #e3e8f1;border-radius:18px;background:#fff;padding:16px}.ruya-r785-ringCard{display:grid;place-items:center;text-align:center}.ruya-r785-ring{--pct:0;position:relative;width:150px;height:150px;border-radius:50%;display:grid;place-items:center;background:conic-gradient(#6230df calc(var(--pct)*1%),#edf0f6 0)}.ruya-r785-ring:after{content:"";position:absolute;inset:15px;border-radius:50%;background:#fff}.ruya-r785-ring strong,.ruya-r785-ring small{position:relative;z-index:1}.ruya-r785-ring strong{font-size:30px;color:#172d64}.ruya-r785-ring small{font-size:11px;color:#7f899c}.ruya-r785-ringLabel{margin-top:10px;font-weight:800;color:#26344c}
.ruya-r785-barsCard h4,.ruya-r785-responseList h4{margin:0 0 12px}.ruya-r785-barRow{display:grid;grid-template-columns:minmax(90px,.8fr) minmax(110px,2fr) auto;gap:10px;align-items:center;margin:10px 0}.ruya-r785-barRow label{font-size:13px;font-weight:750;color:#34425d;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ruya-r785-barTrack{height:11px;border-radius:999px;background:#edf0f6;overflow:hidden}.ruya-r785-barFill{height:100%;border-radius:999px;background:linear-gradient(90deg,#6e25ee,#20439e);min-width:0}.ruya-r785-barRow b{font-size:12px;color:#59657c}.ruya-r785-responseList{margin-top:16px}.ruya-r785-responseRows{display:grid;gap:8px;max-height:260px;overflow:auto}.ruya-r785-responseRow{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:center;padding:10px 12px;background:#f8f9fc;border-radius:12px}.ruya-r785-responseRow div{min-width:0}.ruya-r785-responseRow b{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ruya-r785-responseRow small{color:#8992a4}.ruya-r785-responseRow strong{padding:6px 9px;border-radius:999px;background:#eee9ff;color:#5d34b4;font-size:12px}.ruya-r785-emptyResponses{padding:18px;text-align:center;color:#7d879a;background:#f8f9fc;border-radius:12px}
.ruya-r785-resultsFooter{flex:0 0 auto;border-top:1px solid #e5e9f0;background:#fff;padding:12px 0 max(12px,env(safe-area-inset-bottom,0px));display:flex;justify-content:flex-end}.ruya-r785-resultsFooter button{min-height:44px;border:1px solid #dae1ec;border-radius:10px;background:#fff;padding:9px 16px;font-weight:800;color:#26344c}

/* The survey create/edit modal is always a real viewport sheet on phones. */
@media(max-width:640px){
  body .modalBack.ruya-r784-surveyBack{padding:0!important;align-items:stretch!important;justify-content:stretch!important;width:100vw!important;height:100vh!important;height:100dvh!important;min-height:100dvh!important;overflow:hidden!important;background:rgba(23,32,56,.64)!important}
  body .modalBack .ruya-r784-surveyModal{width:100vw!important;max-width:100vw!important;height:100vh!important;height:100dvh!important;min-height:100dvh!important;max-height:100dvh!important;margin:0!important;border-radius:0!important;padding:max(14px,env(safe-area-inset-top,0px)) 14px 0!important;display:flex!important;flex-direction:column!important;overflow:hidden!important;box-sizing:border-box!important}
  body .modalBack .ruya-r784-surveyModal>.modalTopClose{top:max(12px,env(safe-area-inset-top,0px))!important;right:12px!important;z-index:120!important}
  body .modalBack .ruya-r784-surveyModal>h3{flex:0 0 auto!important;margin:5px 46px 12px 0!important;font-size:20px!important}
  body .modalBack .ruya-r784-surveyBody{flex:1 1 0!important;min-height:0!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch!important;overscroll-behavior:contain!important;padding:2px 1px 18px!important}
  body .modalBack .ruya-r784-surveyBody input,body .modalBack .ruya-r784-surveyBody select,body .modalBack .ruya-r784-surveyBody textarea{font-size:16px!important;max-width:100%!important;box-sizing:border-box!important}
  body .modalBack .ruya-r784-surveyFooter{position:relative!important;bottom:auto!important;flex:0 0 auto!important;display:grid!important;grid-template-columns:minmax(0,.82fr) minmax(0,1.18fr)!important;gap:8px!important;margin:0 -14px!important;padding:10px 14px max(12px,env(safe-area-inset-bottom,0px))!important;background:#fff!important;border-top:1px solid #e2e7ef!important;box-shadow:0 -8px 22px rgba(18,28,52,.12)!important;z-index:150!important}
  body .modalBack .ruya-r784-surveyFooter button{display:block!important;width:100%!important;min-width:0!important;min-height:48px!important;font-size:14px!important}
  .ruya-r785-surveyActions{display:grid;grid-template-columns:1fr 1fr}.ruya-r785-surveyActions button{width:100%;min-width:0}
  .ruya-r785-familyActions{display:grid;grid-template-columns:1fr}.ruya-r785-familyActions>*{width:100%}
  body .modalBack .ruya-r785-resultsModal{width:100vw!important;max-width:100vw!important;height:100vh!important;height:100dvh!important;max-height:100dvh!important;margin:0!important;border-radius:0!important;padding:max(14px,env(safe-area-inset-top,0px)) 14px 0!important}
  .ruya-r785-kpis{grid-template-columns:1fr 1fr}.ruya-r785-infographic{grid-template-columns:1fr}.ruya-r785-ring{width:130px;height:130px}.ruya-r785-barRow{grid-template-columns:minmax(70px,.75fr) minmax(80px,1.6fr) auto}.ruya-r785-resultsFooter{margin:0 -14px;padding:10px 14px max(12px,env(safe-area-inset-bottom,0px));box-shadow:0 -8px 22px rgba(18,28,52,.10)}.ruya-r785-resultsFooter button{width:100%}
}
