/* ============================================================
   SwimWithSmile — Дизайн система
   Правило 60-30-10:  60% бяло · 30% светло синьо · 10% тъмно синьо
   Типография: Unbounded (дисплей) + Manrope (интерфейс и текст)
   ============================================================ */

:root {
  /* --- 60% : бяло / светли повърхности --- */
  --white:      #FFFFFF;
  --paper:      #F4F8FF;   /* фон на приложението (леко синкаво бяло) */
  --paper-2:    #EAF2FF;

  /* --- 30% : светло синьо --- */
  --sky-50:  #EAF3FF;
  --sky-100: #D8E9FF;
  --sky-200: #B9D8FF;
  --sky-300: #8FC0FF;
  --brand-light: #3E9BFF;  /* основно светло синьо */
  --brand:       #1F73E0;

  /* --- 10% : тъмно синьо (акцент) --- */
  --navy:       #0A2A6B;
  --navy-600:   #0C317E;
  --navy-deep:  #061A45;

  /* --- текст --- */
  --ink:     #0B2545;
  --ink-2:   #34517E;
  --muted:   #7E93B4;

  /* --- функционални --- */
  --gold:    #F6B23C;   /* награди / постижения (използва се пестеливо) */
  --green:   #2FBF71;
  --amber:   #F5A623;
  --red:     #EF5F6B;

  /* --- ефекти --- */
  --ring: rgba(31,115,224,.35);
  --shadow-sm: 0 1px 2px rgba(10,42,107,.06), 0 2px 6px rgba(10,42,107,.06);
  --shadow:    0 6px 18px rgba(10,42,107,.10), 0 2px 6px rgba(10,42,107,.06);
  --shadow-lg: 0 20px 45px rgba(10,42,107,.18), 0 8px 20px rgba(10,42,107,.10);
  --shadow-navy: 0 12px 26px rgba(10,42,107,.35);

  --r-xs: 10px;
  --r-sm: 14px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 32px;
  --r-pill: 999px;

  --gap: 20px;
  --header-h: 72px;

  --font-display: 'Unbounded', 'Manrope', system-ui, sans-serif;
  --font-head: 'Manrope', system-ui, sans-serif;
  --font-body: 'Manrope', system-ui, sans-serif;

  /* --- морски акценти (сайт + детайли) --- */
  --abyss:  #020B1F;
  --deep:   #041739;
  --aqua:   #46D6F7;
  --aqua-2: #1FA8F0;
  --sun:    #FFC53D;
  --sun-2:  #FFAE1A;
  --coral:  #FF6B5B;
  --line:   #E3ECFA;

  --ease: cubic-bezier(.22,.61,.36,1);
  --ease-out: cubic-bezier(.16,1,.3,1);
}

/* ---------- reset ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
  /* lang="bg" включва българските курсивни форми (т→m, д→g); държим стандартната кирилица */
  font-feature-settings: "locl" 0;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
::selection { background: var(--sky-200); }

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 800; color: var(--navy); line-height: 1.15; letter-spacing: -.02em; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

/* ясен фокус само при клавиатура */
:focus-visible { outline: 3px solid var(--aqua-2); outline-offset: 3px; border-radius: 10px; }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: none; }
html { scroll-behavior: auto; -webkit-tap-highlight-color: transparent; }
body.menu-open { overflow: hidden; }

.app-root { min-height: 100dvh; display: flex; flex-direction: column; }

/* ============================================================
   Атмосфера — акватичен фон
   ============================================================ */
.aqua-bg {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background:
    radial-gradient(1200px 700px at 85% -10%, var(--sky-100), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, var(--sky-50), transparent 55%),
    var(--paper);
}
.aqua-bg::before {
  content: ""; position: absolute; inset: -20%;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(62,155,255,.06) 0 2px, transparent 3px),
    radial-gradient(circle at 70% 60%, rgba(62,155,255,.05) 0 2px, transparent 3px);
  background-size: 46px 46px, 60px 60px;
  animation: drift 30s linear infinite;
}
@keyframes drift { to { transform: translateY(-46px); } }

