:root {
	--bg: #090d0d;
	--panel: #101616;
	--panel-2: #151d1c;
	--line: #25302e;
	--text: #f3f5ef;
	--muted: #8e9b96;
	--accent: #b8f34a;
	--accent-2: #6ed7bf;
	--danger: #ff7a72;
	--warning: #f5bd56;
	--sidebar: 252px;
	font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	color: var(--text);
	background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 70% -10%, #1a2d27 0, transparent 34%), var(--bg); }
button, input, select { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }
.noise { position: fixed; inset: 0; pointer-events: none; opacity: .12; background: repeating-linear-gradient(115deg, transparent 0 17px, #d8ffe003 17px 18px); }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(560px, 100%); padding: 54px; border: 1px solid var(--line); border-radius: 28px; background: rgba(16,22,22,.88); box-shadow: 0 36px 120px #0009; backdrop-filter: blur(16px); }
.brand-mark { width: 62px; height: 62px; display: grid; place-items: center; border-radius: 18px; background: var(--accent); color: #11180d; font: 700 36px/1 Georgia, serif; margin-bottom: 34px; box-shadow: 0 0 48px #b8f34a33; }
.small-mark { width: 34px; height: 34px; border-radius: 10px; font-size: 22px; margin: 0; }
.eyebrow { margin: 0 0 9px; color: var(--accent-2); letter-spacing: .14em; font-size: 11px; font-weight: 750; }
h1 { margin: 0; max-width: 440px; font-size: clamp(42px, 8vw, 66px); line-height: .98; letter-spacing: -.055em; }
h2 { margin: 0; font-size: 30px; letter-spacing: -.035em; }
h3 { margin: 0; font-size: 21px; letter-spacing: -.02em; }
.lede { color: var(--muted); font-size: 18px; line-height: 1.55; margin: 24px 0 34px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.button { border: 0; border-radius: 11px; padding: 11px 16px; cursor: pointer; font-weight: 700; transition: transform .15s, background .15s; }
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--accent); color: #12180f; }
.button.secondary { background: var(--panel-2); border: 1px solid var(--line); }
.button.danger { background: #3a1c1b; color: #ffaaa4; border: 1px solid #6b302d; }
.button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.app { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) 1fr; }
.sidebar { position: fixed; width: var(--sidebar); height: 100vh; padding: 22px 16px; background: #0c1111e8; border-right: 1px solid var(--line); backdrop-filter: blur(14px); display: flex; flex-direction: column; z-index: 10; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 26px; font-weight: 800; letter-spacing: -.02em; }
nav { flex: 1; }
.nav-label { color: #687570; font-size: 10px; font-weight: 800; letter-spacing: .15em; margin: 25px 12px 8px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 12px; background: transparent; border: 0; border-radius: 10px; padding: 11px 12px; color: var(--muted); cursor: pointer; text-align: left; }
.nav-item:hover { color: var(--text); background: #151c1b; }
.nav-item.active { color: var(--text); background: #1b2422; box-shadow: inset 3px 0 var(--accent); }
.nav-item span { width: 18px; color: var(--accent-2); text-align: center; }
.sidebar-footer { padding: 15px 7px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 34px 1fr 30px; gap: 9px; align-items: center; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #25342f; color: var(--accent); font-weight: 800; }
.identity { min-width: 0; display: flex; flex-direction: column; }
.identity strong, .identity span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.identity strong { font-size: 12px; }
.identity span { font-size: 10px; color: var(--muted); margin-top: 3px; }
.icon-button { border: 0; background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; border-radius: 8px; padding: 5px; }
.icon-button:hover { color: var(--text); background: var(--panel-2); }
main { grid-column: 2; padding: 35px 42px 70px; width: min(1600px, calc(100vw - var(--sidebar))); }
.topbar { display: flex; justify-content: space-between; align-items: end; margin-bottom: 30px; }
.header-actions { display: flex; gap: 10px; align-items: end; }
.select-label { color: var(--muted); font-size: 11px; display: flex; flex-direction: column; gap: 6px; }
select, input { width: 100%; color: var(--text); background: #111817; border: 1px solid var(--line); border-radius: 10px; padding: 10px 11px; outline: none; }
select:focus, input:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px #6ed7bf1b; }
.notice { margin: -12px 0 22px; border: 1px solid #4c6431; background: #1a2517; color: #d9f0b1; border-radius: 11px; padding: 12px 15px; }
.notice.error { border-color: #6b302d; background: #291817; color: #ffaaa4; }
.loading { height: 4px; display: flex; gap: 4px; margin-bottom: 18px; }
.loading span { height: 100%; flex: 1; background: var(--accent); animation: pulse 1s infinite alternate; }
.loading span:nth-child(2) { animation-delay: .2s; }.loading span:nth-child(3) { animation-delay: .4s; }
@keyframes pulse { to { opacity: .16; } }
.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(130px, 1fr)); gap: 12px; margin-bottom: 16px; }
.metric { min-height: 128px; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: linear-gradient(145deg, #131b1a, #0f1514); }
.metric.accent { background: linear-gradient(145deg, #c7ff58, #a0db38); color: #151d10; border: 0; }
.metric-label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.accent .metric-label { color: #3d521d; }
.metric-value { font-size: 28px; letter-spacing: -.045em; font-weight: 750; margin: 19px 0 7px; }
.metric-note { font-size: 11px; color: var(--muted); }
.accent .metric-note { color: #4c6328; }
.dashboard-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 16px; margin-top: 16px; }
.panel { border: 1px solid var(--line); border-radius: 15px; background: #0f1514cc; padding: 20px; min-width: 0; }
.panel.wide { grid-column: 1 / -1; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.panel-head p { margin: 5px 0 0; }
.chart { height: 210px; display: flex; align-items: end; gap: 7px; padding-top: 20px; border-bottom: 1px solid var(--line); }
.bar-wrap { flex: 1; min-width: 5px; height: 100%; display: flex; align-items: end; position: relative; }
.bar { width: 100%; min-height: 2px; border-radius: 4px 4px 0 0; background: linear-gradient(var(--accent), #619833); opacity: .86; }
.bar-wrap:hover .bar { opacity: 1; }
.bar-wrap span { display: none; position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); white-space: nowrap; background: #1d2725; border: 1px solid var(--line); border-radius: 6px; padding: 5px 7px; font-size: 10px; z-index: 2; }
.bar-wrap:hover span { display: block; }
.distribution { display: flex; flex-direction: column; gap: 15px; }
.dist-row { display: grid; grid-template-columns: minmax(100px, 1.2fr) 2fr auto; align-items: center; gap: 10px; font-size: 12px; }
.dist-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track { height: 7px; background: #202a28; border-radius: 99px; overflow: hidden; }
.fill { height: 100%; background: var(--accent-2); border-radius: 99px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { color: #73807b; text-align: left; text-transform: uppercase; letter-spacing: .08em; font-size: 9px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
td { padding: 12px; border-bottom: 1px solid #1c2523; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.status { display: inline-flex; gap: 6px; align-items: center; border-radius: 99px; padding: 4px 8px; background: #1b2522; color: #bdd1c9; font-size: 10px; text-transform: capitalize; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); }
.status.revoked::before, .status.error::before { background: var(--danger); }
.status.warn::before { background: var(--warning); }
.empty { padding: 55px 15px; text-align: center; color: var(--muted); }
.key-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 14px; }
.key-card { border: 1px solid var(--line); border-radius: 15px; background: var(--panel); padding: 19px; }
.key-card-head { display: flex; justify-content: space-between; align-items: center; }
.key-prefix { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.budget-line { display: flex; justify-content: space-between; margin: 25px 0 9px; font-size: 12px; }
.budget-track { height: 9px; background: #26302e; border-radius: 99px; overflow: hidden; }
.budget-fill { height: 100%; background: var(--accent); border-radius: 99px; }
.key-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; margin-top: 14px; }
.toolbar { display: flex; gap: 10px; margin-bottom: 15px; }
.toolbar input { max-width: 380px; }
.model-row { display: grid; grid-template-columns: 110px minmax(220px,1fr) 90px 100px 60px; gap: 12px; align-items: center; padding: 11px 12px; border-bottom: 1px solid #1c2523; font-size: 12px; }
.model-row.header { color: #73807b; text-transform: uppercase; letter-spacing: .08em; font-size: 9px; }
.model-name { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow: hidden; text-overflow: ellipsis; }
.switch { position: relative; width: 40px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; border-radius: 99px; background: #313b39; cursor: pointer; transition: .2s; }
.slider::before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; border-radius: 50%; background: #8e9b96; transition: .2s; }
.switch input:checked + .slider { background: #658e32; }
.switch input:checked + .slider::before { transform: translateX(18px); background: var(--accent); }
dialog { width: min(520px, calc(100vw - 30px)); border: 1px solid var(--line); border-radius: 18px; background: #121918; color: var(--text); padding: 24px; box-shadow: 0 30px 100px #000c; }
dialog::backdrop { background: #040606c9; backdrop-filter: blur(5px); }
dialog form label { display: flex; flex-direction: column; gap: 7px; font-size: 11px; color: var(--muted); margin: 16px 0; }
.dialog-head { display: flex; justify-content: space-between; align-items: start; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 23px; }
.secret-box { display: flex; gap: 9px; align-items: center; padding: 11px; background: #080c0b; border: 1px solid var(--line); border-radius: 11px; margin-top: 18px; }
.secret-box code { overflow: auto; flex: 1; color: var(--accent); }
@media (max-width: 1180px) { .metric-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 820px) {
	:root { --sidebar: 0px; }
	.app { display: block; }
	.sidebar { position: static; width: 100%; height: auto; padding: 12px; border-right: 0; border-bottom: 1px solid var(--line); }
	.brand { padding-bottom: 12px; }
	nav { display: flex; gap: 4px; overflow-x: auto; }
	.nav-label, .sidebar-footer { display: none; }
	#admin-nav { display: contents; }
	.nav-item { width: auto; white-space: nowrap; }
	main { width: 100%; padding: 24px 16px 50px; }
	.metric-grid { grid-template-columns: repeat(2, 1fr); }
	.dashboard-grid { grid-template-columns: 1fr; }
	.panel.wide { grid-column: auto; }
	.topbar { align-items: start; gap: 18px; }
	.header-actions { flex-wrap: wrap; justify-content: flex-end; }
	.model-row { grid-template-columns: 80px minmax(180px,1fr) 65px 50px; }
	.model-row > :nth-child(4) { display: none; }
}
@media (max-width: 520px) {
	.auth-card { padding: 34px 25px; }
	.metric-grid { grid-template-columns: 1fr 1fr; }
	.metric { min-height: 110px; padding: 14px; }
	.metric-value { font-size: 23px; }
	.topbar { flex-direction: column; }
	.header-actions { width: 100%; justify-content: space-between; }
}
