/* Kids Star Preschool — admin panel styles */

:root {
  --cream: #FFF8EC; --paper: #FFFFFF; --bg: #F7F3EA;
  --ink: #3D3358; --ink-soft: #6B6287; --line: #EBE4D8;
  --sun: #FFC93C; --sun-deep: #E8A800; --sun-soft: #FFEDBB;
  --coral: #FF7A85; --coral-deep: #E85D69; --coral-soft: #FFDEE1;
  --sky: #5AB9F5; --sky-deep: #2E96DF; --sky-soft: #DCF1FF;
  --mint: #5ECCA2; --mint-deep: #3BAA81; --mint-soft: #DDF6EC;
  --grape: #9B8CF2; --grape-deep: #7A68E0; --grape-soft: #EAE5FF;
  --peach: #FFA45B; --peach-deep: #E9852F; --peach-soft: #FFE7D1;
  --font-display: "Fredoka", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, sans-serif;
  --shadow: 0 8px 24px rgba(61, 51, 88, .09);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
body { font-family: var(--font-body); background: var(--bg); color: var(--ink); line-height: 1.55; }
h1, h2, h3, h4 { font-family: var(--font-display); }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; }

.btn {
  display: inline-flex; align-items: center; gap: .4em; border: 0;
  font-family: var(--font-display); font-weight: 600; font-size: .95rem;
  padding: .6em 1.3em; border-radius: 999px; color: #fff;
  transition: transform .15s, filter .15s;
}
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn:active { transform: translateY(2px); }
.btn-sun { background: var(--sun); color: #5c4500; box-shadow: 0 4px 0 var(--sun-deep); }
.btn-coral { background: var(--coral); box-shadow: 0 4px 0 var(--coral-deep); }
.btn-mint { background: var(--mint); box-shadow: 0 4px 0 var(--mint-deep); }
.btn-sky { background: var(--sky); box-shadow: 0 4px 0 var(--sky-deep); }
.btn-ghost { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.btn-sm { font-size: .82rem; padding: .45em 1em; }
.btn-danger { background: #fff; color: var(--coral-deep); box-shadow: inset 0 0 0 2px var(--coral-soft); }
.btn-danger:hover { background: var(--coral-soft); }

.bob { animation: bob 3s ease-in-out infinite alternate; }
@keyframes bob { from { transform: translateY(0); } to { transform: translateY(-8px); } }
.mascot-eyes { animation: blink 4.5s infinite; transform-origin: center; transform-box: fill-box; }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.08); } }

/* ------------------------------- login ----------------------------------- */
.login-screen {
  min-height: 100vh; display: grid; place-items: center; padding: 1.5rem;
  background:
    radial-gradient(700px 400px at 85% 10%, var(--sky-soft), transparent 60%),
    radial-gradient(600px 380px at 10% 90%, var(--mint-soft), transparent 60%),
    var(--cream);
}
.login-card {
  background: #fff; border-radius: 28px; padding: 2.6rem 2.4rem;
  width: min(400px, 100%); text-align: center; box-shadow: var(--shadow);
  border: 2px dashed var(--grape); display: grid; gap: .9rem; justify-items: center;
}
.login-card h1 { font-size: 1.7rem; }
.login-card p { color: var(--ink-soft); font-weight: 600; font-size: .95rem; }
.login-card input {
  width: 100%; padding: .75em 1em; font-size: 1rem; font-weight: 700;
  border: 2.5px solid var(--sky-soft); border-radius: 14px; text-align: center;
}
.login-card input:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 4px var(--sky-soft); }
.login-error { background: var(--coral-soft); color: var(--coral-deep); font-weight: 800; font-size: .88rem; padding: .5em 1em; border-radius: 12px; }
.login-back { font-size: .85rem; font-weight: 700; color: var(--ink-soft); text-decoration: underline dotted; }