/* ============================================================
   Бутони
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--font-head); font-weight: 700; font-size: .96rem; letter-spacing: -.005em;
  padding: 13px 22px; border-radius: var(--r-pill); position: relative; isolation: isolate;
  transition: transform .18s var(--ease), box-shadow .25s var(--ease), background .2s, filter .2s;
  white-space: nowrap; user-select: none;
}
.btn:active { transform: translateY(1px) scale(.99); }

.btn-primary {
  background: linear-gradient(135deg, var(--navy-600), var(--navy));
  color: #fff; box-shadow: var(--shadow-navy);
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.08); box-shadow: 0 18px 34px rgba(10,42,107,.42); }

.btn-sky {
  background: linear-gradient(135deg, var(--brand-light), var(--brand));
  color: #fff; box-shadow: 0 10px 22px rgba(31,115,224,.30);
}
.btn-sky:hover { transform: translateY(-2px); filter: brightness(1.06); }

.btn-ghost { background: var(--white); color: var(--navy); box-shadow: var(--shadow-sm); border: 1.5px solid var(--sky-100); }
.btn-ghost:hover { background: var(--sky-50); border-color: var(--sky-200); transform: translateY(-1px); }

.btn-soft { background: var(--sky-100); color: var(--navy); }

/* слънчев CTA — основният бутон на сайта */
.btn-sun {
  background: linear-gradient(180deg, #FFD466, var(--sun) 55%, var(--sun-2));
  color: #1D1405; box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 -2px 0 rgba(160,90,0,.18) inset, 0 12px 28px -8px rgba(255,174,26,.65);
}
.btn-sun:hover { transform: translateY(-2px); box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 -2px 0 rgba(160,90,0,.18) inset, 0 18px 36px -10px rgba(255,174,26,.8); }
.btn-sun svg, .btn-primary svg, .btn-sky svg { transition: transform .25s var(--ease-out); }
.btn-sun:hover svg, .btn-primary:hover svg:last-child { transform: translateX(3px); }

/* стъкло — върху тъмен/воден фон */
.btn-glass {
  background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.22);
  -webkit-backdrop-filter: blur(12px) saturate(140%); backdrop-filter: blur(12px) saturate(140%);
}
.btn-glass:hover { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.34); transform: translateY(-1px); }

