/* ===== Wizzard of Pawz — Manager Portal ===== */
:root {
  --ink: #1e3328;
  --ink-soft: #4f665a;
  --ink-muted: #7a8c81;
  --emerald: #1d7a4f;
  --emerald-deep: #14573a;
  --emerald-dark: #0d3b27;
  --mint: #e7f4ec;
  --gold: #f2b32c;
  --gold-deep: #c98a12;
  --ruby: #b3252e;
  --cream: #fdfaf0;
  --white: #ffffff;
  --demo: #7c3aed;
  --demo-bg: #f3e8ff;
  --demo-border: #c4b5fd;
  /* categorical chart palette — validated (order fixed, never cycled) */
  --cat-1: #1d7a4f;
  --cat-2: #c98a12;
  --cat-3: #b3252e;
  --cat-4: #2b6cb0;
  --radius: 16px;
  --shadow: 0 8px 24px rgba(13, 59, 39, 0.10);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Nunito', system-ui, sans-serif;
  color: var(--ink); background: var(--cream);
  line-height: 1.55; font-size: 16px;
}
h1, h2 { font-family: 'Fraunces', Georgia, serif; color: var(--ink); }
h1 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); }
h2 { font-size: 1.15rem; margin-bottom: 4px; }
a { color: var(--emerald); }

.admin-container { width: min(1060px, 94%); margin: 0 auto; }

/* Demo banner + notes (purple = notes for the owner) */
.demo-banner {
  background: var(--demo); color: #fff; text-align: center;
  padding: 9px 5%; font-size: 0.86rem; line-height: 1.45;
}
.demo-note {
  background: var(--demo-bg); border: 2px dashed var(--demo-border);
  border-radius: 14px; padding: 16px 20px; margin: 26px 0 40px;
  color: #4c1d95; font-size: 0.94rem;
}
.demo-note strong { color: var(--demo); }

/* ===== Login page ===== */
.login-wrap { max-width: 920px; margin: 0 auto; padding: 48px 5% 60px; }
.login-card {
  background: var(--white); border-radius: 20px; box-shadow: var(--shadow);
  padding: 44px 46px; border-top: 6px solid var(--gold);
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 44px; align-items: center;
}
.login-feats { list-style: none; margin-top: 4px; }
.login-feats li {
  position: relative; padding: 7px 0 7px 30px; color: var(--ink-soft);
  font-weight: 700; font-size: 0.93rem;
}
.login-feats li::before {
  content: ''; position: absolute; left: 0; top: 12px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--mint);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2314573a' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-size: 11px; background-position: center; background-repeat: no-repeat;
}
.login-form-col {
  background: var(--cream); border: 1px solid rgba(13, 59, 39, 0.08);
  border-radius: 16px; padding: 28px 26px;
}
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.login-brand .login-paw svg { width: 30px; height: 30px; color: var(--emerald); display: block; }
.login-brand strong { font-family: 'Fraunces', serif; display: block; line-height: 1.1; }
.login-brand small { color: var(--ink-soft); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.7rem; }
.login-card h1 { font-size: 1.45rem; margin-bottom: 8px; }
.login-card h1 em { color: var(--emerald); }
.login-sub { color: var(--ink-soft); font-size: 0.94rem; margin-bottom: 22px; }
.login-card label { display: block; font-weight: 700; font-size: 0.86rem; margin-bottom: 14px; }
.login-card input {
  width: 100%; margin-top: 5px; padding: 12px 14px; font-family: inherit; font-size: 1rem;
  border: 1.5px solid rgba(13, 59, 39, 0.18); border-radius: 10px; background: var(--white);
}
.login-card input:focus { outline: 2px solid var(--emerald); border-color: transparent; }
.login-hint { text-align: center; color: var(--ink-muted); font-size: 0.8rem; margin-top: 12px; }
.back-link { text-align: center; margin-top: 4px; font-weight: 700; }

