@import url('https://fonts.googleapis.com/css2?family=Comfortaa:wght@500;700&family=Montserrat:wght@400;500;600&display=swap');
:root { color-scheme: light; --teal:#319795; --teal-dark:#287f7d; --ink:#2c3e50; --muted:#647176; --line:#e4ebea; --cream:#f7f3eb; }
* { box-sizing:border-box; }
body { margin:0; min-height:100vh; background:#fcfbf9; color:#333; font-family:Montserrat,Arial,sans-serif; line-height:1.6; }
h1,h2,h3,.brand { font-family:Comfortaa,Arial,sans-serif; color:var(--ink); }
a { color:var(--teal-dark); }
.auth-shell { min-height:100vh; display:grid; place-items:center; padding:24px; background:linear-gradient(135deg,#f7f3eb,#edf7f5); }
.auth-card { width:min(100%,460px); background:#fff; padding:36px; border:1px solid var(--line); border-radius:20px; box-shadow:0 16px 48px rgba(38,69,75,.12); }
.brand { display:inline-block; margin-bottom:22px; font-weight:700; text-decoration:none; }
.auth-card h1 { margin:0 0 10px; font-size:1.8rem; }
.muted { color:var(--muted); }
.field-hint { display:block; margin-top:-5px; color:var(--muted); font-size:.82rem; }
form { display:grid; gap:10px; }
label { margin-top:6px; font-weight:600; color:#3f5158; }
input,select,textarea { width:100%; min-height:44px; padding:10px 12px; border:1px solid #cbd5d3; border-radius:9px; background:#fff; color:#263238; font:inherit; }
input:focus,select:focus,textarea:focus { outline:3px solid rgba(49,151,149,.2); border-color:var(--teal); }
.button { display:inline-flex; justify-content:center; align-items:center; min-height:42px; padding:10px 16px; border:0; border-radius:9px; background:var(--teal); color:#fff; text-decoration:none; font:600 .95rem Montserrat,Arial,sans-serif; cursor:pointer; }
.button:hover { background:var(--teal-dark); }
.auth-card .button { margin-top:12px; }
.button-secondary { background:#edf2f1; color:var(--ink); }
.button-secondary:hover { background:#dce7e5; }
.button-danger { background:#a54040; }
.button-danger:hover { background:#843333; }
.auth-footer { margin:22px 0 0; color:var(--muted); font-size:.93rem; }
.alert,.success { padding:12px 14px; border-radius:10px; }
.alert { background:#fff0ef; color:#8c2c28; border:1px solid #f0c7c3; }
.success { background:#e9f6f1; color:#24644d; border:1px solid #b9e1d1; }
.honeypot { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.portal-header { min-height:68px; display:flex; justify-content:space-between; align-items:center; gap:20px; padding:12px clamp(20px,5vw,64px); background:var(--cream); border-bottom:1px solid #ece6da; }
.portal-header form { display:block; }
.portal-header .brand { margin:0; }
.portal-main { width:min(100% - 40px,1050px); margin:42px auto 80px; }
.portal-main h1 { margin:0 0 8px; }
.portal-main h2 { font-size:1.3rem; }
.material-list,.request-list { display:grid; gap:16px; margin-top:20px; }
.material-card,.panel { background:#fff; border:1px solid var(--line); border-radius:15px; padding:22px; box-shadow:0 6px 18px rgba(38,69,75,.05); }
.material-card { display:flex; justify-content:space-between; align-items:center; gap:20px; }
.material-card h3 { margin:0 0 5px; font-size:1.12rem; }
.material-card p { margin:0 0 8px; color:#4a5568; white-space:normal; }
.material-card small { color:var(--muted); }
.child-picker { display:flex; align-items:center; gap:12px; max-width:500px; margin:24px 0; }
.child-picker label { margin:0; white-space:nowrap; }
.child-picker select { max-width:300px; }
.admin-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; margin:30px 0; }
.admin-card { display:grid; gap:9px; padding:22px; color:var(--ink); text-decoration:none; background:#fff; border:1px solid var(--line); border-radius:15px; box-shadow:0 6px 18px rgba(38,69,75,.05); }
.admin-card:hover { border-color:var(--teal); transform:translateY(-2px); }
.admin-card strong { font:700 1.1rem Comfortaa,Arial,sans-serif; }
.admin-card span { color:var(--muted); }
.panel { margin:22px 0; }
.panel h2 { margin:0 0 12px; }
.panel form:not(.approval-form) { max-width:620px; margin-top:16px; }
.approval-form { display:grid; grid-template-columns:minmax(150px,1fr) auto auto; align-items:end; gap:10px; margin-top:18px; }
.approval-form label { grid-column:1/-1; }
.invite-link { overflow-wrap:anywhere; padding:12px; background:#f2f6f5; border-radius:8px; }
.table-wrap { overflow-x:auto; }
table { width:100%; border-collapse:collapse; }
th,td { padding:12px; border-bottom:1px solid var(--line); text-align:left; vertical-align:middle; }
td form { display:block; }
.table-actions { display:flex; flex-wrap:wrap; gap:8px; }
@media(max-width:760px) { .auth-card { padding:26px 22px; } .admin-grid { grid-template-columns:1fr; } .material-card { align-items:flex-start; flex-direction:column; } .approval-form { grid-template-columns:1fr; } .approval-form label { grid-column:auto; } .portal-main { margin-top:28px; } }

/* Административно табло */
.admin-dashboard { background:radial-gradient(ellipse at 90% 4%,rgba(235,246,241,.7),transparent 34%),#fbfaf7; }
.admin-dashboard .portal-header { background:rgba(255,255,255,.84); border-bottom-color:#eeece5; }
.admin-dashboard .brand { display:flex; align-items:center; gap:10px; }
.brand-mark { display:grid; place-items:center; width:34px; height:34px; border-radius:12px; background:#e7f4f0; color:var(--teal-dark); font-size:1.2rem; }
.admin-main { width:min(100% - 40px,1120px); margin-top:38px; }
.admin-welcome { position:relative; display:flex; align-items:center; justify-content:space-between; min-height:210px; overflow:hidden; padding:34px 42px; border:1px solid #e8eee8; border-radius:26px; background:linear-gradient(112deg,#f0f7f1 0%,#edf6f3 56%,#f7f2e9 100%); }
.admin-welcome-copy { position:relative; z-index:1; max-width:700px; }
.admin-eyebrow { display:block; color:#56827a; font-size:.72rem; font-weight:700; letter-spacing:.13em; }
.admin-welcome h1 { margin:12px 0 8px; font-size:clamp(1.7rem,3vw,2.35rem); letter-spacing:-.04em; }
.admin-welcome h1 span { color:#d79e56; font-size:.8em; }
.admin-welcome p { max-width:600px; margin:0; color:#667477; font-size:1rem; }
.welcome-art { position:absolute; top:0; right:34px; width:230px; height:100%; opacity:.75; }
.welcome-art-sun { position:absolute; top:27px; right:49px; width:92px; height:92px; border-radius:50%; background:#f4d9a8; }
.welcome-art-leaf { position:absolute; right:68px; bottom:-40px; width:78px; height:150px; border:2px solid #a9c7b2; border-radius:90% 0 90% 0; transform:rotate(31deg); }
.leaf-two { right:15px; bottom:-53px; width:68px; height:132px; transform:rotate(55deg); border-color:#c7d5b4; }
.welcome-art-dot { position:absolute; top:48px; right:166px; width:14px; height:14px; border-radius:50%; background:#a6cec2; box-shadow:30px 64px 0 #e4b98d; }
.admin-overview { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; margin:22px 0 34px; }
.overview-card { position:relative; display:grid; grid-template-columns:48px 1fr; grid-template-rows:auto 1fr; align-items:center; column-gap:14px; min-height:102px; padding:17px 20px; border:1px solid #ecece7; border-radius:17px; background:#fff; box-shadow:0 7px 22px rgba(38,69,75,.035); }
.overview-icon { grid-row:1/3; display:grid; place-items:center; width:46px; height:46px; border-radius:15px; background:#f1f7f3; color:#458f82; }
.overview-icon svg,.admin-card-icon svg { width:23px; height:23px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.overview-label { align-self:end; color:var(--muted); font-size:.82rem; }
.overview-card strong { align-self:start; color:var(--ink); font:700 1.4rem Comfortaa,Arial,sans-serif; line-height:1.25; }
.overview-pending .overview-icon { background:#fff2e8; color:#c37d4c; }
.overview-parents .overview-icon { background:#f1eef9; color:#8174b1; }
.overview-materials .overview-icon { background:#eaf5f2; color:#438f82; }
.admin-section-heading { display:flex; align-items:end; justify-content:space-between; gap:16px; margin-bottom:16px; }
.admin-section-heading h2 { margin:6px 0 0; font-size:1.38rem; }
.section-caption { padding-bottom:3px; color:#8a9492; font-size:.84rem; }
.admin-dashboard .admin-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin:0; }
.admin-dashboard .admin-card { position:relative; grid-template-columns:54px 1fr auto; grid-template-rows:auto auto auto; align-items:center; column-gap:15px; row-gap:5px; min-height:137px; padding:21px 23px; border-color:#eeece7; border-radius:19px; box-shadow:0 7px 22px rgba(38,69,75,.04); transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease; }
.admin-dashboard .admin-card:hover,.admin-dashboard .admin-card:focus-visible { transform:translateY(-3px); border-color:#b8d9cf; box-shadow:0 13px 28px rgba(38,69,75,.09); }
.admin-dashboard .admin-card:focus-visible { outline:3px solid rgba(49,151,149,.24); outline-offset:3px; }
.admin-card-icon { grid-column:1; grid-row:1/4; display:grid; place-items:center; width:52px; height:52px; border-radius:17px; color:#bd754b; background:#fff1e8; }
.icon-lilac { color:#766baa; background:#f1eef9; }
.icon-mint { color:#408d80; background:#e9f5f0; }
.icon-peach { color:#bd754b; background:#fff1e8; }
.admin-dashboard .admin-card-arrow { grid-column:3; grid-row:1; align-self:start; color:#a1afaa; font-size:1.15rem; }
.admin-dashboard .admin-card strong { grid-column:2; grid-row:1; align-self:end; font-size:1.02rem; }
.admin-dashboard .admin-card > span:not(.admin-card-icon):not(.admin-card-arrow):not(.card-status) { grid-column:2/4; grid-row:2; color:#74817f; font-size:.86rem; }
.admin-dashboard .admin-card .card-status { grid-column:2/4; grid-row:3; justify-self:start; margin-top:5px; padding:3px 9px; border-radius:99px; background:#f2f6f3; color:#5e8075; font-size:.74rem; font-weight:600; }
.admin-dashboard .admin-card:first-child .card-status { background:#fff3e9; color:#a8663e; }
.admin-footnote { display:flex; align-items:center; gap:9px; margin:22px 0 0; color:#77827f; font-size:.85rem; }
.admin-footnote span { color:#cf8c83; font-size:1.15rem; }
@media(max-width:760px) {
  .admin-main { margin-top:22px; }
  .admin-welcome { min-height:190px; padding:27px 24px; }
  .welcome-art { right:-104px; opacity:.36; }
  .admin-overview { gap:10px; }
  .overview-card { grid-template-columns:1fr; gap:5px; min-height:122px; padding:13px; }
  .overview-icon { grid-row:auto; width:38px; height:38px; border-radius:12px; }
  .overview-icon svg { width:20px; height:20px; }
  .overview-label { font-size:.72rem; }
  .overview-card strong { font-size:1.2rem; }
}
@media(max-width:520px) {
  .admin-overview { grid-template-columns:1fr; }
  .overview-card { grid-template-columns:44px 1fr; grid-template-rows:auto auto; min-height:80px; column-gap:12px; }
  .overview-icon { grid-row:1/3; width:42px; height:42px; }
  .overview-label { align-self:end; }
  .overview-card strong { align-self:start; }
  .admin-section-heading { align-items:start; flex-direction:column; gap:2px; }
  .admin-dashboard .admin-grid { grid-template-columns:1fr; }
  .admin-dashboard .admin-card { min-height:126px; padding:18px; }
}

/* Профили и лична страница на дете */
.child-admin-page,.parent-dashboard { background:radial-gradient(ellipse at 90% 2%,rgba(235,246,241,.6),transparent 35%),#fbfaf7; }
.child-admin-page .portal-header,.parent-dashboard .portal-header { background:rgba(255,255,255,.86); }
.child-admin-main,.parent-main { width:min(100% - 40px,1080px); margin-top:34px; }
.page-intro { margin-bottom:24px; }
.page-intro h1 { margin:8px 0 5px; font-size:clamp(1.7rem,3vw,2.2rem); }
.page-intro p { max-width:680px; margin:0; }
.child-admin-layout { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; gap:17px; }
.child-admin-page .panel { margin:0 0 20px; border-color:#eeece7; border-radius:18px; box-shadow:0 8px 24px rgba(38,69,75,.04); }
.child-form-panel { padding:23px; }
.panel-kicker { color:#56827a; font-size:.7rem; font-weight:700; letter-spacing:.12em; }
.child-form-panel h2 { margin:6px 0; }
.child-form-panel > p { margin:0 0 14px; font-size:.88rem; }
.child-form-panel form { gap:8px; }
.child-form-panel form .button { justify-self:start; margin-top:8px; }
.child-list-section { margin:28px 0; }
.child-profile-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:13px; }
.child-profile-card { display:grid; grid-template-columns:48px 1fr; align-items:center; column-gap:13px; padding:18px; border:1px solid #eeece7; border-radius:17px; background:#fff; box-shadow:0 7px 20px rgba(38,69,75,.035); }
.child-avatar,.child-page-avatar { display:grid; place-items:center; width:46px; height:46px; border-radius:16px; background:#eaf5f1; color:#4c9685; font-size:1.35rem; }
.child-avatar svg,.child-page-avatar svg { width:34px; height:34px; fill:none; stroke:currentColor; stroke-width:2.1; stroke-linecap:round; stroke-linejoin:round; }
.child-avatar.avatar-girl,.child-page-avatar.avatar-girl { background:#f7edf4; color:#a66f91; }
.child-avatar.avatar-boy,.child-page-avatar.avatar-boy { background:#eaf1f8; color:#6388a9; }
.child-avatar.avatar-neutral,.child-page-avatar.avatar-neutral { background:#eaf5f1; color:#4c9685; }
.child-profile-info h3 { margin:0; font:700 1rem Comfortaa,Arial,sans-serif; color:var(--ink); }
.child-profile-info p { margin:3px 0 0; color:#899391; font-size:.78rem; }
.child-profile-stats { grid-column:2; display:flex; flex-wrap:wrap; gap:6px; margin-top:10px; }
.child-profile-stats span { padding:4px 8px; border-radius:99px; background:#f3f6f4; color:#667d75; font-size:.7rem; }
.child-profile-stats span:first-child { border:1px solid #d5e9de; background:#e8f4ed; color:#477864; font-weight:700; }
.child-history-link { grid-column:2; justify-self:start; min-height:36px; margin-top:8px; padding:7px 10px; font-size:.78rem; }
.child-edit-form { grid-column:1/-1; display:grid; gap:6px; margin-top:14px; padding-top:12px; border-top:1px solid #f0f1ec; }
.child-edit-form label { margin:0; color:#687976; font-size:.77rem; }
.child-edit-controls { display:flex; align-items:center; gap:8px; }
.child-edit-controls input { min-width:0; min-height:40px; padding:8px 10px; font-size:.88rem; }
.child-edit-controls .button { min-height:40px; padding:8px 12px; white-space:nowrap; }
.child-initial-info-form { grid-column:1/-1; display:grid; gap:7px; margin-top:2px; padding:13px; border:1px solid #e1ebe4; border-radius:13px; background:#f6faf7; }
.child-initial-info-form label { margin:0; color:#526f62; font-size:.78rem; }
.child-initial-info-form textarea { min-height:120px; resize:vertical; }
.child-initial-info-form small { color:#7e8a87; font-size:.74rem; }
.child-initial-info-form .button { justify-self:start; min-height:36px; padding:7px 11px; font-size:.78rem; }
.child-links-panel { margin-top:24px !important; }
.child-links-panel .admin-section-heading { margin-bottom:10px; }
.child-links-panel form { display:block; }
.child-history-page { background:radial-gradient(ellipse at 91% 2%,rgba(235,246,241,.6),transparent 34%),#fbfaf7; }
.child-history-main { width:min(100% - 40px,1020px); margin-top:32px; }
.history-toolbar { display:flex; align-items:center; justify-content:space-between; gap:14px; margin:0 0 14px; }
.parent-initial-reference { margin:0 0 17px; padding:19px 21px; border:1px solid #dcebe3; border-radius:18px; background:linear-gradient(115deg,#f0f7f2,#f8faf6); box-shadow:0 8px 22px rgba(38,69,75,.035); }
.parent-initial-reference h2 { margin:5px 0 0; font-size:1.05rem; }
.parent-initial-reference p { margin:12px 0 0; color:#435652; font-size:.9rem; white-space:normal; }
.therapy-history-list { display:grid; gap:13px; }
.therapy-history-card { display:grid; grid-template-columns:78px minmax(0,1fr); gap:16px; padding:19px; border:1px solid #e9ece6; border-radius:18px; background:#fff; box-shadow:0 8px 22px rgba(38,69,75,.04); }
.history-date { display:grid; align-content:start; justify-items:center; gap:5px; padding:11px 6px; border-radius:14px; background:#eaf5f0; color:#508d7b; }
.history-date span { font:700 1.35rem Comfortaa,Arial,sans-serif; }
.history-date time { font-size:.68rem; white-space:nowrap; }
.history-content { min-width:0; }
.history-card-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; padding-bottom:12px; border-bottom:1px solid #edf0eb; }
.history-card-heading h2 { margin:0; font:700 1rem Comfortaa,Arial,sans-serif; color:var(--ink); }
.history-card-heading .button { min-height:34px; padding:6px 10px; font-size:.76rem; }
.history-notes-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:11px; margin-top:12px; }
.history-note { padding:13px; border:1px solid #e9eee8; border-radius:13px; background:#f8faf8; }
.history-note h3,.history-materials h3 { margin:0 0 6px; color:#63877b; font-size:.75rem; font-weight:700; }
.history-note p { margin:0; color:#435652; font-size:.86rem; white-space:normal; }
.history-guidance { border-color:#dcebe3; background:#f0f7f2; }
.history-materials { margin-top:12px; padding:13px; border:1px solid #eceee9; border-radius:13px; }
.history-materials ul { display:grid; gap:8px; margin:0; padding:0; list-style:none; }
.history-materials li { padding:9px 10px; border-radius:10px; background:#f8faf8; }
.history-materials li strong { color:var(--ink); font-size:.84rem; }
.history-materials li p { margin:4px 0; color:#687573; font-size:.79rem; white-space:normal; }
.history-materials li a { color:#548574; font-size:.76rem; font-weight:600; }
.empty-state { display:grid; justify-items:center; padding:34px 20px; border:1px dashed #d9e4de; border-radius:18px; background:rgba(255,255,255,.72); text-align:center; }
.empty-state > span { display:grid; place-items:center; width:48px; height:48px; margin-bottom:10px; border-radius:16px; background:#edf6f2; color:#579586; font-size:1.5rem; }
.empty-state strong,.empty-state h2 { margin:0 0 4px; color:var(--ink); font:700 1.02rem Comfortaa,Arial,sans-serif; }
.empty-state p { max-width:520px; margin:0; color:var(--muted); font-size:.88rem; }
.parent-welcome { display:flex; align-items:center; justify-content:space-between; min-height:170px; padding:30px 36px; border:1px solid #e7eee8; border-radius:24px; background:linear-gradient(115deg,#eff7f1,#edf6f3 62%,#f7f2ea); }
.parent-welcome h1 { margin:9px 0 5px; font-size:clamp(1.65rem,3vw,2.1rem); }
.parent-welcome p { margin:0; color:#687876; }
.parent-welcome-mark { display:grid; place-items:center; width:82px; height:82px; border-radius:28px; background:rgba(255,255,255,.65); color:#72a899; font-size:2.4rem; }
.parent-empty { margin-top:23px; padding:42px 22px; }
.parent-empty h2 { font-size:1.25rem; }
.child-picker-card { display:flex; flex-wrap:wrap; align-items:end; gap:10px; max-width:none; margin:20px 0; padding:16px 19px; border:1px solid #ecece7; border-radius:16px; background:#fff; }
.child-picker-card label { margin:0; color:var(--ink); }
.child-picker-card select { width:auto; min-width:220px; }
.child-page-heading { display:flex; align-items:center; gap:16px; margin:22px 0 26px; padding:22px 24px; border:1px solid #eeece7; border-radius:20px; background:#fff; box-shadow:0 7px 22px rgba(38,69,75,.04); }
.child-page-avatar { width:58px; height:58px; border-radius:20px; font-size:1.65rem; }
.child-page-avatar svg { width:42px; height:42px; }
.child-page-heading h2 { margin:4px 0; font-size:1.35rem; }
.child-page-heading p { margin:0; color:var(--muted); font-size:.88rem; }
.child-material-count { display:grid; justify-items:center; margin-left:auto; min-width:80px; padding:8px 13px; border-radius:14px; background:#f3f7f4; color:#648279; }
.child-material-count strong { font:700 1.3rem Comfortaa,Arial,sans-serif; }
.child-material-count span { font-size:.72rem; }
.parent-materials-section .admin-section-heading { margin-bottom:13px; }
.materials-empty { padding:28px 18px; }
.materials-empty > span { font-size:1.7rem; }
.parent-material-list { margin-top:0; }
.parent-material-card { justify-content:flex-start; align-items:center; padding:20px; border-color:#eeece7; border-radius:18px; box-shadow:0 7px 22px rgba(38,69,75,.04); }
.material-card-icon { flex:0 0 48px; display:grid; place-items:center; width:48px; height:48px; border-radius:15px; background:#eaf5f1; color:#4c9685; }
.material-card-icon svg { width:23px; height:23px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.material-copy { flex:1; min-width:0; }
.material-copy .material-type { color:#6e9a8c; font-size:.67rem; font-weight:700; letter-spacing:.1em; }
.material-copy h3 { margin:3px 0 5px; }
.material-copy p { margin:0 0 7px; }
.material-copy small { color:#899391; }
.material-download { flex-shrink:0; }
@media(max-width:760px) {
  .child-admin-layout,.child-profile-grid { grid-template-columns:1fr; }
  .parent-welcome { min-height:150px; padding:24px; }
  .parent-welcome-mark { width:63px; height:63px; border-radius:22px; font-size:1.9rem; }
}
@media(max-width:520px) {
  .child-admin-main,.parent-main { margin-top:24px; }
  .child-picker-card { align-items:stretch; flex-direction:column; }
  .child-picker-card select { width:100%; }
  .child-picker-card .button { align-self:flex-start; }
  .child-page-heading { gap:11px; padding:17px; }
  .child-page-avatar { flex-basis:48px; width:48px; height:48px; border-radius:16px; }
  .child-material-count { min-width:65px; padding:7px 9px; }
  .parent-material-card { align-items:flex-start; flex-wrap:wrap; }
  .material-copy { flex-basis:calc(100% - 65px); }
  .material-download { margin-left:60px; }
}

/* Подредба на родителската страница на детето */
.parent-main { width:min(100% - 40px,1020px); margin-top:32px; }
.parent-greeting { display:flex; align-items:end; justify-content:space-between; gap:24px; margin-bottom:22px; }
.parent-greeting h1 { margin:7px 0 0; font-size:clamp(1.55rem,2.7vw,2rem); }
.parent-greeting > p { max-width:420px; margin:0 0 3px; color:#74817f; font-size:.92rem; text-align:right; }
.child-picker-card { margin:0 0 18px; padding:13px 16px; border-color:#e9ece6; box-shadow:0 5px 17px rgba(38,69,75,.035); }
.child-picker-card label { color:#657773; font-size:.82rem; }
.child-picker-card select { min-height:42px; border-color:#e1e8e4; background:#fbfcfa; }
.child-picker-card .button { min-height:42px; }
.child-page-hero { position:relative; display:flex; align-items:center; gap:21px; min-height:190px; overflow:hidden; margin-bottom:29px; padding:31px 34px; border:1px solid #e3ece5; border-radius:25px; background:linear-gradient(110deg,#edf6ef 0%,#edf6f3 58%,#f8f3e9 100%); }
.child-page-avatar { position:relative; z-index:1; flex:0 0 78px; width:78px; height:78px; border:5px solid rgba(255,255,255,.8); border-radius:26px; box-shadow:0 7px 18px rgba(54,102,87,.08); }
.child-page-avatar svg { width:52px; height:52px; }
.child-hero-copy { position:relative; z-index:1; max-width:560px; }
.child-hero-copy .admin-eyebrow { color:#5b8a7c; }
.child-hero-copy h2 { margin:7px 0 5px; font-size:clamp(1.5rem,2.8vw,2rem); }
.child-hero-copy p { margin:0; color:#667874; font-size:.94rem; }
.child-page-hero .child-material-count { position:relative; z-index:1; margin-left:auto; min-width:90px; padding:12px 14px; border:1px solid rgba(255,255,255,.72); background:rgba(255,255,255,.7); }
.child-page-hero .child-material-count strong { font-size:1.5rem; }
.child-hero-decoration { position:absolute; inset:0 0 0 auto; width:260px; opacity:.57; pointer-events:none; }
.child-hero-decoration span { position:absolute; width:110px; height:110px; right:28px; top:-24px; border:1px solid #d9c69f; border-radius:50%; }
.child-hero-decoration span:nth-child(2) { width:155px; height:155px; top:auto; bottom:-99px; right:93px; border-color:#a9c7b2; }
.child-hero-decoration span:nth-child(3) { width:13px; height:13px; top:43px; right:173px; border:0; background:#a8cdc0; }
.materials-section-heading { display:flex; align-items:end; justify-content:space-between; gap:20px; margin:0 0 14px; }
.materials-section-heading h2 { margin:5px 0 3px; font-size:1.4rem; }
.materials-section-heading p { margin:0; color:#7e8a87; font-size:.86rem; }
.materials-total { padding:6px 11px; border:1px solid #e5ece7; border-radius:99px; background:#fff; color:#648279; font-size:.78rem; font-weight:600; white-space:nowrap; }
.parent-material-list { gap:13px; }
.parent-material-card { display:grid; grid-template-columns:50px minmax(0,1fr) auto; align-items:center; column-gap:16px; padding:19px 21px; }
.material-card-icon { width:50px; height:50px; border-radius:16px; }
.material-copy .material-type { font-size:.64rem; }
.material-copy h3 { font-size:1.05rem; }
.material-copy p { color:#687573; }
.material-copy small { font-size:.77rem; }
.parent-material-card .material-download { margin:0; }
.parent-material-card .material-download span { margin-right:4px; font-size:1.1rem; }
.materials-empty { padding:31px 20px; border-style:solid; border-color:#e9eee8; background:rgba(255,255,255,.8); }
.materials-empty > span { background:#f1f6ef; }
.materials-empty strong { font-size:1rem; }
.parent-empty { margin-top:0; }
@media(max-width:760px) {
  .parent-greeting { align-items:start; flex-direction:column; gap:6px; }
  .parent-greeting > p { text-align:left; }
  .child-page-hero { min-height:170px; gap:15px; padding:25px; }
  .child-page-avatar { flex-basis:66px; width:66px; height:66px; }
  .child-page-avatar svg { width:46px; height:46px; }
}
@media(max-width:520px) {
  .parent-main { margin-top:22px; }
  .child-page-hero { flex-wrap:wrap; gap:12px; padding:19px; }
  .child-page-avatar { flex-basis:54px; width:54px; height:54px; border-width:3px; border-radius:18px; }
  .child-page-avatar svg { width:42px; height:42px; }
  .child-hero-copy { flex:1; min-width:0; }
  .child-hero-copy h2 { font-size:1.35rem; }
  .child-hero-copy p { font-size:.82rem; }
  .child-page-hero .child-material-count { flex-basis:100%; display:flex; justify-content:center; gap:7px; min-width:0; margin:3px 0 0; padding:7px 10px; }
  .child-page-hero .child-material-count strong { font-size:1rem; }
  .child-page-hero .child-material-count span { align-self:center; }
  .child-hero-decoration { right:-150px; opacity:.33; }
  .materials-section-heading { align-items:start; }
  .parent-material-card { grid-template-columns:43px minmax(0,1fr); padding:16px; gap:10px 12px; }
  .parent-material-card .material-card-icon { width:43px; height:43px; }
  .material-copy { grid-column:2; }
  .parent-material-card .material-download { grid-column:2; justify-self:start; margin:2px 0 0; }
}

/* Месечен календар и преглед на терапевтичните материали */
.parent-content-grid { display:grid; grid-template-columns:minmax(330px,.88fr) minmax(0,1.12fr); align-items:start; gap:18px; }
.calendar-panel,.session-detail-panel { min-width:0; border:1px solid #e9ece6; border-radius:21px; background:#fff; box-shadow:0 9px 25px rgba(38,69,75,.045); }
.calendar-panel { padding:21px; }
.calendar-header { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:20px; }
.calendar-header h2 { margin:5px 0 0; color:var(--ink); font-size:1.25rem; text-transform:capitalize; }
.calendar-navigation { display:flex; gap:7px; }
.calendar-navigation a { display:grid; place-items:center; width:37px; height:37px; border:1px solid #e7ece8; border-radius:12px; background:#fbfcfa; color:#58736c; font-size:1.55rem; line-height:1; text-decoration:none; }
.calendar-navigation a:hover,.calendar-navigation a:focus-visible { background:#eaf5f0; border-color:#bad8ca; }
.calendar-weekdays,.calendar-days { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:6px; text-align:center; }
.calendar-weekdays { margin-bottom:8px; color:#8b9692; font-size:.73rem; font-weight:600; }
.calendar-weekdays span { padding:3px 0; }
.calendar-day,.calendar-blank { position:relative; display:grid; place-items:center; min-width:0; aspect-ratio:1; border-radius:13px; }
.calendar-day { color:#64716f; font-size:.86rem; }
a.calendar-day { color:#fff; background:#78ad9a; box-shadow:inset 0 0 0 1px rgba(255,255,255,.25); font-weight:700; text-decoration:none; transition:transform .15s ease,background .15s ease; }
a.calendar-day:hover { transform:translateY(-2px); background:#5c9984; }
a.calendar-day.selected { background:#317e70; outline:3px solid #cfe6da; outline-offset:1px; }
.calendar-day.has-session i { position:absolute; bottom:6px; width:4px; height:4px; border-radius:50%; background:rgba(255,255,255,.84); }
.calendar-day.today:not(.has-session) { box-shadow:inset 0 0 0 1px #98bdae; color:#3c7d6b; font-weight:700; }
.calendar-legend { display:flex; align-items:center; gap:8px; margin-top:16px; color:#76837f; font-size:.76rem; }
.legend-dot { width:10px; height:10px; border-radius:50%; background:#78ad9a; }
.session-detail-panel { padding:22px; }
.select-date-state { display:grid; justify-items:start; align-content:center; min-height:286px; padding:13px; }
.select-date-icon { display:grid; place-items:center; width:44px; height:44px; margin-bottom:14px; border-radius:14px; background:#edf5f0; color:#609382; font-size:1.35rem; }
.select-date-state h2 { margin:0 0 6px; font-size:1.2rem; }
.select-date-state p { max-width:360px; margin:0; color:#788580; font-size:.87rem; }
.session-detail-heading { display:flex; align-items:center; gap:12px; padding-bottom:16px; border-bottom:1px solid #edf0eb; }
.session-detail-heading h2 { margin:5px 0 0; font-size:1.2rem; text-transform:capitalize; }
.session-detail-icon { display:grid; place-items:center; flex:0 0 42px; width:42px; height:42px; border-radius:14px; background:#eaf5f0; color:#4f927f; font-weight:700; }
.parent-note { margin:17px 0 19px; padding:15px 16px; border:1px solid #e8eee8; border-radius:15px; background:#f7faf7; }
.note-label { color:#63877b; font-size:.67rem; font-weight:700; letter-spacing:.09em; }
.parent-note p { margin:7px 0 0; color:#435652; font-size:.9rem; white-space:normal; }
.parent-guidance { border-color:#dcebe3; background:#f0f7f2; }
.parent-guidance .note-label { color:#4d806d; }
.session-files h3 { display:flex; align-items:center; gap:8px; margin:0 0 12px; color:var(--ink); font:700 1rem Comfortaa,Arial,sans-serif; }
.session-files h3 span { display:grid; place-items:center; min-width:22px; height:22px; padding:0 6px; border-radius:99px; background:#edf4ef; color:#63877b; font:600 .73rem Montserrat,Arial,sans-serif; }
.session-files > .muted { margin:0; font-size:.86rem; }
.parent-file-card { min-width:0; margin-top:11px; padding:14px; border:1px solid #e9ede8; border-radius:15px; background:#fff; }
.parent-file-heading { display:flex; align-items:center; gap:11px; min-width:0; }
.file-type-icon { display:grid; place-items:center; flex:0 0 42px; width:42px; height:42px; border-radius:13px; background:#eef5f0; color:#5b9482; }
.file-type-icon svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.parent-file-heading > div { min-width:0; }
.file-eyebrow { color:#7a9b8e; font-size:.62rem; font-weight:700; letter-spacing:.1em; }
.parent-file-heading h3 { overflow-wrap:anywhere; margin:2px 0 3px; font:700 .92rem Comfortaa,Arial,sans-serif; }
.parent-file-heading small { color:#8a9491; font-size:.72rem; }
.parent-file-description { margin:10px 0 0; color:#697572; font-size:.82rem; white-space:normal; }
.pdf-preview { margin-top:12px; }
.pdf-preview summary { width:max-content; color:#397f70; font-size:.8rem; font-weight:600; cursor:pointer; }
.pdf-frame-wrap { overflow:hidden; height:350px; margin-top:10px; border:1px solid #e5eae6; border-radius:10px; background:#f3f5f3; }
.pdf-frame-wrap iframe { display:block; width:100%; height:100%; border:0; background:#f3f5f3; }
.image-preview-wrap { display:flex; justify-content:center; align-items:center; max-height:520px; overflow:auto; margin-top:10px; padding:12px; border:1px solid #e5eae6; border-radius:10px; background:#f3f5f3; }
.image-preview-wrap img { display:block; max-width:100%; max-height:500px; object-fit:contain; border-radius:6px; }
.parent-download-link { min-height:36px; margin-top:11px; padding:7px 11px; font-size:.8rem; }
.general-materials { margin-top:30px; }
.general-materials .materials-section-heading { margin-bottom:13px; }
.general-files-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.admin-materials-page { background:radial-gradient(ellipse at 91% 2%,rgba(235,246,241,.6),transparent 34%),#fbfaf7; }
.admin-materials-page .portal-header { background:rgba(255,255,255,.86); }
.admin-materials-main { width:min(100% - 40px,1020px); margin-top:32px; }
.session-editor,.session-list-panel,.material-upload-panel,.latest-materials { margin:0 0 18px; border-color:#e9ece6; border-radius:19px; box-shadow:0 8px 22px rgba(38,69,75,.04); }
.session-editor-heading { display:flex; align-items:center; gap:12px; margin-bottom:18px; }
.session-editor-icon { display:grid; place-items:center; width:45px; height:45px; border-radius:15px; background:#eaf5f0; color:#578f7e; font-size:1.35rem; }
.session-editor-heading .panel-kicker { display:block; }
.session-editor-heading h2 { margin:4px 0 0; }
.session-form { display:grid; grid-template-columns:1fr 1fr; align-items:end; gap:12px; }
.session-form label { display:grid; gap:6px; margin:0; }
.session-note-field { grid-column:1/-1; }
.session-note-field textarea { resize:vertical; }
.session-guidance-field { grid-column:1/-1; }
.session-guidance-field textarea { resize:vertical; }
.session-guidance-field small { color:#7e8a87; font-size:.78rem; }
.session-child-display { display:grid; gap:4px; align-self:end; min-height:64px; padding:9px 12px; border:1px solid #e5ebe7; border-radius:9px; background:#f7faf7; }
.session-child-display span { color:#84908c; font-size:.74rem; }
.session-child-display strong { color:var(--ink); }
.session-form-actions { display:flex; gap:8px; }
.session-list-panel .admin-section-heading { margin-bottom:12px; }
.session-list { display:grid; gap:9px; }
.session-list-item { display:grid; grid-template-columns:48px minmax(0,1fr) auto; align-items:center; gap:12px; padding:12px; border:1px solid #edf0ec; border-radius:14px; background:#fff; }
.session-date-badge { display:grid; justify-items:center; align-content:center; width:46px; height:50px; border-radius:13px; background:#eaf5f0; color:#508d7b; }
.session-date-badge strong { font:700 1.15rem Comfortaa,Arial,sans-serif; line-height:1.2; }
.session-date-badge span { font-size:.62rem; font-weight:700; }
.session-list-copy { min-width:0; }
.session-list-copy > strong { margin-right:8px; color:var(--ink); font-size:.87rem; }
.session-list-copy time { color:#7b8984; font-size:.77rem; }
.session-list-copy p { overflow:hidden; display:-webkit-box; margin:4px 0 0; color:#7b8582; font-size:.77rem; -webkit-box-orient:vertical; -webkit-line-clamp:2; }
.session-list-item > .button { min-height:36px; padding:6px 10px; font-size:.78rem; }
.material-upload-panel h2 { margin:5px 0; }
.material-upload-panel > p { margin:0 0 14px; }
.material-upload-panel form { max-width:660px; }
.latest-materials h2 { margin:0 0 10px; }
.material-edit-panel,.material-delete-confirm { margin:0 0 18px; border-color:#e9ece6; border-radius:19px; box-shadow:0 8px 22px rgba(38,69,75,.04); }
.material-edit-panel h2,.material-delete-confirm h2 { margin:5px 0 14px; }
.material-edit-panel form { max-width:660px; }
.material-edit-panel label small { display:block; margin-top:6px; color:#7e8a87; }
.material-delete-confirm { border-color:#f0d9d4; background:#fffaf8; }
.material-delete-confirm p { color:#687573; }
.material-actions { display:flex; flex-wrap:wrap; gap:7px; min-width:195px; }
.material-actions .button { padding:8px 11px; font-size:.82rem; }
.button-danger { border:1px solid #b94b3f; background:#b94b3f; color:#fff; }
.button-danger:hover { background:#9f3f35; }
.button-danger-outline { border-color:#edd2cc; background:#fff; color:#a4463a; }
.button-danger-outline:hover { border-color:#d69a8e; background:#fff5f2; }
@media (max-width:720px) { .material-actions { min-width:170px; } }
@media(max-width:560px) {
  .child-history-main { width:min(100% - 28px,1020px); margin-top:24px; }
  .history-toolbar { align-items:flex-start; flex-direction:column; }
  .history-toolbar .button { width:100%; }
  .therapy-history-card { grid-template-columns:1fr; gap:10px; padding:14px; }
  .history-date { grid-template-columns:auto 1fr; justify-items:start; align-items:center; gap:8px; padding:8px 10px; }
  .history-date span { font-size:1.05rem; }
  .history-notes-grid { grid-template-columns:1fr; }
  .history-card-heading { align-items:flex-start; flex-direction:column; }
}
@media(max-width:820px) {
  .parent-content-grid { grid-template-columns:1fr; }
  .select-date-state { min-height:180px; }
  .general-files-grid { grid-template-columns:1fr; }
}
@media(max-width:560px) {
  .calendar-panel { padding:16px; }
  .calendar-weekdays,.calendar-days { gap:4px; }
  .calendar-day,.calendar-blank { border-radius:10px; }
  .calendar-day.has-session i { bottom:4px; }
  .session-detail-panel { padding:17px; }
  .pdf-frame-wrap { height:290px; }
  .image-preview-wrap { max-height:360px; padding:8px; }
  .image-preview-wrap img { max-height:340px; }
  .session-form { grid-template-columns:1fr; }
  .session-note-field { grid-column:auto; }
  .session-guidance-field { grid-column:auto; }
  .session-list-item { grid-template-columns:43px minmax(0,1fr); }
  .session-date-badge { width:42px; }
  .session-list-item > .button { grid-column:2; justify-self:start; }
}
