/* The Elbow Room — Admin dashboard styles */
:root {
  --bg:       #f6f3ed;
  --bg-2:     #efe8dc;
  --paper:    #ffffff;
  --ink:      #2e3a2d;
  --ink-2:    #4a5a49;
  --muted:    #857f6c;
  --muted-2:  #b3a994;
  --line:     rgba(46,58,45,0.10);
  --line-2:   rgba(46,58,45,0.06);
  --blush:    #c98873;
  --blush-mist: #f6e6dc;
  --sage:     #94a47e;
  --sage-deep:#67734f;
  --sage-mist:#ede6d2;
  --danger:   #c84b4b;
  --danger-mist: #f6dcdc;
  --amber:    #d49a4e;
}

* { box-sizing:border-box; }
html, body { margin:0; padding:0; min-height:100%; background:var(--bg); color:var(--ink); font-family:'Nunito', system-ui, -apple-system, sans-serif; }
a { color:inherit; text-decoration:none; }
button { font-family:inherit; cursor:pointer; }
h1, h2, h3 { font-family:'Fraunces', Georgia, serif; font-weight:500; color:var(--ink); letter-spacing:-0.01em; }

/* ── Auth pages ──────────────────────────────────── */
.admin-auth {
  display:flex; align-items:center; justify-content:center;
  min-height:100vh; padding:32px;
  background:linear-gradient(135deg, var(--bg), var(--bg-2));
}
.auth-card {
  width:100%; max-width:420px;
  background:var(--paper);
  border-radius:24px; padding:40px 36px;
  box-shadow:0 24px 60px rgba(46,58,45,0.10), 0 4px 12px rgba(46,58,45,0.04);
  text-align:center;
}
.auth-logo { width:64px; height:64px; border-radius:50%; object-fit:cover; margin-bottom:20px; }
.auth-card h1 { font-size:26px; margin:0 0 8px; }
.auth-lead { color:var(--muted); font-size:14px; margin:0 0 28px; }
.auth-card form { text-align:left; display:flex; flex-direction:column; gap:14px; }
.auth-card label { font-size:13px; font-weight:600; color:var(--ink-2); letter-spacing:0.02em; margin-top:6px; }
.auth-card label small { color:var(--muted); font-weight:400; margin-left:4px; }
.auth-card input {
  padding:13px 16px; border-radius:12px;
  border:1.5px solid var(--line); background:var(--bg);
  font-size:15px; color:var(--ink);
}
.auth-card input:focus { outline:none; border-color:var(--blush); background:var(--paper); box-shadow:0 0 0 4px rgba(201,136,115,0.12); }
.auth-error, .auth-success {
  text-align:left; padding:14px 18px; border-radius:12px;
  font-size:14px; margin-bottom:18px;
}
.auth-error   { background:var(--danger-mist); border:1px solid var(--danger); color:var(--danger); }
.auth-success { background:var(--sage-mist);   border:1px solid var(--sage);   color:var(--sage-deep); }
.auth-success a { color:var(--sage-deep); border-bottom:1px solid currentColor; }