/* -------------------------------- layout --------------------------------- */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--ink); color: #EFEAFF; padding: 1.2rem .9rem;
  display: flex; flex-direction: column; gap: 1.2rem;
  position: sticky; top: 0; height: 100vh;
}
.side-brand { display: flex; gap: .6rem; align-items: center; color: #fff; text-decoration: none; padding: .3rem .5rem; }
.side-brand span { font-family: var(--font-display); font-weight: 600; line-height: 1.1; }
.side-brand small { font-weight: 400; color: #BDB3DC; font-size: .72rem; letter-spacing: .05em; }
.side-nav { display: grid; gap: .3rem; }
.side-nav button {
  display: flex; align-items: center; gap: .5em; width: 100%; text-align: left;
  background: none; border: 0; color: #CFC7EA; font-weight: 800; font-size: .95rem;
  padding: .65em .9em; border-radius: 14px; transition: all .15s;
}
.side-nav button:hover { background: rgba(255,255,255,.08); color: #fff; }
.side-nav button.active {
  background: linear-gradient(120deg, #FF6B9D, #8F6BFF); color: #fff;
  box-shadow: 0 6px 16px -6px rgba(232, 73, 127, .55);
}
.side-nav .pill {
  margin-left: auto; background: var(--coral); color: #fff; font-size: .72rem;
  padding: .1em .6em; border-radius: 999px;
}
.side-foot { margin-top: auto; display: grid; gap: .4rem; }
.side-foot a, .side-foot button {
  background: none; border: 0; color: #9d92c4; font-weight: 700; font-size: .88rem;
  text-decoration: none; text-align: left; padding: .4em .9em; border-radius: 10px;
}
.side-foot a:hover, .side-foot button:hover { background: rgba(255,255,255,.08); color: #fff; }

.main { padding: 2rem 2.2rem 4rem; max-width: 1060px; width: 100%; }
.view-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.view-head h1 { font-size: 1.6rem; }
.view-head .spacer { flex: 1; }
.view-sub { color: var(--ink-soft); font-weight: 600; margin: -1rem 0 1.4rem; font-size: .92rem; }

/* ------------------------------- dashboard ------------------------------- */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.6rem; }
.stat-card {
  background: #fff; border-radius: 20px; padding: 1.2rem 1.3rem; box-shadow: var(--shadow);
  border-top: 5px solid var(--sun);
}
.stat-card:nth-child(2) { border-top-color: var(--coral); }
.stat-card:nth-child(3) { border-top-color: var(--sky); }
.stat-card:nth-child(4) { border-top-color: var(--mint); }
.stat-card .num { font-family: var(--font-display); font-size: 2rem; font-weight: 700; }
.stat-card .label { color: var(--ink-soft); font-weight: 700; font-size: .88rem; }
.tips {
  background: var(--grape-soft); border-radius: 20px; padding: 1.3rem 1.5rem;
  border: 2px dashed var(--grape);
}
.tips h3 { margin-bottom: .5rem; }
.tips li { margin-left: 1.2em; color: var(--ink-soft); font-weight: 600; font-size: .93rem; }

/* --------------------------------- lists --------------------------------- */
.card { background: #fff; border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; }
.list-row {
  display: flex; align-items: center; gap: 1rem; padding: .9rem 1.2rem;
  border-bottom: 1px solid var(--line);
}
.list-row:last-child { border-bottom: 0; }
.list-row .emoji-chip {
  width: 46px; height: 46px; flex: none; display: grid; place-items: center;
  font-size: 1.4rem; border-radius: 14px; background: var(--sun-soft);
}
.list-row .grow { flex: 1; min-width: 0; }
.list-row h3 { font-size: 1.05rem; }
.list-row .meta { color: var(--ink-soft); font-size: .84rem; font-weight: 700; }
.list-row .desc { color: var(--ink-soft); font-size: .88rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46ch; }
.list-row .row-actions { display: flex; gap: .4rem; flex: none; }
.badge { font-size: .7rem; font-weight: 800; padding: .2em .7em; border-radius: 999px; }
.badge-standard { background: var(--sky-soft); color: var(--sky-deep); }
.badge-extra { background: var(--peach-soft); color: var(--peach-deep); }
.badge-off { background: #eee; color: #888; }
.group-title { font-family: var(--font-display); font-weight: 600; margin: 1.4rem 0 .7rem; color: var(--ink-soft); }

/* ------------------------------- enquiries ------------------------------- */
.filter-chips { display: flex; gap: .5rem; flex-wrap: wrap; }
.filter-chips button {
  background: #fff; border: 2px solid var(--line); border-radius: 999px;
  font-weight: 800; font-size: .85rem; padding: .35em 1em; color: var(--ink-soft);
}
.filter-chips button.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.inq-card { border-left: 6px solid var(--sky); margin-bottom: .9rem; padding: 1rem 1.2rem; }
.inq-card.status-new { border-left-color: var(--coral); }
.inq-card.status-contacted { border-left-color: var(--sun); }
.inq-card.status-closed { border-left-color: var(--mint); }
.inq-top { display: flex; align-items: baseline; gap: .8rem; flex-wrap: wrap; }
.inq-top h3 { font-size: 1.1rem; }
.inq-top .when { color: var(--ink-soft); font-size: .8rem; font-weight: 700; margin-left: auto; }
.inq-contact { display: flex; gap: 1.2rem; flex-wrap: wrap; font-weight: 700; font-size: .9rem; margin: .3rem 0; }
.inq-contact a { color: var(--sky-deep); }
.inq-msg { background: var(--bg); border-radius: 12px; padding: .6em .9em; font-size: .92rem; font-weight: 600; color: var(--ink-soft); margin: .5rem 0; }
.inq-actions { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.inq-actions select {
  font-weight: 800; font-size: .85rem; padding: .35em .7em; border-radius: 10px;
  border: 2px solid var(--line); background: #fff; color: var(--ink);
}
.inq-note { flex: 1; min-width: 200px; }
.inq-note input {
  width: 100%; font-size: .85rem; font-weight: 600; padding: .4em .8em;
  border: 2px solid var(--line); border-radius: 10px;
}
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--ink-soft); font-weight: 700; }
.empty-state .big { font-size: 2.6rem; display: block; margin-bottom: .5rem; }

/* -------------------------------- gallery -------------------------------- */
.admin-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1rem; }
.admin-photo { background: #fff; border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.admin-photo img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.admin-photo .photo-body { padding: .6rem .7rem; display: grid; gap: .45rem; }
.admin-photo input {
  font-size: .82rem; font-weight: 600; padding: .35em .6em;
  border: 2px solid var(--line); border-radius: 8px; width: 100%;
}
.admin-photo .photo-actions { display: flex; gap: .3rem; justify-content: space-between; }
.icon-btn {
  border: 0; background: var(--bg); border-radius: 8px; padding: .3em .55em;
  font-size: .85rem; font-weight: 800;
}
.icon-btn:hover { background: var(--sun-soft); }
.icon-btn.danger:hover { background: var(--coral-soft); }

/* --------------------------------- forms --------------------------------- */
.form-grid { display: grid; gap: .9rem; }
.form-grid label { display: grid; gap: .3rem; font-family: var(--font-display); font-weight: 600; font-size: .9rem; }
.form-grid input, .form-grid textarea, .form-grid select {
  font-family: var(--font-body); font-size: .95rem; font-weight: 600; width: 100%;
  padding: .6em .85em; border: 2.5px solid var(--sky-soft); border-radius: 12px; color: var(--ink);
}
.form-grid input:focus, .form-grid textarea:focus, .form-grid select:focus {
  outline: none; border-color: var(--sky); box-shadow: 0 0 0 3px var(--sky-soft);
}
.form-grid textarea { resize: vertical; }
.form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.check-line { display: flex !important; align-items: center; gap: .5rem; grid-auto-flow: column; justify-content: start; }
.check-line input { width: 20px; height: 20px; accent-color: var(--mint); }
.color-swatches { display: flex; gap: .5rem; flex-wrap: wrap; }
.color-swatches input { display: none; }
.color-swatches .swatch {
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  border: 3px solid transparent; transition: transform .15s;
}
.color-swatches input:checked + .swatch { border-color: var(--ink); transform: scale(1.15); }
.sw-sun { background: var(--sun); } .sw-coral { background: var(--coral); } .sw-sky { background: var(--sky); }
.sw-mint { background: var(--mint); } .sw-grape { background: var(--grape); } .sw-peach { background: var(--peach); }

.img-picker { display: flex; align-items: center; gap: .8rem; }
.img-picker .thumb {
  width: 74px; height: 74px; border-radius: 12px; background: var(--bg);
  display: grid; place-items: center; overflow: hidden; font-size: 1.5rem; flex: none;
  border: 2px dashed var(--line);
}
.img-picker .thumb img { width: 100%; height: 100%; object-fit: cover; }
.img-picker .img-btns { display: grid; gap: .35rem; }

.settings-group { background: #fff; border-radius: 20px; box-shadow: var(--shadow); padding: 1.4rem 1.5rem; margin-bottom: 1.2rem; }
.settings-group h3 { margin-bottom: .9rem; font-size: 1.1rem; color: var(--grape-deep); }
.save-bar { position: sticky; bottom: 1rem; display: flex; justify-content: flex-end; margin-top: 1rem; }
.save-bar .btn { box-shadow: 0 4px 0 var(--mint-deep), 0 10px 30px rgba(61,51,88,.25); }

/* --------------------------------- modal --------------------------------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(31, 25, 48, .55); z-index: 80;
  display: grid; place-items: center; padding: 3vh 4vw;
}
.modal {
  background: #fff; border-radius: 22px; width: min(560px, 100%);
  max-height: 92vh; overflow: auto; box-shadow: 0 30px 80px rgba(0,0,0,.3);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 1.4rem .6rem;
}
.modal-close { background: var(--bg); border: 0; width: 36px; height: 36px; border-radius: 50%; font-weight: 800; }
.modal-close:hover { background: var(--coral-soft); color: var(--coral-deep); }
.modal-body { padding: .6rem 1.4rem 1.5rem; }
.modal-foot { display: flex; gap: .6rem; justify-content: flex-end; margin-top: 1.1rem; }

/* --------------------------------- toast --------------------------------- */
.toast {
  position: fixed; bottom: 1.4rem; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-weight: 800; font-size: .92rem;
  padding: .7em 1.5em; border-radius: 999px; z-index: 99;
  box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: toastIn .25s ease;
}
.toast.error { background: var(--coral-deep); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } }

/* ------------------------------- responsive ------------------------------ */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: static; height: auto; flex-direction: row; align-items: center;
    flex-wrap: wrap; gap: .5rem; padding: .7rem;
  }
  .side-brand { width: 100%; }
  .side-nav { display: flex; flex-wrap: wrap; gap: .3rem; }
  .side-nav button { width: auto; font-size: .85rem; padding: .5em .8em; }
  .side-foot { margin: 0; display: flex; }
  .main { padding: 1.4rem 1rem 3rem; }
  .form-2col { grid-template-columns: 1fr; }
}
