/* Kunstschule Hurvich — кабинет учителя. Стиль из брендбука 2026-08-26. */
:root {
  --burgundy: #7C3F58;
  --sage: #8EAA8A;
  --bg: #FBF8F4;
  --card: #FFFFFF;
  --soft: #F4ECEF;
  --line: #DCD0D4;
  --text: #241B20;
  --muted: #6E5C63;
  --paid: #3F8F4F;
  --unpaid: #C08A2E;
  --info: #4C7A82;
  --radius: 14px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.45;
  overscroll-behavior-y: none;
}

h1, h2, h3 { font-family: Fraunces, Georgia, "Times New Roman", serif; font-weight: 600; margin: 0 0 8px; }
h1 { font-size: 22px; }
h2 { font-size: 19px; }
h3 { font-size: 17px; }

/* ---------- каркас ---------- */

.top {
  position: sticky; top: 0; z-index: 20;
  background: var(--burgundy); color: #fff;
  padding: 14px 16px calc(14px + env(safe-area-inset-top)) 16px;
  padding-top: calc(14px + env(safe-area-inset-top));
  display: flex; align-items: center; gap: 12px;
}
.top h1 { color: #fff; margin: 0; font-size: 20px; flex: 1; }
.top button { background: rgba(255,255,255,.15); color: #fff; border: 0; }

.wrap { padding: 16px; padding-bottom: 96px; max-width: 720px; margin: 0 auto; }

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--card); border-top: 1px solid var(--line);
  display: flex; padding-bottom: env(safe-area-inset-bottom);
}
.nav a {
  flex: 1; text-align: center; padding: 11px 4px 13px;
  color: var(--muted); text-decoration: none; font-size: 13px;
}
.nav a.on { color: var(--burgundy); font-weight: 600; }
.nav .ic { display: block; font-size: 20px; line-height: 1.1; }

/* ---------- карточки ---------- */

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); margin-bottom: 12px; overflow: hidden;
}
.card.tap { cursor: pointer; }
.card.tap:active { background: var(--soft); }

.lesson { display: flex; gap: 12px; padding: 12px; align-items: stretch; }
.lesson .pic {
  width: 78px; height: 78px; flex: 0 0 78px; border-radius: 10px;
  background: var(--soft) center/cover no-repeat; border: 1px solid var(--line);
}
.lesson .body { flex: 1; min-width: 0; }
.lesson .time { font-size: 19px; font-weight: 600; font-family: Fraunces, Georgia, serif; }
.lesson .meta { color: var(--muted); font-size: 15px; }
.lesson .count { color: var(--muted); font-size: 15px; margin-top: 2px; }

/* ---------- чипы и точки ---------- */

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--soft); color: var(--muted);
  border-radius: 999px; padding: 2px 10px; font-size: 13px; margin-bottom: 4px;
}
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.chip.workshop .dot { background: var(--unpaid); }
.chip.geburtstag .dot { background: var(--sage); }
.chip.plan { background: transparent; border: 1px dashed var(--line); }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--soft); border-radius: 999px; padding: 2px 9px;
  font-size: 13px; color: var(--muted); white-space: nowrap;
}
.badge .dot { width: 8px; height: 8px; border-radius: 50%; }
.badge.paid .dot { background: var(--paid); }
.badge.unpaid .dot { background: var(--unpaid); }
.badge.probe .dot { background: var(--info); }
.badge.vertrag .dot { background: var(--sage); }

/* ---------- дети ---------- */

.kid { display: flex; align-items: center; gap: 10px; padding: 12px; border-top: 1px solid var(--line); }
.kid:first-child { border-top: 0; }
.kid .who { flex: 1; min-width: 0; }
.kid .who .nm { font-weight: 600; }
.kid .who .st { margin-top: 3px; display: flex; gap: 6px; flex-wrap: wrap; }
.kid .who .nm a { color: inherit; }

.check {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 9px;
  border: 2px solid var(--line); background: var(--card);
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; color: transparent; cursor: pointer;
}
.check.on { background: var(--sage); border-color: var(--sage); color: #fff; }
.check.busy { opacity: .5; }

/* ---------- элементы управления ---------- */

button, .btn {
  font: inherit; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); padding: 10px 14px; cursor: pointer;
}
button.primary, .btn.primary { background: var(--burgundy); border-color: var(--burgundy); color: #fff; }
button:active { opacity: .85; }
button[disabled] { opacity: .5; cursor: default; }

input[type=text], input[type=password], textarea, select {
  font: inherit; width: 100%; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text);
}
textarea { min-height: 96px; resize: vertical; }
label { display: block; font-size: 14px; color: var(--muted); margin: 10px 0 4px; }

.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.pad { padding: 12px; }
.center { text-align: center; }

.err { background: #F7E4E4; border: 1px solid #E0B8B8; color: #7A2222; padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; }
.ok { background: #E7F1E7; border: 1px solid #BBD7BB; color: #2A5A2A; padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; }

/* ---------- календарь ---------- */

.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cal-head .title { flex: 1; font-family: Fraunces, Georgia, serif; font-size: 19px; font-weight: 600; text-align: center; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .wd { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 0; }
.cal .day {
  aspect-ratio: 1; border: 1px solid var(--line); border-radius: 10px; background: var(--card);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 15px; cursor: pointer;
}
.cal .day.out { opacity: .3; }
.cal .day.ferien { background: var(--soft); color: var(--muted); }
.cal .day.sel { border-color: var(--burgundy); border-width: 2px; }
.cal .day.today { font-weight: 700; color: var(--burgundy); }
.cal .dots { display: flex; gap: 3px; height: 6px; }
.cal .dots i { width: 6px; height: 6px; border-radius: 50%; display: block; }
.cal .dots i.n { background: var(--muted); }
.cal .dots i.workshop { background: var(--unpaid); }
.cal .dots i.geburtstag { background: var(--sage); }
.cal-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cal-legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* ---------- материал урока ---------- */

.material img { width: 100%; display: block; border-radius: 10px; border: 1px solid var(--line); }
.zoom {
  position: fixed; inset: 0; background: rgba(20,14,17,.94); z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 12px;
  overflow: auto; touch-action: pinch-zoom;
}
.zoom img { max-width: 100%; max-height: 100%; object-fit: contain; }
.zoom .close { position: fixed; top: calc(12px + env(safe-area-inset-top)); right: 12px; }

/* ---------- вход ---------- */

.login { max-width: 360px; margin: 48px auto 0; padding: 0 20px 40px; }
.login .brand { text-align: center; margin-bottom: 22px; }
.login .brand .name { font-family: Fraunces, Georgia, serif; font-size: 24px; color: var(--burgundy); }
.login .brand .sub { color: var(--muted); font-size: 15px; }

/* ---------- страница владельца ---------- */

.acc { padding: 12px; border-top: 1px solid var(--line); }
.acc:first-child { border-top: 0; }
.acc .nm { font-weight: 600; }
.pw-box { background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 16px; text-align: center; margin: 12px 0; }
.pw-box .pw { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 24px; letter-spacing: .5px; margin: 8px 0 12px; word-break: break-all; }

.hint { color: var(--muted); font-size: 14px; margin-top: 6px; }
.sep { height: 1px; background: var(--line); margin: 16px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips label { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--text); font-size: 14px; }
.chips input { width: auto; }