.btn {
  display: inline-block; font-weight: 800; border: 0; cursor: pointer;
  border-radius: 999px; padding: 12px 22px; font-size: 0.95rem; font-family: inherit;
  transition: transform 0.15s, background 0.15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--emerald); color: #fff; }
.btn-primary:hover { background: var(--emerald-deep); }
.btn-block { width: 100%; }

/* ===== Admin chrome ===== */
.icon { width: 18px; height: 18px; flex-shrink: 0; }
.admin-topbar { background: var(--emerald-dark); color: #d9e8df; padding: 15px 0; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.admin-brand { display: flex; align-items: center; gap: 10px; }
.admin-brand .icon { width: 22px; height: 22px; color: var(--gold); }
.admin-brand strong { font-family: 'Fraunces', serif; color: #fff; font-size: 1.05rem; }
.admin-brand span {
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--gold);
}
.btn-logout {
  display: inline-flex; align-items: center; gap: 7px;
  background: transparent; border: 1.5px solid rgba(255,255,255,0.4); color: #fff;
  border-radius: 8px; padding: 7px 14px; font-family: inherit; font-weight: 700;
  font-size: 0.82rem; cursor: pointer;
}
.btn-logout .icon { width: 15px; height: 15px; }
.btn-logout:hover { background: rgba(255,255,255,0.12); }
.admin-tabs-bar {
  background: var(--white); border-bottom: 1px solid rgba(13,59,39,0.12);
  box-shadow: 0 1px 3px rgba(13,59,39,0.05);
}
.admin-nav { display: flex; gap: 2px; overflow-x: auto; }
.tab {
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none; color: var(--ink-soft); font-weight: 700; font-size: 0.9rem;
  padding: 14px 18px 11px; border-bottom: 3px solid transparent; white-space: nowrap;
}
.tab .icon { width: 17px; height: 17px; }
.tab.active { color: var(--emerald-deep); border-bottom-color: var(--emerald); }
.tab:not(.active):hover { color: var(--ink); background: var(--cream); }

.page-head {
  margin: 30px 0 18px; display: flex; justify-content: space-between;
  align-items: flex-end; gap: 16px; flex-wrap: wrap;
}
.page-head.mt-lg { margin-top: 48px; }
.page-sub { color: var(--ink-soft); font-weight: 600; font-size: 0.92rem; }
.page-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Topbar user chip */
.topbar-right { display: flex; align-items: center; gap: 16px; }
.user-chip { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 0.85rem; color: #d9e8df; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--gold); color: var(--emerald-dark);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.72rem;
}

/* Small action buttons + select chip */
.btn-primary-sm, .btn-ghost-sm, .select-chip {
  font-family: inherit; font-weight: 800; font-size: 0.84rem; cursor: pointer;
  border-radius: 8px; padding: 9px 14px;
}
.btn-primary-sm { background: var(--emerald); color: #fff; border: 0; }
.btn-primary-sm:hover { background: var(--emerald-deep); }
.btn-ghost-sm { background: var(--white); color: var(--ink); border: 1.5px solid rgba(13,59,39,0.2); }
.btn-ghost-sm:hover { background: var(--cream); }
.select-chip { background: var(--white); color: var(--ink); border: 1.5px solid rgba(13,59,39,0.2); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 16px);
  background: var(--emerald-dark); color: #fff; padding: 12px 22px; border-radius: 10px;
  font-weight: 700; font-size: 0.9rem; opacity: 0; transition: 0.25s; z-index: 99;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3); pointer-events: none; max-width: 90%; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Card header row (title + controls) */
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.search-input {
  padding: 9px 14px; border: 1.5px solid rgba(13,59,39,0.18); border-radius: 9px;
  background: var(--cream); font-family: inherit; font-size: 0.9rem; min-width: 240px;
}
.search-input:focus { outline: 2px solid var(--emerald); border-color: transparent; }
.sched-table tbody tr:hover { background: rgba(29,122,79,0.04); }

/* Toggle switch */
.switch { position: relative; width: 42px; height: 24px; flex-shrink: 0; display: inline-block; }
.switch input { opacity: 0; position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; z-index: 1; }
.switch .track { position: absolute; inset: 0; background: #c3d0c8; border-radius: 999px; transition: 0.2s; }
.switch .track::after {
  content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; transition: 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.switch input:checked + .track { background: var(--emerald); }
.switch input:checked + .track::after { transform: translateX(18px); }

/* Settings */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.set-row {
  display: flex; align-items: center; gap: 10px; padding: 11px 0;
  border-bottom: 1px dashed rgba(13,59,39,0.1); font-size: 0.92rem; font-weight: 600;
}
.set-row:last-child { border-bottom: 0; }
.set-row .grow { flex: 1; }
.set-row .day { width: 92px; font-weight: 800; color: var(--ink-soft); font-size: 0.85rem; }
.adm-input {
  padding: 8px 10px; border: 1.5px solid rgba(13,59,39,0.16); border-radius: 8px;
  background: var(--cream); font-family: inherit; font-size: 0.88rem; color: var(--ink); font-weight: 600;
}
.adm-input:focus { outline: 2px solid var(--emerald); border-color: transparent; }
.adm-input.w-sm { width: 86px; }
.adm-input.w-md { width: 120px; }
.badge-addon {
  background: var(--demo-bg); color: var(--demo); font-size: 0.66rem; font-weight: 800;
  padding: 2px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.04em;
}
.row-muted { opacity: 0.5; }

/* ===== Stat tiles ===== */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat-tile {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; display: flex; flex-direction: column; gap: 2px;
}
.stat-num { font-family: 'Fraunces', serif; font-size: 1.9rem; font-weight: 700; color: var(--emerald-deep); }
.stat-label { color: var(--ink-soft); font-weight: 700; font-size: 0.8rem; }
.stat-delta { font-size: 0.76rem; font-weight: 800; margin-top: 4px; }
.stat-delta.up { color: var(--emerald); }
.stat-delta.down { color: var(--emerald); } /* fewer cancellations = good */
.btn-mini {
  margin-top: 8px; align-self: flex-start; background: var(--mint); color: var(--emerald-deep);
  border: 1.5px solid rgba(29,122,79,0.3); border-radius: 999px; padding: 4px 12px;
  font-family: inherit; font-weight: 800; font-size: 0.76rem; cursor: pointer;
}
.btn-mini:hover { background: #d8ecdf; }

/* ===== Cards ===== */
.card {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px 24px; margin-bottom: 22px;
}
.card-sub { color: var(--ink-muted); font-size: 0.84rem; font-weight: 600; margin-bottom: 14px; }

/* ===== Schedule table ===== */
.table-scroll { overflow-x: auto; margin-top: 10px; }
.sched-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; min-width: 560px; }
.sched-table th {
  text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink-muted); padding: 8px 10px; border-bottom: 2px solid rgba(13,59,39,0.1);
}
.sched-table td { padding: 11px 10px; border-bottom: 1px solid rgba(13,59,39,0.08); }
.sched-table td:first-child { font-weight: 800; color: var(--emerald-deep); white-space: nowrap; }
.row-walkin { background: #fdf6e3; }
.row-cancelled td { opacity: 0.55; }
.chip {
  display: inline-flex; align-items: center; padding: 3px 11px; border-radius: 999px;
  font-size: 0.74rem; font-weight: 800; white-space: nowrap;
}
.chip::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: currentColor; margin-right: 7px;
}
.chip-ok { background: var(--mint); color: var(--emerald-deep); }
.chip-wait { background: #fbf0d3; color: #8a6207; }
.chip-bad { background: #fbe3e4; color: var(--ruby); }
.chip-info { background: #e3edf8; color: #1e4f80; }

/* ===== Week strip ===== */
.week-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 10px; }
.week-day {
  background: var(--cream); border: 1.5px solid rgba(13,59,39,0.1); border-radius: 12px;
  padding: 12px 8px; text-align: center; display: flex; flex-direction: column; gap: 2px;
}
.week-day small { font-weight: 800; color: var(--ink-muted); letter-spacing: 0.05em; font-size: 0.68rem; }
.week-day strong { font-family: 'Fraunces', serif; font-size: 1.4rem; color: var(--emerald-deep); }
.week-day span { font-size: 0.7rem; color: var(--ink-soft); font-weight: 700; }
.week-day.today { background: var(--mint); border-color: var(--emerald); }

/* ===== Charts ===== */
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .bar { cursor: pointer; }
.chart .bar:hover path, .chart .bar:focus path { opacity: 0.8; }
.axis-label { font-size: 12px; fill: var(--ink-muted); font-family: 'Nunito', sans-serif; font-weight: 700; }
.grid-line { stroke: rgba(13,59,39,0.08); stroke-width: 1; }
.baseline { stroke: rgba(13,59,39,0.25); stroke-width: 1.5; }
.direct-label { font-size: 12px; font-weight: 800; fill: var(--ink); font-family: 'Nunito', sans-serif; }

/* Stacked mix bar */
.mix-bar { display: flex; height: 34px; border-radius: 8px; overflow: hidden; gap: 2px; background: var(--white); margin: 8px 0 14px; }
.mix-seg { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 0.76rem; font-weight: 800; min-width: 0; }
.mix-legend { display: flex; flex-direction: column; gap: 8px; }
.mix-legend li { display: flex; align-items: center; gap: 10px; list-style: none; font-size: 0.9rem; font-weight: 700; color: var(--ink-soft); }
.mix-legend .swatch { width: 14px; height: 14px; border-radius: 4px; flex-shrink: 0; }
.mix-legend .val { margin-left: auto; font-weight: 800; color: var(--ink); }

/* Tooltip */
.chart-tip {
  position: fixed; z-index: 99; pointer-events: none; opacity: 0;
  background: var(--emerald-dark); color: #fff; font-size: 0.8rem; font-weight: 700;
  padding: 6px 12px; border-radius: 8px; transform: translate(-50%, calc(-100% - 10px));
  transition: opacity 0.1s; white-space: nowrap; box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}
.chart-tip.show { opacity: 1; }

/* ===== Insights ===== */
.insight-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.insight-card h2, .market-card h2 { margin-bottom: 8px; }
.insight-icon {
  width: 42px; height: 42px; border-radius: 12px; margin-bottom: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--mint); color: var(--emerald-deep);
}
.insight-icon .icon { width: 20px; height: 20px; }
.insight-icon.gold { background: #fbf0d3; color: #8a6207; }
.insight-icon.ruby { background: #fbe3e4; color: var(--ruby); }
.insight-icon.blue { background: #e3edf8; color: #1e4f80; }
.insight-card p, .market-card p { color: var(--ink-soft); font-size: 0.95rem; }
.insight-card strong, .market-card strong { color: var(--ink); }
.market-card { border-top: 4px solid var(--gold); }
.market-mock {
  background: var(--mint); border-radius: 12px 12px 12px 4px; padding: 12px 16px;
  font-size: 0.88rem; margin-bottom: 10px; color: var(--ink) !important;
}

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .stat-row { grid-template-columns: 1fr 1fr; }
  .chart-grid, .insight-grid, .settings-grid { grid-template-columns: 1fr; }
  .search-input { min-width: 0; width: 100%; }
}
@media (max-width: 760px) {
  .login-wrap { padding-top: 26px; }
  .login-card { grid-template-columns: 1fr; gap: 26px; padding: 28px 22px; }
  .login-card h1 { font-size: 1.3rem; }
  .login-card h1 br { display: none; }
  .login-form-col { padding: 22px 18px; }
}
@media (max-width: 560px) {
  .week-strip { grid-template-columns: repeat(5, 1fr); gap: 6px; }
  .week-day strong { font-size: 1.1rem; }
  .topbar-inner { flex-wrap: wrap; }
  .page-head { margin-top: 22px; }
  .stat-num { font-size: 1.6rem; }
}
