﻿@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --ink: #243136;
    --muted: #728087;
    --line: #e7e2d8;
    --paper: #fffdfa;
    --soft: #f6efe4;
    --mint: #7bb9a6;
    --mint-dark: #397966;
    --coral: #ee8c76;
    --sun: #f6bf5f;
    --sky: #80b9d8;
    --rose: #f6d8d0;
    --violet: #9b8ad8;
    --shadow: 0 24px 70px rgba(57, 68, 70, .14);
    font-synthesis-weight: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
img, video {
    display: block;
    max-width: 100%;
}
body {
    margin: 0;
    min-height: 100%;
    background:
        linear-gradient(120deg, rgba(246, 191, 95, .16), transparent 30%),
        linear-gradient(240deg, rgba(128, 185, 216, .18), transparent 34%),
        var(--soft);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-weight: 400;
    letter-spacing: 0;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
input, select, textarea {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    color: var(--ink);
    padding: 11px 13px;
    outline: none;
}
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--mint); box-shadow: 0 0 0 3px rgba(126, 182, 162, .18); }
label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 600; }
label small { color: #8a969b; font-weight: 500; line-height: 1.4; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(28px, 5vw, 46px); line-height: 1.05; margin-bottom: 10px; font-weight: 700; }
h2 { font-size: 18px; margin-bottom: 16px; font-weight: 700; }

.login-body, .install-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 22px;
    background:
        radial-gradient(circle at 18% 12%, rgba(246, 191, 95, .42), transparent 26%),
        radial-gradient(circle at 88% 18%, rgba(128, 185, 216, .34), transparent 28%),
        linear-gradient(140deg, #fff6e7, #eef7f1 55%, #f9e5de);
}
.login-shell, .install-shell { width: min(100%, 1120px); }
.login-shell {
    display: grid;
    grid-template-columns: .85fr 1.15fr;
    gap: 22px;
    align-items: stretch;
}
.login-card, .install-panel, .panel, .student-card, .stat-card {
    background: rgba(255, 253, 250, .94);
    border: 1px solid rgba(255, 255, 255, .74);
    border-radius: 28px;
    box-shadow: var(--shadow);
}
.login-hero, .login-card {
    min-height: 620px;
    border-radius: 28px;
}
.login-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 36px;
    color: #fff;
    background:
        linear-gradient(180deg, rgba(36, 49, 54, 0) 35%, rgba(36, 49, 54, .68) 100%),
        url("images/kindergarten-hero.jpg") center/cover;
    box-shadow: var(--shadow);
}
.login-hero h1 {
    font-size: clamp(44px, 7vw, 76px);
    margin-bottom: 14px;
}
.login-hero p {
    max-width: 420px;
    font-weight: 500;
    color: rgba(255,255,255,.9);
    line-height: 1.55;
}
.login-card {
    padding: 26px;
    overflow: hidden;
}
.install-panel { padding: clamp(24px, 4vw, 42px); }
.brand-mark, .brand-mini {
    display: inline-grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: var(--mint);
    color: #fff;
    font-weight: 700;
    margin-bottom: 18px;
}
.brand-logo {
    width: 42px;
    height: 42px;
    max-width: 42px;
    max-height: 42px;
    flex: 0 0 42px;
    object-fit: cover;
    border-radius: 14px;
    margin-right: 10px;
    background: #fff;
    border: 1px solid rgba(255,255,255,.7);
}
.brand-mini {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    margin: 0 10px 0 0;
}
.muted, .demo-hint { color: var(--muted); }
.demo-hint { font-size: 13px; margin: 18px 0 0; }
.stack-form, .compact-form { display: grid; gap: 13px; }
.form-grid, .admin-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 26px;
}
.form-grid h2, .admin-form .checkboxes, .span-2 { grid-column: 1 / -1; }
.form-grid h2 { margin: 18px 0 0; padding-top: 8px; border-top: 1px solid var(--line); }
.check-row { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.check-row input, .checkboxes input { width: auto; min-height: auto; }
.action-form {
    display: grid;
    grid-template-columns: 1.2fr .9fr .5fr .5fr .5fr auto auto auto;
    gap: 12px;
    align-items: end;
}
.action-list {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}
.action-row {
    display: grid;
    grid-template-columns: 1.4fr .5fr .45fr .45fr auto auto auto auto;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
}
.action-row input { min-height: 40px; }
.action-row label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ink);
}
.action-row label input { width: auto; min-height: auto; }

