/* Ashdown & Sons — admin console. Same tokens as the public site, utilitarian layout. */
:root {
  --paper: #f2efe7; --paper-2: #e9e4d6; --ink: #211d16; --ink-2: #4b4536;
  --muted: #77705e; --line: #d6cfbd; --dark: #23201a; --dark-ink: #f0ecdf;
  --dark-muted: #a89f8a; --accent: #e0a32e; --accent-deep: #a97b12;
  --green: #3d7a45; --green-bg: #e2eddd; --red: #a83a2a; --red-bg: #f4e0da;
  --blue: #33608c; --blue-bg: #dfe8f2; --radius: 4px; --radius-md: 8px;
  --display: 'Cabinet Grotesk', sans-serif; --body: 'Supreme', system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--body); font-size: 15.5px; line-height: 1.55; color: var(--ink); background: var(--paper); }
::selection { background: var(--accent); color: var(--ink); }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--accent-deep); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.1; margin: 0 0 .4em; }
h1 { font-size: 1.7rem; }
svg { width: 18px; height: 18px; }

.admin-layout { display: flex; min-height: 100vh; }
.admin-side {
  width: 230px; flex-shrink: 0; background: var(--dark); color: var(--dark-muted);
  padding: 26px 18px; display: flex; flex-direction: column; gap: 4px;
}
.admin-side .brand { color: var(--dark-ink); text-decoration: none; margin-bottom: 26px; display: block; }
.admin-side .brand b { font-family: var(--display); font-weight: 800; font-size: 1.15rem; display: block; }
.admin-side .brand span { font-size: .62rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.admin-side a.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: var(--radius); text-decoration: none; font-weight: 500;
  transition: background .15s ease-out, color .15s ease-out;
}
.admin-side a.nav-item:hover { background: rgba(255,255,255,.06); color: var(--dark-ink); }
.admin-side a.nav-item.active { background: var(--accent); color: var(--ink); font-weight: 700; }
.admin-side .spacer { flex: 1; }
.admin-side form button {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px;
  background: none; border: none; color: var(--dark-muted); font: inherit; font-weight: 500;
  border-radius: var(--radius); cursor: pointer;
}
.admin-side form button:hover { background: rgba(255,255,255,.06); color: var(--dark-ink); }
.admin-side .view-site { font-size: .82rem; margin-top: 10px; }

.admin-main { flex: 1; padding: 34px 38px; min-width: 0; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 26px; flex-wrap: wrap; }
.admin-head p { margin: 0; color: var(--muted); }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 28px; }
.stat {
  background: #fbf9f3; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 16px 18px;
}
.stat b { font-family: var(--display); font-weight: 800; font-size: 1.7rem; display: block; }
.stat span { font-size: .82rem; color: var(--muted); font-weight: 500; }

.panel { background: #fbf9f3; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 22px; margin-bottom: 24px; }
.panel h2 { font-size: 1.15rem; margin-bottom: 14px; }

table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--ink); }
td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:hover td { background: var(--paper-2); }
.table-scroll { overflow-x: auto; }

.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 700; white-space: nowrap; }
.chip.new { background: var(--accent); color: var(--ink); }
.chip.contacted { background: var(--blue-bg); color: var(--blue); }
.chip.survey_booked { background: var(--blue-bg); color: var(--blue); }
.chip.quoted { background: #f0e6c8; color: #7a5c0e; }
.chip.won { background: var(--green-bg); color: var(--green); }
.chip.lost { background: var(--red-bg); color: var(--red); }
.chip.off { background: var(--paper-2); color: var(--muted); }
.chip.on { background: var(--green-bg); color: var(--green); }

.btn {
  display: inline-flex; align-items: center; gap: 8px; font: inherit; font-weight: 700;
  font-size: .9rem; padding: 9px 16px; border: 2px solid var(--ink); border-radius: var(--radius);
  cursor: pointer; text-decoration: none; background: transparent; color: var(--ink);
  transition: background .15s ease-out, color .15s ease-out;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.solid { background: var(--accent); border-color: var(--accent); }
.btn.solid:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn.small { padding: 5px 10px; font-size: .8rem; border-width: 1.5px; }
.btn.danger { border-color: var(--red); color: var(--red); }
.btn.danger:hover { background: var(--red); color: #fff; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.filters a {
  text-decoration: none; font-size: .84rem; font-weight: 600; padding: 6px 13px;
  border: 1.5px solid var(--line); border-radius: 999px; transition: all .15s ease-out;
}
.filters a:hover { border-color: var(--ink); }
.filters a.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

label { font-weight: 700; font-size: .84rem; display: block; margin-bottom: 4px; }
input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="number"], select, textarea {
  font: inherit; color: var(--ink); background: #fff; border: 1.5px solid var(--line);
  border-radius: var(--radius); padding: 9px 12px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-deep); }
textarea { resize: vertical; min-height: 90px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .9rem; }
.check input { width: auto; }

.saved-note { background: var(--green-bg); color: var(--green); padding: 10px 16px; border-radius: var(--radius); font-weight: 600; margin-bottom: 18px; }

details.editor { border: 1px solid var(--line); border-radius: var(--radius-md); background: #fbf9f3; margin-bottom: 12px; }
details.editor summary {
  cursor: pointer; padding: 14px 18px; font-weight: 700; display: flex; align-items: center; gap: 12px;
  list-style: none;
}
details.editor summary::-webkit-details-marker { display: none; }
details.editor summary .meta { font-weight: 500; color: var(--muted); font-size: .85rem; }
details.editor summary .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
details.editor .editor-body { padding: 0 18px 18px; border-top: 1px solid var(--line); padding-top: 16px; }
.thumb { width: 64px; height: 42px; object-fit: cover; border-radius: 3px; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { background: #fbf9f3; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 38px; width: 100%; max-width: 400px; }
.login-card .brand-sub { font-size: .64rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 24px; }
.login-error { background: var(--red-bg); color: var(--red); padding: 10px 14px; border-radius: var(--radius); font-size: .9rem; font-weight: 600; margin-bottom: 14px; }

.note-cell { max-width: 320px; }
.note-cell form { display: flex; gap: 6px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }

@media (max-width: 880px) {
  .admin-layout { flex-direction: column; }
  .admin-side { width: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 14px 16px; }
  .admin-side .brand { margin: 0 16px 0 0; }
  .admin-side a.nav-item { padding: 8px 10px; }
  .admin-side .spacer { display: none; }
  .admin-main { padding: 20px 16px; }
  .form-grid { grid-template-columns: 1fr; }
}
