/* =========================================================
   Easy Property — Admin Panel
   Shares the colour tokens and fonts of the public site
   (public/assets/css/style.css) so both feel like one brand.
   ========================================================= */

/* ---------- Design tokens ---------- */
:root {
  --ink: #0f2b46;          /* deep navy — sidebar, headings */
  --ink-2: #173a5c;
  --ink-3: #1e4870;
  --body: #4a5b6b;
  --muted: #7a8a99;
  --bg: #f3f8fc;
  --tint: #e8f4fc;
  --card: #ffffff;
  --line: #d6e6f2;
  --accent: #4fb8f0;       /* main light blue */
  --accent-dark: #2fa3e3;
  --accent-ink: #0b78b8;   /* light-blue for text on light bg */
  --on-accent: #0f2b46;
  --gold: #8fd3fa;         /* light-blue highlight on dark bg */
  --star: #f5b942;
  --success: #1d9a8a;
  --danger: #c0392b;

  --font-head: "Fraunces", Georgia, serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(15, 43, 70, .06), 0 4px 14px -8px rgba(15, 43, 70, .14);
  --shadow: 0 10px 30px -12px rgba(15, 43, 70, .18);
  --shadow-lg: 0 24px 50px -20px rgba(15, 43, 70, .35);
  --ease: cubic-bezier(.2, .7, .2, 1);

  --sidebar-w: 264px;
  --sidebar-w-collapsed: 80px;
  --topbar-h: 72px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body); font-size: 15px; line-height: 1.6;
  color: var(--body); background: var(--bg); -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--ink); line-height: 1.2; font-weight: 600; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.icon { flex-shrink: 0; }

/* ---------- Shared bits ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent-ink); margin-bottom: 10px;
}
.eyebrow::before { content: ""; width: 24px; height: 2px; background: currentColor; }
.eyebrow--light { color: var(--gold); }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); min-width: 0; }
.brand__mark {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0; display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent); font-family: var(--font-head); font-weight: 700; font-size: 1.3rem;
}
.brand__text { font-family: var(--font-head); font-size: 1.15rem; line-height: 1; white-space: nowrap; }
.brand__text strong {
  display: block; margin-top: 4px; font-family: var(--font-body); font-size: .66rem; font-weight: 600;
  letter-spacing: .2em; text-transform: uppercase; opacity: .75;
}
.brand--light { color: #fff; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 999px; font-weight: 600; font-size: .92rem; white-space: nowrap;
  border: 1.5px solid transparent;
  transition: background .25s var(--ease), color .25s, border-color .25s, transform .25s var(--ease), box-shadow .25s;
}
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-dark); transform: translateY(-1px); box-shadow: 0 10px 20px -10px var(--accent-dark); }
.btn--ghost { border-color: var(--line); color: var(--ink); background: var(--card); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--light { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.25); }
.btn--light:hover { background: rgba(255,255,255,.18); }
.btn--sm { padding: 8px 16px; font-size: .85rem; }
.btn--lg { padding: 14px 24px; font-size: 1rem; }
.btn--block { width: 100%; }
.btn.is-disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

.icon-btn {
  width: 42px; height: 42px; border-radius: 12px; display: inline-grid; place-items: center; flex-shrink: 0;
  color: var(--ink); transition: background .2s, color .2s;
}
.icon-btn:hover { background: var(--tint); }

.alert { padding: 12px 16px; border-radius: 12px; font-size: .92rem; font-weight: 500; margin-bottom: 20px; border: 1px solid; }
.alert--success { background: #e6f6f3; border-color: #b7e3dc; color: #136b60; }

.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--gold)); color: var(--ink);
  font-weight: 700; font-size: .85rem; letter-spacing: .02em;
}
.avatar--sm { width: 32px; height: 32px; font-size: .75rem; background: var(--tint); color: var(--accent-ink); }
.avatar--lg { width: 56px; height: 56px; font-size: 1.1rem; }

.badge {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px;
  font-size: .74rem; font-weight: 700; white-space: nowrap;
}
.badge--new { background: var(--tint); color: var(--accent-ink); }
.badge--contacted { background: #fff4dc; color: #93650a; }
.badge--visit { background: #e6f6f3; color: #136b60; }
.badge--closed { background: #eef1f4; color: var(--muted); }

/* =========================================================
   Admin shell
   ========================================================= */
