:root {
	--navy: #13233a;
	--navy-2: #1d3150;
	--crimson: #8c1c3a;
	--crimson-2: #a5244a;
	--ink: #1b2433;
	--muted: #667085;
	--line: #e4e7ec;
	--bg: #f5f6f8;
	--card: #fff;
	--ok: #0f7a4a;
	--ok-bg: #e7f6ee;
	--warn: #9a5b00;
	--warn-bg: #fff4e0;
	--bad: #b42318;
	--bad-bg: #fdecea;
	--radius: 10px;
	--font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Tamil", sans-serif;
	--mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.55 var(--font); color: var(--ink); background: var(--bg); }
a { color: var(--crimson); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 26px; line-height: 1.2; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0 0 14px; }
code { font-family: var(--mono); font-size: 13px; }
small { font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.strong { font-weight: 600; color: var(--ink); }
.num { font-variant-numeric: tabular-nums; }
.ok { color: var(--ok); }
.bad { color: var(--bad); }
.lead { color: var(--muted); max-width: 70ch; margin: 0 0 20px; }
.warn { background: var(--warn-bg); color: var(--warn); padding: 10px 12px; border-radius: 8px; font-size: 13.5px; }

/* Layout */
body.has-nav { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--navy); color: #c9d3e3; padding: 22px 16px; display: flex; flex-direction: column; gap: 26px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none !important; }
.brand__mark { width: 36px; height: 36px; border-radius: 9px; background: var(--crimson); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 18px; }
.brand__name { font-weight: 700; line-height: 1.15; }
.brand__name small { display: block; font-weight: 400; color: #9fb0c8; font-size: 12px; }
.brand--dark { color: var(--ink); margin-bottom: 22px; }
.brand--dark .brand__name small { color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { color: #c9d3e3; padding: 9px 12px; border-radius: 8px; font-weight: 500; text-decoration: none; }
.nav a:hover { background: var(--navy-2); color: #fff; }
.nav a[aria-current="page"] { background: var(--crimson); color: #fff; }
.side__out { margin-top: auto; }
.side__out button { background: none; border: 1px solid #34496a; color: #c9d3e3; border-radius: 8px; padding: 8px 12px; width: 100%; cursor: pointer; font: inherit; }
.side__out button:hover { border-color: #c9d3e3; color: #fff; }
.main { padding: 32px clamp(16px, 4vw, 44px) 60px; min-width: 0; max-width: 1240px; width: 100%; }
body.is-bare .main { max-width: none; display: grid; place-items: start center; padding-top: 7vh; }

.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.back { font-size: 13px; color: var(--muted); display: inline-block; margin-bottom: 6px; }

/* Cards & grids */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; align-items: start; }
.cols--edit { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: 18px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat b { display: block; font-size: 28px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 13px; }
.stat:first-child { border-top: 3px solid var(--crimson); }

/* Forms */
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 13.5px; }
.form label small { font-weight: 400; color: var(--muted); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
input[type=text], input[type=email], input[type=url], input[type=password], input[type=number], input[type=date], input[type=search], input[type=file], select, textarea {
	font: inherit; font-weight: 400; color: var(--ink); background: #fff; border: 1px solid #cfd4dc; border-radius: 8px; padding: 9px 11px; width: 100%; min-width: 0;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(140, 28, 58, .25); border-color: var(--crimson); }
fieldset.db { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px 16px; margin: 0; display: flex; flex-direction: column; gap: 10px; }
fieldset.db legend { font-weight: 700; font-size: 13.5px; padding: 0 6px; }
.form label.radio { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; }
.form label.radio input { margin-top: 4px; }
[hidden] { display: none !important; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; font-size: 14px; padding: 9px 16px; border-radius: 8px; border: 1px solid #cfd4dc; background: #fff; color: var(--ink); cursor: pointer; text-decoration: none !important; white-space: nowrap; }
.btn:hover { border-color: var(--ink); }
.btn--primary { background: var(--crimson); border-color: var(--crimson); color: #fff; }
.btn--primary:hover { background: var(--crimson-2); border-color: var(--crimson-2); }
.btn--ghost { background: transparent; }
.btn--danger { background: #fff; color: var(--bad); border-color: #f1b8b2; }
.btn--danger:hover { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn--sm { padding: 5px 10px; font-size: 13px; }
.btn--lg { padding: 12px 20px; font-size: 15px; }

/* Flash */
.flash { padding: 11px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; border: 1px solid; }
.flash--ok { background: var(--ok-bg); color: var(--ok); border-color: #b7e2c8; }
.flash--error { background: var(--bad-bg); color: var(--bad); border-color: #f4c3bd; }

/* Pills & tags */
.pill { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pill--active { background: var(--ok-bg); color: var(--ok); }
.pill--expired { background: var(--warn-bg); color: var(--warn); }
.pill--suspended { background: var(--bad-bg); color: var(--bad); }
.tag { font-size: 11px; background: #eef1f6; color: var(--muted); padding: 1px 7px; border-radius: 99px; font-weight: 600; }

/* Tables */
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar input[type=search] { flex: 1 1 280px; width: auto; }
.toolbar select { width: auto; }
.tablewrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 11px 16px; border-bottom: 1px solid var(--line); background: #fafbfc; white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table code.key { white-space: nowrap; }
.table .actions > div { display: flex; gap: 6px; justify-content: flex-end; }
.upload { margin-bottom: 18px; }

/* Copy */
.copy { display: flex; align-items: center; gap: 8px; background: #f3f4f7; border: 1px solid var(--line); border-radius: 8px; padding: 6px 6px 6px 12px; min-width: 0; }
.copy code { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.copy--big code { font-size: 17px; font-weight: 700; letter-spacing: .02em; color: var(--navy); }
.card--key { border-top: 3px solid var(--crimson); display: flex; flex-direction: column; gap: 12px; }
.card--key h2 { margin: 0; }
.msg summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--crimson); }
.msg textarea { margin: 10px 0 8px; font-size: 13px; }

/* Lists */
.feed, .sites, .plist, .checks { list-style: none; margin: 0; padding: 0; }
.feed li { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.feed li:last-child { border-bottom: 0; }
.feed time { display: block; color: var(--muted); font-size: 12px; }
.feed--small li { font-size: 13.5px; padding: 7px 0; }
.sites li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.sites li:last-child { border-bottom: 0; }
.sites li > div { min-width: 0; overflow-wrap: anywhere; }
.sites small { display: block; }
.plist li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
.plist li:last-child { border-bottom: 0; }
.danger { text-align: right; }

/* Auth & install */
.auth { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 32px; width: 100%; max-width: 420px; box-shadow: 0 10px 30px rgba(19, 35, 58, .06); }
.auth--wide { max-width: 640px; }
.auth h1 { margin-bottom: 6px; }
.auth .form { margin-top: 18px; }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin: 18px 0; font-size: 13.5px; }
.checks .is-ok { color: var(--ok); }
.checks .is-bad { color: var(--bad); font-weight: 600; }

@media (max-width: 900px) {
	body.has-nav { grid-template-columns: 1fr; }
	.side { position: static; height: auto; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 12px 16px; }
	.nav { flex-direction: row; overflow-x: auto; grid-column: 1 / -1; }
	.nav a { padding: 7px 10px; white-space: nowrap; }
	.side__out { margin: 0; grid-row: 1; grid-column: 2; }
	.side__out button { width: auto; padding: 6px 10px; }
	.cols--edit { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
	.row2, .checks { grid-template-columns: 1fr; }
	.row2 > span:empty { display: none; }
	.auth { padding: 22px; }
	.main { padding: 20px 16px 48px; }
	.table--licenses th:nth-child(2), .table--licenses td:nth-child(2), .table--licenses th:nth-child(5), .table--licenses td:nth-child(5) { display: none; }
}