.primary-btn, .ghost-btn, .secondary-btn, .accent-btn {
    min-height: 46px;
    border: 0;
    border-radius: 16px;
    padding: 11px 16px;
    font-weight: 700;
}
.primary-btn { background: linear-gradient(135deg, var(--mint-dark), #2f6f8f); color: #fff; }
.secondary-btn { background: linear-gradient(135deg, var(--sky), var(--violet)); color: #fff; }
.accent-btn { background: linear-gradient(135deg, var(--coral), var(--sun)); color: #fff; }
.ghost-btn { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.text-danger, .text-link { color: #b94b3e; background: none; border: 0; padding: 0; font-weight: 700; }
.text-link { color: var(--mint-dark); }
.alert {
    border-radius: 8px;
    padding: 12px 14px;
    margin: 12px 0;
    font-weight: 700;
}
.alert.success { background: #e8f5ed; color: #2c7357; }
.alert.danger { background: #fae7e1; color: #9c3e31; }

.app-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 18px 0 42px;
}
.topbar {
    position: sticky;
    top: 0;
    z-index: 3;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 12px 0 18px;
    background: linear-gradient(180deg, rgba(246, 239, 228, .96) 74%, rgba(246, 239, 228, 0));
}
.topbar > div { display: flex; align-items: center; min-width: 0; }
.topbar strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar small { display: block; color: var(--muted); margin-left: 10px; }

.stats-grid, .student-grid, .parent-grid, .two-col {
    display: grid;
    gap: 16px;
}
.stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 16px; }
.parent-grid { grid-template-columns: minmax(0, 1.4fr) minmax(280px, .6fr); }
.panel, .student-card, .stat-card { padding: 24px; margin-top: 18px; border-radius: 28px; }
.panel, .student-card, .stat-card, .mini-card {
    backdrop-filter: blur(14px);
}
.stat-card span { display: block; color: var(--muted); font-weight: 700; }
.stat-card strong { display: block; font-size: 34px; margin-top: 10px; }
.stat-card:nth-child(1) { background: linear-gradient(135deg, #ffffff, #eef9f3); }
.stat-card:nth-child(2) { background: linear-gradient(135deg, #ffffff, #fff5df); }
.stat-card:nth-child(3) { background: linear-gradient(135deg, #ffffff, #edf5ff); }
.stat-card:nth-child(4) { background: linear-gradient(135deg, #ffffff, #ffeee7); }

.role-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.role-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 6px;
    margin-bottom: 18px;
    border-radius: 20px;
    background: #f4f0e9;
    border: 1px solid rgba(231, 226, 216, .8);
}
.role-tabs label {
    min-height: 50px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    color: var(--muted);
    font-weight: 700;
    cursor: pointer;
    transition: .18s ease;
}
#role-admin:checked ~ .role-tabs label[for="role-admin"],
#role-teacher:checked ~ .role-tabs label[for="role-teacher"],
#role-parent:checked ~ .role-tabs label[for="role-parent"] {
    color: #fff;
    background: linear-gradient(135deg, #3b7f6b, #6fb7a2);
    box-shadow: 0 12px 24px rgba(57, 121, 102, .24);
}
.login-panels { min-height: 495px; }
.role-panel { display: none; }
#role-admin:checked ~ .login-panels .admin-panel,
#role-teacher:checked ~ .login-panels .teacher-panel,
#role-parent:checked ~ .login-panels .parent-panel {
    display: grid;
}
.role-panel {
    gap: 18px;
    padding: 24px;
    border-radius: 28px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: 0 16px 36px rgba(57, 68, 70, .08);
}
.role-panel h2 { margin-bottom: 0; font-size: 28px; }
.role-panel p { color: var(--muted); margin-bottom: 0; line-height: 1.55; }
.parent-login { background: linear-gradient(135deg, #fff, #fff6eb) !important; }

.admin-hero {
    min-height: 220px;
    display: flex;
    align-items: end;
    padding: 28px;
    border-radius: 28px;
    color: #fff;
    background:
        linear-gradient(140deg, rgba(37, 61, 68, .88), rgba(57, 121, 102, .78)),
        linear-gradient(90deg, var(--coral), var(--sky));
    box-shadow: var(--shadow);
}
.admin-hero span, .teacher-head span {
    display: inline-block;
    margin-bottom: 9px;
    font-weight: 700;
    color: #ffe8b7;
}
.admin-hero h1 {
    max-width: 720px;
    font-size: clamp(30px, 5vw, 52px);
}
.admin-hero p { max-width: 620px; margin-bottom: 0; color: rgba(255,255,255,.86); }
.settings-panel input[type="color"] { padding: 5px; }

.chip-list, .card-list, .checkboxes, .quick-actions, .photo-grid {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #eef7f2;
    border-radius: 999px;
    padding: 8px 10px;
    color: var(--mint-dark);
    font-weight: 700;
}
.chip button { border: 0; background: transparent; color: inherit; font-size: 18px; }
.card-list { margin-top: 16px; }
.mini-card {
    flex: 1 1 220px;
    display: grid;
    gap: 5px;
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 16px;
    background: #fff;
}
.person-card {
    grid-template-columns: 58px 1fr;
    align-items: center;
}
.person-card form, .person-card .text-link { grid-column: 2; }
.person-card img, .small-avatar {
    grid-row: span 4;
    width: 52px;
    height: 52px;
    border-radius: 18px;
    object-fit: cover;
    max-width: 52px;
    max-height: 52px;
}
.small-avatar {
    display: grid;
    place-items: center;
    background: var(--mint);
    color: #fff;
    font-weight: 700;
}
.small-avatar.child { background: var(--coral); }
.mini-card span, .mini-card small { color: var(--muted); }
.checkboxes label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    padding: 9px 11px;
    border-radius: 8px;
}

.student-card {
    border: 1px solid rgba(255,255,255,.76);
    background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,253,250,.9));
}
.student-card:nth-child(3n + 1) .avatar { background: #dff4ec; color: #397966; }
.student-card:nth-child(3n + 2) .avatar { background: #fff0d4; color: #a96e24; }
.student-card:nth-child(3n + 3) .avatar { background: #f9ded6; color: #a74c3d; }
.student-card h2 { font-size: 22px; }
.moments-panel {
    background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(239,249,244,.94));
}
.moments-panel h2::after,
.parent-flow h2::after {
    content: "";
    display: block;
    width: 42px;
    height: 4px;
    margin-top: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--mint), var(--sun));
}
.quick-arrival { background: linear-gradient(180deg, #ecf9f2, #fff) !important; }
.quick-breakfast, .quick-lunch { background: linear-gradient(180deg, #fff5dc, #fff) !important; }
.quick-ate_little, .quick-ate_normal, .quick-ate_well { background: linear-gradient(180deg, #fff0ea, #fff) !important; }
.quick-sleep_start, .quick-sleep_end { background: linear-gradient(180deg, #eef5ff, #fff) !important; }
.quick-toilet, .quick-activity { background: linear-gradient(180deg, #f2efff, #fff) !important; }

.teacher-head {
    margin: 12px 0 18px;
    padding: 28px;
    border-radius: 28px;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(87, 171, 146, .96), rgba(128, 185, 216, .86)),
        var(--mint);
}
.teacher-head p { color: rgba(255,255,255,.9); margin-bottom: 0; }
.student-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.student-title { display: flex; align-items: center; gap: 13px; margin-bottom: 16px; }
.student-title h2 { margin: 0; }
.student-title span { color: var(--muted); }
.student-live {
    display: grid;
    gap: 7px;
    margin: 0 0 16px;
    padding: 15px;
    border-radius: 22px;
    background: linear-gradient(135deg, #effaf4, #fff8e8);
    border: 1px solid rgba(231,226,216,.72);
}
.student-live strong {
    font-size: 18px;
    font-weight: 700;
    color: #2f6f5d;
}
.student-live span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
}
.avatar {
    width: 54px;
    height: 54px;
    min-width: 54px;
    max-width: 54px;
    max-height: 54px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: var(--rose);
    color: #9c4e40;
    font-weight: 700;
    font-size: 24px;
}
.photo-avatar { object-fit: cover; padding: 0; border: 3px solid #fff; }
.quick-actions form { flex: 1 1 145px; }
.quick-actions button {
    width: 100%;
    min-height: 64px;
    border: 0;
    border-radius: 20px;
    background: linear-gradient(180deg, var(--action-bg, #fff), #fff);
    color: var(--ink);
    box-shadow: inset 0 0 0 1px var(--line), 0 8px 18px rgba(57,68,70,.06);
    font-weight: 700;
    padding: 10px;
}
.quick-actions button.is-done {
    color: #397966;
    background: linear-gradient(180deg, #dff4ec, #f7fff9);
    box-shadow: inset 0 0 0 1px rgba(57,121,102,.18);
    opacity: .78;
}
.quick-actions button:disabled {
    cursor: default;
}
.quick-actions button:hover { background: #eaf6f1; }
.note-form, .photo-form { display: grid; gap: 10px; margin-top: 14px; }

.parent-hero {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 18px;
    min-height: 190px;
    padding: 28px;
    border-radius: 28px;
    background:
        linear-gradient(135deg, rgba(255,246,230,.94), rgba(230,243,238,.94) 55%, rgba(248,231,223,.94)),
        #fff;
    box-shadow: var(--shadow);
}
.parent-hero span { color: var(--mint-dark); font-weight: 700; }
.parent-hero p { color: var(--muted); margin-bottom: 0; }
.parent-hero nav { display: flex; gap: 8px; flex-wrap: wrap; }
.parent-hero a {
    padding: 10px 14px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--line);
    font-weight: 700;
}
.parent-hero a.active { background: var(--mint-dark); color: #fff; border-color: var(--mint-dark); }
.parent-child-id { display: flex; align-items: center; gap: 16px; }
.parent-child-id img, .big-initial {
    width: 86px;
    height: 86px;
    min-width: 86px;
    max-width: 86px;
    max-height: 86px;
    border-radius: 28px;
    object-fit: cover;
    box-shadow: 0 12px 26px rgba(57,68,70,.14);
}
.big-initial {
    display: grid;
    place-items: center;
    background: var(--coral);
    color: #fff;
    font-size: 38px;
    font-weight: 700;
}
.calm { box-shadow: 0 10px 34px rgba(54, 70, 76, .08); }
.side-stack { display: grid; gap: 16px; align-content: start; }
.side-stack .panel { margin-top: 16px; }
.side-stack .panel,
.parent-flow {
    background: rgba(255,255,255,.9);
}
.timeline { display: grid; gap: 12px; }
.timeline > div {
    display: grid;
    grid-template-columns: 58px 1fr;
    gap: 12px;
    border-left: 3px solid var(--mint);
    background: #fff;
    border-radius: 8px;
    padding: 12px;
}
.timeline time { color: var(--mint-dark); font-weight: 700; }
.timeline p { margin: 0; }
.timeline small { grid-column: 2; color: var(--muted); }
.timeline.big > div { grid-template-columns: 70px 1fr; padding: 15px; }
.parent-flow .timeline {
    gap: 14px;
}
.parent-flow .timeline > div {
    grid-template-columns: 54px 1fr;
    align-items: start;
    border-left: 0;
    background: transparent;
    padding: 0;
}
.parent-flow .timeline time {
    align-self: start;
    padding-top: 13px;
    font-size: 12px;
    color: var(--muted);
}
.parent-flow .timeline p {
    width: fit-content;
    max-width: 100%;
    padding: 13px 15px;
    border-radius: 20px 20px 20px 6px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(57,68,70,.08);
}
.parent-flow .timeline small {
    grid-column: 2;
    width: fit-content;
    padding: 8px 12px;
    border-radius: 16px;
    background: #eaf7ef;
    color: #397966;
}
.notice {
    border-top: 0;
    border-radius: 18px;
    padding: 14px;
    margin-top: 10px;
    background: #fff8ea;
}
.notice p { color: var(--muted); margin: 5px 0 0; }
.photo-grid figure {
    margin: 0;
    flex: 1 1 180px;
    min-width: 0;
}
.photo-grid img {
    width: 100%;
    max-height: 240px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
}
.photo-grid figcaption { color: var(--muted); font-size: 13px; margin-top: 6px; }

.moment-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    margin-top: 16px;
}
.moment-strip article {
    display: grid;
    gap: 8px;
    padding: 12px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid var(--line);
}
.moment-strip img, .moment-strip video {
    width: 100%;
    max-height: 260px;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 14px;
    background: #eff3f0;
}
.moment-strip p { color: var(--muted); margin-bottom: 0; }
.moment-strip small { color: var(--muted); }
.parent-moments { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

@media (max-width: 860px) {
    .login-shell { grid-template-columns: 1fr; }
    .login-hero { min-height: 380px; padding: 28px; background-position: center 35%; }
    .login-card { min-height: auto; }
    .login-panels { min-height: auto; }
    .stats-grid, .two-col, .student-grid, .parent-grid, .form-grid, .admin-form, .action-form, .action-row { grid-template-columns: 1fr; }
    .form-grid h2, .admin-form .checkboxes, .span-2 { grid-column: auto; }
    .parent-hero { align-items: start; flex-direction: column; }
    .topbar small { display: none; }
}

@media (max-width: 560px) {
    body { background: #f7efe5; }
    .login-body, .install-body { padding: 10px; place-items: start center; }
    .login-hero { border-radius: 24px; min-height: 320px; background-position: center 32%; }
    .login-card { border-radius: 24px; }
    .app-shell { width: min(100% - 14px, 1180px); padding-bottom: 24px; }
    .login-card, .install-panel, .panel, .student-card, .stat-card { padding: 16px; }
    .admin-hero, .teacher-head, .parent-hero { border-radius: 24px; padding: 20px; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat-card strong { font-size: 28px; }
    .quick-actions form { flex-basis: calc(50% - 5px); }
    .quick-actions button { min-height: 68px; font-size: 13px; }
    .timeline > div, .timeline.big > div { grid-template-columns: 56px 1fr; }
    .brand-mini { width: 38px; height: 38px; font-size: 12px; }
    .parent-child-id { align-items: flex-start; }
    .parent-child-id img, .big-initial { width: 68px; height: 68px; min-width: 68px; max-width: 68px; max-height: 68px; border-radius: 22px; }
    .parent-moments { grid-template-columns: 1fr; }
    .role-tabs { gap: 6px; padding: 5px; }
    .role-tabs label { min-height: 44px; font-size: 13px; }
    .role-panel { padding: 18px; border-radius: 24px; }
    .moment-strip img, .moment-strip video { max-height: 210px; }
    .photo-grid img { max-height: 180px; }
}