.btn-ink { background: var(--deep); color: #fff; box-shadow: 0 10px 24px -10px rgba(4,23,57,.6); }
.btn-ink:hover { transform: translateY(-2px); background: #0A2552; }

.btn-xl { padding: 17px 28px; font-size: 1.04rem; }
.btn-xl svg { width: 20px; height: 20px; }
.btn-soft:hover { background: var(--sky-200); }

.btn-danger { background: #fff; color: var(--red); box-shadow: var(--shadow-sm); border: 1.5px solid #FBD5D9; }
.btn-danger:hover { background: #FFF1F2; }

.btn-sm { padding: 9px 15px; font-size: .86rem; }
.btn-lg { padding: 16px 30px; font-size: 1.05rem; }
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 44px; height: 44px; padding: 0; border-radius: 14px;
  transition: transform .18s var(--ease), box-shadow .25s var(--ease), background .2s, filter .2s;
}
.btn-icon:active { transform: translateY(1px) scale(.96); }
.btn-icon svg, .btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }

/* ============================================================
   Форма
   ============================================================ */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.field label { font-size: .84rem; font-weight: 700; color: var(--navy); letter-spacing: .01em; }
.field .hint { font-size: .76rem; color: var(--muted); }

.input, .select, .textarea {
  width: 100%; background: var(--paper); border: 1.8px solid var(--sky-100);
  border-radius: var(--r-sm); padding: 14px 16px; color: var(--ink); font-size: .96rem;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.input::placeholder, .textarea::placeholder { color: #A9BAD6; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--sky-200); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand-light); box-shadow: 0 0 0 4px var(--ring); background: #fff;
}
.textarea { resize: vertical; min-height: 92px; }
.textarea-lg { min-height: 120px; }
.select { appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%230A2A6B' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; padding-right: 42px; cursor: pointer; }

/* секции във формуляри — групират полета за по-лесно и ясно попълване */
.form-section { margin-bottom: 22px; }
.form-section + .form-section { padding-top: 4px; border-top: 1px solid var(--sky-50); }
.form-section-title {
  display:flex; align-items:center; gap:8px; font-family: var(--font-head); font-weight:700; font-size:.92rem;
  color: var(--brand); text-transform: uppercase; letter-spacing:.04em; margin-bottom:14px;
}
.form-section-title svg { width:16px; height:16px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 0 16px; }
/* позволява на елементите в grid да се свиват вместо да преливат */
.field { min-width: 0; }
.grid-2 > *, .grid-3 > * { min-width: 0; }
.input, .select, .textarea { max-width: 100%; }

/* ============================================================
   Карти / общи
   ============================================================ */
.card {
  background: var(--white); border-radius: var(--r-lg);
  box-shadow: var(--shadow); border: 1px solid rgba(185,216,255,.4);
}
.card-pad { padding: 22px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-head); font-weight: 600; font-size: .76rem;
  padding: 5px 11px; border-radius: var(--r-pill);
  background: var(--sky-100); color: var(--navy);
}
.badge-code { background: var(--navy); color: #fff; letter-spacing: 3px; font-size: .82rem; }
.badge-gold { background: linear-gradient(135deg,#FFE29A,var(--gold)); color: #6b4a05; }
.badge-green { background: #D9F7E6; color: #1B7A47; }

.chip {
  display:inline-flex; align-items:center; gap:6px; padding:6px 12px; border-radius: var(--r-pill);
  background: var(--sky-50); color: var(--ink-2); font-weight:600; font-size:.82rem;
  border:1.5px solid transparent; cursor:pointer; transition: all .16s;
}
.chip:hover { background: var(--sky-100); }
.chip.active { background: var(--navy); color:#fff; }
.chip svg { width:15px; height:15px; flex-shrink:0; }
/* предпазна мрежа: икони без зададен размер да не се разливат */
.slot-main svg, .info-item svg, .tl-date svg { width:16px; height:16px; }

.pagettl { font-family: var(--font-display); font-size: clamp(1.45rem, 3vw, 2rem); font-weight: 700; letter-spacing: -.035em; }
.page-eyebrow { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: var(--brand); margin-bottom: 6px; }
.subtle { color: var(--muted); }
.divider { height:1px; background: var(--sky-100); margin: 18px 0; border:0; }

/* ============================================================
   Топ навигация (треньор)
   ============================================================ */
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  box-sizing: border-box;
  display: flex; align-items: center; gap: 18px;
  padding: env(safe-area-inset-top, 0px) clamp(16px,4vw,34px) 0;
  background: rgba(255,255,255,.82); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--sky-100);
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.logo-mark { flex-shrink: 0; filter: drop-shadow(0 6px 12px rgba(31,95,214,.28)); transition: transform .5s var(--ease-out); }
.brand:hover .logo-mark { transform: rotate(-8deg) scale(1.05); }
.brand-txt { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; color: var(--navy); letter-spacing: -.03em; white-space: nowrap; }
.brand-name span { color: var(--brand-light); }
.brand-team { font-size: .72rem; font-weight: 700; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; margin-top: 1px; }

.nav { display: flex; gap: 6px; margin-left: 10px; }
.nav a {
  display:flex; align-items:center; gap:9px; padding: 10px 16px; border-radius: var(--r-pill);
  font-family: var(--font-head); font-weight: 600; font-size:.95rem; color: var(--ink-2);
  transition: all .16s var(--ease);
}
.nav a svg { width:19px; height:19px; }
.nav a:hover { background: var(--sky-50); color: var(--navy); }
.nav a.active { background: var(--navy); color:#fff; box-shadow: var(--shadow-navy); }

.topbar-right { margin-left:auto; display:flex; align-items:center; gap:12px; }
.usr { display:flex; align-items:center; gap:10px; padding:6px 6px 6px 14px; border-radius: var(--r-pill); background: var(--sky-50); }
.usr .avatar { width:34px; height:34px; border-radius:50%; background: linear-gradient(135deg,var(--brand-light),var(--navy)); color:#fff; display:grid; place-items:center; font-family:var(--font-head); font-weight:700; font-size:.9rem; }
.usr .nm { font-weight:700; font-size:.9rem; color:var(--navy); }

/* container */
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: clamp(20px,4vw,36px) clamp(16px,4vw,34px) 80px; flex: 1; }
.page-head { display:flex; align-items:flex-end; justify-content:space-between; gap:16px; flex-wrap:wrap; margin-bottom: 24px; }

/* ============================================================
   Календар — в стил Apple Calendar
   ============================================================ */
.cal-head {
  display:flex; align-items:center; gap:10px; margin-bottom:20px; flex-wrap:wrap;
}
.cal-nav { display:flex; align-items:center; gap:6px; }
.cal-title {
  font-family:var(--font-head); font-weight:800; font-size:1.3rem; color:var(--navy);
  text-transform: capitalize; flex:1; text-align:center; min-width:140px;
}
.cal-grid {
  display:grid; grid-template-columns: repeat(7,1fr); gap:0;
  border:1px solid var(--sky-100); border-radius:14px; overflow:hidden; background:#fff;
}
.cal-grid > *:nth-child(7n) { border-right:none; }
.cal-dow {
  text-align:center; font-weight:700; font-size:.7rem; color:var(--muted);
  text-transform:uppercase; letter-spacing:.05em; padding:9px 0; background:#fff;
  border-bottom:1px solid var(--sky-100); border-right:1px solid var(--sky-50);
}
.cal-dow.weekend { color: var(--brand-light); }
.cal-cell {
  position:relative; min-height:116px; background:#fff; padding:4px 5px 6px; cursor:pointer;
  display:flex; flex-direction:column; gap:2px; overflow:hidden;
  border-right:1px solid var(--sky-50); border-bottom:1px solid var(--sky-50);
  transition: background .15s;
}
.cal-cell:hover { background: var(--sky-50); }
.cal-cell.empty { background:#fafcff; cursor:default; }
.cal-cell.empty:hover { background:#fafcff; }
.cal-cell.weekend:not(.empty) { background:#fbfdff; }
.cal-cell.weekend:not(.empty):hover { background: var(--sky-50); }
.cal-daynum {
  align-self:flex-start; font-family:var(--font-head); font-weight:600; color:var(--ink-2);
  font-size:.82rem; min-width:24px; height:24px; padding:0 5px;
  display:inline-flex; align-items:center; justify-content:center; border-radius:12px; margin-bottom:2px;
}
.cal-cell.today .cal-daynum { background: var(--brand); color:#fff; }
/* легенда с цветовете на треньорите */
.coach-legend { display:flex; flex-wrap:wrap; gap:8px 16px; margin-bottom:16px; padding-bottom:14px; border-bottom:1px solid var(--sky-50); }
.legend-item { display:inline-flex; align-items:center; gap:7px; font-family:var(--font-head); font-weight:600; font-size:.84rem; color:var(--ink-2); }
.legend-item .dot { width:12px; height:12px; border-radius:50%; flex-shrink:0; }

/* тренировки като събития в клетката (Google Calendar стил) */
.cal-events { display:flex; flex-direction:column; gap:2px; min-width:0; }
.cal-ev {
  display:block; font-size:.7rem; font-weight:600; line-height:1.55;
  padding:1px 6px; border-radius:5px; color:#fff;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; cursor:pointer;
}
.cal-ev:hover { filter:brightness(1.07); }
.cal-more { font-size:.68rem; font-weight:700; color:var(--muted); padding:1px 6px; cursor:pointer; }
.cal-more:hover { color: var(--navy); }

/* session row */
.slot {
  display:flex; align-items:center; gap:14px; padding:13px 16px; border-radius: var(--r-md);
  background:var(--white); box-shadow: var(--shadow-sm); border:1px solid var(--sky-50);
  transition: transform .16s var(--ease), box-shadow .2s; cursor:pointer;
}
.slot:hover { transform: translateX(3px); box-shadow: var(--shadow); }
.slot > svg { width:20px; height:20px; flex-shrink:0; color: var(--sky-300); }
.slot-time { font-family:var(--font-head); font-weight:800; font-size:1.05rem; color:var(--navy); min-width:56px; }
.slot-main { flex:1; min-width:0; }
.slot-main .t { font-weight:700; color:var(--ink); }
.slot-main .s { font-size:.84rem; color:var(--muted); }

/* участник в тренировка — картон с ясно видими снимка и име */
.part-card {
  background:var(--white); border-radius: var(--r-lg); padding:18px;
  box-shadow: var(--shadow-sm); border:1px solid var(--sky-50);
}
.part-head { display:flex; align-items:center; gap:12px; margin-bottom:16px; flex-wrap:wrap; }
.part-avatar {
  width:52px; height:52px; border-radius:16px; flex-shrink:0; overflow:hidden;
  background: linear-gradient(135deg,var(--sky-100),var(--sky-200));
  display:grid; place-items:center; color:var(--brand); font-family:var(--font-head); font-weight:800; font-size:1.15rem;
  box-shadow: var(--shadow-sm);
}
.part-avatar img { width:100%; height:100%; object-fit:cover; }
.part-name { font-family:var(--font-head); font-weight:800; font-size:1.15rem; color:var(--navy); margin-right:auto; }

/* ============================================================
   Деца — карти
   ============================================================ */
.kid-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(230px,1fr)); gap: 18px; }
.kid {
  background:var(--white); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow:hidden;
  cursor:pointer; transition: transform .2s var(--ease), box-shadow .25s; border:1px solid rgba(185,216,255,.4);
}
.kid:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.kid-photo { aspect-ratio: 1/1; background: linear-gradient(135deg,var(--sky-100),var(--sky-200)); position:relative; }
.kid-photo img { width:100%; height:100%; object-fit:cover; }
.kid-photo .ph { position:absolute; inset:0; display:grid; place-items:center; color:var(--brand); font-family:var(--font-head); font-weight:800; font-size:2.6rem; opacity:.5; }
.kid-body { padding: 15px 16px 18px; }
.kid-name { font-family:var(--font-head); font-weight:700; font-size:1.06rem; color:var(--navy); }
.kid-meta { display:flex; align-items:center; gap:8px; margin-top:8px; flex-wrap:wrap; }

/* ============================================================
   Профил на дете
   ============================================================ */
.profile-head {
  display:flex; gap:22px; align-items:center; padding: 24px; border-radius: var(--r-xl);
  background: linear-gradient(135deg, var(--navy), var(--brand)); color:#fff; box-shadow: var(--shadow-lg);
  position:relative; overflow:hidden;
}
.profile-head::after { content:""; position:absolute; right:-60px; top:-60px; width:220px; height:220px; border-radius:50%; background: rgba(255,255,255,.08); }
.profile-avatar { width:104px; height:104px; border-radius: 26px; object-fit:cover; border:3px solid rgba(255,255,255,.5); background: var(--sky-200); flex-shrink:0; box-shadow: var(--shadow); }
.profile-avatar.ph { display:grid; place-items:center; font-family:var(--font-head); font-weight:800; font-size:2.4rem; color:#fff; }
.profile-info h1 { color:#fff; font-size: clamp(1.4rem,3vw,2rem); }
.profile-info .row { display:flex; gap:10px; flex-wrap:wrap; margin-top:10px; }
.profile-info .badge { background: rgba(255,255,255,.16); color:#fff; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }

.tabs { display:flex; gap:6px; margin: 22px 0; overflow-x:auto; padding-bottom:2px; }
.tab {
  padding: 10px 18px; border-radius: var(--r-pill); font-family:var(--font-head); font-weight:600;
  color:var(--ink-2); white-space:nowrap; transition: all .16s; background: var(--white); box-shadow: var(--shadow-sm);
}
.tab:hover { background: var(--sky-50); }
.tab.active { background: var(--navy); color:#fff; box-shadow: var(--shadow-navy); }

.info-grid { display:grid; grid-template-columns: repeat(auto-fit,minmax(200px,1fr)); gap:12px; }
.info-item {
  background: var(--paper); border:1.5px solid var(--sky-100); border-radius: var(--r-md);
  padding:13px 16px 15px; transition: border-color .16s, background .16s;
}
.info-item:hover { border-color: var(--sky-200); background: #fff; }
.info-item .k {
  font-size:.68rem; font-weight:800; color:var(--brand); text-transform:uppercase; letter-spacing:.06em;
}
.info-item .v { font-weight:600; color:var(--ink); margin-top:6px; line-height:1.48; word-break:break-word; }
.info-item .v.no-data { color:var(--muted); font-weight:500; font-style:italic; }

/* секции в картона на детето */
.card-section { margin-bottom:26px; }
.card-section:last-child { margin-bottom:0; }
.card-section-title {
  display:flex; align-items:center; gap:11px;
  font-family:var(--font-head); font-weight:800; font-size:1.02rem; color:var(--navy);
  margin-bottom:16px; padding-bottom:12px; border-bottom:2px solid var(--sky-50);
}
.card-section-title .ico {
  width:32px; height:32px; border-radius:10px; flex-shrink:0; display:grid; place-items:center;
  background: linear-gradient(135deg,var(--sky-100),var(--sky-200)); color:var(--brand);
}
.card-section-title .ico svg { width:17px; height:17px; }

/* progress bars (карта за напредък) */
.prog-row { margin-bottom: 16px; }
.prog-top { display:flex; justify-content:space-between; margin-bottom:7px; font-weight:700; }
.prog-top .val { color: var(--brand); }
.prog-track { height:12px; border-radius: var(--r-pill); background: var(--sky-100); overflow:hidden; }
.prog-fill { height:100%; border-radius: var(--r-pill); background: linear-gradient(90deg, var(--brand-light), var(--navy)); width:0; transition: width 1s var(--ease-out); }

/* rating dots (1-5) */
.rate { display:inline-flex; gap:5px; }
.rate .d { width:13px; height:13px; border-radius:50%; background: var(--sky-100); }
.rate .d.on-1 { background: var(--red); }
.rate .d.on-2 { background: #F5883C; }
.rate .d.on-3 { background: var(--amber); }
.rate .d.on-4 { background: #7BC96F; }
.rate .d.on-5 { background: var(--green); }

/* achievement card */
.ach {
  display:flex; align-items:center; gap:14px; padding:16px; border-radius: var(--r-md);
  background:var(--white); box-shadow: var(--shadow-sm); border:1px solid var(--sky-50);
  transition: transform .16s var(--ease), box-shadow .2s;
}
.ach:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.ach-ico { width:52px; height:52px; border-radius:16px; display:grid; place-items:center; font-size:1.6rem;
  background: linear-gradient(135deg,#FFF3D6,#FFE29A); flex-shrink:0; }
.ach-main { flex:1; min-width:0; }
.ach-main .n { font-family:var(--font-head); font-weight:700; color:var(--navy); }
.ach-main .r { font-size:.84rem; color:var(--ink-2); }
.ach-date { font-size:.8rem; color:var(--muted); font-weight:600; }

/* timeline (история) */
.tl { position:relative; padding-left: 26px; }
.tl::before { content:""; position:absolute; left:8px; top:6px; bottom:6px; width:2px; background: var(--sky-100); }
.tl-item { position:relative; padding: 4px 0 20px; }
.tl-item::before { content:""; position:absolute; left:-22px; top:8px; width:12px; height:12px; border-radius:50%;
  background: var(--brand-light); border:3px solid #fff; box-shadow: 0 0 0 2px var(--sky-200); }
.tl-date { font-family:var(--font-head); font-weight:700; color:var(--navy); }

/* empty state */
.empty { text-align:center; padding: 50px 20px; color: var(--muted); }
.empty .ico { width:76px; height:76px; margin:0 auto 16px; border-radius: 24px; display:grid; place-items:center;
  background: var(--sky-50); color: var(--brand-light); }

/* ============================================================
   Модал
   ============================================================ */
.modal-host { position: fixed; inset: 0; z-index: 90; display:grid; place-items:center; padding: 18px; overscroll-behavior: contain; }
.modal-host[hidden] { display:none; }
.modal-scrim { position:absolute; inset:0; background: rgba(6,26,69,.42); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: fade .25s var(--ease); }
.modal {
  position:relative; width: min(560px, 100%); max-height: 90dvh; overflow-y:auto; overflow-x:hidden;
  background:#fff; border-radius: var(--r-xl); box-shadow: var(--shadow-lg);
  animation: pop .3s var(--ease-out);
}
.modal-lg { width: min(760px, 100%); }
.modal-head { display:flex; align-items:center; justify-content:space-between; padding: 22px 24px; border-bottom:1px solid var(--sky-50); position:sticky; top:0; background:#fff; z-index:2; }
.modal-head h3 { font-size:1.2rem; letter-spacing: -.025em; }
.modal-body { padding: 22px 24px; }
.modal-foot { padding: 16px 24px 22px; display:flex; gap:12px; justify-content:flex-end; }
.x-btn { width:38px; height:38px; border-radius:12px; display:grid; place-items:center; color:var(--muted); transition: all .15s; }
.x-btn:hover { background: var(--sky-50); color: var(--navy); }

/* ============================================================
   Тост
   ============================================================ */
.toast-host { position: fixed; bottom: 22px; left:50%; transform: translateX(-50%); z-index: 120; display:flex; flex-direction:column; gap:10px; align-items:center; pointer-events:none; }
.toast {
  display:flex; align-items:center; gap:11px; padding: 13px 20px; border-radius: var(--r-pill);
  background: var(--navy); color:#fff; box-shadow: var(--shadow-lg); font-weight:600; font-size:.92rem;
  animation: toastIn .35s var(--ease-out); pointer-events:auto;
}
.toast.ok { background: linear-gradient(135deg,#22a06b,#12805a); }
.toast.err { background: linear-gradient(135deg,#e0525f,#c33645); }
.toast svg { width:19px; height:19px; }

/* ============================================================
   Анимации
   ============================================================ */
@keyframes fade { from { opacity:0; } }
@keyframes pop { from { opacity:0; transform: translateY(14px) scale(.97); } }
@keyframes sheetUp { from { transform: translateY(100%); } }
@keyframes toastIn { from { opacity:0; transform: translateY(16px); } }
@keyframes rise { from { opacity:0; transform: translateY(16px); } to { opacity:1; transform:none; } }
.rise { animation: rise .5s var(--ease-out) both; }
.stagger > * { animation: rise .5s var(--ease-out) both; }
.stagger > *:nth-child(1){animation-delay:.03s}
.stagger > *:nth-child(2){animation-delay:.06s}
.stagger > *:nth-child(3){animation-delay:.09s}
.stagger > *:nth-child(4){animation-delay:.12s}
.stagger > *:nth-child(5){animation-delay:.15s}
.stagger > *:nth-child(6){animation-delay:.18s}
.stagger > *:nth-child(7){animation-delay:.21s}
.stagger > *:nth-child(8){animation-delay:.24s}
.stagger > *:nth-child(n+9){animation-delay:.27s}

/* skeleton */
.skel { background: linear-gradient(90deg,var(--sky-50),var(--sky-100),var(--sky-50)); background-size:200% 100%; animation: sh 1.2s infinite; border-radius: var(--r-sm); }
@keyframes sh { to { background-position:-200% 0; } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration:.001ms !important; transition-duration:.001ms !important; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 860px) {
  .brand-name { font-size: 1rem; }
  .nav a span { display:none; }
  .nav a { padding: 10px 13px; }
  .usr .nm { display:none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .brand-name { display:none; }
  .nav { gap:2px; margin-left:2px; }
  .nav a { padding: 9px 10px; }
}
@media (max-width: 560px) {
  :root { --header-h: 64px; }
  .cal-head { gap:8px; }
  .cal-title { font-size:1.08rem; order:-1; flex-basis:100%; text-align:center; margin-bottom:2px; }
  .cal-grid { gap:0; }
  .cal-cell { min-height:74px; border-radius:0; padding:4px; }
  .cal-daynum { min-width:22px; height:22px; font-size:.78rem; padding:0 3px; }
  .cal-events { display:flex; gap:3px; }
  .cal-ev { font-size:0; height:6px; padding:0; border-radius:99px; line-height:0; }
  .cal-more { font-size:.58rem; }
  .cal-dow { font-size:.62rem; padding:7px 0; }
  .kid-grid { grid-template-columns: 1fr; gap:10px; }
  .kid { display:flex; align-items:center; gap:14px; border-radius: var(--r-md); }
  .kid:hover { transform:none; }
  .kid-photo { width:60px; height:60px; aspect-ratio:unset; border-radius:16px; flex-shrink:0; margin:10px 0 10px 10px; }
  .kid-photo .ph { font-size:1.3rem; }
  .kid-body { padding:10px 14px 10px 0; }
  .profile-head { flex-direction:column; text-align:center; }
  .profile-info .row { justify-content:center; }
  .modal-foot { flex-direction: column-reverse; padding-bottom: max(22px, env(safe-area-inset-bottom)); }
  .modal-foot .btn { width:100%; }
  /* модалите стават „лист" отдолу — като в нативно приложение */
  .modal-host { place-items: end center; padding: 0; }
  .modal { width: 100%; max-height: 92dvh; border-radius: 26px 26px 0 0; animation: sheetUp .42s var(--ease-out); }
  .modal-lg { width: 100%; }
  .modal-head { padding: 22px 20px 16px; }
  .modal-head::before { content:""; position:absolute; top:8px; left:50%; width:40px; height:5px; margin-left:-20px; border-radius:99px; background: var(--sky-100); }
  .modal-body { padding: 18px 20px; }
  .modal-foot { padding-left: 20px; padding-right: 20px; }
  .tabs { margin: 18px -4px 22px; }
  .card-pad { padding: 16px; }
  .info-grid { grid-template-columns: repeat(auto-fit,minmax(122px,1fr)); gap:8px; }
  .info-item { padding:10px 12px 11px; }
  .info-item .k { font-size:.63rem; }
  .info-item .v { font-size:.9rem; margin-top:4px; }
}

/* ============================================================
   Екран за вход (auth)
   ============================================================ */
.auth { display:grid; grid-template-columns: 1.05fr 1fr; min-height:100dvh; }
.auth-hero {
  position:relative; overflow:hidden; display:flex; align-items:center; padding: clamp(30px,6vw,70px);
  background: linear-gradient(150deg, var(--navy-deep), var(--navy) 45%, var(--brand) 120%); color:#fff;
}
.auth-hero-in { position:relative; z-index:2; max-width: 440px; }
.auth-h { font-size: clamp(2.4rem,5vw,3.6rem); color:#fff; font-weight:800; line-height:1.02; }
.auth-sub { margin-top:16px; font-size:1.08rem; color: rgba(255,255,255,.82); max-width: 380px; }
.auth-feats { margin-top: 30px; display:flex; flex-direction:column; gap:14px; }
.auth-feats .feat { display:flex; align-items:center; gap:12px; font-weight:600; font-size:1rem; }
.auth-feats .feat svg { width:22px; height:22px; padding:9px; box-sizing:content-box; border-radius:12px; background: rgba(255,255,255,.14); }
.wave-deco { position:absolute; left:0; right:0; bottom:0; height:120px; z-index:1; }
.wave-deco svg { width:100%; height:100%; }

.auth-panel { position:relative; display:grid; place-items:center; padding: clamp(24px,5vw,50px); background: var(--paper); }
.auth-card { width:100%; max-width: 420px; background:#fff; border-radius: var(--r-xl); box-shadow: var(--shadow-lg); padding: clamp(24px,4vw,38px); }
.auth-card h2 { font-size:1.6rem; }
.seg { display:flex; gap:6px; padding:5px; background: var(--sky-50); border-radius: var(--r-pill); margin-bottom: 26px; }
.seg-btn { flex:1; padding:11px; border-radius: var(--r-pill); font-family:var(--font-head); font-weight:600; color:var(--ink-2); transition: all .18s var(--ease); }
.seg-btn.active { background:#fff; color:var(--navy); box-shadow: var(--shadow-sm); }
.gear-btn { position:absolute; top:20px; right:20px; width:42px; height:42px; border-radius:13px; display:grid; place-items:center; color:var(--muted); background:#fff; box-shadow: var(--shadow-sm); transition: all .16s; }
.gear-btn:hover { color:var(--navy); transform: rotate(30deg); }
.gear-btn svg { width:20px; height:20px; }

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-hero { min-height: 300px; padding: 34px; }
  .auth-feats { display:none; }
  .auth-h { font-size: 2.2rem; }
  .auth-panel { padding: 26px 18px 50px; }
  .auth-card { margin-top: -40px; position:relative; z-index:5; }
}

/* --- родителски изглед --- */
.parent-top { background: linear-gradient(150deg, var(--deep), var(--navy) 60%, var(--brand)); color:#fff; padding: calc(16px + env(safe-area-inset-top, 0px)) clamp(16px,4vw,34px) 16px; display:flex; align-items:center; gap:14px; }
.parent-top .brand-name { color:#fff; }
.parent-top .brand-name span { color: var(--sky-200); }
.reward-tag { display:inline-flex; align-items:center; gap:6px; font-weight:700; font-size:.8rem; color:#6b4a05; background: linear-gradient(135deg,#FFE29A,var(--gold)); padding:5px 12px; border-radius: var(--r-pill); }

/* --- качване на снимка --- */
.photo-up { display:flex; gap:14px; align-items:center; }
.photo-preview { width:74px; height:74px; border-radius:18px; overflow:hidden; background:var(--sky-100); display:grid; place-items:center; color:var(--brand-light); flex-shrink:0; }
.photo-preview svg { width:30px; height:30px; }
.photo-preview img { width:100%; height:100%; object-fit:cover; }
input[type=file].input { padding:9px 12px; cursor:pointer; }
input[type=file].input::file-selector-button { border:none; background:var(--navy); color:#fff; font-family:var(--font-head); font-weight:600; padding:8px 14px; border-radius:10px; margin-right:12px; cursor:pointer; transition:filter .15s; }
input[type=file].input::file-selector-button:hover { filter:brightness(1.12); }
