/* ============================================================
   Карты прогресса учеников — Людмила Владимировна
   Палитра: чёрный / пастельный красный / белый
   ============================================================ */

:root {
    --c-primary:       #d45d5d;          /* пастельный красный */
    --c-primary-dark:  #b04848;
    --c-primary-soft:  #fbecec;          /* очень светлый розовый фон */
    --c-text:          #1a1a1a;          /* почти чёрный */
    --c-text-soft:     #4a4a4a;
    --c-muted:         #888;
    --c-border:        #ececec;
    --c-bg:            #fafafa;
    --c-card:          #ffffff;
    --c-success:       #4a8f5b;
    --c-danger:        #b8443d;
    --c-warning:       #d08842;
    --radius:          12px;
    --radius-sm:       8px;
    --shadow-sm:       0 1px 2px rgba(20, 20, 20, .05);
    --shadow:          0 4px 12px rgba(20, 20, 20, .08);
    --shadow-lg:       0 12px 32px rgba(20, 20, 20, .10);
    --font:            -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.55;
    color: var(--c-text);
    background: var(--c-bg);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.2; color: var(--c-text); }
p  { margin: 0 0 1em; }
.muted { color: var(--c-muted); }
.center { text-align: center; }
.link  { color: var(--c-primary); font-weight: 600; }

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================================
   ГЛАВНАЯ (public)
   ============================================================ */
.page-public { background: var(--c-bg); }
.page-public .hero {
    background:
        radial-gradient(1200px 600px at 80% -100px, rgba(212,93,93,.15), transparent 60%),
        linear-gradient(135deg, #1a1a1a 0%, #2d0a0a 100%);
    color: #fff;
    padding: 70px 0 90px;
    position: relative;
}
.hero-inner { text-align: center; max-width: 760px; margin: 0 auto; }
.hero-badge {
    display: inline-block;
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.18);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 14px;
    margin-bottom: 18px;
    backdrop-filter: blur(6px);
    color: #fbecec;
}
.hero-title { font-size: clamp(28px, 5vw, 48px); margin: 0 0 8px; color: #fff; letter-spacing: -.02em; }
.hero-subtitle { font-size: clamp(18px, 2.5vw, 22px); opacity: .9; margin: 0 0 14px; color: #f3d4d4; }
.hero-tagline { font-size: clamp(16px, 2vw, 19px); opacity: .85; margin: 0 0 32px; }
.hero-cta { margin: 0 0 24px; }
.hero-note {
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.18);
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    color: #fff;
    display: inline-block;
    margin: 0 0 40px;
}
.hero-note strong { font-weight: 600; color: #fbecec; }
.hero-features {
    list-style: none; padding: 0; margin: 0;
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 24px;
    text-align: left;
}
.hero-features li {
    display: flex; gap: 10px; align-items: center;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.10);
    padding: 12px 16px; border-radius: var(--radius-sm);
    font-size: 15px;
}
.hero-features span { font-size: 22px; }

.info-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 50px 0;
}
.info-card {
    background: var(--c-card);
    border-radius: var(--radius);
    padding: 26px 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--c-border);
    text-align: center;
    transition: transform .2s, box-shadow .2s;
}
.info-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--c-primary); }
.info-card-icon { font-size: 36px; margin-bottom: 10px; }
.info-card h3 { font-size: 18px; margin-bottom: 8px; }
.info-card p  { color: var(--c-text-soft); font-size: 14.5px; margin: 0; }

/* ============================================================
   АВТОРИЗАЦИЯ
   ============================================================ */
