/* Admin page: plain, phone-first, light. */
:root { --blue: #0369a1; --ink: #111418; --soft: #4a5059; --line: #e3e6ea; --green: #15803d; --red: #b91c1c; --amber: #b45309; }
* { box-sizing: border-box; }
body { margin: 0; background: #f4f6f8; color: var(--ink); font: 15px/1.45 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 16px; }
.top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
h1 { font-size: 22px; margin: 0; letter-spacing: -0.02em; }
h2 { font-size: 17px; margin: 0 0 6px; }
.link { color: var(--blue); font-weight: 600; text-decoration: none; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 14px; }
.hint { margin: 0 0 12px; color: var(--soft); font-size: 14px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin-bottom: 14px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.stat b { display: block; font-size: 22px; letter-spacing: -0.02em; }
.stat span { color: var(--soft); font-size: 13px; }
.row { display: grid; gap: 8px; }
@media (min-width: 560px) { .row { grid-template-columns: 1.3fr 1fr auto; } }
input { font: inherit; padding: 11px 12px; border: 1px solid #cdd3da; border-radius: 10px; background: #fff; min-width: 0; width: 100%; }
input:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
.search { margin-bottom: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border-radius: 10px; border: 0; background: var(--blue); color: #fff; font: 700 15px 'Inter', sans-serif; text-decoration: none; cursor: pointer; }
.btn:disabled { opacity: .55; }
.btn.alt { background: #fff; color: var(--blue); border: 1px solid #b6c6d4; }
.btn.small { min-height: 38px; padding: 0 12px; font-size: 14px; }
.btn.danger { background: #fff; color: var(--red); border: 1px solid #e4b4b4; }
.msg { padding: 10px 12px; border-radius: 10px; background: #e8f4ea; color: var(--green); margin: 0 0 12px; }
.msg.err { background: #fbeaea; color: var(--red); }
.free { list-style: none; margin: 12px 0 0; padding: 0; }
.free li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.free .who { min-width: 0; overflow-wrap: anywhere; }
.free .who small { display: block; color: var(--soft); }
.user { border-top: 1px solid var(--line); padding: 12px 0; }
.user:first-child { border-top: 0; }
.user h3 { margin: 0; font-size: 15px; overflow-wrap: anywhere; }
.meta { color: var(--soft); font-size: 13px; margin: 2px 0 8px; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; margin-left: 6px; vertical-align: middle; background: #eef1f4; color: var(--soft); }
.badge.comped { background: #e0f2fe; color: var(--blue); }
.badge.active { background: #e8f4ea; color: var(--green); }
.badge.trial { background: #fef3c7; color: var(--amber); }
.badge.expired { background: #fbeaea; color: var(--red); }
.acts { display: flex; flex-wrap: wrap; gap: 6px; }
.noteline { display: flex; gap: 6px; margin-top: 8px; }
.empty { color: var(--soft); padding: 8px 0; }
select { font: inherit; padding: 9px 10px; border: 1px solid #cdd3da; border-radius: 10px; background: #fff; min-width: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.funnel { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 8px; }
.funnel i { font-style: normal; font-size: 12px; padding: 2px 8px; border-radius: 99px; background: #eef1f4; color: var(--soft); }
.funnel i.on { background: #e8f4ea; color: var(--green); font-weight: 700; }
button.stat { font: inherit; text-align: left; cursor: pointer; color: inherit; }
button.stat:hover { border-color: var(--blue); }
.fold > summary { cursor: pointer; list-style: none; }
.fold > summary h2 { display: inline; margin: 0; }
.fold > summary::after { content: ' ▾'; color: var(--soft); }
.fold[open] > summary { margin-bottom: 8px; }
.user > summary { display: flex; align-items: center; gap: 12px; cursor: pointer; list-style: none; min-height: 48px; }
.user > summary::-webkit-details-marker { display: none; }
.user > summary .who { flex: 1; min-width: 0; }
.user > summary .em { font-weight: 600; overflow-wrap: anywhere; }
.user > summary small { color: var(--soft); font-size: 13px; }
.prog { width: 64px; height: 6px; border-radius: 99px; background: #e3e6ea; flex: none; overflow: hidden; }
.prog span { display: block; height: 100%; background: var(--green); }
.docs { color: var(--soft); font-size: 13px; width: 52px; text-align: right; flex: none; }
.user .body { padding: 6px 0 4px; }
@media (max-width: 520px) { .prog { width: 40px; } .docs { display: none; } }
/* Accounts table + drawer */
.tablewrap { overflow-x: auto; }
.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
.grid th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--soft); padding: 8px 10px; border-bottom: 2px solid var(--line); white-space: nowrap; }
.grid td { padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.grid .num { text-align: right; }
.grid tbody tr { cursor: pointer; }
.grid tbody tr:hover, .grid tbody tr.on { background: #f1f6fb; }
.grid td.acct { white-space: normal; min-width: 200px; }
.grid .em { font-weight: 600; overflow-wrap: anywhere; }
.grid small, .dhead small { color: var(--soft); }
.st.active { color: var(--green); font-weight: 600; } .st.trial { color: var(--amber); } .st.expired { color: var(--red); } .st.comped { color: var(--blue); }
.scrim { position: fixed; inset: 0; background: rgba(17,20,24,.35); z-index: 10; }
.drawer { position: fixed; left: 0; right: 0; bottom: 0; height: 75vh; max-width: 1000px; margin: 0 auto; background: #fff; z-index: 11; display: flex; flex-direction: column; border-radius: 16px 16px 0 0; box-shadow: 0 -8px 30px rgba(0,0,0,.22); transition: height .2s ease; }
.drawer.min { height: 64px; }
.drawer::before { content: ''; width: 40px; height: 4px; border-radius: 99px; background: #cdd3da; margin: 8px auto 0; flex: none; }
.dbody { flex: 1; overflow-y: auto; padding: 0 16px 24px; display: grid; gap: 0 28px; align-content: start; }
@media (min-width: 720px) { .dbody { grid-template-columns: 1fr 1fr; } }
.drawer.min .dbody { display: none; }
.dbtns { display: flex; gap: 6px; flex: none; }
body.sheet-open { padding-bottom: 80px; }
.dhead { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 16px 10px; border-bottom: 1px solid var(--line); flex: none; cursor: pointer; }
.dhead h3 { margin: 0; font-size: 16px; overflow-wrap: anywhere; }
.dhead > div:first-child { min-width: 0; }
.drawer h4 { margin: 18px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--soft); }
.kv { width: 100%; border-collapse: collapse; font-size: 14px; }
.kv th { text-align: left; font-weight: 500; color: var(--soft); padding: 7px 0; border-bottom: 1px solid var(--line); width: 52%; }
.kv td { padding: 7px 0; border-bottom: 1px solid var(--line); }
.kv td.yes { color: var(--green); font-weight: 600; } .kv td.no { color: var(--soft); }
/* Funnel chart: one hue, bars from a shared baseline */
:root { --bar: #2a78d6; --track: #e9edf1; }
.funnelchart h2 { margin-bottom: 2px; }
.frow { display: grid; grid-template-columns: 130px 1fr 96px; align-items: center; gap: 10px; padding: 5px 0; }
.flabel { font-size: 14px; color: var(--ink); }
.ftrack { height: 14px; background: var(--track); border-radius: 0 4px 4px 0; overflow: hidden; }
.fbar { display: block; height: 100%; background: var(--bar); border-radius: 0 4px 4px 0; }
.fval { font-size: 13px; color: var(--soft); text-align: right; font-variant-numeric: tabular-nums; }
.frow.worst .flabel, .frow.worst .fval { font-weight: 700; color: var(--ink); }
@media (max-width: 520px) { .frow { grid-template-columns: 96px 1fr 78px; gap: 6px; } }
[hidden] { display: none !important; }