.admin-shell { min-height: 100vh; min-height: 100dvh; }
.admin-main {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  margin-left: var(--sidebar-w); transition: margin-left .3s var(--ease);
}
.admin-content { flex: 1; width: 100%; max-width: 1400px; margin-inline: auto; padding: 28px clamp(16px, 3vw, 36px) 40px; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 60; width: var(--sidebar-w);
  display: flex; flex-direction: column; background: var(--ink); color: rgba(255,255,255,.72);
  transition: width .3s var(--ease), transform .35s var(--ease);
}
.sidebar::after { /* soft light-blue glow, echoes the site's dark sections */
  content: ""; position: absolute; inset: auto 0 0 0; height: 280px; pointer-events: none;
  background: radial-gradient(120% 100% at 50% 100%, rgba(79,184,240,.16), transparent 70%);
}
.sidebar__head {
  height: var(--topbar-h); flex-shrink: 0; display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 0 20px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar .brand { color: #fff; }
.sidebar__close { display: none; color: #fff; }
.sidebar__close:hover { background: rgba(255,255,255,.08); }

.sidebar__nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 12px 14px 20px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.sidebar__label {
  padding: 18px 12px 8px; font-size: .7rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: rgba(255,255,255,.4); white-space: nowrap;
}
.sidebar__list { display: grid; gap: 2px; }
.sidebar__link {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 12px;
  border-radius: 12px; font-weight: 500; white-space: nowrap;
  transition: background .2s, color .2s;
}
.sidebar__link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar__link.is-active { background: rgba(79,184,240,.16); color: #fff; }
.sidebar__link.is-active::before {
  content: ""; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.sidebar__link.is-active .icon { color: var(--accent); }
.sidebar__link.is-disabled { cursor: default; color: rgba(255,255,255,.45); }
.sidebar__link.is-disabled:hover { background: transparent; color: rgba(255,255,255,.45); }
.sidebar__text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.badge--soon { background: rgba(255,255,255,.08); color: rgba(255,255,255,.55); font-size: .66rem; letter-spacing: .04em; padding: 2px 8px; }
.sidebar__foot { position: relative; z-index: 1; padding: 14px; border-top: 1px solid rgba(255,255,255,.08); }

/* Collapsed (desktop only): icons with hover tooltips */
@media (min-width: 1025px) {
  .sidebar-collapsed .admin-main { margin-left: var(--sidebar-w-collapsed); }
  .sidebar-collapsed .sidebar { width: var(--sidebar-w-collapsed); }
  .sidebar-collapsed .sidebar__head { justify-content: center; padding: 0; }
  .sidebar-collapsed .brand__text,
  .sidebar-collapsed .sidebar__text,
  .sidebar-collapsed .badge--soon { display: none; }
  .sidebar-collapsed .sidebar__label { font-size: 0; padding: 14px 0 6px; }
  .sidebar-collapsed .sidebar__label::before { content: ""; display: block; height: 1px; margin: 0 14px; background: rgba(255,255,255,.1); }
  .sidebar-collapsed .sidebar__link { justify-content: center; padding-inline: 0; }
  .sidebar-collapsed .sidebar__link::after {
    content: attr(data-tip); position: absolute; left: calc(100% + 12px); top: 50%; transform: translate(-4px, -50%);
    padding: 6px 10px; border-radius: 8px; background: var(--ink); color: #fff; font-size: .82rem; font-weight: 500;
    box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; white-space: nowrap;
  }
  .sidebar-collapsed .sidebar__link:hover::after { opacity: 1; transform: translate(0, -50%); }
  .sidebar-collapsed .sidebar__nav { overflow: visible; }
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px; padding: 0 clamp(16px, 3vw, 36px);
  background: rgba(243, 248, 252, .88); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar__toggle { margin-left: -8px; }
.topbar__title { flex: 1; min-width: 0; }
.topbar__title h1 { font-size: 1.35rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.breadcrumb { font-size: .82rem; color: var(--muted); }
.topbar__actions { display: flex; align-items: center; gap: 12px; }

.user-chip {
  display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); transition: border-color .2s, box-shadow .2s;
}
.user-chip:hover, .user-chip[aria-expanded="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,184,240,.15); }
.user-chip__meta { display: grid; text-align: left; line-height: 1.2; }
.user-chip__meta strong { color: var(--ink); font-size: .88rem; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip__meta small { color: var(--muted); font-size: .74rem; }
.user-chip__caret { color: var(--muted); transition: transform .2s; }
.user-chip[aria-expanded="true"] .user-chip__caret { transform: rotate(180deg); }

.dropdown { position: relative; }
.dropdown__menu {
  position: absolute; right: 0; top: calc(100% + 10px); width: 240px; padding: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  animation: drop .18s var(--ease);
}
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } }
.dropdown__head { display: grid; padding: 10px 12px 12px; margin-bottom: 6px; border-bottom: 1px solid var(--line); line-height: 1.35; }
.dropdown__head strong { color: var(--ink); }
.dropdown__head span { font-size: .82rem; color: var(--muted); overflow-wrap: anywhere; }
.dropdown__item {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  font-weight: 500; color: var(--ink); text-align: left; transition: background .2s, color .2s;
}
.dropdown__item:hover { background: var(--tint); }
.dropdown__item--danger:hover { background: #fbeceb; color: var(--danger); }

/* ---------- Footer ---------- */
.admin-footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px;
  padding: 18px clamp(16px, 3vw, 36px); border-top: 1px solid var(--line); font-size: .82rem; color: var(--muted);
}

/* =========================================================
   Dashboard
   ========================================================= */
.welcome {
  position: relative; overflow: hidden; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px;
  padding: clamp(24px, 3.5vw, 36px); border-radius: var(--radius-lg); color: rgba(255,255,255,.75);
  background:
    radial-gradient(600px 240px at 100% 0%, rgba(79,184,240,.35), transparent 70%),
    linear-gradient(135deg, var(--ink) 0%, var(--ink-3) 100%);
  box-shadow: var(--shadow);
}
.welcome::after { /* faint skyline grid, nods to architecture */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .07;
  background-image: linear-gradient(rgba(255,255,255,1) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,1) 1px, transparent 1px);
  background-size: 32px 32px; mask-image: linear-gradient(90deg, transparent 30%, #000);
}
.welcome__text, .welcome__actions { position: relative; z-index: 1; }
.welcome h2 { color: #fff; font-size: clamp(1.5rem, 2.6vw, 2.1rem); margin-bottom: 6px; }
.welcome__actions { display: flex; flex-wrap: wrap; gap: 10px; }

.sample-note {
  display: flex; align-items: center; gap: 8px; margin: 16px 0 0; font-size: .82rem; color: var(--muted);
}

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-top: 16px; }
.stat {
  display: flex; align-items: flex-start; gap: 16px; padding: 20px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  transition: transform .25s var(--ease), box-shadow .25s;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat--link { color: inherit; }
.stat--link:hover .stat__value { color: var(--accent-ink); }
.review-list { margin-top: 0; border-top: 0; }
.review-list .quick-links__item:first-child { padding-top: 0; }
.stat__icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0; }
.stat--accent .stat__icon { background: var(--tint); color: var(--accent-ink); }
.stat--ink .stat__icon { background: var(--ink); color: var(--gold); }
.stat--success .stat__icon { background: #e6f6f3; color: var(--success); }
.stat--star .stat__icon { background: #fff4dc; color: #b9800f; }
.stat__label { font-size: .85rem; color: var(--muted); font-weight: 500; }
.stat__value { font-family: var(--font-head); font-size: 2rem; font-weight: 700; color: var(--ink); line-height: 1.1; margin: 4px 0 6px; }
.stat__trend { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; color: var(--success); }

.dash-grid {
  display: grid; gap: 18px; margin-top: 18px;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  grid-template-areas: "enq proj" "enq acct";
  align-items: start;
}
.dash-grid > :nth-child(1) { grid-area: enq; }
.dash-grid > :nth-child(2) { grid-area: proj; }
.dash-grid > :nth-child(3) { grid-area: acct; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 22px; min-width: 0; }
.panel__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.panel__head h3 { font-size: 1.15rem; }
.panel__head p { font-size: .84rem; color: var(--muted); }

.table-wrap { overflow-x: auto; margin: 0 -22px -22px; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th {
  text-align: left; padding: 10px 22px; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); background: var(--bg); border-block: 1px solid var(--line);
}
.table td { padding: 14px 22px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: #f8fbfe; }
.person { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.person strong { color: var(--ink); font-weight: 600; }
.nowrap { white-space: nowrap; color: var(--muted); }

.progress-list { display: grid; gap: 18px; }
.progress-list__row { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 8px; }
.progress-list strong { display: block; color: var(--ink); font-weight: 600; font-size: .92rem; }
.progress-list small { color: var(--muted); font-size: .8rem; }
.progress-list__pct { font-weight: 700; color: var(--accent-ink); font-size: .88rem; }
.progress { height: 8px; border-radius: 999px; background: var(--tint); overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-dark)); }

.account { display: flex; align-items: center; gap: 14px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.account > div { display: grid; min-width: 0; line-height: 1.35; }
.account strong { color: var(--ink); font-size: 1.02rem; }
.account span { font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; }
.meta-list { display: grid; gap: 12px; margin-top: 16px; }
.meta-list > div { display: flex; justify-content: space-between; gap: 12px; font-size: .88rem; }
.meta-list dt { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.meta-list dd { color: var(--ink); font-weight: 600; text-align: right; }

/* =========================================================
   Hero section editor
   ========================================================= */
.hero-editor { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); width: 100%; }
.hero-preview {
  position: relative; aspect-ratio: 21 / 9; border-radius: 12px; overflow: hidden; background: var(--ink);
}
.hero-preview img { width: 100%; height: 100%; object-fit: cover; }
.hero-preview::after { /* same navy wash as the live hero, so contrast reads true */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(15,43,70,.55), rgba(15,43,70,.1));
}
.hero-preview__tag {
  position: absolute; left: 12px; top: 12px; z-index: 1; padding: 4px 10px; border-radius: 999px;
  background: rgba(255,255,255,.9); color: var(--ink); font-size: .75rem; font-weight: 700;
}

.dropzone {
  position: relative; display: grid; place-items: center; min-height: 200px; padding: 20px; text-align: center;
  border: 2px dashed var(--line); border-radius: var(--radius); background: var(--bg); cursor: pointer;
  transition: border-color .2s, background .2s;
}
.dropzone:hover, .dropzone.is-dragover { border-color: var(--accent); background: var(--tint); }
.dropzone:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(79,184,240,.18); }
.field.has-error .dropzone { border-color: var(--danger); }
.dropzone__input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dropzone__empty { display: grid; justify-items: center; gap: 4px; font-size: .88rem; color: var(--muted); }
.dropzone__empty strong { color: var(--ink); font-size: .95rem; }
.dropzone__icon {
  width: 48px; height: 48px; margin-bottom: 8px; border-radius: 14px; display: grid; place-items: center;
  background: var(--card); color: var(--accent-ink); box-shadow: var(--shadow-sm);
}
.dropzone__preview { display: grid; gap: 10px; width: 100%; }
.dropzone__preview img { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; border-radius: 10px; }
@media (max-width: 760px) {
  .hero-preview, .dropzone__preview img { aspect-ratio: 16 / 9; }
}
.dropzone__file { font-size: .82rem; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.dropzone.has-file .dropzone__empty { display: none; }

.hint-list { display: grid; gap: 6px; font-size: .84rem; color: var(--muted); }
.hint-list li { position: relative; padding-left: 18px; }
.hint-list li::before { content: ""; position: absolute; left: 4px; top: .6em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* =========================================================
   CRUD pages (business types, …)
   ========================================================= */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.text-link { color: var(--accent-ink); font-weight: 600; }
.text-link:hover { text-decoration: underline; }
.alert--error { background: #fbeceb; border-color: #f0c4bf; color: #9b2c20; }

.split { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.split__side { position: sticky; top: calc(var(--topbar-h) + 20px); }
.panel--narrow { max-width: 560px; }

.count-chip { flex-shrink: 0; padding: 4px 12px; border-radius: 999px; background: var(--tint); color: var(--accent-ink); font-size: .78rem; font-weight: 700; white-space: nowrap; }

.table .col-actions { width: 1%; white-space: nowrap; text-align: right; }
.table tr.is-muted .cell-title { color: var(--muted); }
.cell-title { color: var(--ink); font-weight: 600; }
.row-actions { display: inline-flex; gap: 4px; }
.icon-btn--sm { width: 36px; height: 36px; border-radius: 10px; color: var(--muted); }
.icon-btn--sm:hover { color: var(--ink); }
.icon-btn--danger:hover { background: #fbeceb; color: var(--danger); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; background: none; color: var(--muted); }
.badge--toggle { cursor: pointer; transition: box-shadow .2s; }
.badge--toggle:hover { box-shadow: 0 0 0 2px currentColor inset; }

.empty { display: grid; justify-items: center; gap: 6px; padding: 36px 16px; text-align: center; color: var(--muted); font-size: .9rem; }
.empty strong { color: var(--ink); font-size: 1rem; }
.empty__icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--tint); color: var(--accent-ink); margin-bottom: 6px; }

/* Plain field: no leading icon */
.field.field--plain input { padding-left: 16px; }
.field .req { color: var(--danger); }
.field__hint { margin-top: 6px; font-size: .8rem; color: var(--muted); }

/* Toggle switch built on a checkbox */
.switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track {
  position: relative; flex-shrink: 0; width: 44px; height: 26px; margin-top: 1px; border-radius: 999px;
  background: var(--line); transition: background .2s;
}
.switch__track::after {
  content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(15,43,70,.3); transition: transform .2s var(--ease);
}
.switch input:checked + .switch__track { background: var(--accent-dark); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch__text { display: grid; line-height: 1.35; }
.switch__text strong { color: var(--ink); font-size: .9rem; }
.switch__text small { color: var(--muted); font-size: .8rem; }

.form-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding-top: 6px; }

/* =========================================================
   Partner applications
   ========================================================= */
.panel__head--wrap { flex-wrap: wrap; align-items: center; }
.stack { display: grid; gap: 18px; min-width: 0; }
.split--wide-side { grid-template-columns: minmax(0, 1fr) 360px; }

.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tab {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 9px;
  font-size: .86rem; font-weight: 600; color: var(--muted); white-space: nowrap; transition: background .2s, color .2s;
}
.tab:hover { color: var(--ink); }
.tab.is-active { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }
.tab__count { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--line); color: var(--body); font-size: .74rem; text-align: center; }
.tab.is-active .tab__count { background: var(--tint); color: var(--accent-ink); }
.tab--alert .tab__count { background: #fff4dc; color: #93650a; }
.tabs--block { width: fit-content; max-width: 100%; margin-bottom: 18px; }

.search { position: relative; flex: 1; min-width: 220px; max-width: 340px; }
.search__icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; height: 42px; padding: 0 14px 0 40px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card);
  transition: border-color .2s, box-shadow .2s;
}
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(79,184,240,.18); }

.cell-stack { display: grid; line-height: 1.35; min-width: 0; }
.cell-stack small { color: var(--muted); font-size: .8rem; }
a.cell-stack:hover .cell-title { color: var(--accent-ink); }

.badge--status-pending { background: #fff4dc; color: #93650a; }
.badge--status-approved { background: #e6f6f3; color: #136b60; }
.badge--status-rejected { background: #fbeceb; color: #9b2c20; }
.badge--lg { padding: 5px 14px; font-size: .8rem; }
.badge--count { margin-left: auto; min-width: 22px; justify-content: center; padding: 2px 7px; background: var(--star); color: var(--ink); font-size: .7rem; }

.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 22px -22px -22px; padding: 14px 22px; border-top: 1px solid var(--line); }
.pager__info { font-size: .84rem; color: var(--muted); }
.pager__links { display: flex; gap: 8px; }

.details { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; }
.details > div { min-width: 0; }
.details__full { grid-column: 1 / -1; }
.details dt { font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.details dd { color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
.details__text { white-space: pre-line; font-weight: 400 !important; color: var(--body) !important; }

.account { border-bottom: 0; padding-bottom: 0; }

.note { padding: 12px 14px; border-radius: 12px; margin-bottom: 16px; font-size: .88rem; }
.note strong { display: block; margin-bottom: 2px; }
.note--danger { background: #fbeceb; color: #9b2c20; }
.note--warn { background: #fff4dc; color: #93650a; }
.note p { white-space: pre-line; }

.decision { display: grid; gap: 10px; }
.decision__note { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: .8rem; color: var(--muted); }
.btn--success { background: var(--success); color: #fff; }
.btn--success:hover { background: #17837a; transform: translateY(-1px); box-shadow: 0 10px 20px -10px var(--success); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { background: #a93226; }
.btn--danger-ghost { border-color: #f0c4bf; color: var(--danger); background: var(--card); }
.btn--danger-ghost:hover { background: #fbeceb; }

.reject summary { list-style: none; cursor: pointer; }
.reject summary::-webkit-details-marker { display: none; }
.reject[open] summary { background: #fbeceb; }
.reject__form { margin-top: 12px; gap: 12px; }
.reject textarea {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); resize: vertical;
}
.reject textarea:focus { outline: none; border-color: var(--danger); box-shadow: 0 0 0 4px rgba(192,57,43,.12); }
.field .opt { font-weight: 400; color: var(--muted); font-size: .78rem; }

/* =========================================================
   Login
   ========================================================= */
.auth { background: var(--bg); }
.auth__grid { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }

.auth__visual {
  position: relative; overflow: hidden; color: rgba(255,255,255,.75);
  background:
    linear-gradient(160deg, rgba(15,43,70,.92) 0%, rgba(15,43,70,.78) 55%, rgba(11,120,184,.55) 100%),
    url("https://images.unsplash.com/photo-1600596542815-ffad4c1539a9?auto=format&fit=crop&w=1400&q=80") center / cover no-repeat,
    var(--ink);
}
.auth__visual-inner { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; padding: clamp(32px, 5vw, 64px); }
.auth__pitch { max-width: 460px; }
.auth__pitch h2 { color: #fff; font-size: clamp(1.8rem, 3vw, 2.6rem); letter-spacing: -.01em; margin-bottom: 26px; }
.auth__points { display: grid; gap: 12px; }
.auth__points li { display: flex; align-items: center; gap: 12px; font-weight: 500; }
.auth__points .icon {
  width: 34px; height: 34px; padding: 8px; border-radius: 10px; background: rgba(79,184,240,.18); color: var(--gold);
}
.auth__copy { font-size: .82rem; color: rgba(255,255,255,.5); }

.auth__panel { display: grid; place-items: center; padding: clamp(24px, 5vw, 64px) 20px; }
.auth__card { width: 100%; max-width: 420px; }
.auth__brand-mobile { display: none; margin-bottom: 32px; }
.auth__title { font-size: clamp(1.9rem, 3vw, 2.3rem); letter-spacing: -.01em; }
.auth__lead { color: var(--muted); margin: 6px 0 28px; }
.auth__back { display: inline-block; margin-top: 28px; font-size: .88rem; font-weight: 600; color: var(--muted); }
.auth__back:hover { color: var(--accent-ink); }

.form { display: grid; gap: 18px; }
.field label { display: block; margin-bottom: 7px; font-size: .86rem; font-weight: 600; color: var(--ink); }
.field__control { position: relative; }
.field__icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; transition: color .2s; }
.field input {
  width: 100%; height: 52px; padding: 0 16px 0 44px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
}
.field input::placeholder { color: #a3b1bd; }
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(79,184,240,.18); }
.field__control:focus-within .field__icon { color: var(--accent-ink); }
.field input[type="password"], .field input[data-revealed] { padding-right: 52px; }
.field__reveal {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px;
  display: grid; place-items: center; border-radius: 10px; color: var(--muted);
}
.field__reveal:hover { color: var(--ink); background: var(--tint); }
.field__reveal .when-shown, .field__reveal[aria-pressed="true"] .when-hidden { display: none; }
.field__reveal[aria-pressed="true"] .when-shown { display: block; }
.field.has-error input { border-color: var(--danger); }
.field.has-error input:focus { box-shadow: 0 0 0 4px rgba(192,57,43,.14); }
.field__error { margin-top: 6px; font-size: .82rem; font-weight: 500; color: var(--danger); }

.check { display: inline-flex; align-items: center; gap: 10px; font-size: .9rem; cursor: pointer; width: fit-content; }
.check input { width: 18px; height: 18px; accent-color: var(--accent-dark); }

/* =========================================================
   Profile
   ========================================================= */
img.avatar { object-fit: cover; padding: 0; }
.avatar img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.avatar--xl { width: 88px; height: 88px; font-size: 1.6rem; overflow: hidden; }
.avatar-field__label { display: block; margin-bottom: 10px; font-size: .86rem; font-weight: 600; color: var(--ink); }
.avatar-picker { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.avatar-picker__actions { display: grid; justify-items: start; gap: 10px; }
.avatar-picker__actions .btn { cursor: pointer; }
.avatar-picker__actions .field__hint { margin-top: 0; }
.avatar-picker .sr-only:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }

/* =========================================================
   Services
   ========================================================= */
.field textarea {
  width: 100%; padding: 12px 16px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--card); color: var(--ink); resize: vertical; transition: border-color .2s, box-shadow .2s;
}
.field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(79,184,240,.18); }
.field.has-error textarea { border-color: var(--danger); }
/* CKEditor */
.field .ck.ck-editor__main > .ck-editor__editable { min-height: 180px; border-radius: 0 0 12px 12px; }
.field .ck.ck-editor__top .ck-toolbar { border-radius: 12px 12px 0 0; }
.field .ck-content ul, .field .ck-content ol { padding-left: 1.4em; }
.field .ck-content ul { list-style: disc; }
.field .ck-content ol { list-style: decimal; }
.field.has-error .ck.ck-editor__main > .ck-editor__editable:not(.ck-focused) { border-color: var(--danger); }
.service-row { display: flex; align-items: center; gap: 14px; min-width: 0; }
.service-row__img { width: 64px; height: 48px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: var(--tint); }
.service-row__img--empty { display: grid; place-items: center; color: var(--muted); }
.service-thumb { display: grid; gap: 8px; margin-bottom: 12px; }
.service-thumb img { width: 100%; max-height: 220px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.service-thumb figcaption { font-size: .8rem; color: var(--muted); }

/* Settings: logos are wide and often transparent, so show the whole thing on a checkered tint */
.logo-thumb img { max-height: 90px; width: auto; max-width: 100%; object-fit: contain; padding: 12px; background: repeating-conic-gradient(var(--line) 0 25%, var(--card) 0 50%) 0 0 / 16px 16px; }
.logo-remove { margin-bottom: 12px; }

/* Testimonials */
.testimonial-thumb img { width: 96px; height: 96px; max-height: none; border-radius: 50%; }
.avatar--img { object-fit: cover; padding: 0; }
.rating { color: #b9800f; letter-spacing: 1px; }

/* About section */
.about-editor { max-width: 760px; }
.field-row { display: grid; gap: 18px; grid-template-columns: 140px minmax(0, 1fr); }
.about-editor__note { margin-top: -10px; }
.field-row--even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 560px) { .field-row { grid-template-columns: minmax(0, 1fr); } }

/* =========================================================
   Selects
   ========================================================= */
.field select {
  width: 100%; height: 52px; padding: 0 44px 0 16px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237a8a99' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 16px center;
  color: var(--ink); appearance: none; cursor: pointer; transition: border-color .2s, box-shadow .2s;
}
.field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(79,184,240,.18); }
.field.has-error select { border-color: var(--danger); }

/* Icon picker (Tom Select) */
.field .ts-wrapper.single .ts-control {
  min-height: 52px; padding: 0 44px 0 16px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--card); color: var(--ink); box-shadow: none; font-size: inherit; cursor: pointer; align-items: center; flex-wrap: nowrap;
}
.field .ts-wrapper.single .ts-control .item { margin: 0; flex-shrink: 0; white-space: nowrap; }
.field .ts-wrapper.single .ts-control::after { right: 18px; border-color: var(--muted) transparent transparent; }
.field .ts-wrapper.single.dropdown-active .ts-control::after { border-color: transparent transparent var(--muted); }
.field .ts-wrapper.focus .ts-control { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(79,184,240,.18); }
.field.has-error .ts-wrapper .ts-control { border-color: var(--danger); }
.field .ts-control input { height: auto; padding: 0 0 0 8px; border: 0; border-radius: 0; box-shadow: none; }
.field .ts-dropdown { margin-top: 6px; border: 1.5px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm); overflow: hidden; font-size: inherit; }
.field .ts-dropdown .ts-dropdown-content { max-height: 280px; }
.field .ts-dropdown .option { padding: 8px 14px; }
.field .ts-dropdown .active { background: var(--tint); color: var(--accent-ink); }
.icon-option { display: flex; align-items: center; gap: 12px; }
.icon-option i { width: 20px; text-align: center; color: var(--accent-ink); font-size: 1rem; }

.category-row { display: flex; align-items: center; gap: 12px; }
.category-row__icon { width: 36px; height: 36px; flex-shrink: 0; border-radius: 10px; display: grid; place-items: center; background: var(--tint); color: var(--accent-ink); }
.table tr.is-muted .category-row__icon { color: var(--muted); }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1280px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "enq enq" "proj acct"; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .split__side { position: static; order: -1; }
  .search { max-width: none; }
}

/* Tablet & phone: sidebar becomes an off-canvas drawer */
@media (max-width: 1024px) {
  .admin-main { margin-left: 0; }
  .sidebar { width: min(var(--sidebar-w), 86vw); transform: translateX(-100%); box-shadow: none; visibility: hidden; transition: transform .35s var(--ease), visibility 0s .35s; }
  .sidebar-open .sidebar { transform: none; visibility: visible; box-shadow: var(--shadow-lg); transition: transform .35s var(--ease), visibility 0s; }
  .sidebar__close { display: inline-grid; }
  .sidebar-backdrop {
    position: fixed; inset: 0; z-index: 50; background: rgba(10,31,51,.55);
    -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fade .25s;
  }
  @keyframes fade { from { opacity: 0; } }
  body.sidebar-open { overflow: hidden; }

  .auth__grid { grid-template-columns: 1fr; }
  .auth__visual { display: none; }
  .auth__brand-mobile { display: inline-flex; }
}

@media (max-width: 760px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "enq" "proj" "acct"; }
  .topbar__site { display: none; }
  .user-chip { padding-right: 4px; }
  .user-chip__meta, .user-chip__caret { display: none; }
  .welcome { align-items: flex-start; }
  .welcome__actions { width: 100%; }
  .welcome__actions .btn { flex: 1; }
}

@media (max-width: 520px) {
  body { font-size: 14.5px; }
  .stats { gap: 12px; }
  .stat { flex-direction: column; gap: 12px; padding: 16px; }
  .stat__icon { width: 40px; height: 40px; border-radius: 12px; }
  .stat__value { font-size: 1.6rem; }
  .stat__trend { align-items: flex-start; }
  .panel { padding: 18px; }
  .table-wrap { margin: 0 -18px -18px; }
  .pager { margin: 18px -18px -18px; padding-inline: 18px; }
  .details { grid-template-columns: 1fr; }
  .table th, .table td { padding-inline: 18px; }
  .admin-footer { justify-content: center; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* =========================================================
   Partner area (shares the admin shell)
   ========================================================= */
.auth__alt { margin-top: 18px; text-align: center; font-size: .9rem; color: var(--muted); }

.application__body { display: flex; gap: 16px; align-items: flex-start; padding: 16px; border-radius: 12px; background: var(--tint); }
.application__body strong { display: block; color: var(--ink); margin-bottom: 4px; }
.application__body p { font-size: .9rem; color: var(--body); }
.application__body p + p { margin-top: 8px; }
.application__icon { width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px; display: grid; place-items: center; background: var(--card); color: var(--accent-ink); }
.application--pending .application__body { background: #fff8e8; }
.application--pending .application__icon { color: #93650a; }
.application--approved .application__body { background: #e9f7f4; }
.application--approved .application__icon { color: #136b60; }
.application--rejected .application__body { background: #fbeceb; }
.application--rejected .application__icon { color: #9b2c20; }
.application__reason span { font-weight: 700; color: #9b2c20; }
.application__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

.quick-links { display: grid; margin-top: 16px; border-top: 1px solid var(--line); }
.quick-links__item { display: flex; align-items: center; gap: 10px; padding: 12px 2px; border-bottom: 1px solid var(--line); color: var(--ink); font-weight: 600; font-size: .9rem; overflow-wrap: anywhere; }
.quick-links__item:last-child { border-bottom: 0; padding-bottom: 0; }
.quick-links__item .icon { color: var(--accent-ink); flex-shrink: 0; }
.quick-links__item:hover { color: var(--accent-ink); }
.profile-stack { max-width: 860px; }
.field-grid { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 640px) { .field-grid { grid-template-columns: minmax(0, 1fr); } }
.partner-area .welcome { margin-bottom: 18px; }
/* Keep the main column first when the layout stacks (admin forms put the side panel first). */
.split--content-first > .split__side { order: 0; }
.field__label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 7px; }
.field__label-row label { margin-bottom: 0; }
.field__label-link { font-size: .82rem; }