.page-auth {
    background: linear-gradient(135deg, #1a1a1a 0%, #3a1414 100%);
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.auth-wrap { width: 100%; max-width: 420px; }
.auth-card {
    background: #fff;
    border-radius: 16px;
    padding: 36px 30px;
    box-shadow: var(--shadow-lg);
    position: relative;
}
.auth-back {
    position: absolute; top: 16px; left: 18px;
    color: var(--c-muted); font-size: 14px;
}
.auth-logo  { font-size: 44px; text-align: center; margin: 8px 0 8px; }
.auth-title { font-size: 22px; text-align: center; margin: 0 0 4px; }
.auth-sub   { color: var(--c-muted); text-align: center; margin: 0 0 22px; font-size: 14.5px; }
.auth-hint  { color: var(--c-muted); text-align: center; font-size: 13px; margin: 16px 0 0; }

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
    background: #fff;
    border-bottom: 1px solid var(--c-border);
    box-shadow: var(--shadow-sm);
    position: sticky; top: 0; z-index: 10;
}
.topbar-admin { background: linear-gradient(90deg, #1a1a1a, #3a1414); border-bottom: 0; }
.topbar-admin .topbar-brand, .topbar-admin .user-chip { color: #fff; }
.topbar-admin .btn-ghost { color: #fff; border-color: rgba(255,255,255,.35); }
.topbar-admin .btn-ghost:hover { background: rgba(255,255,255,.10); }
.topbar-inner {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 20px;
}
.topbar-brand {
    font-weight: 700; color: var(--c-text); font-size: 17px;
}
.topbar-nav { display: flex; align-items: center; gap: 12px; }
.user-chip {
    background: var(--c-primary-soft);
    color: var(--c-primary-dark);
    padding: 6px 12px; border-radius: 999px;
    font-size: 14px; font-weight: 500;
}

/* ============================================================
   КНОПКИ
   ============================================================ */
.btn {
    display: inline-block;
    border: 0; cursor: pointer;
    padding: 10px 18px;
    font-size: 15px; font-weight: 600;
    border-radius: var(--radius-sm);
    transition: background .15s, transform .05s, box-shadow .15s;
    font-family: inherit;
    text-align: center;
    text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
    background: var(--c-primary);
    color: #fff;
    box-shadow: 0 1px 2px rgba(212,93,93,.25);
}
.btn-primary:hover { background: var(--c-primary-dark); text-decoration: none; }
.btn-ghost {
    background: transparent;
    color: var(--c-text);
    border: 1px solid var(--c-border);
}
.btn-ghost:hover { background: var(--c-primary-soft); border-color: var(--c-primary); color: var(--c-primary-dark); text-decoration: none; }
.btn-danger { background: var(--c-danger); color: #fff; }
.btn-danger:hover { background: #8a2f2a; }
.btn-lg { padding: 14px 26px; font-size: 16px; }
.btn-sm { padding: 6px 12px; font-size: 13.5px; }
.btn-block { display: block; width: 100%; }

/* ============================================================
   ФОРМЫ
   ============================================================ */
.form { display: flex; flex-direction: column; gap: 14px; }
.form-sub { font-size: 15px; margin: 0 0 6px; color: var(--c-text); font-weight: 600; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field > span { font-size: 13.5px; color: var(--c-text-soft); font-weight: 500; }
.form-field input, .form-field select, .form-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    background: #fff;
    font-size: 15px;
    font-family: inherit;
    color: var(--c-text);
    transition: border-color .15s, box-shadow .15s;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
    outline: 0;
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(212,93,93,.15);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sep { border: 0; border-top: 1px solid var(--c-border); margin: 24px 0; }

.alert {
    padding: 12px 16px; border-radius: var(--radius-sm);
    margin: 16px 0; font-size: 14.5px;
}
.alert-error  { background: #fbecec; color: #8a2f2a; border: 1px solid #f3c2c2; }
.alert-success{ background: #e6f2e9; color: #2f5e3a; border: 1px solid #b8d8bf; }

/* ============================================================
   DASHBOARD — карточки детей
   ============================================================ */
.page-head { margin: 30px 0 20px; }
.page-head h1 { font-size: clamp(24px, 3vw, 30px); }
.empty {
    background: #fff; border: 1px dashed var(--c-border);
    border-radius: var(--radius); padding: 40px 20px;
    text-align: center; color: var(--c-text-soft);
}
.kids-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px; margin: 18px 0 40px;
}
.kid-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--c-border);
    text-decoration: none !important;
    color: inherit;
    display: flex; flex-direction: column; align-items: center;
    text-align: center;
    transition: transform .15s, box-shadow .2s;
}
.kid-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: var(--c-primary);
}
.kid-photo {
    width: 96px; height: 96px;
    border-radius: 50%;
    background: var(--c-primary-soft);
    overflow: hidden;
    margin-bottom: 14px;
    display: flex; align-items: center; justify-content: center;
}
.kid-photo img { width: 100%; height: 100%; object-fit: cover; }
.kid-name { font-size: 17px; margin: 0 0 4px; }
.kid-meta { color: var(--c-text-soft); font-size: 14px; margin: 0 0 14px; }
.kid-last { background: var(--c-primary-soft); padding: 10px 12px; border-radius: var(--radius-sm); width: 100%; margin: 0 0 14px; font-size: 14px; }
.kid-cta  { color: var(--c-primary); font-weight: 600; font-size: 14.5px; }

/* ============================================================
   STUDENT — карточка ученика
   ============================================================ */
.student-hero {
    background: #fff;
    border-radius: var(--radius);
    padding: 22px;
    margin: 24px 0;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--c-border);
    display: flex; gap: 22px; align-items: center;
}
.student-hero-photo {
    width: 110px; height: 110px;
    border-radius: 50%;
    background: var(--c-primary-soft);
    overflow: hidden; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.student-hero-photo img { width: 100%; height: 100%; object-fit: cover; }
.student-hero-info h1 { font-size: clamp(22px, 3vw, 28px); margin: 0 0 10px; }
.student-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 6px 20px; color: var(--c-text-soft); font-size: 14.5px; }
.student-meta .lbl { color: var(--c-muted); margin-right: 4px; }

.parents-card .parents-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
}
.parents-card h4 { font-size: 14.5px; color: var(--c-muted); margin: 0 0 4px; font-weight: 500; }
.parents-card p  { margin: 0 0 4px; font-size: 15px; }

.card {
    background: #fff;
    border-radius: var(--radius);
    padding: 22px 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--c-border);
    margin: 0 0 20px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.card-title { font-size: 18px; margin: 0; color: var(--c-text); }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14.5px;
    min-width: 480px;
}
.data-table th, .data-table td {
    padding: 11px 12px;
    text-align: left;
    border-bottom: 1px solid var(--c-border);
    vertical-align: middle;
}
.data-table th {
    background: #2a2a2a;
    color: #fbecec;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .03em;
    position: sticky; top: 0;
}
.data-table tbody tr:hover { background: #fafafa; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.qualities-table th, .qualities-table td { text-align: center; }
.qualities-table th:first-child, .qualities-table td:first-child { text-align: left; }

.grade-badge {
    display: inline-block;
    min-width: 28px; padding: 4px 10px;
    border-radius: 999px;
    text-align: center;
    font-weight: 700;
    font-size: 14px;
}
.muted-badge { opacity: .55; }

.delta {
    display: inline-block; padding: 2px 8px; border-radius: 999px;
    font-weight: 700; font-size: 13px;
}
.delta.up   { background: #e6f2e9; color: #2f5e3a; }
.delta.down { background: #fbecec; color: #8a2f2a; }
.delta.zero { background: #f0f0f0; color: #6b6b6b; }

.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.inline { display: inline; }

.notes-list { display: flex; flex-direction: column; gap: 12px; }
.note {
    background: #fafafa;
    border-left: 4px solid var(--c-primary);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
}
.note-date { font-size: 12.5px; color: var(--c-muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .04em; }
.note-body { font-size: 15px; line-height: 1.55; white-space: pre-wrap; }

/* ============================================================
   ADMIN
   ============================================================ */
.admin-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 20px;
    margin: 24px 0 40px;
}
.admin-grid .card { margin: 0; }
.admin-grid .card:nth-child(1) { grid-row: span 2; }
@media (max-width: 900px) {
    .admin-grid { grid-template-columns: 1fr; }
    .admin-grid .card:nth-child(1) { grid-row: auto; }
}

.links-section { margin-bottom: 20px; }
.links-list { display: flex; flex-direction: column; gap: 10px; }
.link-row {
    display: flex; gap: 16px; align-items: center;
    padding: 14px 16px;
    background: #fafafa;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    flex-wrap: wrap;
}
.link-info { flex: 1 1 240px; min-width: 0; }
.link-name { font-weight: 600; font-size: 15.5px; color: var(--c-text); }
.link-contact, .link-usage { font-size: 12.5px; margin-top: 2px; }
.link-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; flex: 2 1 360px; }
.link-url {
    flex: 1 1 220px; min-width: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    padding: 8px 10px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--c-text-soft);
    transition: border-color .15s, background .15s;
}
.link-url:hover, .link-url:focus { border-color: var(--c-primary); background: #fff; }
.link-url.copied { border-color: var(--c-success); background: #e6f2e9; color: var(--c-success); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
    background: #fff;
    border-top: 1px solid var(--c-border);
    padding: 18px 0;
    margin-top: 40px;
    text-align: center;
    color: var(--c-muted);
    font-size: 13.5px;
}

/* ============================================================
   АДАПТИВ
   ============================================================ */
@media (max-width: 720px) {
    .container { padding: 0 14px; }
    .page-public .hero { padding: 50px 0 60px; }
    .info-cards { grid-template-columns: 1fr; gap: 14px; margin: 30px 0; }
    .hero-features { grid-template-columns: 1fr; }

    .auth-card { padding: 28px 22px; }
    .auth-back { position: static; display: inline-block; margin-bottom: 8px; }

    .topbar-inner { padding: 10px 14px; flex-wrap: wrap; gap: 8px; }
    .topbar-brand { font-size: 15px; }
    .user-chip { font-size: 12.5px; padding: 4px 10px; }

    .student-hero { flex-direction: column; text-align: center; padding: 18px; }
    .student-meta { grid-template-columns: 1fr; }
    .parents-card .parents-grid { grid-template-columns: 1fr; gap: 12px; }

    .card { padding: 18px; }
    .form-row { grid-template-columns: 1fr; }

    .data-table { font-size: 13.5px; }
    .data-table th, .data-table td { padding: 9px 8px; }
}
@media (max-width: 480px) {
    .hero-features li { font-size: 14px; padding: 10px 12px; }
    .btn-lg { padding: 12px 18px; font-size: 15px; }
    .card-title { font-size: 16px; }
}

