/* ============================================================
   Nourkids admin.css  (login, dashboard, plans, bookings)
   ============================================================ */

/* ---------- Login ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(60% 50% at 85% 10%, var(--accent-soft) 0%, transparent 60%),
    radial-gradient(50% 40% at 10% 90%, var(--grape-soft) 0%, transparent 60%),
    var(--bg);
}
.login-card {
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border-radius: var(--r-l);
  box-shadow: var(--shadow-l);
  padding: 40px 36px 32px;
}
.login-card .brand { justify-content: center; margin-block-end: 22px; }
.login-card h1 { font-size: 32px; text-align: center; margin-block-end: 6px; }
.login-card .login-sub { text-align: center; color: var(--muted); font-size: 16px; margin-block-end: 26px; }
.login-hint {
  background: var(--amber-soft);
  color: #7A5400;
  border-radius: var(--r-s);
  font-size: 14.5px;
  padding: 11px 15px;
  text-align: center;
  margin-block-start: 18px;
}
.login-lang { text-align: center; margin-block-start: 18px; }

.login-card.shake { animation: shake 0.4s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

/* ---------- Admin shell ---------- */
.admin {
  display: grid;
  grid-template-columns: 264px 1fr;
  min-height: 100vh;
  background: var(--bg);
}

.admin-side {
  background: var(--ink);
  color: var(--on-ink);
  padding: 26px 18px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  position: sticky;
  inset-block-start: 0;
  height: 100vh;
}
.admin-side .brand { color: #FFFFFF; padding-inline: 10px; }
.admin-side .brand img { width: 42px; height: 42px; object-fit: contain; border-radius: 50%; }
.admin-side .brand__name { font-size: 21px; }
.admin-side .brand__role {
  display: block;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--on-ink-dim);
}

.admin-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.admin-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--r-s);
  color: var(--on-ink);
  font-size: 16px;
  font-weight: 700;
  transition: background 0.15s ease, color 0.15s ease;
}
.admin-nav a svg { width: 18px; height: 18px; flex: none; }
.admin-nav a:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.admin-nav a.is-active { background: var(--accent-strong); color: #fff; }
.admin-nav .nav-sep { flex: 1; }

.admin-main { padding: 30px 38px 60px; min-width: 0; }

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-block-end: 28px;
  flex-wrap: wrap;
}
.admin-topbar h1 { font-size: clamp(28px, 3.6vw, 40px); margin: 0; }
.admin-topbar .sub { color: var(--muted); font-size: 16px; margin: 2px 0 0; }
.topbar-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------- Stat cards ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 20px;
  margin-block-end: 30px;
}
.stat {
  background: var(--surface);
  border-radius: var(--r-m);
  box-shadow: var(--shadow-s);
  padding: 20px 22px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.stat > div { min-width: 0; }
.stat__icon {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stat__icon svg { width: 22px; height: 22px; }
.stat__icon--revenue { background: var(--success-soft); color: var(--success-ink); }
.stat__icon--bookings { background: var(--info-soft); color: #6B2FB0; }
.stat__icon--products { background: var(--accent-soft); color: var(--accent-ink); }
.stat__icon--low { background: var(--danger-soft); color: var(--danger); }
.stat__label { font-size: 14.5px; font-weight: 800; color: var(--muted); margin: 0; }
.stat__value {
  font-family: var(--font-display);
  font-size: clamp(24px, 6vw, 32px);
  font-weight: 800;
  margin: 2px 0 0;
  font-variant-numeric: tabular-nums;
}
.stat__sub { font-size: 14px; color: var(--muted); margin: 2px 0 0; }

/* ---------- Cards / tables ---------- */
.admin-card {
  background: var(--surface);
  border-radius: var(--r-m);
  box-shadow: var(--shadow-s);
  margin-block-end: 26px;
  overflow: hidden;
}
.admin-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 0;
  flex-wrap: wrap;
}
.admin-card__head h2 { font-size: 23px; margin: 0; }
.admin-card__head a { font-size: 15.5px; font-weight: 700; }

.table-wrap { overflow-x: auto; padding: 8px 8px 12px; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
  min-width: 760px;
}
table.data th, table.data td {
  text-align: start;
  padding: 14px 16px;
  line-height: 1.4;
  border-block-end: 1px solid var(--line);
  vertical-align: middle;
}
table.data th {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border-block-end-color: var(--line-strong);
  white-space: nowrap;
}
table.data tr:last-child td { border-block-end: 0; }
table.data tbody tr { transition: background 0.12s ease; }
table.data tbody tr:hover { background: var(--bg); }
table.data .price { white-space: nowrap; }

.prod-cell { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.prod-cell__art {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  overflow: hidden;
  flex: none;
}
.prod-cell__art svg { width: 100%; height: 100%; }
.prod-cell__name { font-weight: 700; margin: 0; }
.prod-cell__sub { font-size: 14px; color: var(--muted); margin: 0; }

.seats-pill {
  display: inline-block;
  min-width: 46px;
  text-align: center;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  font-size: 14.5px;
  font-weight: 800;
  background: var(--success-soft);
  color: var(--success-ink);
  font-variant-numeric: tabular-nums;
}
.seats-pill.low { background: var(--danger-soft); color: var(--danger); }
.seats-pill.out { background: #E7EEF5; color: var(--muted); }
/* Unlimited capacity (a monthly membership can't sell out) */
.seats-pill.inf { background: var(--info-soft); color: #6B2FB0; }

/* Record-type pill in the items table */
.type-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 800;
}
.type-pill--plan { background: var(--accent-soft); color: var(--accent-ink); }
.type-pill--offer { background: var(--amber-soft); color: #8A5E00; }
.type-pill--workshop { background: var(--grape-soft); color: #6B2FB0; }

/* Schedule column: offer date range / workshop day + time */
.sched-cell {
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink-soft);
  white-space: nowrap;
}
.sched-cell .badge { margin-block-start: 4px; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r-s);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  transition: all 0.14s ease;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.icon-btn--danger:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }
.icon-btn svg { width: 16px; height: 16px; }
.row-actions { display: flex; gap: 8px; }

select.status-select {
  padding: 8px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-soft);
}

.admin-empty {
  text-align: center;
  color: var(--muted);
  padding: 44px 24px;
  font-size: 17px;
}

/* Type filter above the items table. .chip itself is styled in base.css;
   admin pages don't load store.css, so the flex wrapper is declared here. */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips .chip { padding: 8px 16px; font-size: 15px; }

.admin-search { position: relative; }
.admin-search input {
  padding: 10px 16px;
  padding-inline-start: 38px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--surface);
  font: inherit;
  font-size: 16px;
  width: 250px;
  max-width: 100%;
}
.admin-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.admin-search svg {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: 13px;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--muted);
  pointer-events: none;
}

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(53, 63, 112, 0.45);
  backdrop-filter: blur(4px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
  z-index: 400;
}
.modal.is-open { display: flex; }
.modal__box {
  width: 100%;
  max-width: 720px;
  background: var(--surface);
  border-radius: var(--r-l);
  box-shadow: var(--shadow-l);
  padding: 30px 32px;
  animation: modalIn 0.25s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-block-end: 20px;
}
.modal__head h2 { font-size: 26px; margin: 0; }
.modal__close {
  border: 0;
  background: var(--surface-warm);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 20px;
  color: var(--ink-soft);
  line-height: 1;
}
.modal__close:hover { background: var(--accent-soft); color: var(--accent-ink); }

.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.modal-grid .field--full { grid-column: 1 / -1; }

/* One <fieldset> per record type; the type <select> shows exactly one of them.
   .fs / .fs__legend / .check-field now live in base.css so the public
   registration form can use them too. */

.art-picker { display: grid; grid-template-columns: 1fr 190px; gap: 22px; align-items: start; }
.art-preview {
  border-radius: var(--r-m);
  overflow: hidden;
  border: 1px solid var(--line);
}
.art-preview svg { width: 100%; height: auto; }

.swatches { display: flex; flex-wrap: wrap; gap: 9px; }
.swatch {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.6);
  transition: transform 0.12s ease;
}
.swatch:hover { transform: scale(1.1); }
.swatch.is-active { border-color: var(--ink); }


