/* Кабінет батьків, авторизація — темна панельна естетика EXO */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; background: rgba(18, 12, 8, 0.72); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 3; backdrop-filter: blur(10px); }
.brand { font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: 0.12em; text-transform: uppercase; text-decoration: none; display: inline-flex; align-items: center; gap: 10px; }
.brand-dot { width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffe8a3, var(--gold)); display: inline-block; box-shadow: 0 0 18px rgba(214, 177, 84, 0.5); }
.brand-sub { font-weight: 500; font-size: 11px; letter-spacing: 0.14em; color: var(--ink-faint); margin-left: 2px; }
.topnav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.topnav a, .linklike { text-decoration: none; color: var(--ink-soft); font-weight: 500; font-size: 14px; background: none; border: 1px solid transparent; cursor: pointer; padding: 8px 14px; border-radius: 999px; }
.topnav a:hover, .linklike:hover { color: var(--ink); }
.topnav a.active { border-color: var(--line-strong); color: var(--ink); background: var(--panel); }
.topnav .to-kid { background: var(--gold); color: var(--accent-ink); font-weight: 600; }

.cab { max-width: 980px; margin: 0 auto; padding: 28px 16px 60px; }
.loading, .muted { color: var(--muted); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; backdrop-filter: blur(6px); }
.card + .card { margin-top: 16px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.between { justify-content: space-between; }
.stack { display: grid; gap: 12px; }
h1 { font-size: 28px; } h2 { font-size: 20px; } h3 { font-size: 16px; }
label { display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: var(--ink-soft); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], select, textarea {
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 12px; background: rgba(0, 0, 0, 0.25); color: var(--ink); font-weight: 400; font-size: 15px; width: 100%; }
input::placeholder, textarea::placeholder { color: var(--ink-faint); }
textarea { min-height: 84px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid rgba(214, 177, 84, 0.6); outline-offset: 1px; border-color: var(--gold); }
input[type=date]::-webkit-calendar-picker-indicator { filter: invert(0.9); }
.btn { border: 1px solid var(--line-strong); background: transparent; border-radius: 999px; padding: 12px 22px; font-weight: 600; cursor: pointer; text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; gap: 8px; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--panel-strong); }
.btn-primary { background: var(--gold); border-color: var(--gold); color: var(--accent-ink); }
.btn-primary:hover { background: #e2c06a; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-soft); }
.btn-danger { color: var(--danger); border-color: rgba(255, 176, 149, 0.4); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: default; }
.form-error { color: var(--danger); font-size: 14px; margin: 0; }
.ok { color: var(--ok); font-size: 14px; }
.badge { display: inline-block; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 600; background: var(--panel-strong); color: var(--ink-soft); }
.badge.warn { background: var(--danger-bg); color: var(--danger); }
.badge.good { background: var(--success-bg); color: var(--ok); }

.child-card { display: grid; gap: 8px; text-decoration: none; color: inherit; transition: transform .12s, background .15s; }
.child-card:hover { transform: translateY(-2px); background: var(--panel-strong); }
.child-avatar { font-size: 40px; line-height: 1; }
.child-name { font-family: var(--font-display); font-weight: 600; font-size: 20px; }
.add-card { border-style: dashed; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0 18px; }
.tabs a { text-decoration: none; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); font-size: 14px; font-weight: 500; color: var(--ink-soft); }
.tabs a.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.radio-row { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-row label { flex-direction: row; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; font-weight: 500; cursor: pointer; }
.radio-row input:checked + span { color: var(--gold); font-weight: 600; }
.avatar-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.avatar-pick label { border: 1px solid var(--line); border-radius: var(--radius-sm); width: 54px; height: 54px; display: grid; place-items: center; font-size: 26px; cursor: pointer; background: rgba(0,0,0,.2); }
.avatar-pick input { display: none; }
.avatar-pick label.sel { outline: 2px solid var(--gold); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px 6px 12px; font-size: 14px; background: var(--panel); }
.chip button { border: 0; background: var(--panel-strong); color: var(--ink); border-radius: 50%; width: 20px; height: 20px; cursor: pointer; line-height: 1; font-size: 12px; }
.mem-item { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.mem-item:first-child { border-top: 0; }
.mem-meta { font-size: 12px; color: var(--muted); }
.preview { background: rgba(0,0,0,.25); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14px; line-height: 1.5; }
.preview b { color: var(--gold); font-weight: 600; }
.sess { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 14px 0; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.sess:first-of-type { border-top: 0; }
.sess-title { font-weight: 600; }
.sess-sum { font-size: 14px; color: var(--ink-soft); margin-top: 4px; }
.transcript { display: grid; gap: 8px; }
.bubble { max-width: 78%; padding: 10px 14px; border-radius: 16px; font-size: 15px; line-height: 1.4; }
.bubble.user { background: rgba(255, 248, 240, 0.08); justify-self: start; border-bottom-left-radius: 4px; }
.bubble.agent { background: rgba(214, 177, 84, 0.16); justify-self: end; border-bottom-right-radius: 4px; }
.bubble .who { display: block; font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 14px; }
.kv b { color: var(--ink-soft); font-weight: 500; }

.modal { position: fixed; inset: 0; z-index: 10; background: rgba(6, 4, 2, 0.7); display: grid; place-items: center; padding: 16px; backdrop-filter: blur(6px); }
.modal-card { background: #1a110b; border: 1px solid var(--line); border-radius: 18px; padding: 24px; width: 100%; max-width: 420px; display: grid; gap: 12px; }
.modal-card form { display: grid; gap: 12px; }

.auth-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.auth-card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 28px; width: 100%; max-width: 420px; display: grid; gap: 14px; backdrop-filter: blur(8px); }
.auth-card form { display: grid; gap: 12px; }
.auth-switch, .auth-note { font-size: 14px; color: var(--muted); margin: 0; }
.google-btn { display: flex; justify-content: center; min-height: 44px; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.bal-card { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }
.bal-big { font-family: var(--font-display); font-weight: 600; font-size: 44px; line-height: 1; color: var(--gold); }
.contract-text { max-height: 40vh; overflow: auto; white-space: pre-wrap; font-size: 13px; line-height: 1.5; background: rgba(0,0,0,.25); border-radius: var(--radius-sm); padding: 12px; }
@media (max-width: 640px) { .topbar { flex-direction: column; align-items: flex-start; } .bubble { max-width: 92%; } }

.access-row { display: grid; grid-template-columns: 150px 1fr; gap: 16px; align-items: start; }
.qr { width: 150px; height: 150px; background: #fff; padding: 8px; border-radius: 12px; }
.howto { margin-top: 14px; color: var(--ink-soft); }
.howto summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.howto ol { line-height: 1.6; padding-left: 20px; }
@media (max-width: 560px) { .access-row { grid-template-columns: 1fr; } }
