/* ==========================================================================
   Creation Center admin console
   The screens the team actually uses. In WordPress these become admin pages
   registered by the theme, rendered inside wp-admin's own chrome.
   ========================================================================== */

body.admin { background: var(--sand); }

.adm {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
}

/* ---- sidebar --------------------------------------------------------- */

.adm-side {
  background: var(--plum-deep); color: #B7A8C4;
  padding: 1.15rem 0; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.adm-side .brand { padding: 0 1.25rem 1.25rem; gap: .6rem; }
.adm-side .brand-text { color: #fff; font-size: 1.1rem; }
.adm-side .brand-text small { color: var(--gold-2); }
.adm-nav { padding: 0 .7rem; }
.adm-nav .grp {
  font-size: .64rem; letter-spacing: .15em; text-transform: uppercase;
  color: #7A6A88; font-weight: 700; padding: 1.1rem .6rem .4rem;
}
.adm-nav a {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem .6rem; border-radius: var(--r-sm);
  color: #C4B6D0; text-decoration: none; font-size: .89rem; font-weight: 500;
}
.adm-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.adm-nav a.on { background: var(--gold); color: #3A2705; font-weight: 650; }
.adm-nav a .ic { width: 18px; text-align: center; opacity: .85; font-size: .95rem; }
.adm-nav a .badge {
  margin-left: auto; background: rgba(255,255,255,.14); color: #fff;
  border-radius: var(--r-pill); font-size: .68rem; font-weight: 700; padding: .1rem .42rem;
}
.adm-nav a.on .badge { background: rgba(0,0,0,.16); color: #3A2705; }
.adm-side .foot { padding: 1.25rem; margin-top: 1rem; border-top: 1px solid rgba(255,255,255,.1); font-size: .78rem; }
.adm-side .foot a { color: var(--gold-2); }

/* ---- main ------------------------------------------------------------ */

.adm-main { min-width: 0; }
.adm-bar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(251,247,241,.94); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 1rem 1.75rem;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.adm-bar h1 { margin: 0; font-family: var(--sans); font-size: 1.2rem; font-weight: 650; }
.adm-bar .sub { font-size: .84rem; color: var(--ink-3); }
.adm-bar .right { margin-left: auto; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.adm-body { padding: 1.75rem; }

.adm-note {
  background: var(--plum-soft); border: 1px solid #E2D5EC; color: var(--plum);
  border-radius: var(--r); padding: .85rem 1.15rem; font-size: .87rem; margin-bottom: 1.5rem;
}
.adm-note b { font-weight: 650; }

/* ---- stat tiles ------------------------------------------------------ */

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1.75rem; }
.tile {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r);
  padding: 1.1rem 1.25rem;
}
.tile .k { font-size: .74rem; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); font-weight: 650; }
.tile .v { font-family: var(--serif); font-size: 2.1rem; font-weight: 600; color: var(--ink); line-height: 1.1; margin: .3rem 0 .1rem; }
.tile .d { font-size: .8rem; color: var(--ink-3); }
.tile .d b { color: var(--ok); font-weight: 650; }
.tile .d b.warn { color: var(--danger); }

/* ---- panels ---------------------------------------------------------- */

.panel {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r);
  margin-bottom: 1.5rem; overflow: hidden;
}
.panel-head {
  padding: .95rem 1.25rem; border-bottom: 1px solid var(--line-2);
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
}
.panel-head h3 { margin: 0; font-family: var(--sans); font-size: .98rem; font-weight: 650; }
.panel-head .right { margin-left: auto; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.panel-body { padding: 1.25rem; }
.panel-body.flush { padding: 0; }
.panel .table-wrap { border: 0; border-radius: 0; }

.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }
.cols-3 { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; align-items: start; }
/* Grid children default to min-width:auto. Without this, one 640px-min-width table
   inside a panel widens the whole track and the entire console scrolls sideways. */
.cols > *, .cols-3 > *, .tiles > * { min-width: 0; }
.panel, .panel-body, .panel-head { min-width: 0; }
.adm-side { min-width: 0; }

/* ---- availability grid ----------------------------------------------- */

.av-grid { display: grid; grid-template-columns: 64px repeat(7, 1fr); gap: 2px; user-select: none; }
.av-grid .hd { font-size: .72rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); text-align: center; padding: .4rem 0; }
.av-grid .hr-lbl { font-size: .72rem; color: var(--ink-3); text-align: right; padding-right: .5rem; font-variant-numeric: tabular-nums; line-height: 26px; }
.av-cell {
  height: 26px; border-radius: 3px; background: #EAE4DA; cursor: pointer;
  border: 0; transition: background .1s;
}
.av-cell:hover { outline: 2px solid var(--plum); outline-offset: -2px; }
.av-cell.on { background: #BFE0CD; }

/* legend, mirrors the one on the public calendar */
.cal-legend { display: flex; flex-wrap: wrap; gap: 1.1rem; font-size: .78rem; color: var(--ink-3); }
.cal-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: .4rem; vertical-align: -1px; }

/* ---- day schedule ---------------------------------------------------- */

.sched { display: flex; flex-direction: column; gap: .5rem; }
.sched-item {
  display: grid; grid-template-columns: 70px 4px 1fr auto; gap: .9rem; align-items: center;
  padding: .7rem .9rem; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff;
}
.sched-item .t { font-size: .84rem; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.sched-item .stripe { align-self: stretch; border-radius: 2px; background: var(--plum); }
.sched-item.free { border-style: dashed; background: var(--sand); }
.sched-item.free .stripe { background: var(--line); }
.sched-item .who { font-size: .9rem; font-weight: 600; color: var(--ink); }
.sched-item .what { font-size: .8rem; color: var(--ink-3); }

/* ---- access selector ------------------------------------------------- */

.acc-sel {
  font-size: .8rem; font-weight: 600; padding: .3rem .55rem; border-radius: var(--r-pill);
  border: 1.5px solid transparent; cursor: pointer; appearance: none;
  background-image: none; padding-right: .55rem; width: auto;
}
.acc-public       { background: var(--ok-soft);    color: var(--ok); }
.acc-signed-in    { background: var(--plum-soft);  color: var(--plum); }
.acc-member       { background: var(--gold-soft);  color: #8A6410; }
.acc-practitioner { background: var(--sage-soft);  color: var(--sage); }
.acc-attendee     { background: #EDE7F6;           color: #5B3E86; }
.acc-hidden       { background: var(--danger-soft);color: var(--danger); }

/* ---- misc ------------------------------------------------------------ */

.chip-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.searchbar { display: flex; gap: .5rem; align-items: center; }
.searchbar input { width: 240px; }
.mini { font-size: .8rem; color: var(--ink-3); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: .72rem; font-weight: 700; color: #fff;
  background: var(--plum);
}
.avatar.g2 { background: var(--sage); }
.avatar.g3 { background: var(--gold); color: #3A2705; }
.name-cell { display: flex; align-items: center; gap: .65rem; }

.toggle { position: relative; width: 40px; height: 22px; flex: none; }
.toggle input { opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.toggle span { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: background .15s; pointer-events: none; }
.toggle span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.toggle input:checked + span { background: var(--ok); }
.toggle input:checked + span::after { transform: translateX(18px); }

@media (max-width: 1080px) {
  .adm { grid-template-columns: 1fr; }
  .adm-side { position: static; height: auto; }
  .adm-side .adm-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
  .adm-side .grp { grid-column: 1 / -1; }
  .cols, .cols-3 { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .adm-body { padding: 1rem; }
  .adm-bar { padding: .85rem 1rem; }
  .av-grid { grid-template-columns: 44px repeat(7, 1fr); }
}
