/* Admin dashboard — Judie Haircut & Spa */
:root {
  --black: #000000; --ink: #141008;
  --gold: #C1932E; --gold-bright: #E2B548; --gold-warm: #EFC65D;
  --champagne: #FCDF85; --cream: #FAF4E4;
  --paper: #FFFFFF; --line: #E4D9BE; --line-dark: #3A2F1A;
  --text: #171310; --muted: #5C5344;
  --danger: #8C2F1B; --ok: #2F5227;
  --r-card: 8px; --r-btn: 6px; --r-badge: 3px;
  --font: "Inter", "Segoe UI", Arial, sans-serif;
  --sidebar-w: 240px;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: var(--font); font-size: 1rem; line-height: 1.55;
  color: var(--text); background: #F4EFE2;
}
a { color: var(--gold); }
:focus-visible { outline: 3px solid var(--gold-bright); outline-offset: 2px; }
h1 { font-size: 1.6rem; margin: 0 0 .25rem; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
p { margin: 0 0 .75rem; }
img { max-width: 100%; }

/* ---------- layout ---------- */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 60;
  width: var(--sidebar-w); background: var(--black); color: #CFC4AC;
  display: flex; flex-direction: column;
  transform: translateX(-100%); transition: transform .25s ease;
}
.admin-sidebar.open { transform: translateX(0); }
.sidebar-brand {
  padding: 1rem; border-bottom: 1px solid var(--line-dark);
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
}
.sidebar-brand img { height: 40px; width: auto; }
.sidebar-brand .close-btn { display: none; }
.sidebar-nav { padding: .75rem .5rem; overflow-y: auto; flex: 1; }
.sidebar-nav .nav-section {
  font-size: .7rem; letter-spacing: .14em; text-transform: uppercase;
  color: #9A8F74; padding: .9rem .75rem .3rem;
}
.sidebar-nav a {
  display: flex; align-items: center; gap: .6rem;
  padding: .6rem .75rem; margin: .1rem 0; border-radius: var(--r-btn);
  color: #CFC4AC; text-decoration: none; font-weight: 600; font-size: .95rem;
}
.sidebar-nav a svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-nav a:hover { background: #1d1708; color: var(--champagne); }
.sidebar-nav a.on { background: var(--gold); color: var(--black); }
.sidebar-foot { padding: .75rem; border-top: 1px solid var(--line-dark); }
.sidebar-foot a, .sidebar-foot button {
  display: block; width: 100%; text-align: left;
  background: none; border: 0; color: #CFC4AC; font: inherit; font-weight: 600;
  padding: .55rem .5rem; text-decoration: none; cursor: pointer; border-radius: var(--r-btn);
}
.sidebar-foot a:hover, .sidebar-foot button:hover { background: #1d1708; color: var(--champagne); }
.sidebar-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 55;
  display: none;
}
.sidebar-overlay.show { display: block; }

.admin-main { flex: 1; min-width: 0; margin-left: 0; }
.admin-topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--paper); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: .75rem; padding: .6rem 1rem;
}
.menu-btn {
  width: 44px; height: 44px; border: 2px solid var(--line-dark); border-radius: var(--r-btn);
  background: var(--paper); color: var(--text); font-size: 1.2rem; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.admin-topbar .who { margin-left: auto; font-size: .9rem; color: var(--muted); }
.admin-topbar .who strong { color: var(--text); }
.admin-content { padding: 1.25rem 1rem 3rem; max-width: 72rem; }

@media (min-width: 900px) {
  .admin-sidebar { transform: none; }
  .sidebar-brand .close-btn { display: none; }
  .menu-btn { display: none; }
  .admin-main { margin-left: var(--sidebar-w); }
  .admin-content { padding: 1.75rem 2rem 4rem; }
}
@media (max-width: 899px) {
  .sidebar-brand .close-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border: 0; background: none; color: var(--champagne);
    font-size: 1.4rem; cursor: pointer;
  }
}

