/* Ems K9s admin: same palette as the site, built phone-first. */
:root {
  --ink: #0E120D; --ink-2: #161C15; --ink-3: #1D251C; --green: #2D4A2E; --moss: #8DB58B;
  --bone: #F3EFE6; --sand: #C8794B; --sand-hi: #D98B5D; --muted: #A8B0A0; --line: rgba(243, 239, 230, .13);
  --danger: #E5776B; --gold: #E2C26A; --bar-h: 7.6rem;
  --display: "Anton", Impact, "Arial Narrow", sans-serif;
  --body: "Figtree", "Segoe UI", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: #39443A transparent; }
body {
  margin: 0; background: var(--ink); color: var(--bone); font: 400 1rem/1.5 var(--body);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  min-height: 100vh; min-height: 100dvh;
}
[hidden] { display: none !important; }
img { max-width: 100%; height: auto; display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--sand); outline-offset: 2px; border-radius: 6px; }
h1, h2 { font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: .01em; line-height: 1; margin: 0; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; padding: .8rem 1.1rem; min-height: 2.9rem; border: 1px solid var(--line); border-radius: 999px; background: var(--ink-3); color: var(--bone); font-weight: 700; font-size: .95rem; text-decoration: none; transition: background .2s, transform .2s, border-color .2s; }
.btn:hover { background: #26301F; border-color: rgba(243, 239, 230, .28); }
.btn--primary { background: var(--sand); border-color: var(--sand); color: var(--ink); }
.btn--primary:hover { background: var(--sand-hi); border-color: var(--sand-hi); }
.btn:disabled { opacity: .6; cursor: wait; }
.iconbtn { display: grid; place-items: center; width: 2.7rem; height: 2.7rem; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--bone); }
.iconbtn:hover { background: var(--ink-3); }

/* sign in */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 1.4rem; background: radial-gradient(60rem 40rem at 70% -10%, rgba(45, 74, 46, .45), transparent 60%), var(--ink); }
.login__card { width: min(100%, 24rem); background: var(--ink-2); border: 1px solid var(--line); border-radius: 18px; padding: 1.8rem 1.5rem 1.6rem; display: grid; gap: .55rem; box-shadow: 0 1.4rem 3rem rgba(0, 0, 0, .45); }
.login__logo { width: 7.2rem; justify-self: center; margin: -.2rem 0 1rem; }
label { font-weight: 600; font-size: .9rem; }
input, textarea { font: inherit; color: var(--bone); background: var(--ink); border: 1.5px solid rgba(243, 239, 230, .2); border-radius: 12px; padding: .8rem .9rem; width: 100%; }
input::placeholder, textarea::placeholder { color: #7D8776; }
input:focus, textarea:focus { outline: 3px solid rgba(200, 121, 75, .55); outline-offset: 0; border-color: var(--sand); }
.pw { position: relative; }
.pw input { padding-right: 4.6rem; }
.pw__show { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--moss); font-weight: 700; font-size: .85rem; padding: .5rem .7rem; }
.remember { display: flex; align-items: center; gap: .65rem; margin: .9rem 0 0; font-weight: 500; font-size: .95rem; color: var(--muted); cursor: pointer; }
.remember input { width: 1.2rem; height: 1.2rem; flex: none; margin: 0; accent-color: var(--moss); cursor: pointer; }
.error { margin: .2rem 0 0; min-height: 1.3em; color: var(--danger); font-weight: 600; font-size: .92rem; }
.login .btn { width: 100%; margin-top: .3rem; }

/* top bar */
.bar { flex-wrap: wrap; row-gap: .1rem; position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .9rem; padding: .6rem 1rem; background: rgba(14, 18, 13, .9); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); padding-top: calc(.6rem + env(safe-area-inset-top)); margin-top: calc(-1 * env(safe-area-inset-top)); }
.bar__logo { width: 3.1rem; flex: none; }
.bar__title { font-size: 1.7rem; flex: 1; }
.bar__actions { display: flex; gap: .4rem; }

/* layout: phone = one column; wide = list + detail side by side */
.layout { max-width: 78rem; margin: 0 auto; padding: 1rem; display: grid; gap: 1.2rem; }
.placeholder { display: none; }

