/* Solihull AI — admin panel */
@font-face { font-family: "Inter"; font-weight: 100 900; font-display: swap; src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Inter"; font-weight: 100 900; font-display: swap; src: url("../fonts/inter-latin-ext-wght-normal.woff2") format("woff2"); unicode-range: U+0100-02AF; }
:root {
  --ink: #0E1A17; --bg: #F3F1EC; --card: #fff; --line: #E3DED3; --muted: #66736E; --text: #17231F;
  --emerald: #0F6B55; --mint: #5FD3A8; --amber: #F2B84B; --low: #D8574A; --mid: #E2A23A; --good: #1F9D6E;
  --c-human: #0F6B55; --c-search: #3B6FD8; --c-ai: #E2A23A; --c-bot: #A3ADA9;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.55 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--emerald); }
.muted { color: var(--muted); } .small { font-size: .82rem; } .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; word-break: break-all; } .nowrap { white-space: nowrap; }
.logo-mark { width: 30px; height: 30px; }

.abar { position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; padding: .7rem 1.2rem; background: var(--ink); color: #fff; }
.abrand { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; font-weight: 700; }
.abrand small { font-weight: 500; color: var(--mint); margin-left: .2rem; }
.anav { display: flex; gap: .2rem; overflow-x: auto; order: 3; width: 100%; }
.anav a { padding: .45rem .8rem; border-radius: 999px; color: #C9D6D0; text-decoration: none; white-space: nowrap; font-weight: 500; }
.anav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.anav a[aria-current="page"] { background: var(--mint); color: var(--ink); }
.auser { display: flex; align-items: center; gap: .8rem; margin-left: auto; }
.auser a { color: #C9D6D0; text-decoration: none; font-size: .9rem; }
.auser form { margin: 0; }
@media (min-width: 900px) { .anav { order: 0; width: auto; } }

.amain { max-width: 1320px; margin: 0 auto; padding: 1.5rem 1.2rem 3rem; }
.atitle { font-size: 1.6rem; margin: .2rem 0 1.2rem; letter-spacing: -.01em; }

.abtn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 42px; padding: .55rem 1.1rem; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.abtn-primary { background: var(--ink); color: #fff; } .abtn-primary:hover { background: var(--emerald); color: #fff; }
.abtn-ghost { background: transparent; border-color: var(--line); color: inherit; }
.abar .abtn-ghost { color: #fff; border-color: rgba(255,255,255,.25); }
.abtn-danger { background: #FBE7E4; color: #9A2E22; }
.abtn-sm { min-height: 34px; padding: .35rem .8rem; font-size: .85rem; }
.abtn-block { width: 100%; }

.alert { padding: .8rem 1rem; border-radius: 10px; font-weight: 500; }
.alert-ok { background: #E3F4EC; color: #0C5A43; } .alert-err { background: #FBE7E4; color: #9A2E22; }

.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: radial-gradient(circle at 80% 0%, #1B4A3D, var(--ink) 60%); }
.auth-card { width: 100%; max-width: 400px; background: var(--card); border-radius: 18px; padding: 2rem; box-shadow: 0 30px 80px -20px rgba(0,0,0,.5); }
.auth-brand { display: flex; align-items: center; gap: .7rem; margin-bottom: 1.5rem; }
.aform { display: grid; gap: 1rem; }
.aform label { display: grid; gap: .35rem; font-weight: 600; font-size: .9rem; }
.aform input { min-height: 46px; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-weight: 400; }
.aform input:focus { outline: none; border-color: var(--emerald); box-shadow: 0 0 0 4px rgba(15,107,85,.15); }
.req { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .3rem; font-size: .9rem; }
.req .ok { color: var(--good); } .req .bad { color: var(--low); font-weight: 600; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: 1.2rem; }
.toolbar-links { display: flex; flex-wrap: wrap; gap: .5rem; }
.seg { display: inline-flex; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.seg a { padding: .4rem .8rem; border-radius: 9px; color: var(--text); text-decoration: none; font-weight: 500; font-size: .9rem; }
.seg a[aria-current="true"] { background: var(--ink); color: #fff; }
.pill { display: inline-block; padding: .4rem .8rem; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: .85rem; font-weight: 500; }
.pill-hot { background: var(--amber); border-color: var(--amber); color: var(--ink); font-weight: 700; }

.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: .8rem; margin-bottom: 1rem; }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(5, 1fr); } }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.1rem; display: grid; gap: .2rem; }
.kpi span { font-size: .82rem; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: .4rem; }
.kpi strong { font-size: 1.8rem; letter-spacing: -.02em; line-height: 1.1; }
.kpi small { color: var(--muted); font-size: .78rem; }
.kpi-total { background: var(--ink); color: #fff; border-color: var(--ink); grid-column: span 2; }
@media (min-width: 900px) { .kpi-total { grid-column: auto; } }
.kpi-total span, .kpi-total small { color: #A9B8B1; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.dot-human { background: var(--c-human); } .dot-search { background: var(--c-search); } .dot-ai { background: var(--c-ai); } .dot-bot { background: var(--c-bot); }

.apanel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1.1rem 1.2rem; margin-bottom: 1rem; min-width: 0; }
.apanel-narrow { max-width: 560px; }
.apanel-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem; align-items: center; margin-bottom: .6rem; }
.apanel-h { font-size: 1rem; margin: 0 0 .8rem; }
.apanel-head .apanel-h { margin: 0; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: .9rem; padding: 0; margin: 0; font-size: .82rem; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: .35rem; }

.chart-wrap { width: 100%; overflow: hidden; }
.chart { width: 100%; height: 260px; }
.chart .grid { stroke: #EDE9E1; stroke-width: 1; }
.chart .axis { font-size: 11px; fill: var(--muted); font-family: inherit; }
.chart .b-human { fill: var(--c-human); } .chart .b-search { fill: var(--c-search); } .chart .b-ai { fill: var(--c-ai); } .chart .b-bot { fill: var(--c-bot); }
.chart .hit { fill: transparent; } .chart .hit:hover { fill: rgba(14,26,23,.05); }
.share { display: flex; gap: 3px; margin-top: .8rem; }
.share-bar { -webkit-appearance: none; appearance: none; flex: 1; height: 8px; border: 0; border-radius: 4px; background: #EDE9E1; }
.share-bar::-webkit-progress-bar { background: #EDE9E1; border-radius: 4px; }
.share-human::-webkit-progress-value { background: var(--c-human); border-radius: 4px; } .share-human::-moz-progress-bar { background: var(--c-human); }
.share-search::-webkit-progress-value { background: var(--c-search); border-radius: 4px; } .share-search::-moz-progress-bar { background: var(--c-search); }
.share-ai::-webkit-progress-value { background: var(--c-ai); border-radius: 4px; } .share-ai::-moz-progress-bar { background: var(--c-ai); }
.share-bot::-webkit-progress-value { background: var(--c-bot); border-radius: 4px; } .share-bot::-moz-progress-bar { background: var(--c-bot); }

.agrid { display: grid; gap: 0 1rem; }
@media (min-width: 900px) { .agrid { grid-template-columns: 1fr 1fr; } .agrid-4 { grid-template-columns: repeat(4, 1fr); } }
.table-scroll { overflow-x: auto; }
.atable { width: 100%; border-collapse: collapse; font-size: .88rem; }
.atable th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: .4rem .5rem; border-bottom: 1px solid var(--line); }
.atable td { padding: .5rem; border-bottom: 1px solid #F0ECE4; vertical-align: top; }
.atable tr:last-child td { border-bottom: 0; }
.atable .num { text-align: right; white-space: nowrap; }
.cell-label { display: block; word-break: break-word; }
.bar { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 4px; border: 0; border-radius: 2px; background: #F0ECE4; margin-top: .3rem; }
.bar::-webkit-progress-bar { background: #F0ECE4; border-radius: 2px; }
.bar::-webkit-progress-value { background: var(--emerald); border-radius: 2px; }
.bar::-moz-progress-bar { background: var(--emerald); border-radius: 2px; }

.tag { display: inline-block; padding: .1rem .5rem; border-radius: 6px; font-size: .75rem; font-weight: 600; background: #F0ECE4; color: var(--text); white-space: nowrap; }
.tag-human { background: #E3F4EC; color: #0C5A43; } .tag-search { background: #E4ECFB; color: #23488F; } .tag-ai { background: #FCF0D9; color: #7A5410; } .tag-bot { background: #EEF0EF; color: #4D5653; }
.score { display: inline-block; min-width: 2.4em; text-align: center; padding: .15rem .4rem; border-radius: 6px; color: #fff; font-weight: 700; }
.score-good { background: var(--good); } .score-mid { background: var(--mid); } .score-low { background: var(--low); }
.pager { display: flex; gap: 1rem; justify-content: center; align-items: center; padding-top: 1rem; font-size: .9rem; }

.msgs { display: grid; gap: .6rem; }
.msg { background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.msg-new { border-left: 4px solid var(--amber); }
.msg summary { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; padding: .9rem 1.1rem; cursor: pointer; }
.msg-meta { font-size: .82rem; color: var(--muted); display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.msg-body { padding: 0 1.1rem 1.1rem; }
.msg-dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .6rem; margin: 0 0 1rem; }
.msg-dl dt { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.msg-dl dd { margin: 0; word-break: break-word; }
.msg-text { background: #FAF8F4; border-radius: 10px; padding: 1rem; white-space: normal; word-break: break-word; }
.msg-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.msg-actions form { margin: 0; }
.kv { list-style: none; padding: 0; margin: 0; }
.kv li { display: flex; justify-content: space-between; padding: .5rem 0; border-bottom: 1px solid #F0ECE4; }