/* ---------- cards & stats ---------- */
.stat-grid { display: grid; gap: .75rem; grid-template-columns: repeat(2, 1fr); margin-bottom: 1.5rem; }
@media (min-width: 700px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 1rem 1.1rem;
}
.stat-card .num { font-size: 1.9rem; font-weight: 800; line-height: 1.1; }
.stat-card .lbl { font-size: .82rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.stat-card .sub { font-size: .8rem; color: var(--muted); }
.panel {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 1.1rem 1.25rem; margin-bottom: 1.25rem;
}
.panel h2 { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.tbl th, table.tbl td { text-align: left; padding: .6rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.tbl th { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); white-space: nowrap; }
table.tbl tr:last-child td { border-bottom: 0; }

/* ---------- badges ---------- */
.badge {
  display: inline-block; padding: .15rem .55rem; border-radius: var(--r-badge);
  font-size: .76rem; font-weight: 700; border: 1px solid var(--line-dark); white-space: nowrap;
}
.badge.confirmed, .badge.new, .badge.published { background: var(--gold-bright); color: var(--black); border-color: var(--black); }
.badge.cancelled, .badge.draft { background: #E8E0CC; color: var(--muted); }
.badge.done, .badge.arrived, .badge.read, .badge.responded { background: #EFF5EA; color: var(--ok); border-color: var(--ok); }
.badge.no-show { background: var(--danger); color: var(--paper); border-color: var(--danger); }
.badge.role { background: var(--ink); color: var(--champagne); border-color: var(--ink); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 40px; padding: .55rem 1rem;
  font: inherit; font-weight: 700; font-size: .92rem;
  border: 2px solid var(--black); border-radius: var(--r-btn);
  background: var(--gold-bright); color: var(--black);
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--gold-warm); }
.btn-dark { background: var(--black); color: var(--champagne); border-color: var(--black); }
.btn-dark:hover { background: #1d1708; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-dark); }
.btn-ghost:hover { border-color: var(--black); }
.btn-danger { background: var(--danger); color: var(--paper); border-color: var(--danger); }
.btn-danger:hover { background: #6d2415; }
.btn-success { background: var(--ok); color: var(--paper); border-color: var(--ok); }
.btn-success:hover { background: #275c29; }
.btn-sm { min-height: 32px; padding: .3rem .7rem; font-size: .82rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- forms ---------- */
.field { margin-bottom: .9rem; }
.field label { display: block; font-weight: 600; margin-bottom: .3rem; font-size: .92rem; }
.field .hint { font-size: .82rem; color: var(--muted); }
input[type="text"], input[type="tel"], input[type="email"], input[type="password"],
input[type="date"], input[type="time"], input[type="number"], select, textarea {
  width: 100%; min-height: 42px; padding: .55rem .7rem;
  font: inherit; font-size: 1rem; border: 2px solid var(--line); border-radius: var(--r-btn);
  background: var(--paper); color: var(--text);
}
textarea { min-height: 110px; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); outline: none; }
.form-grid { display: grid; gap: 0 1rem; }
@media (min-width: 700px) { .form-grid.cols-2 { grid-template-columns: 1fr 1fr; } .form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; } }
.check { display: flex; gap: .6rem; align-items: flex-start; margin-bottom: .9rem; }
.check input { width: 20px; height: 20px; margin-top: .1rem; flex: none; }
.field.error input, .field.error select, .field.error textarea { border-color: var(--danger); }
.field .error-msg { color: var(--danger); font-size: .82rem; margin-top: .25rem; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 3rem; }
.pw-toggle {
  position: absolute; right: 0; top: 0; height: 42px; width: 44px;
  border: 0; background: none; color: var(--muted); cursor: pointer; font-size: .85rem; font-weight: 700;
}

/* ---------- filter pills ---------- */
.pills { display: flex; flex-wrap: wrap; gap: .4rem; }
.pills a {
  padding: .4rem .8rem; border: 1px solid var(--line-dark); border-radius: var(--r-badge);
  text-decoration: none; color: var(--text); font-size: .85rem; font-weight: 600;
}
.pills a.on { background: var(--black); color: var(--champagne); border-color: var(--black); }
.pills .count { opacity: .7; font-weight: 400; }

/* ---------- alerts / empty ---------- */
.alert { border: 1px solid var(--gold); background: var(--cream); padding: .8rem 1rem; border-radius: var(--r-card); margin-bottom: 1rem; }
.alert.error { border-color: var(--danger); background: #FBEFEA; }
.alert.success { border-color: var(--ok); background: #EFF5EA; }
.empty-state { border: 1px dashed var(--line-dark); border-radius: var(--r-card); padding: 2rem 1rem; text-align: center; color: var(--muted); }

/* ---------- article editor ---------- */
.editor-wrap { border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.ql-toolbar.ql-snow { border: 0; border-bottom: 1px solid var(--line); background: var(--cream); }
.ql-container.ql-snow { border: 0; min-height: 220px; font-family: var(--font); font-size: 1rem; }
.prose h2 { margin-top: 1.5rem; }
.prose h3 { margin-top: 1.25rem; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose blockquote { border-left: 3px solid var(--gold); margin: 1rem 0; padding: .2rem 1rem; color: var(--muted); }
.prose img { border-radius: var(--r-card); }
.prose a { color: var(--gold); }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; background: var(--black); }
.login-card { background: var(--paper); border-radius: var(--r-card); padding: 2rem; width: 100%; max-width: 380px; border-top: 4px solid var(--gold); }
.login-card img { height: 56px; width: auto; margin: 0 auto 1rem; display: block; }
.login-card h1 { text-align: center; font-size: 1.3rem; }

/* ---------- misc ---------- */
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mt { margin-top: 1rem; }
.flex { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; }
.search-input { max-width: 22rem; }
.art-thumb { width: 72px; height: 48px; object-fit: cover; border-radius: var(--r-badge); border: 1px solid var(--line); }