/* summary tiles */
.tile { display: grid; gap: .15rem; text-align: left; padding: .7rem .75rem; background: var(--ink-2); border: 1px solid var(--line); border-radius: 14px; position: relative; overflow: hidden; }
.tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--muted); }
.tile--new::before { background: var(--sand); }
.tile--wait::before { background: var(--gold); }
.tile--bad::before { background: var(--danger); }
.tile--bad .tile__n { color: var(--danger); }
.tile--contacted::before { background: var(--moss); }
.tile--call_booked::before { background: var(--gold); }
.tile--client::before { background: #5FAF6A; }
.tile__n { font: 400 1.9rem/1 var(--display); }
.tile__l { font-size: .74rem; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.tile.is-on { background: var(--ink-3); border-color: rgba(243, 239, 230, .35); }
.tile--new .tile__n { color: var(--sand); }

/* search + filters */
.tools { display: grid; gap: .7rem; margin-bottom: .6rem; }
.search { position: relative; display: block; }
.search svg { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 2.6rem; border-radius: 999px; }
.chips { display: flex; gap: .45rem; overflow-x: auto; padding: .1rem 0 .3rem; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: .5rem .95rem; border-radius: 999px; border: 1px solid var(--line); background: transparent; font-weight: 600; font-size: .88rem; color: var(--muted); }
.chip.is-on { background: var(--bone); color: var(--ink); border-color: var(--bone); }
.liststatus { margin: .4rem 0 0; color: var(--muted); }

/* list */
.list { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .5rem; }
.row { width: 100%; display: grid; grid-template-columns: auto 1fr auto; gap: .8rem; align-items: start; text-align: left; padding: .95rem 1rem; background: var(--ink-2); border: 1px solid var(--line); border-radius: 14px; transition: background .2s, border-color .2s; }
.row:hover { background: var(--ink-3); }
.row.is-sel { border-color: var(--sand); background: var(--ink-3); }
.row__dot { width: .6rem; height: .6rem; border-radius: 50%; margin-top: .5rem; background: transparent; }
.row.is-new .row__dot { background: var(--sand); box-shadow: 0 0 0 4px rgba(200, 121, 75, .22); }
.row__main { display: grid; gap: .15rem; min-width: 0; }
.row__top { display: flex; justify-content: space-between; gap: .8rem; align-items: baseline; }
.row__name { font-weight: 700; font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1 1 auto; }
.row.is-new .row__name { color: #fff; }
.row__time { font-size: .8rem; color: var(--muted); white-space: nowrap; flex: none; }
.row__dog { color: var(--moss); font-size: .9rem; font-weight: 600; }
.row__msg { color: #C9CDC2; font-size: .93rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pill { align-self: start; margin-top: .15rem; padding: .22rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .03em; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.pill--new { background: var(--sand); border-color: var(--sand); color: var(--ink); }
.pill--contacted { color: var(--moss); border-color: rgba(141, 181, 139, .5); }
.pill--call_booked { color: var(--gold); border-color: rgba(226, 194, 106, .5); }
.pill--client { color: #7CCB86; border-color: rgba(124, 203, 134, .5); }

/* detail */
.detail { background: var(--ink-2); border: 1px solid var(--line); border-radius: 18px; padding: 1.2rem 1.1rem 1.4rem; }
.back { display: inline-flex; align-items: center; gap: .3rem; border: 0; background: none; color: var(--moss); font-weight: 700; padding: .3rem .2rem .3rem 0; margin-bottom: .6rem; }
.d-head h2 { font-size: clamp(2rem, 7vw, 2.8rem); }
.d-when { margin: .4rem 0 1.1rem; color: var(--muted); font-size: .92rem; }
.d-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.2rem; }
.d-actions .btn { flex: 1 1 8rem; }
.d-facts { margin: 0 0 1.2rem; display: grid; gap: .1rem; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.d-facts div { display: grid; grid-template-columns: 5rem 1fr; gap: .8rem; padding: .7rem .9rem; background: var(--ink); }
.d-facts div + div { border-top: 1px solid var(--line); }
.d-facts dt { color: var(--muted); font-size: .85rem; font-weight: 600; }
.d-facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.d-h { margin: 1.4rem 0 .55rem; font: 700 .76rem/1 var(--body); letter-spacing: .16em; text-transform: uppercase; color: var(--moss); }
.d-msg { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 1.05rem; line-height: 1.6; background: var(--ink); border: 1px solid var(--line); border-radius: 14px; padding: .95rem 1rem; }
.seg { display: flex; flex-wrap: wrap; gap: .45rem; }
.seg__b { padding: .6rem 1rem; border-radius: 999px; border: 1px solid var(--line); background: transparent; font-weight: 700; font-size: .9rem; color: var(--muted); transition: background .2s, color .2s; }
.seg__b:hover { color: var(--bone); border-color: rgba(243, 239, 230, .3); }
.seg__b.is-on { color: var(--ink); border-color: transparent; }
.seg__b--new.is-on { background: var(--sand); }
.seg__b--contacted.is-on { background: var(--moss); }
.seg__b--call_booked.is-on { background: var(--gold); }
.seg__b--client.is-on { background: #7CCB86; }
.seg__b--not_a_fit.is-on { background: #B9BDB2; }
.d-notes { resize: vertical; min-height: 7rem; line-height: 1.55; }
.d-saved { margin: .4rem 0 0; min-height: 1.3em; font-size: .85rem; color: var(--muted); }
.d-saved.is-error { color: var(--danger); font-weight: 600; }
.danger { margin-top: 1.6rem; display: inline-flex; align-items: center; gap: .5rem; padding: .65rem 1rem; border-radius: 999px; border: 1px solid rgba(229, 119, 107, .4); background: transparent; color: var(--danger); font-weight: 700; font-size: .9rem; }
.danger:hover { background: rgba(229, 119, 107, .1); }

/* toast */
.toast { position: fixed; left: 50%; bottom: calc(1.2rem + env(safe-area-inset-bottom)); transform: translate(-50%, 1rem); opacity: 0; pointer-events: none; background: var(--bone); color: var(--ink); font-weight: 700; padding: .7rem 1.1rem; border-radius: 999px; box-shadow: 0 .8rem 2rem rgba(0, 0, 0, .45); transition: opacity .25s, transform .25s; z-index: 50; max-width: calc(100vw - 2rem); text-align: center; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: var(--danger); color: #1b0a08; }

/* phone: when an enquiry is open it replaces the list */
@media (max-width: 59.99rem) {
  body.has-detail .pane-list { display: none; }
  .detail { border-radius: 16px; }
}

/* wide: list on the left, detail on the right */
@media (min-width: 60rem) {
  .layout { grid-template-columns: minmax(0, 26rem) minmax(0, 1fr); align-items: start; gap: 1.6rem; padding: 1.4rem; }
  .list-pane { max-height: calc(100vh - var(--bar-h) - 1rem); overflow-y: auto; padding-right: .3rem; }
  .detail, .placeholder { position: sticky; top: calc(var(--bar-h) + .6rem); }
  .placeholder { display: grid; place-items: center; min-height: 16rem; border: 1px dashed var(--line); border-radius: 18px; color: var(--muted); text-align: center; padding: 2rem; }
  .placeholder p { max-width: 22rem; margin: 0; }
  .back { display: none; }
  .detail { max-height: calc(100vh - var(--bar-h) - 1rem); overflow-y: auto; }
}

/* alerts bell */
#alerts { position: relative; }
#alerts .slash { transition: opacity .2s; }
#alerts[data-state="on"] { color: var(--sand); }
#alerts[data-state="on"] .slash { opacity: 0; }
#alerts[data-state="on"]::after { content: ""; position: absolute; top: .5rem; right: .55rem; width: .5rem; height: .5rem; border-radius: 50%; background: var(--sand); box-shadow: 0 0 0 2px var(--ink); }
#alerts[data-state="blocked"], #alerts[data-state="unsupported"] { opacity: .6; }
#alerts.is-busy { opacity: .6; pointer-events: none; }
/* sign-in motion */
.login__card { animation: cardIn .55s cubic-bezier(.2, .7, .2, 1) both; }
.login__logo { animation: cardIn .7s .08s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes cardIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.login input { transition: border-color .2s, box-shadow .25s, background .2s, transform .2s; }
.login input:focus { outline: 0; border-color: var(--sand); background: #0B0F0A; box-shadow: 0 0 0 4px rgba(200, 121, 75, .22), 0 .6rem 1.4rem -.8rem rgba(200, 121, 75, .6); transform: translateY(-1px); }
.login label { transition: color .2s; }
.login label:has(+ input:focus), .login label:has(+ .pw input:focus) { color: var(--sand); }
.login__card.shake { animation: shake .42s cubic-bezier(.36, .07, .19, .97) both; }
@keyframes shake { 15%, 85% { transform: translateX(-3px); } 30%, 70% { transform: translateX(6px); } 45%, 55% { transform: translateX(-8px); } }
.btn__spin { width: 0; height: 1.15rem; border: 2.4px solid rgba(14, 18, 13, .28); border-top-color: var(--ink); border-radius: 50%; opacity: 0; margin-right: -.55rem; transition: width .2s, opacity .2s, margin .2s; flex: none; box-sizing: border-box; }
.btn.is-loading .btn__spin { width: 1.15rem; opacity: 1; margin-right: 0; animation: spin .7s linear infinite; }
.btn.is-loading:disabled { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }
/* sign-in animation */
.fx { position: fixed; inset: 0; z-index: 100; display: grid; place-content: center; justify-items: center; gap: 1.4rem; background: radial-gradient(50rem 34rem at 50% 38%, rgba(45, 74, 46, .55), transparent 65%), var(--ink); opacity: 0; transition: opacity .3s; }
.fx.is-on { opacity: 1; }
.fx[hidden] { display: none; }
.fx__stage { position: relative; width: min(58vw, 13rem); aspect-ratio: 1; display: grid; place-items: center; }
.fx__ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; transform: rotate(-90deg); opacity: 0; }
.fx.is-on .fx__ring { animation: ringIn .5s .45s ease-out forwards; }
@keyframes ringIn { from { opacity: 0; transform: rotate(-90deg) scale(.86); } to { opacity: 1; transform: rotate(-90deg) scale(1); } }
.fx__track, .fx__fill, .fx__glow { fill: none; stroke-width: 3.4; }
.fx__glow { stroke: var(--sand); stroke-width: 9; stroke-opacity: .2; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; }
.fx__track { stroke: rgba(243, 239, 230, .12); }
.fx__fill { stroke: var(--sand); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; }
.fx__logo { width: 62%; height: auto; opacity: 0; transform: translateY(-190%) scale(1.08); filter: drop-shadow(0 .6rem 1rem rgba(0, 0, 0, .55)); }
.fx.is-on .fx__logo { animation: logoDrop .85s cubic-bezier(.3, 0, .2, 1) forwards; }
@keyframes logoDrop {
  0%   { opacity: 0; transform: translateY(-190%) scale(1.08); animation-timing-function: cubic-bezier(.55, 0, .9, .5); }
  45%  { opacity: 1; transform: translateY(0) scale(1); animation-timing-function: cubic-bezier(.2, .7, .3, 1); }
  66%  { transform: translateY(-9%) scale(1.01); animation-timing-function: cubic-bezier(.55, 0, .9, .5); }
  82%  { transform: translateY(0) scale(1); animation-timing-function: cubic-bezier(.2, .7, .3, 1); }
  92%  { transform: translateY(-2.5%); animation-timing-function: ease-in; }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.fx__msg { margin: 0; font-weight: 600; color: var(--muted); letter-spacing: .02em; min-height: 1.5em; opacity: 0; }
.fx.is-on .fx__msg { animation: cardIn .5s .6s ease-out forwards; }
.fx.is-done .fx__logo { animation: logoPop .5s ease-out both; }
@keyframes logoPop { 0% { transform: scale(1); } 45% { transform: scale(1.08); } 100% { transform: scale(1); } }
.fx.is-done .fx__fill { stroke: var(--moss); }
.fx.is-done .fx__glow { stroke: var(--moss); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
