*{box-sizing:border-box}body{margin:0;background:#f7f8f4;color:#103e32;font:16px/1.7 Tahoma,Arial,sans-serif} [hidden]{display:none!important}header{background:#103e32;color:#fff;padding:16px 5%;display:flex;align-items:center;gap:24px;flex-wrap:wrap}a{color:inherit;text-decoration:none}.brand{font-size:24px;font-weight:bold;margin-inline-end:auto}.brand small{display:block;font-size:10px;color:#dfc17d;letter-spacing:2px}main{max-width:1200px;margin:auto;padding:24px}.notice{background:#fff3d8;padding:12px 16px;border-radius:8px}h1,h2,p{margin:0 0 14px}h1{font-size:30px}.login,.panel,dialog{background:white;border:1px solid #dce5dc;border-radius:16px;padding:24px;box-shadow:0 8px 30px #103e320b}.login{max-width:440px;margin:50px auto}label{display:block;margin-bottom:16px}input,select{width:100%;padding:12px;border:1px solid #cad8ce;border-radius:8px;color:inherit;background:#fbfcfa;font:inherit}button{border:0;border-radius:8px;background:#165b48;color:white;padding:10px 18px;cursor:pointer;font:inherit;font-weight:bold}button:disabled{opacity:.45;cursor:not-allowed}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #b89b55;outline-offset:2px}.intro,.pager,.filters{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap}.intro small{color:#96783b}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin:24px 0}.stat{background:white;border:1px solid #dce5dc;border-radius:14px;padding:20px;border-top:3px solid #b89b55}.stat strong{font-size:32px;display:block}.filters{justify-content:start;margin:16px 0}.filters input{flex:2;min-width:180px}.filters select{flex:1;min-width:120px}.scroll{overflow:auto}table{border-collapse:collapse;width:100%;white-space:nowrap}th,td{padding:12px;text-align:right;border-bottom:1px solid #e7ece7}th{background:#eef3ee}td button{padding:6px 12px}.pager{margin-top:16px}.status{font-weight:bold}.pending{color:#926817}.approved{color:#165b48}.rejected{color:#a73535}dialog{width:min(680px,94vw);max-height:88vh;color:#103e32}dialog::backdrop{background:#103e3288}dl{display:grid;grid-template-columns:1fr 1fr;gap:8px 16px}dt{font-size:13px;color:#63766e}dd{margin:0;overflow-wrap:anywhere}dl div{background:#f7f8f4;padding:10px;border-radius:8px}#message,#detailMessage{color:#165b48;font-weight:bold;white-space:pre-wrap}footer{text-align:center;color:#63766e;padding:24px}@media(max-width:650px){main{padding:12px}.stats{grid-template-columns:1fr 1fr}.panel{padding:12px}dl{grid-template-columns:1fr}}

.admin-actions{display:flex;gap:10px;flex-wrap:wrap}.admin-actions #addChild{background:#165b48}.registration-panel{margin:0 0 24px;scroll-margin-top:20px}.registration-panel fieldset{border:1px solid #dce5dc;border-radius:12px;padding:20px;margin:20px 0}.registration-panel legend{color:#96783b;font-weight:bold;padding:0 8px}.registration-panel .fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 18px}.registration-panel .fields label{margin:0}.registration-panel .consent{display:flex;align-items:center;gap:10px}.registration-panel input[type=checkbox]{width:auto;accent-color:#165b48}.registration-panel .secondary{background:#eef3ee;color:#103e32}.registration-panel #childResult{margin-top:12px}.registration-panel #childResult[data-state=error]{color:#a73535}@media(max-width:650px){.registration-panel .fields{grid-template-columns:1fr}.registration-panel fieldset{padding:12px}}


.child-photo-upload{display:flex;align-items:center;gap:20px;background:#f7f8f4;border:1px dashed #b89b55;border-radius:14px;padding:18px;margin:4px 0 24px}.photo-avatar{width:116px;height:116px;flex:0 0 116px;border-radius:50%;overflow:hidden;background:#e7eee8;border:2px solid #b89b55;display:grid;place-items:center;color:#165b48;font-size:56px}.photo-avatar img{width:100%;height:100%;object-fit:cover}.child-photo-upload>div:last-child{min-width:0;flex:1}.child-photo-upload label{font-weight:bold;margin-bottom:6px}.child-photo-upload small{display:block;color:#63766e;margin:6px 0}.child-photo-upload input::file-selector-button{border:0;background:#165b48;color:white;padding:7px 12px;border-radius:6px;font:inherit;margin-inline-end:10px;cursor:pointer}.child-photo-upload #photoError{color:#a73535;margin:4px 0}.table-photo{width:46px;height:46px;object-fit:cover;border-radius:50%;border:1px solid #b89b55;vertical-align:middle}.detail-photo{text-align:center;margin:12px auto}.detail-photo img{width:136px;height:136px;object-fit:cover;border-radius:50%;border:2px solid #b89b55}@media(max-width:500px){.child-photo-upload{flex-direction:column;align-items:stretch}.photo-avatar{align-self:center;flex:auto}.child-photo-upload input{max-width:100%}}

/* V7 child actions */
.row-actions{white-space:nowrap}.row-actions button{margin:3px 0 3px 6px;font-size:13px;padding:7px 12px}.row-actions .edit-child{background:#e9c361;color:#103e32}.row-actions .delete-child{background:#a73535;color:white}.row-actions .edit-child:hover{background:#d9ad41}.row-actions .delete-child:hover{background:#852b2b}

/* V8 — login screen only; dashboard styles remain unchanged */
body:has(#login:not([hidden])){min-height:100vh;min-height:100dvh;display:flex;flex-direction:column;background:#061a16;color:#edf5f0}
body:has(#login:not([hidden])) header{background:#041b16;border-bottom:1px solid #b89b5540;padding:13px max(5%,calc((100% - 1120px)/2));min-height:72px;gap:18px}
body:has(#login:not([hidden])) .brand{color:#e9bf53;white-space:nowrap;font-size:23px}
body:has(#login:not([hidden])) header>a:not(.brand){border:1px solid #a68b494d;background:#0b3028;padding:8px 13px;border-radius:10px;font-size:13px}
body:has(#login:not([hidden])) main{position:relative;isolation:isolate;max-width:none;width:100%;margin:0;flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:22px 24px 34px;min-height:650px;background:linear-gradient(90deg,#030807 0%,#040a08 23%,#080c09a6 53%,#22150820 100%),url('assets/admin-quran.webp') right center / auto 115% no-repeat,radial-gradient(ellipse at 90% 5%,#87542b,#130f0b 60%,#050807 90%)}
body:has(#login:not([hidden])) main>.notice{width:min(100%,700px);font-size:12px;text-align:center;background:#182b24d9;color:#edcf82;border:1px solid #b89b5555;margin:0 0 12px;padding:8px 12px}
body:has(#login:not([hidden])) #message:empty{display:none}
body:has(#login:not([hidden])) #message:not(:empty){width:min(100%,476px);color:#ffe1a0;background:#492b24;border:1px solid #be9a4b;padding:9px 14px;border-radius:9px;font-size:14px;margin:0 0 12px}
body:has(#login:not([hidden])) .login{width:min(100%,476px);max-width:none;margin:18px auto 0;padding:0;overflow:hidden;border:1px solid #a6a26055;border-radius:22px;background:#0a3028;box-shadow:0 22px 65px #0008;color:#f5faf6}
.login-heading{position:relative;overflow:hidden;padding:24px 26px;background:linear-gradient(105deg,#064638 0%,#145b4a 43%,#5d8650 76%,#b5a34d 100%);border-bottom:1px solid #d3b24d55}
.login-heading:before{content:'';position:absolute;inset:-60px 43% -60px -50px;transform:skewX(-10deg);background:#00352b38;pointer-events:none}
.login-heading h1,.login-heading p{position:relative;margin:0}.login-heading h1{font-size:26px;font-weight:800}.login-heading p{color:#f5e4a9;font-size:14px;font-weight:bold;margin-top:2px}
.login-body{padding:24px 26px 22px}.login-body label{font-size:14px;font-weight:bold;color:#e7f1eb;margin-bottom:16px}.login-body input{display:block;margin-top:6px;color:#fff;background:#08271f;border:1px solid #41634e;border-radius:11px;padding:12px 14px;min-height:47px}.login-body input::placeholder{color:#9cb1a6;opacity:1}.login-body input:focus{outline:2px solid #e5bc50;outline-offset:1px}.login-body input[name=username],.login-body input[name=password]{direction:ltr;text-align:right}.login-body button[type=submit]{width:100%;background:linear-gradient(110deg,#d7a831,#f5ce64);color:#102c21;min-height:48px;border-radius:11px;margin-top:5px;box-shadow:0 5px 14px #0002}.login-body button[type=submit]:hover{filter:brightness(1.08)}.login-links{border-top:2px solid #d5b34e;margin-top:22px;padding-top:15px;display:flex;flex-direction:column;align-items:center;gap:3px;color:#efc554;font-size:13px}.login-links a:hover{text-decoration:underline}.login-links small{color:#b4c7bd;font-size:12px}
body:has(#login:not([hidden])) footer{background:#041b16;border-top:1px solid #b89b5540;color:#d5dfd7;padding:13px 20px;font-size:12px}
@media(max-width:650px){body:has(#login:not([hidden])) main{min-height:0;padding:24px 16px;background-position:center,right center,center;background-size:auto,auto 100%,auto}body:has(#login:not([hidden])) .login{margin:10px auto}.login-heading,.login-body{padding:20px}.login-heading h1{font-size:23px}body:has(#login:not([hidden])) header{padding:10px 16px;gap:8px}body:has(#login:not([hidden])) .brand{font-size:19px}body:has(#login:not([hidden])) header>a:not(.brand){font-size:11px;padding:7px}}

/* V9: dashboard theme — scoped to the authenticated view; no API changes. */
body:has(#dashboard:not([hidden])){
  min-height:100vh;min-height:100dvh;display:flex;flex-direction:column;
  color:#f5f5ed;background-color:#060c09;
  background-image:linear-gradient(90deg,#030705 0%,#080d09 18%,#100d08ed 36%,#23180db0 62%,#1b150b2b 100%),radial-gradient(ellipse at 100% 0%,#f6cc8570,transparent 60%),url('assets/admin-quran.webp');
  background-position:center,center,right bottom;background-size:cover,cover,auto max(100vh,740px);background-repeat:no-repeat;background-attachment:fixed;
}
body:has(#dashboard:not([hidden])) header{background:#05251f;border-bottom:1px solid #cba64e66;padding:14px 5%;min-height:78px;gap:22px}
body:has(#dashboard:not([hidden])) .brand small{color:#edc653}
body:has(#dashboard:not([hidden])) main{width:100%;max-width:1240px;flex:1;padding:24px 28px 38px}
body:has(#dashboard:not([hidden])) footer{background:#031a15;color:#e2eae4;border-top:1px solid #cba64e44;padding:15px;font-size:13px}
body:has(#dashboard:not([hidden])) .notice{background:linear-gradient(100deg,#63430aaf,#865412a6);color:#fff4d7;border:1px solid #cba64e;border-radius:9px;font-size:14px;padding:10px 15px}
body:has(#dashboard:not([hidden])) #message:empty{display:none}
body:has(#dashboard:not([hidden])) #message:not(:empty){color:#ffe0a1;background:#112b22;border:1px solid #b89b55;border-radius:8px;padding:10px 14px}
#dashboard .intro small{color:#e6c374;font-weight:600}#dashboard .intro h1{font-size:32px;margin:3px 0 6px}#dashboard .intro p{color:#e9e6db;margin-bottom:8px}
#dashboard .stats{gap:14px;margin:24px 0 30px}
#dashboard .stat{position:relative;background:linear-gradient(135deg,#06392eed,#061f19f5);color:#fff;border:1px solid #d1ad50;border-radius:15px;padding:20px 16px;text-align:center;box-shadow:0 12px 26px #0004;min-height:112px}
#dashboard .stat strong{font-size:34px;line-height:1.2;margin-bottom:8px}
#dashboard .stat::before{position:absolute;right:15px;top:17px;color:#f0bd35;font-size:24px;line-height:1.2;font-weight:bold}
#dashboard .stat:nth-child(1)::before{content:'♟'}#dashboard .stat:nth-child(2)::before{content:'◷'}#dashboard .stat:nth-child(3)::before{content:'✓'}#dashboard .stat:nth-child(4)::before{content:'×'}
#dashboard .panel,body:has(#dashboard:not([hidden])) #detail{background:linear-gradient(135deg,#062d24f7,#041e19f5);color:#f5f6ef;border:1px solid #d1ad50;border-radius:16px;box-shadow:0 12px 40px #0006;padding:24px}
#dashboard .panel h2{font-size:25px;margin-bottom:16px}#dashboard .panel h2::before{content:'◈';color:#edbd42;margin-inline-end:8px}
#dashboard input,#dashboard select,body:has(#dashboard:not([hidden])) #detail select{color-scheme:dark;background:#092b23;color:#f5f6ef;border:1px solid #9e98556e;border-radius:9px}
#dashboard input::placeholder{color:#d0d6cc;opacity:1}#dashboard input:focus,#dashboard select:focus{outline-color:#f0c45a}
#dashboard button:not(.edit-child):not(.delete-child),body:has(#dashboard:not([hidden])) #detail button,body:has(#dashboard:not([hidden])) #logout{background:#125b48;color:#fff;border:1px solid #a78d4b80;border-radius:8px}
#dashboard button:not(:disabled):hover,body:has(#dashboard:not([hidden])) #logout:hover{filter:brightness(1.15)}
#dashboard .filters button,#dashboard #submitChild,body:has(#dashboard:not([hidden])) #save{background:linear-gradient(115deg,#e0ac32,#ffd46b)!important;color:#102b22!important;border:1px solid #e7c156!important}
#dashboard .filters{gap:10px}#dashboard .scroll{border-radius:7px}
#dashboard th{background:#0d3c30;color:#f7f8f3}#dashboard th,#dashboard td{border-bottom:1px solid #38605388;padding:13px 10px}#dashboard tbody tr:hover{background:#1d52463b}
#dashboard .approved{color:#7be594}#dashboard .pending{color:#f5ce6a}#dashboard .rejected{color:#ff9d9d}
#dashboard .row-actions .edit-child{background:#f2bf46;color:#152b21;border:1px solid #f2ca67}#dashboard .row-actions .delete-child{background:#9e3538;color:#fff;border:1px solid #c55b5b}
#dashboard .row-actions button{margin-inline-end:5px}#dashboard .pager{color:#f3f0e4}
#dashboard .registration-panel fieldset{border-color:#6a795a}#dashboard .registration-panel legend{color:#f1ce73}#dashboard .registration-panel input[type=checkbox]{accent-color:#e6bd55}#dashboard .child-photo-upload{background:#092b23;border-color:#cba64e}#dashboard .photo-avatar{background:#153e33;color:#e9cc83}#dashboard .child-photo-upload small{color:#c6d7ce}#dashboard .registration-panel #childResult[data-state=error],#dashboard .child-photo-upload #photoError{color:#ffabab}
body:has(#dashboard:not([hidden])) #detail::backdrop{background:#000b}body:has(#dashboard:not([hidden])) #detail dl div{background:#0d382d}body:has(#dashboard:not([hidden])) #detail dt{color:#cbd9d0}body:has(#dashboard:not([hidden])) #detailMessage{color:#ffd38b}
@media(max-width:650px){body:has(#dashboard:not([hidden])) main{padding:16px 12px 26px}body:has(#dashboard:not([hidden])) header{padding:12px;gap:10px}body:has(#dashboard:not([hidden])) .brand{font-size:20px}#dashboard .panel,body:has(#dashboard:not([hidden])) #detail{padding:14px}#dashboard .stats{gap:10px}#dashboard .stat{padding:18px 8px;min-height:100px}#dashboard .stat::before{right:8px;top:12px;font-size:18px}#dashboard .stat strong{font-size:28px}#dashboard .intro h1{font-size:26px}}
header .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #e8bd50;
    text-decoration: none;
}

header .brand svg {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
}

header .brand span {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 23px;
    line-height: 1.4;
}

header .brand small {
    font-size: 9px;
    letter-spacing: 1.5px;
    margin-top: 2px;
}

header .brand {
    display: flex !important;
    align-items: center !important;
    gap: 12px;
    padding: 10px 0;
    color: #e8bd50;
}

header .brand > span {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    line-height: 1.4;
    margin: 0;
}

header .brand small {
    display: block;
    font-size: 9px;
    letter-spacing: 1.5px;
    margin-top: 3px;
    line-height: 1.4;
}

header .brand svg {
    display: block;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    margin: 0;
}
header a.brand {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    padding: 6px 0 !important;
    line-height: 1 !important;
}

header a.brand > svg {
    width: 40px !important;
    height: 40px !important;
    flex-shrink: 0;
    vertical-align: middle;
}

header a.brand > span {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    font-size: 22px !important;
    line-height: 1.4 !important;
}

header a.brand small {
    display: block !important;
    font-size: 9px !important;
    letter-spacing: 1.5px !important;
    text-align: center !important;
    margin: 3px 0 0 !important;
}

header .admin-logo {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    color: #e8bd50;
    text-decoration: none;
    padding: 8px 0;
}

.admin-logo > svg {
    display: block;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
}

.admin-logo > span {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.4;
}

.admin-logo small {
    display: block;
    font-size: 9px;
    letter-spacing: 1.5px;
    line-height: 1.4;
    margin-top: 3px;
    text-align: center;
    direction: ltr;
}

header a.brand.admin-logo {
    display: flex !important;
    align-items: center !important;
    flex-direction: row !important;
    gap: 10px !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #e8bd50 !important;
    padding: 6px 0 !important;
    margin-left: auto !important;
}

header .admin-logo > span {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    font-size: 22px !important;
    font-weight: 800 !important;
    line-height: 1.4 !important;
}

header .admin-logo small {
    display: block !important;
    font-size: 9px !important;
    letter-spacing: 1.5px !important;
    margin: 3px 0 0 !important;
}

header .admin-logo svg {
    display: block !important;
    width: 38px !important;
    height: 38px !important;
    flex-shrink: 0 !important;
}

/* رمز إظهار وإخفاء كلمة المرور */

.password-wrapper {
    position: relative;
    width: 100%;
}

.password-wrapper input {
    width: 100%;
    padding-left: 50px !important;
    box-sizing: border-box;
}

#togglePassword {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #155747 !important;
    padding: 5px !important;
    margin: 0 !important;
    width: auto !important;
    cursor: pointer;
}

#togglePassword:hover {
    color: #d4af37 !important;
}

/* Correction password mobile */

@media (max-width: 768px) {

    .password-wrapper {
        position: relative !important;
        display: block !important;
        width: 100% !important;
    }

    #togglePassword {
        display: flex !important;
        align-items: center;
        justify-content: center;
        position: absolute !important;
        left: 8px !important;
        top: 50% !important;
        transform: translateY(-50%);
        width: 40px !important;
        height: 40px !important;
        z-index: 10;
        visibility: visible !important;
        opacity: 1 !important;
    }

    #togglePassword svg {
        display: block !important;
        width: 22px !important;
        height: 22px !important;
    }

    #loginPassword {
        padding-left: 50px !important;
    }
}

/* تنسيق أزرار الإدارة على الهاتف */

@media (max-width: 768px) {

    header {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 10px !important;
        padding: 15px !important;
    }

    header .brand {
        width: 100% !important;
        justify-content: center !important;
        margin-bottom: 10px !important;
    }

    header > a:not(.brand),
    header > button:not([hidden]) {
        flex: 1 1 0;
        min-width: 0;
        background: #155747 !important;
        border: 1px solid #54745b !important;
        border-radius: 10px !important;
        padding: 12px 8px !important;
        color: #ffffff !important;
        font-size: 14px !important;
        text-align: center;
        text-decoration: none;
        white-space: nowrap;
        box-sizing: border-box;
        margin: 0 !important;
    }
}


/* تنسيق أزرار الهيدر على جميع الشاشات */

header > a:not(.brand),
header > button:not([hidden]) {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background: #155747 !important;
    border: 1px solid #54745b !important;
    border-radius: 10px !important;
    padding: 12px 20px !important;
    color: #ffffff !important;
    font-size: 15px !important;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: 0.3s;
}

header > a:not(.brand):hover,
header > button:not([hidden]):hover {
    background: #e8bd50 !important;
    color: #092820 !important;
}

/* Navigation des sections */

.section-navigation {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
    margin: 25px 0;
}

.section-navigation a {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #155747;
    border: 1px solid #b89b55;
    border-radius: 12px;
    padding: 22px 10px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    transition: 0.3s;
}

.section-navigation a:hover {
    background: #e8bd50;
    color: #092820;
    transform: translateY(-3px);
}

@media (max-width: 768px) {
    .section-navigation {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .section-navigation a {
        font-size: 14px;
        padding: 20px 8px;
    }
}

/* الملاحظة الأولية */
textarea[name="initial_observation"] {
    width: 100%;
    min-height: 100px;
    background: #0d2b23 !important;
    color: #ffffff !important;
    border: 1px solid #526b4b;
    border-radius: 10px;
    padding: 14px;
    font-family: inherit;
    font-size: 16px;
    direction: rtl;
    text-align: right;
    box-sizing: border-box;
    resize: vertical;
}

textarea[name="initial_observation"]::placeholder {
    color: #a5b8b0;
}

textarea[name="initial_observation"]:focus {
    outline: none;
    border-color: #e8bd50;
}

.admin-navigation {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 20px 0 30px;
}

.admin-navigation a {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #145548;
  color: #ffffff;
  border: 1px solid #c5a34f;
  border-radius: 12px;
  padding: 20px 10px;
  text-align: center;
  text-decoration: none;
  font-size: 16px;
  font-weight: bold;
  transition: 0.3s;
}

.admin-navigation a:hover {
  background: #e9bc50;
  color: #092b24;
}

@media (max-width: 768px) {
  .admin-navigation {
    grid-template-columns: repeat(2, 1fr);
  }
}