/* Kindergarten admin panel. Builds on styles.css tokens and components. */

/* 29.10.2026: the same colours and type as the app Tarik chose (themes.css "ljubicasta"),
   so the panel and the parents' app read as one product. */
:root {
  --wall: #F3F0FA; --wall-deep: #E2D8F3; --bg: #F3F0FA;
  --surface: #FFFFFF; --sunk: #EFE8F8; --line: #E2D8F3;
  --ink: #120A20; --muted: #5C5470; --faint: #6B6480;
  --primary: #5C34A3; --primary-ink: #FFFFFF; --primary-soft: #EFE8F8;
  --accent: #B4500F; --accent-fill: #FF8A3D; --accent-soft: #FFEEE2;
  --font-display: 'Figtree', system-ui, sans-serif;
}
.display, .title, .section-title { font-weight: 800; letter-spacing: -0.4px; }

body.panel-body { background: var(--bg); }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .card { padding: 24px; }
.tabs2 { display: flex; gap: 4px; background: var(--sunk); border-radius: 12px; padding: 4px; margin: 20px 0 16px; }
.tabs2 button { flex: 1; min-height: 38px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--muted); }
.tabs2 button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(30, 43, 40, 0.08); }

.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form .hint { font-size: 12px; font-weight: 400; color: var(--faint); }
select.field { appearance: auto; }
.code-input { text-transform: uppercase; letter-spacing: 3px; font-weight: 700; font-size: 18px; text-align: center; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
/* Famly's violet, as the app's top bar: white text, the open page in white */
.side { background: var(--primary); color: #fff; padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.side-brand .logo { background: #fff; color: #F4A340; }
.side-brand .head { color: #fff; }
.side-brand .small.faint, .side-foot .small.muted { color: rgba(255, 255, 255, 0.72); }
.nav { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; font-size: 14px; font-weight: 600; color: rgba(255, 255, 255, 0.84); width: 100%; text-align: left; }
.nav:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.nav.on { background: #fff; color: var(--primary); }
.nav .count { margin-left: auto; background: #FF8A3D; color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; }
.side-foot { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, 0.2); padding-top: 12px; }

.main { padding: 28px 36px 60px; max-width: 1080px; width: 100%; min-width: 0; } /* min-width: let wide tables scroll inside their card */
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .grow p { margin: 4px 0 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions .btn { width: auto; }

/* ---------- content ---------- */
.stats4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
/* each number with an outlined icon, as the app's day cards (Procare) */
.stat-card { --k: var(--primary); --k-soft: var(--primary-soft); display: flex; flex-direction: column; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; box-shadow: 0 4px 14px rgba(42, 39, 51, 0.05); }
.stat-ico { width: 40px; height: 40px; margin-bottom: 12px; border-radius: 12px; border: 1.5px solid var(--k-soft); color: var(--k); display: flex; align-items: center; justify-content: center; font-style: normal; }
.stat-card b { display: block; font-family: var(--font-display); font-size: 28px; line-height: 32px; font-weight: 800; }
.stat-card span { font-size: 13px; color: var(--muted); }
.stat-card.t-ok { --k: var(--ok); --k-soft: var(--ok-soft); }
.stat-card.t-accent { --k: var(--accent); --k-soft: var(--accent-soft); }
.stat-card.t-muted { --k: var(--muted); --k-soft: var(--sunk); }
.stat-card.t-danger { --k: var(--danger); --k-soft: var(--danger-soft); }
.stat-card.t-meal { --k: var(--meal); --k-soft: var(--meal-soft); }

/* Pregled opens like the app: the kindergarten's photo with its name */
.ov-hero { position: relative; display: flex; align-items: flex-end; gap: 16px; min-height: 168px; margin-bottom: 24px; padding: 20px 22px; border-radius: 18px; overflow: hidden; color: #fff;
  background: linear-gradient(135deg, #5C34A3 0%, #7A55C2 100%); }
.ov-hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ov-hero:not(.plain)::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(18, 10, 32, 0) 30%, rgba(18, 10, 32, 0.62) 100%); }
.ov-hero-txt, .ov-hero-act { position: relative; z-index: 1; }
.ov-hero-txt { flex: 1; min-width: 0; }
.ov-hero-txt .display { margin: 0; color: #fff; font-size: 30px; line-height: 34px; }
.ov-hero-txt p { margin: 4px 0 0; font-size: 15px; line-height: 21px; color: rgba(255, 255, 255, 0.9); }
.ov-hero-act { align-self: flex-start; }
.link-light { padding: 0; color: #fff; font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

.steps { display: flex; flex-direction: column; }
.step { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.step + .step { border-top: 1px solid var(--line); }
.step .num { width: 28px; height: 28px; border-radius: 50%; background: var(--sunk); color: var(--muted); font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.step.done .num { background: var(--ok); color: #fff; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.3px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; white-space: nowrap; }
.card.flush { padding: 0; overflow-x: auto; }
.card.flush .tbl { min-width: 520px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }

.icon-btn { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.icon-btn:hover { background: var(--sunk); color: var(--ink); }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }

.code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-weight: 700; letter-spacing: 1.5px; background: var(--sunk); padding: 3px 8px; border-radius: 8px; font-size: 13px; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 14px; }

.menu-grid { display: grid; grid-template-columns: 110px repeat(3, 1fr); gap: 8px; align-items: center; }
.menu-grid .hd { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; }
.menu-grid .day { font-weight: 600; font-size: 14px; }
.menu-grid .day small { display: block; color: var(--faint); font-weight: 400; }

.modal-bg { position: fixed; inset: 0; background: rgba(20, 24, 22, 0.45); display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px; z-index: 50; overflow-y: auto; }
.modal { background: var(--surface); border-radius: var(--r-lg); padding: 24px; width: 100%; max-width: 520px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2); }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 60; max-width: 90vw; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--danger); }

.loading { min-height: 100vh; display: flex; align-items: center; justify-content: center; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; padding: 10px; }
  .side-brand, .side-foot { display: none; }
  .nav { width: auto; }
  .main { padding: 20px 16px 60px; }
  .page-head { flex-direction: column; align-items: stretch; }
  .form .row2 { grid-template-columns: 1fr; }
  .menu-grid { grid-template-columns: 1fr; }
  .menu-grid .hd { display: none; }
}

/* ---------- today, people ---------- */
.link-card { text-align: left; cursor: pointer; }
.link-card:hover { border-color: var(--primary); }
.pill.owner { background: var(--primary-soft); color: var(--primary); }
.tbl select.field { min-height: 38px; padding: 6px 10px; font-size: 14px; max-width: 230px; }
.field.time { width: 118px; min-height: 38px; padding: 6px 10px; font-size: 14px; }

.page-head .tabs2 button { padding: 0 18px; min-height: 40px; }
.legend { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- attendance month ---------- */
.att-month .tbl { min-width: 0; font-size: 13px; }
.att-month .tbl th, .att-month .tbl td { padding: 8px 6px; }
.att-month .dcol { text-align: center; width: 26px; min-width: 26px; color: var(--muted); }
.att-month th.dcol.now { color: var(--primary); }
.att-month td.p { color: var(--ok); }
.att-month td.o { color: var(--danger); font-weight: 700; }
.att-month td.future { background: var(--bg); }
.att-month .sticky { position: sticky; left: 0; background: var(--surface); min-width: 150px; z-index: 1; }

/* ---------- messages ---------- */
.msgs-grid { display: grid; grid-template-columns: minmax(250px, 340px) 1fr; gap: 16px; align-items: start; }
.threads { max-height: 70vh; overflow-y: auto; }
.thread { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.thread:hover { background: var(--bg); }
.thread.on { background: var(--primary-soft); }
.unread-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent-fill); flex-shrink: 0; }
.convo { display: flex; flex-direction: column; min-height: 420px; }
.pchat { flex: 1; max-height: 52vh; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.pmsg { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.pmsg.mine { align-items: flex-end; }
.pmsg .bubble { max-width: 78%; white-space: pre-wrap; font-size: 15px; }
.pcompose { display: flex; gap: 10px; align-items: flex-end; padding: 12px; border-top: 1px solid var(--line); }
.pcompose .field { flex: 1; resize: vertical; }

/* ---------- photos ---------- */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.ppost { overflow: hidden; }
.pimg { display: block; position: relative; aspect-ratio: 4 / 3; background: var(--sunk); }
.pimg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pcount { position: absolute; right: 8px; bottom: 8px; background: rgba(20, 24, 22, 0.7); color: #fff; border-radius: 999px; font-size: 12px; padding: 2px 8px; display: inline-flex; gap: 4px; align-items: center; }

@media (max-width: 860px) {
  .msgs-grid { grid-template-columns: 1fr; }
  .threads { max-height: 38vh; }
}

/* ---------- znak picker ---------- */
.znak-pick { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; }
.znak-pick legend { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 8px; display: flex; flex-direction: column; gap: 2px; }
.form .znak-pick label { flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 14px; border: 2px solid transparent; cursor: pointer; font-size: 12px; color: var(--ink); font-weight: 600; }
.znak-pick label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.znak-pick label.taken { opacity: 0.45; }
.znak-pick input { position: absolute; opacity: 0; pointer-events: none; }
.znak-pick label:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent); }

/* Postavke: details on the left, the kindergarten's photo and ownership on the right */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.settings-grid > div > .section-head { margin-top: 0; }
.cover-card { display: flex; flex-direction: column; gap: 12px; }
.cover-preview { display: block; width: 100%; height: 180px; border-radius: 12px; object-fit: cover; background: var(--sunk); }
.cover-preview.plain { background: linear-gradient(135deg, #EFE8F8 0%, #DCD0F0 100%); }
@media (max-width: 1100px) { .settings-grid { grid-template-columns: 1fr; } }

/* the child's photo, where the parents added one, in place of the sign */
.kid-face { border-radius: 50%; object-fit: cover; flex-shrink: 0; display: block; }

/* the app icon on sign-in and in the side bar */
.app-icon { display: block; flex-shrink: 0; filter: drop-shadow(0 4px 10px rgba(30, 10, 60, 0.25)); }

/* Pregled (overview), option 5 of the mock-ups (30.10): the page uses the width, bigger numbers,
   two columns: groups and what waits on the office | today as it happens, calendar, menu. */
.main.wide { max-width: 1560px; }
.nav { font-size: 15px; }
.section-head .label { font-size: 14px; }
.stat-card b { font-size: 34px; line-height: 38px; }
.stat-card span { font-size: 15px; }
.ov-cols { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.ov-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.ov-group { padding: 18px 20px; }
.ov-gh { display: flex; align-items: flex-start; gap: 12px; }
.ov-frac { font-size: 15px; color: var(--muted); white-space: nowrap; }
.ov-frac b { font-family: var(--font-display); font-size: 28px; color: var(--ok); }
.ov-bar { height: 8px; border-radius: 99px; background: var(--sunk); margin: 12px 0 14px; overflow: hidden; }
.ov-bar i { display: block; height: 100%; background: var(--ok); border-radius: 99px; }
.ov-kids { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.ov-kids li { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.ov-kids b { font-weight: 600; min-width: 64px; }
.ov-st { font-size: 14px; color: var(--muted); }
.ov-st.present { color: var(--ok); } .ov-st.expected { color: var(--accent); } .ov-st.absent { color: var(--danger); }
.ov-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--muted); }
.ov-dot.present { background: var(--ok); } .ov-dot.expected { background: var(--accent); } .ov-dot.absent { background: var(--danger); }
.ov-todo ul, .ov-feed ul { list-style: none; margin: 0; padding: 0; }
.ov-todo li { display: flex; align-items: center; gap: 14px; padding: 12px 2px; border-bottom: 1px solid var(--line); font-size: 15px; }
.ov-todo li:last-child, .ov-feed li:last-child { border-bottom: 0; }
.ov-feed li { display: grid; grid-template-columns: 50px 32px 1fr; gap: 10px; align-items: start; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.ov-feed time { font-size: 14px; font-weight: 600; color: var(--muted); padding-top: 6px; }
.ov-feed b { display: block; font-size: 15px; }
.ov-fi { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.ov-fi.ok { background: var(--ok-soft); color: var(--ok); } .ov-fi.danger { background: var(--danger-soft); color: var(--danger); }
.ov-fi.accent { background: var(--accent-soft); color: var(--accent); } .ov-fi.primary { background: var(--primary-soft); color: var(--primary); }
.ov-fi.muted { background: var(--sunk); color: var(--muted); } .ov-fi.meal { background: var(--meal-soft); color: var(--meal); }
.ov-day { padding: 16px 18px; margin-bottom: 14px; }
.ov-dh { display: flex; align-items: center; gap: 8px; color: var(--primary); margin-bottom: 8px; }
.ov-dh b { color: var(--text, inherit); font-size: 16px; }
.ov-day p { margin: 6px 0 0; font-size: 15px; } .ov-day p .small { display: block; }
.ov-day dl { margin: 0; display: grid; grid-template-columns: 90px 1fr; gap: 6px 10px; font-size: 15px; }
.ov-day dt { color: var(--muted); } .ov-day dd { margin: 0; }
@media (max-width: 1100px) { .ov-cols { grid-template-columns: 1fr; } }

/* 861 to 1100 px wide (small laptops, tablets): less padding, so the tables (attendance with its time fields) fit without sideways scrolling */
@media (min-width: 861px) and (max-width: 1100px) {
  .main { padding-left: 24px; padding-right: 24px; }
  .tbl th, .tbl td { padding-left: 8px; padding-right: 8px; }
}

/* a long link or word in a message wraps inside the bubble */
.bubble { overflow-wrap: anywhere; }

/* a long link in a message preview wraps instead of widening the overview */
.ov-feed li > div { min-width: 0; overflow-wrap: anywhere; }
