:root { --void: #050814; --deep: #1b2352; --ink: #e6ecf7; --muted: #93a0bd; --ion: #6fe3ff; --halo: #ffe9b8;
  --edge: rgba(150, 190, 255, .16); --glass: rgba(150, 180, 255, .06); --ok: #7be3b0; --warn: #ffcf7a; --danger: #ff8a8a;
  --font: "Manrope", system-ui, sans-serif; --display: "Unbounded", "Manrope", sans-serif; --gutter: clamp(16px, 4vw, 48px); }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(60vmax 40vmax at 8% 110%, rgba(27, 35, 82, .9), transparent 70%), var(--void);
  color: var(--ink); font: 400 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ion); outline-offset: 2px; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2 { font-family: var(--display); font-weight: 400; margin: 0 0 12px; }
h2 { font-size: 17px; }

.top { display: flex; align-items: center; gap: 14px; padding: 16px var(--gutter); border-bottom: 1px solid var(--edge); }
.logo { font-family: var(--display); font-size: 18px; text-decoration: none; }
.crumb { color: var(--muted); border-left: 1px solid var(--edge); padding-left: 14px; }
.top nav { margin-left: auto; display: flex; gap: 18px; align-items: center; font-size: 14px; }
.top nav a { text-decoration: none; color: var(--muted); }
.top nav a:hover { color: var(--ink); }
.link { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; }
.link:hover { color: var(--ink); }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--edge); background: var(--glass); cursor: pointer; text-decoration: none; font-weight: 500; }
.btn.primary { background: linear-gradient(135deg, var(--ion), #93b8ff); color: #04101f; border-color: transparent; }
.btn.ghost:hover { background: rgba(150, 180, 255, .12); }

.stats, .tabs, #view-clients, #view-hooks { margin-left: var(--gutter); margin-right: var(--gutter); }
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 24px; }
.stat { background: var(--glass); border: 1px solid var(--edge); border-radius: 16px; padding: 16px 18px; }
.stat strong { display: block; font: 400 30px/1.1 var(--display); }
.stat span { color: var(--muted); font-size: 13px; }
.stat.ok strong { color: var(--ok); } .stat.warn strong { color: var(--warn); }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); } }

.tabs { display: flex; gap: 4px; margin-top: 28px; border-bottom: 1px solid var(--edge); }
.tabs button { background: none; border: 0; padding: 10px 16px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--ink); border-color: var(--ion); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 14px; }
.toolbar input, .toolbar select, dialog input { background: var(--glass); border: 1px solid var(--edge); border-radius: 12px; padding: 10px 14px; min-height: 40px; }
.toolbar input { flex: 1 1 220px; }
.toolbar select option, select option { background: #0c1230; }
.toolbar .btn { margin-left: auto; }

.table-wrap { overflow-x: auto; border: 1px solid var(--edge); border-radius: 16px; background: var(--glass); margin-bottom: 40px; }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 13px; padding: 12px 16px; border-bottom: 1px solid var(--edge); }
td { padding: 12px 16px; border-bottom: 1px solid rgba(150, 190, 255, .08); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.who strong { display: block; font-weight: 500; } td.who span { color: var(--muted); font-size: 13px; }
.actions-col { text-align: right; } td.actions { text-align: right; white-space: nowrap; }
.act { background: none; border: 1px solid var(--edge); border-radius: 999px; padding: 4px 11px; margin-left: 4px; font-size: 13px; cursor: pointer; color: var(--muted); }
.act:hover { color: var(--ink); border-color: var(--ion); } .act.danger:hover { color: var(--danger); border-color: var(--danger); }
.empty { padding: 32px 16px; text-align: center; color: var(--muted); margin: 0; }

.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; border: 1px solid var(--edge); }
.pill.active { color: var(--ok); border-color: rgba(123, 227, 176, .4); }
.pill.trial { color: var(--ion); border-color: rgba(111, 227, 255, .4); }
.pill.expired { color: var(--warn); border-color: rgba(255, 207, 122, .4); }
.pill.blocked { color: var(--danger); border-color: rgba(255, 138, 138, .4); }
.pill.pending { color: var(--halo); border-color: rgba(255, 233, 184, .4); }

.hook-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 20px; margin-top: 20px; align-items: start; }
@media (max-width: 900px) { .hook-grid { grid-template-columns: 1fr; } }
.panel-box { background: var(--glass); border: 1px solid var(--edge); border-radius: 16px; padding: 20px; }
.panel-box .table-wrap { margin-bottom: 0; }
.copy-row { display: flex; gap: 8px; align-items: center; } .copy-row code { flex: 1; min-width: 0; overflow-wrap: anywhere; background: rgba(0, 0, 0, .3); padding: 10px 12px; border-radius: 10px; font-size: 13px; }
.state { font-size: 14px; margin: 12px 0; } .state.ok { color: var(--ok); } .state.warn { color: var(--warn); }
.howto { color: var(--muted); padding-left: 20px; } .howto li { margin-bottom: 8px; } .howto strong { color: var(--ink); font-weight: 500; } .howto code { color: var(--halo); }

dialog { background: #0b1130; color: var(--ink); border: 1px solid var(--edge); border-radius: 20px; padding: 24px; width: min(92vw, 420px); }
dialog::backdrop { background: rgba(2, 4, 12, .7); }
dialog label { display: block; margin: 14px 0 0; color: var(--muted); font-size: 13px; } dialog input { display: block; width: 100%; margin-top: 6px; color: var(--ink); }
.hint { color: var(--muted); font-size: 13.5px; margin: 0; } .error { color: var(--danger); min-height: 1.4em; margin: 10px 0 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

.denied { max-width: 420px; margin: 20vh auto; padding: 0 var(--gutter); text-align: center; } .denied p { color: var(--muted); margin-bottom: 24px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: #0b1130; border: 1px solid var(--ion); padding: 10px 18px; border-radius: 999px; opacity: 0; pointer-events: none; transition: .25s; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 720px) { .toolbar .btn { margin-left: 0; width: 100%; } }