.btn-admin-primary {
  background:var(--blush); color:#fff;
  border:none; border-radius:12px;
  padding:14px 20px; font-weight:700; font-size:15px;
  letter-spacing:0.02em;
  margin-top:12px; transition:background .2s, transform .15s, box-shadow .2s;
  box-shadow:0 4px 14px rgba(201,136,115,0.28);
}
.btn-admin-primary:hover { background:#b87664; transform:translateY(-1px); box-shadow:0 8px 20px rgba(201,136,115,0.36); }
.btn-admin-primary.btn-sm { padding:10px 16px; font-size:13.5px; margin:0; }

/* ── Shell layout ────────────────────────────────── */
.admin-shell:not(.admin-auth) {
  display:grid;
  grid-template-columns:240px 1fr;
  min-height:100vh;
}
.sidebar {
  background:var(--ink); color:#fff;
  padding:24px 18px;
  display:flex; flex-direction:column;
  position:sticky; top:0; height:100vh;
}
.sidebar-brand {
  display:flex; align-items:center; gap:12px;
  font-family:'Fraunces', serif; font-size:18px; font-weight:500;
  padding-bottom:24px; margin-bottom:18px;
  border-bottom:1px solid rgba(255,255,255,0.1);
  color:#fff;
}
.sidebar-brand img { width:38px; height:38px; border-radius:50%; }
.sidebar-nav { display:flex; flex-direction:column; gap:4px; flex:1; }
.sidebar-nav a {
  padding:11px 14px; border-radius:10px;
  font-size:14px; font-weight:600; letter-spacing:0.02em;
  color:rgba(255,255,255,0.7);
  transition:background .15s, color .15s;
}
.sidebar-nav a:hover { background:rgba(255,255,255,0.05); color:#fff; }
.sidebar-nav a.is-active { background:var(--blush); color:#fff; }
.sidebar-footer {
  display:flex; flex-direction:column; gap:8px;
  padding-top:18px; border-top:1px solid rgba(255,255,255,0.1);
}
.sidebar-link {
  font-size:12.5px; color:rgba(255,255,255,0.55);
  padding:8px 14px; border-radius:8px;
  transition:color .15s;
}
.sidebar-link:hover { color:#fff; }
.sidebar-logout { color:var(--blush); }
.sidebar-me {
  padding:10px 14px 12px;
  margin-bottom:10px;
  border-bottom:1px solid rgba(255,255,255,0.08);
}
.sidebar-me-name {
  font-family:'Fraunces', serif; font-size:14.5px;
  color:#fff; line-height:1.2;
}
.sidebar-me-role {
  font-size:11px; letter-spacing:0.1em; text-transform:uppercase;
  color:rgba(255,255,255,0.45); margin-top:3px;
}

/* ── Staff page ──────────────────────────────────── */
.staff-list { display:flex; flex-direction:column; gap:10px; margin-bottom:36px; }
.staff-row {
  display:grid;
  grid-template-columns:56px 1fr auto;
  gap:18px;
  padding:18px 22px;
  background:var(--paper);
  border:1px solid var(--line-2);
  border-radius:14px;
  align-items:center;
  transition:box-shadow .15s;
}
.staff-row:hover { box-shadow:0 6px 16px rgba(46,58,45,0.06); }
.staff-row[data-role="owner"]     { border-left:4px solid var(--blush); }
.staff-row[data-role="developer"] { border-left:4px solid #7c3aed; }
.staff-avatar {
  width:48px; height:48px;
  border-radius:50%;
  background:var(--sage-mist);
  color:var(--sage-deep);
  display:flex; align-items:center; justify-content:center;
  font-family:'Fraunces', serif; font-weight:500; font-size:22px;
}
.staff-row[data-role="owner"]     .staff-avatar { background:var(--blush-mist); color:var(--blush); }
.staff-row[data-role="developer"] .staff-avatar { background:#e9e4f3; color:#5a3a8a; }
.staff-main { display:flex; flex-direction:column; gap:4px; min-width:0; }
.staff-name {
  font-family:'Fraunces', serif; font-size:18px; font-weight:500; color:var(--ink);
  display:flex; align-items:center; gap:8px;
}
.staff-you {
  font-family:'Nunito', sans-serif; font-size:11px;
  letter-spacing:0.08em; text-transform:uppercase;
  background:var(--sage-mist); color:var(--sage-deep);
  padding:2px 8px; border-radius:99px;
  font-weight:600;
}
.staff-meta { font-size:13px; color:var(--muted); display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.role-pill {
  font-size:11px; text-transform:uppercase; letter-spacing:0.08em;
  padding:3px 9px; border-radius:99px;
  font-weight:700;
}
.role-pill.role-owner     { background:var(--blush-mist); color:var(--blush); }
.role-pill.role-developer { background:#e9e4f3; color:#5a3a8a; }
.role-pill.role-staff     { background:var(--sage-mist); color:var(--sage-deep); }
.staff-perms {
  display:flex; gap:10px; flex-wrap:wrap;
  font-size:12.5px; color:var(--ink-2);
  margin-top:6px;
}
.staff-perms span { background:var(--bg); padding:3px 9px; border-radius:6px; }
.staff-perms .off { color:var(--muted-2); }
.staff-actions summary {
  list-style:none; cursor:pointer; user-select:none;
}
.staff-actions summary::-webkit-details-marker { display:none; }
.staff-edit-form {
  margin-top:14px; padding-top:14px;
  border-top:1px dashed var(--line);
  display:flex; flex-direction:column; gap:12px;
  width:280px;
}
.staff-edit-form label { font-size:12.5px; font-weight:600; color:var(--ink-2); display:flex; flex-direction:column; gap:4px; }
.staff-edit-form label small { color:var(--muted); font-weight:400; }
.staff-edit-form input, .staff-edit-form select {
  padding:9px 12px; border-radius:8px; border:1px solid var(--line);
  background:var(--bg); font-size:13.5px; color:var(--ink);
}
.staff-edit-actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:6px; }

@media(max-width:680px) {
  .staff-row { grid-template-columns:48px 1fr; }
  .staff-actions { grid-column:1 / -1; }
  .staff-edit-form { width:100%; }
}

/* ── Calendar sync ───────────────────────────────────── */
.cal-url-row { display:flex; gap:8px; margin-top:6px; }
.cal-url-input {
  flex:1;
  padding:10px 14px;
  border-radius:10px;
  border:1px solid var(--line);
  background:var(--bg);
  font-family:'Courier New', monospace;
  font-size:13px;
  color:var(--ink);
  cursor:text;
}
.cal-url-input:focus { outline:none; border-color:var(--blush); background:var(--paper); }
.cal-instructions summary { font-size:13.5px; color:var(--blush); font-weight:600; }
.cal-instructions h3 { color:var(--ink); margin:18px 0 8px; }
.cal-instructions ol { color:var(--ink-2); font-size:14px; }
.cal-instructions a { color:var(--blush); border-bottom:1px solid var(--blush-soft); }

.admin-main { padding:36px 44px; max-width:1200px; }

@media(max-width:880px) {
  .admin-shell:not(.admin-auth) { grid-template-columns:1fr; }
  .sidebar { position:relative; height:auto; flex-direction:row; align-items:center; padding:14px 18px; gap:12px; }
  .sidebar-brand { padding-bottom:0; margin-bottom:0; border-bottom:none; font-size:15px; }
  .sidebar-brand img { width:30px; height:30px; }
  .sidebar-brand span { display:none; }
  .sidebar-nav { flex-direction:row; flex:1; justify-content:center; }
  .sidebar-footer { flex-direction:row; padding-top:0; border-top:none; }
  .admin-main { padding:20px; }
}

/* ── Page head ───────────────────────────────────── */
.page-head { display:flex; align-items:flex-end; justify-content:space-between; gap:24px; margin-bottom:32px; flex-wrap:wrap; }
.page-head h1 { font-size:32px; margin:0 0 6px; }
.page-sub { color:var(--muted); font-size:14px; margin:0; }

/* ── Stat cards ──────────────────────────────────── */
.stat-grid {
  display:grid; grid-template-columns:repeat(auto-fit, minmax(200px, 1fr));
  gap:16px; margin-bottom:36px;
}
.stat-card {
  background:var(--paper); border-radius:18px;
  padding:24px 24px 22px;
  border:1px solid var(--line-2);
  box-shadow:0 1px 2px rgba(46,58,45,0.04);
}
.stat-label { font-size:12.5px; letter-spacing:0.08em; text-transform:uppercase; color:var(--muted); font-weight:600; }
.stat-value { font-family:'Fraunces', serif; font-size:42px; font-weight:500; color:var(--ink); margin:6px 0 4px; line-height:1; }
.stat-foot  { font-size:12.5px; color:var(--muted); }

/* ── Sections ────────────────────────────────────── */
.admin-section { margin-bottom:48px; }
.admin-section-head {
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom:14px; gap:16px;
}
.admin-section-head h2 { font-size:22px; margin:0; }
.link-ghost { font-size:13.5px; color:var(--blush); font-weight:600; }
.link-ghost:hover { text-decoration:underline; }
.muted { color:var(--muted); font-size:13.5px; }
.empty-state {
  padding:36px; text-align:center;
  background:var(--paper); border-radius:14px;
  border:1px dashed var(--line);
  color:var(--muted); font-style:italic;
}

/* ── Booking rows ────────────────────────────────── */
.booking-list { display:flex; flex-direction:column; gap:8px; }
.booking-row {
  display:grid;
  grid-template-columns:90px 1fr auto;
  gap:18px; padding:18px 20px;
  background:var(--paper); border-radius:14px;
  border:1px solid var(--line-2);
  align-items:flex-start;
  transition:box-shadow .15s, transform .15s;
}
.booking-row:hover { box-shadow:0 6px 16px rgba(46,58,45,0.06); }
.booking-row.status-cancelled { opacity:0.5; }
.booking-row.status-completed { background:#fbfaf6; }

.bk-when {
  text-align:center;
  padding:10px 8px;
  background:var(--bg); border-radius:10px;
}
.bk-date { font-size:13px; color:var(--muted); font-weight:600; }
.bk-time { font-family:'Fraunces', serif; font-size:18px; font-weight:500; color:var(--ink); margin-top:2px; }

.bk-main { display:flex; flex-direction:column; gap:4px; min-width:0; }
.bk-client { display:flex; align-items:center; gap:10px; font-size:16px; }
.bk-client strong { font-weight:700; color:var(--ink); }
.bk-service { color:var(--ink-2); font-size:14px; }
.bk-contact { font-size:13px; color:var(--muted); }
.bk-contact a { color:var(--blush); }
.bk-contact a:hover { text-decoration:underline; }
.bk-notes { font-size:13px; color:var(--ink-2); background:var(--sage-mist); padding:8px 12px; border-radius:8px; margin-top:6px; border-left:3px solid var(--sage); }
.bk-ref { font-size:11.5px; color:var(--muted-2); letter-spacing:0.04em; margin-top:4px; }

.status-pill {
  font-size:11px; text-transform:uppercase; letter-spacing:0.08em;
  padding:3px 9px; border-radius:99px;
  font-weight:700;
}
.booking-row.status-confirmed .status-pill { background:var(--sage-mist); color:var(--sage-deep); }
.booking-row.status-completed .status-pill { background:var(--blush-mist); color:var(--blush); }
.booking-row.status-cancelled .status-pill { background:var(--danger-mist); color:var(--danger); }
.booking-row.status-no-show   .status-pill { background:#fdebd8; color:var(--amber); }

.bk-actions { display:flex; flex-direction:column; gap:6px; align-items:flex-end; }

.btn-action {
  background:var(--bg); border:1px solid var(--line);
  padding:7px 12px; border-radius:8px;
  font-size:12.5px; font-weight:600; color:var(--ink);
  transition:background .15s, color .15s, border-color .15s;
  white-space:nowrap;
}
.btn-action:hover { background:var(--sage-mist); border-color:var(--sage); }
.btn-action.btn-danger { color:var(--danger); border-color:rgba(200,75,75,0.3); }
.btn-action.btn-danger:hover { background:var(--danger-mist); border-color:var(--danger); color:var(--danger); }
.btn-action.btn-quiet { color:var(--muted); }
.btn-action[disabled] { opacity:0.5; cursor:wait; }

@media(max-width:680px) {
  .booking-row { grid-template-columns:1fr; }
  .bk-when { display:flex; align-items:center; justify-content:flex-start; gap:14px; padding:6px 12px; }
  .bk-actions { flex-direction:row; flex-wrap:wrap; align-items:flex-start; }
}

/* ── Filter toolbar ──────────────────────────────── */
.admin-toolbar {
  display:flex; align-items:center; gap:14px;
  flex-wrap:wrap; margin-bottom:20px;
}
.filter-tabs { display:flex; gap:4px; background:var(--paper); padding:4px; border-radius:12px; border:1px solid var(--line-2); }
.filter-tab { padding:8px 14px; font-size:13px; font-weight:600; color:var(--muted); border-radius:9px; transition:color .15s, background .15s; }
.filter-tab:hover { color:var(--ink); }
.filter-tab.is-active { background:var(--ink); color:#fff; }
.admin-search {
  flex:1; min-width:220px;
  padding:11px 14px; border-radius:10px;
  border:1px solid var(--line); background:var(--paper);
  font-size:14px; color:var(--ink);
}
.admin-search:focus { outline:none; border-color:var(--blush); box-shadow:0 0 0 3px rgba(201,136,115,0.12); }

/* ── Flash messages ──────────────────────────────── */
.flash {
  padding:14px 20px; border-radius:12px;
  margin-bottom:24px;
  font-size:14.5px; font-weight:600;
}
.flash-success { background:var(--sage-mist); color:var(--sage-deep); border:1px solid rgba(148,164,126,0.4); }
.flash-error   { background:var(--danger-mist); color:var(--danger); border:1px solid rgba(200,75,75,0.3); }

/* ── Settings cards ──────────────────────────────── */
.settings-card {
  background:var(--paper); border-radius:18px;
  padding:28px 32px; margin-bottom:24px;
  border:1px solid var(--line-2);
}
.settings-card h2 { font-size:22px; margin:0 0 6px; }
.settings-card .muted { display:block; margin-bottom:20px; }

.hours-grid { display:flex; flex-direction:column; gap:10px; margin-bottom:24px; }
.hours-row {
  display:flex; align-items:center; gap:14px;
  padding:8px 12px; background:var(--bg); border-radius:10px;
}
.day-name { width:100px; font-weight:600; color:var(--ink); text-transform:capitalize; }
.hours-row input[type="time"] {
  padding:8px 12px; border-radius:8px; border:1px solid var(--line);
  background:var(--paper); font-size:14px; color:var(--ink);
}
.closed-toggle { margin-left:auto; font-size:13px; color:var(--muted); display:flex; align-items:center; gap:6px; }

.settings-numbers { display:grid; grid-template-columns:repeat(auto-fit, minmax(200px, 1fr)); gap:14px; margin-bottom:20px; }
.settings-numbers label { display:flex; flex-direction:column; gap:6px; font-size:13px; color:var(--ink-2); font-weight:600; }
.settings-numbers input {
  padding:10px 14px; border-radius:10px; border:1px solid var(--line);
  background:var(--bg); font-size:14px; font-weight:500;
}

.settings-card textarea {
  width:100%; padding:12px 14px; border-radius:10px;
  border:1px solid var(--line); background:var(--bg);
  font-family:'Nunito', monospace; font-size:14px; color:var(--ink);
  resize:vertical; min-height:120px; margin-bottom:14px;
}

.services-editor { display:flex; flex-direction:column; gap:12px; margin-bottom:16px; }
.service-row {
  display:grid;
  grid-template-columns:1.6fr 1fr 80px 80px auto;
  gap:8px; align-items:start;
  padding:12px; background:var(--bg); border-radius:12px;
}
.service-row .svc-desc { grid-column:1 / -2; }
.service-row input, .service-row textarea {
  padding:9px 12px; border-radius:8px; border:1px solid var(--line);
  background:var(--paper); font-size:13.5px;
}
.service-row textarea { resize:vertical; }
.settings-actions { display:flex; justify-content:flex-end; margin-top:20px; }

@media(max-width:780px) {
  .service-row { grid-template-columns:1fr 1fr; }
  .service-row .svc-desc { grid-column:1 / -1; }
}