.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-block-start: 8px;
  flex-wrap: wrap;
}

/* Order detail rows */
.od-row { display: flex; gap: 10px; font-size: 16px; padding-block: 6px; }
.od-row b { min-width: 132px; color: var(--muted); font-weight: 700; }
.od-items { margin-block-start: 14px; border-block-start: 1px solid var(--line); padding-block-start: 8px; }

/* Mobile admin */
.admin-mobilebar { display: none; }

@media (max-width: 920px) {
  .admin { grid-template-columns: 1fr; }
  .admin-side {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    width: 260px;
    z-index: 500;
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    height: 100vh;
    height: 100dvh;
  }
  [dir="rtl"] .admin-side { transform: translateX(105%); }
  .admin-side.is-open { transform: translateX(0); }
  .admin-mobilebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: var(--ink);
    color: #FFFFFF;
    position: sticky;
    inset-block-start: 0;
    z-index: 90;
  }
  .admin-mobilebar .brand { color: #FFFFFF; }
  .admin-mobilebar .brand img { width: 30px; height: 30px; border-radius: 50%; }
  .admin-mobilebar .brand__name { font-size: 19px; }
  .admin-mobilebar button {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #FFFFFF;
    border-radius: var(--r-s);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .admin-mobilebar button svg { width: 18px; height: 18px; }
  .admin-scrim {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 450;
  }
  .admin-scrim.is-visible { opacity: 1; pointer-events: auto; }
  .admin-main { padding: 22px 20px 50px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .modal-grid { grid-template-columns: 1fr; }
  .art-picker { grid-template-columns: 1fr; }
  .art-preview { max-width: 240px; }
}

@media (max-width: 520px) {
  .stats { grid-template-columns: 1fr; }
  .modal__box { padding: 24px 20px; }
}
