/* ============================================================
   Painel de Licenças (a casa) — a MESMA linguagem visual do Quibt Studio.
   Tokens, tipografia (Hanken Grotesk), raios, cards, chips e botões copiados de
   apps/desktop/src/renderer/styles/app.css (ver portal.css). Tema claro por
   padrão, escuro pelo sistema ou pelo botão da barra (data-theme no <html>).
   ============================================================ */
@font-face {
	font-family: "Hanken Grotesk";
	font-style: normal;
	font-weight: 400 700;
	font-display: swap;
	src: url("/fonts/hanken-grotesk-latin-ext.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: "Hanken Grotesk";
	font-style: normal;
	font-weight: 400 700;
	font-display: swap;
	src: url("/fonts/hanken-grotesk-latin.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: "JetBrains Mono";
	font-style: normal;
	font-weight: 400 700;
	font-display: swap;
	src: url("/fonts/jetbrains-mono-latin.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- tokens (= app.css do Studio) ---------- */
:root {
	color-scheme: light;
	--accent: #0071fb;
	--accent-hover: #005fe0;
	--accent-foreground: #ffffff;
	--accent-soft: #e7f1ff;
	--accent-soft-border: #cfe3ff;
	--solid-bg: #18181b;
	--solid-fg: #ffffff;
	--bg-app: #f5f5f7;
	--bg-behind: #e4e4e8;
	--panel: #ffffff;
	--surface: #fafafa;
	--surface-2: #f7f7f9;
	--border: #ececef;
	--border-subtle: #f0f0f3;
	--border-subtle-2: #f5f5f7;
	--ink: #18181b;
	--ink-2: #27272a;
	--ink-3: #3f3f46;
	--ink-4: #52525b;
	--muted: #71717a;
	--weak: #a1a1aa;
	--weaker: #c4c4cc;
	--success: #16a34a;
	--success-text: #15803d;
	--success-bg: #dcfce7;
	--success-border: #bbf7d0;
	--amber: #d97706;
	--amber-text: #b45309;
	--amber-bg: #fef3c7;
	--amber-border: #fde68a;
	--red: #dc2626;
	--red-text: #b91c1c;
	--red-bg: #fee2e2;
	--red-border: #fecaca;
	--radius-xs: 4px;
	--radius-sm: 8px;
	--radius-md: 12px;
	--radius-lg: 16px;
	--text-xs: 11px;
	--text-sm: 12px;
	--text-base: 13px;
	--text-md: 14px;
	--text-lg: 16px;
	--text-xl: 22px;
	--text-2xl: 32px;
	--fw-regular: 400;
	--fw-medium: 500;
	--fw-semibold: 600;
	--fw-bold: 700;
	--shadow-xs: 0 1px 2px rgba(24, 24, 27, 0.04);
	--shadow-sm: 0 1px 3px rgba(24, 24, 27, 0.06);
	--shadow-md: 0 12px 34px rgba(0, 0, 0, 0.16);
	--shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.4);
	--font-ui: "Hanken Grotesk", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	--font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
	--sidebar-w: 236px;
	--content-max: 1080px;
}
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		color-scheme: dark;
		--accent: #3b8cff;
		--accent-hover: #60a5fa;
		--accent-soft: color-mix(in srgb, var(--accent) 18%, var(--panel));
		--accent-soft-border: color-mix(in srgb, var(--accent) 34%, var(--panel));
		--solid-bg: #f4f4f5;
		--solid-fg: #18181b;
		--bg-app: #1a1a1e;
		--bg-behind: #0f0f12;
		--panel: #232327;
		--surface: #1f1f23;
		--surface-2: #26262b;
		--border: #34343a;
		--border-subtle: #2b2b30;
		--border-subtle-2: #292930;
		--ink: #f4f4f5;
		--ink-2: #e4e4e7;
		--ink-3: #d4d4d8;
		--ink-4: #b4b4bb;
		--muted: #a1a1aa;
		--weak: #8a8a93;
		--weaker: #5c5c64;
		--success: #22c55e;
		--success-text: #4ade80;
		--success-bg: #0f2a1a;
		--success-border: #14532d;
		--amber: #f59e0b;
		--amber-text: #fbbf24;
		--amber-bg: #2a1f08;
		--amber-border: #78350f;
		--red: #ef4444;
		--red-text: #f87171;
		--red-bg: #2a1212;
		--red-border: #5b1d1d;
		--shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.28);
		--shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
		--shadow-md: 0 12px 34px rgba(0, 0, 0, 0.55);
		--shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.7);
	}
}
:root[data-theme="dark"] {
	color-scheme: dark;
	--accent: #3b8cff;
	--accent-hover: #60a5fa;
	--accent-soft: color-mix(in srgb, var(--accent) 18%, var(--panel));
	--accent-soft-border: color-mix(in srgb, var(--accent) 34%, var(--panel));
	--solid-bg: #f4f4f5;
	--solid-fg: #18181b;
	--bg-app: #1a1a1e;
	--bg-behind: #0f0f12;
	--panel: #232327;
	--surface: #1f1f23;
	--surface-2: #26262b;
	--border: #34343a;
	--border-subtle: #2b2b30;
	--border-subtle-2: #292930;
	--ink: #f4f4f5;
	--ink-2: #e4e4e7;
	--ink-3: #d4d4d8;
	--ink-4: #b4b4bb;
	--muted: #a1a1aa;
	--weak: #8a8a93;
	--weaker: #5c5c64;
	--success: #22c55e;
	--success-text: #4ade80;
	--success-bg: #0f2a1a;
	--success-border: #14532d;
	--amber: #f59e0b;
	--amber-text: #fbbf24;
	--amber-bg: #2a1f08;
	--amber-border: #78350f;
	--red: #ef4444;
	--red-text: #f87171;
	--red-bg: #2a1212;
	--red-border: #5b1d1d;
	--shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.28);
	--shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
	--shadow-md: 0 12px 34px rgba(0, 0, 0, 0.55);
	--shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.7);
}

/* ---------- base ---------- */
* {
	box-sizing: border-box;
}
html,
body {
	margin: 0;
	min-height: 100dvh;
}
body {
	font-family: var(--font-ui);
	font-size: var(--text-md);
	line-height: 1.45;
	color: var(--ink);
	background: var(--bg-app);
	-webkit-font-smoothing: antialiased;
}
button,
input,
select,
textarea {
	font: inherit;
	color: inherit;
}
b,
strong {
	font-weight: var(--fw-semibold);
}
.muted {
	color: var(--muted);
}
[hidden] {
	display: none !important;
}
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ---------- controles ---------- */
input:where(:not([type="checkbox"]):not([type="radio"]):not([type="file"])),
select,
textarea {
	width: 100%;
	min-width: 0;
	height: 34px;
	padding: 0 12px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	font-size: var(--text-base);
	color: var(--ink-2);
	outline: none;
	transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
select {
	appearance: none;
	-webkit-appearance: none;
	padding-right: 30px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%2371717a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 10px center;
	background-size: 14px;
}
textarea {
	height: auto;
	padding: 10px 12px;
	resize: vertical;
	line-height: 1.5;
}
input::placeholder,
textarea::placeholder {
	color: var(--weak);
}
input:focus,
select:focus,
textarea:focus {
	border-color: var(--accent);
	background: var(--panel);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}
input[type="checkbox"],
input[type="radio"] {
	accent-color: var(--accent);
}
label {
	display: grid;
	gap: 6px;
	min-width: 0;
	font-size: var(--text-sm);
	font-weight: var(--fw-semibold);
	color: var(--ink-4);
}
label > small,
label .hint {
	font-weight: var(--fw-regular);
	color: var(--weak);
}
.field-label {
	font-size: var(--text-sm);
	font-weight: var(--fw-semibold);
	color: var(--ink-4);
	margin-bottom: 6px;
}
.hint {
	margin: 0;
	font-size: var(--text-sm);
	color: var(--weak);
	line-height: 1.5;
}

.btn-primary,
button[type="submit"]:not(.compact):not(.btn-ghost) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 34px;
	padding: 0 14px;
	background: var(--accent);
	color: var(--accent-foreground);
	border: none;
	border-radius: var(--radius-sm);
	font-size: var(--text-base);
	font-weight: var(--fw-semibold);
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.15s, transform 0.1s;
}
.btn-primary:hover,
button[type="submit"]:not(.compact):not(.btn-ghost):hover {
	background: var(--accent-hover);
}
.btn-primary:active {
	transform: translateY(1px);
}
.btn-block {
	width: 100%;
}
.btn-ghost {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	height: 34px;
	padding: 0 12px;
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	font-size: var(--text-base);
	font-weight: var(--fw-medium);
	color: var(--ink-4);
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-ghost:hover {
	background: var(--surface);
	border-color: var(--weak);
	color: var(--ink);
}
button.compact,
label.compact {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 28px;
	padding: 0 10px;
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	font-size: var(--text-sm);
	font-weight: var(--fw-medium);
	color: var(--ink-4);
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.15s, border-color 0.15s, color 0.15s;
}
button.compact:hover,
label.compact:hover {
	background: var(--surface);
	border-color: var(--weak);
	color: var(--ink);
}
button.compact.primary {
	background: var(--accent);
	border-color: var(--accent);
	color: var(--accent-foreground);
	font-weight: var(--fw-semibold);
}
button.compact.primary:hover {
	background: var(--accent-hover);
	border-color: var(--accent-hover);
}
button.compact.danger {
	color: var(--red-text);
}
button.compact.danger:hover {
	background: var(--red-bg);
	border-color: var(--red-border);
}
button:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}
.icon-button {
	appearance: none;
	width: 30px;
	height: 30px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: var(--radius-sm);
	background: transparent;
	color: var(--ink-4);
	font-size: var(--text-md);
	line-height: 1;
	cursor: pointer;
}
.icon-button:hover {
	background: color-mix(in srgb, var(--ink) 6%, transparent);
	color: var(--ink);
}
.icon-button svg {
	width: 16px;
	height: 16px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.7;
	stroke-linecap: round;
	stroke-linejoin: round;
}
/* Chips clicáveis do prazo (+30 dias, 1 ano…). */
.chip-row {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	align-self: end;
	padding-bottom: 3px;
}
.chip {
	height: 28px;
	padding: 0 12px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--panel);
	color: var(--ink-4);
	font-size: var(--text-sm);
	font-weight: var(--fw-medium);
	cursor: pointer;
}
.chip:hover {
	border-color: var(--accent);
	color: var(--accent);
	background: var(--accent-soft);
}
.status,
.tag,
.role-badge {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	height: 20px;
	padding: 0 8px;
	border-radius: 999px;
	font-size: var(--text-xs);
	font-weight: var(--fw-semibold);
	line-height: 1;
	white-space: nowrap;
	background: var(--surface-2);
	color: var(--ink-4);
	border: 1px solid var(--border-subtle);
}
.status {
	background: var(--success-bg);
	border-color: transparent;
	color: var(--success-text);
}
.status::before {
	content: "";
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--success);
}
.status.revoked,
.status.expired {
	background: var(--red-bg);
	color: var(--red-text);
}
.status.revoked::before,
.status.expired::before {
	background: var(--red);
}
.tag.owner,
.role-badge {
	background: var(--accent-soft);
	border-color: transparent;
	color: var(--accent);
}
.tag.disabled {
	background: var(--red-bg);
	border-color: transparent;
	color: var(--red-text);
}
.tag.env {
	background: var(--amber-bg);
	border-color: transparent;
	color: var(--amber-text);
}

/* ---------- login (= EntryShell do Studio) ---------- */
.login-view {
	min-height: 100dvh;
	display: grid;
	place-items: center;
	align-content: center;
	gap: 16px;
	padding: 24px;
	background: var(--bg-behind);
}
.login-card {
	width: min(420px, 100%);
	display: grid;
	gap: 12px;
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	background: var(--panel);
	box-shadow: var(--shadow-md);
	padding: 28px 28px 24px;
}
.login-brand {
	display: flex;
	align-items: center;
	gap: 10px;
}
.login-logo,
.brand-logo {
	display: block;
	flex: none;
	width: 22px;
	height: 22px;
	object-fit: contain;
	user-select: none;
	-webkit-user-drag: none;
}
.login-logo {
	width: 36px;
	height: 36px;
}
.login-title {
	font-size: var(--text-lg);
	font-weight: var(--fw-semibold);
	line-height: 1.2;
	letter-spacing: -0.01em;
}
.login-subtitle {
	font-size: var(--text-sm);
	color: var(--muted);
}
.login-lead {
	margin: 4px 0 0;
	color: var(--muted);
	font-size: var(--text-base);
	line-height: 1.5;
}
.field {
	display: grid;
	gap: 6px;
}
.field > span {
	font-size: var(--text-sm);
	font-weight: var(--fw-semibold);
	color: var(--ink-4);
}
.login-card input {
	height: 42px;
	padding: 0 14px;
	border-radius: var(--radius-md);
	font-size: var(--text-md);
	font-weight: var(--fw-medium);
}
.login-card button[type="submit"] {
	height: 42px;
	margin-top: 4px;
	border-radius: var(--radius-md);
	font-size: var(--text-md);
}
.login-error {
	margin: 0;
	padding: 10px 12px;
	border-radius: var(--radius-sm);
	background: var(--red-bg);
	color: var(--red-text);
	font-size: var(--text-base);
}
.login-footnote {
	margin: 0;
	color: var(--weak);
	font-size: var(--text-sm);
}
.login-switch {
	color: var(--accent);
	font-weight: var(--fw-semibold);
	text-decoration: none;
}
.login-switch:hover {
	text-decoration: underline;
}

/* ---------- casca: barra do topo (= titlebar do Studio) ---------- */
.shell {
	width: min(1180px, 100%);
	margin: 0 auto;
	padding: 0 24px 64px;
}
.topbar {
	position: sticky;
	top: 0;
	z-index: 30;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	height: 56px;
	margin: 0 -24px 22px;
	padding: 0 24px;
	background: color-mix(in srgb, var(--bg-app) 88%, transparent);
	backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--border-subtle);
}
.topbar-brand {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}
.brand-text {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
}
.brand {
	font-weight: var(--fw-semibold);
	font-size: var(--text-base);
	white-space: nowrap;
}
.back-link {
	appearance: none;
	border: none;
	background: none;
	padding: 0;
	color: var(--accent);
	font: inherit;
	font-size: var(--text-sm);
	font-weight: var(--fw-semibold);
	cursor: pointer;
}
.back-link:hover {
	text-decoration: underline;
}
.topbar-session {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}
.session-user {
	font-size: var(--text-base);
	font-weight: var(--fw-medium);
	color: var(--ink-3);
}
.menu {
	position: relative;
}
.menu-trigger .gear {
	font-size: var(--text-md);
	line-height: 1;
}
.menu-panel {
	position: absolute;
	right: 0;
	top: calc(100% + 6px);
	z-index: 40;
	width: 300px;
	display: grid;
	gap: 1px;
	padding: 6px;
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	background: var(--panel);
	box-shadow: var(--shadow-md);
}
.menu-item {
	appearance: none;
	display: grid;
	gap: 2px;
	text-align: left;
	border: none;
	border-radius: var(--radius-sm);
	background: none;
	padding: 8px 10px;
	cursor: pointer;
	font: inherit;
	color: var(--ink);
}
.menu-item:hover {
	background: color-mix(in srgb, var(--ink) 5%, transparent);
}
.menu-item strong {
	font-size: var(--text-base);
	font-weight: var(--fw-semibold);
}
.menu-item small {
	color: var(--muted);
	font-size: var(--text-sm);
	line-height: 1.4;
}

/* ---------- navegação do topo (= abas do Studio) ---------- */
.topnav {
	display: flex;
	align-items: center;
	gap: 2px;
	padding: 3px;
	border-radius: var(--radius-sm);
	background: color-mix(in srgb, var(--ink) 5%, transparent);
}
.topnav-item {
	appearance: none;
	height: 28px;
	padding: 0 12px;
	border: 0;
	border-radius: var(--radius-xs);
	background: transparent;
	color: var(--ink-4);
	font-size: var(--text-base);
	font-weight: var(--fw-medium);
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.12s, color 0.12s;
}
.topnav-item:hover {
	color: var(--ink);
}
.topnav-item.is-active {
	background: var(--panel);
	color: var(--ink);
	box-shadow: var(--shadow-xs);
}

/* ---------- filtros da lista ---------- */
.list-filters {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	margin: -6px 0 14px;
}
.list-filters select {
	width: auto;
	height: 30px;
	padding-top: 0;
	padding-bottom: 0;
	font-size: var(--text-sm);
}
.list-filters .btn-ghost {
	height: 30px;
	font-size: var(--text-sm);
	margin-left: auto;
}
.seg {
	display: inline-flex;
	gap: 2px;
	padding: 3px;
	border-radius: var(--radius-sm);
	background: color-mix(in srgb, var(--ink) 5%, transparent);
}
.seg-item {
	appearance: none;
	height: 24px;
	padding: 0 10px;
	border: 0;
	border-radius: var(--radius-xs);
	background: transparent;
	color: var(--ink-4);
	font-size: var(--text-sm);
	font-weight: var(--fw-medium);
	cursor: pointer;
}
.seg-item.is-active {
	background: var(--panel);
	color: var(--ink);
	box-shadow: var(--shadow-xs);
}

/* ---------- visão geral ---------- */
.kpis {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 12px;
	margin-bottom: 16px;
}
.kpi {
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	padding: 14px 16px;
	box-shadow: var(--shadow-xs);
}
.kpi b {
	display: block;
	font-size: var(--text-xl);
	font-weight: var(--fw-semibold);
	letter-spacing: -0.02em;
	font-variant-numeric: tabular-nums;
	line-height: 1.15;
}
.kpi span {
	display: block;
	margin-top: 3px;
	font-size: var(--text-sm);
	color: var(--muted);
}
.kpi .bar {
	margin-top: 10px;
}
.two-col {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
	gap: 16px;
	margin-bottom: 16px;
}
.panel-title {
	display: flex;
	align-items: baseline;
	gap: 8px;
	margin: 0 0 10px;
	font-size: var(--text-md);
	font-weight: var(--fw-semibold);
}
.panel-title .muted {
	font-weight: var(--fw-regular);
}
.panel-title .back-link {
	margin-left: auto;
}
.stack {
	display: grid;
	gap: 4px;
}
.stack-row {
	appearance: none;
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 9px 10px;
	border: 0;
	border-radius: var(--radius-sm);
	background: transparent;
	color: var(--ink);
	font: inherit;
	text-align: left;
	cursor: pointer;
}
.stack-row:not(.static):hover {
	background: color-mix(in srgb, var(--ink) 5%, transparent);
}
.stack-row.static {
	cursor: default;
}
.stack-row .status {
	flex: none;
	min-width: 96px;
	justify-content: center;
}
.stack-main {
	flex: 1;
	min-width: 0;
	display: grid;
	gap: 2px;
}
.stack-main b {
	font-size: var(--text-base);
	font-weight: var(--fw-semibold);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.stack-main small {
	color: var(--muted);
	font-size: var(--text-sm);
	line-height: 1.4;
}
.stack-main .bar {
	margin-top: 4px;
}
.stack-go {
	color: var(--weak);
}
.stack-when {
	flex: none;
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	color: var(--muted);
}
.bar {
	display: block;
	height: 5px;
	border-radius: 999px;
	background: var(--border-subtle);
	overflow: hidden;
}
.bar i {
	display: block;
	height: 100%;
	border-radius: 999px;
	background: var(--accent);
}
.bar i.hot {
	background: var(--amber);
}
.bar i.full {
	background: var(--red);
}
.status.expiring {
	background: var(--amber-bg);
	color: var(--amber-text);
}
.status.expiring::before {
	background: var(--amber);
}
.license-card.is-highlight {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}

/* ---------- páginas ---------- */
.page-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	margin-bottom: 16px;
}
.page-title {
	margin: 0 0 3px;
	font-size: var(--text-xl);
	font-weight: var(--fw-semibold);
	letter-spacing: -0.02em;
	line-height: 1.2;
}
.page-head .muted {
	margin: 0;
	font-size: var(--text-base);
	color: var(--weak);
}
.page-tools {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}
.page-tools input[type="search"] {
	width: 260px;
	flex: none;
}
.panel {
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	background: var(--panel);
	box-shadow: var(--shadow-xs);
	padding: 16px 18px;
}
.list-panel {
	display: grid;
	gap: 12px;
}
.empty {
	border: 1px dashed var(--border);
	border-radius: var(--radius-md);
	color: var(--muted);
	padding: 40px 28px;
	text-align: center;
	font-size: var(--text-base);
	background: var(--panel);
}

/* ---------- cards de empresa / plano / skill / acesso (= settings-card) ---------- */
.licenses {
	display: grid;
	gap: 12px;
}
.license-card {
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	background: var(--panel);
	box-shadow: var(--shadow-xs);
	padding: 16px 18px;
	transition: border-color 0.15s, box-shadow 0.15s;
}
.license-card:hover {
	border-color: var(--weak);
}
.card-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
}
.card-identity {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	column-gap: 10px;
	min-width: 0;
}
.license-logo {
	width: 32px;
	height: 32px;
	border-radius: var(--radius-sm);
	object-fit: cover;
	border: 1px solid var(--border);
	background: var(--panel);
}
.license-name {
	font-weight: var(--fw-semibold);
	font-size: var(--text-lg);
	letter-spacing: -0.01em;
}
.license-meta {
	flex-basis: 100%;
	color: var(--muted);
	font-size: var(--text-sm);
	margin-top: 2px;
}
.card-identity .license-logo + .license-name + .license-meta {
	margin-left: 42px;
}
.card-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 10px;
	margin: 14px 0 12px;
	padding: 12px 0;
	border-top: 1px solid var(--border-subtle);
	border-bottom: 1px solid var(--border-subtle);
}
.stat {
	display: grid;
	gap: 2px;
	min-width: 0;
}
.stat b {
	font-size: var(--text-md);
	font-weight: var(--fw-semibold);
	font-variant-numeric: tabular-nums;
	overflow-wrap: anywhere;
}
.stat span {
	color: var(--muted);
	font-size: var(--text-sm);
}
.card-actions {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	align-items: center;
}
.card-more {
	margin-top: 12px;
	border-top: 1px solid var(--border-subtle);
	padding-top: 10px;
}
.card-more > summary {
	cursor: pointer;
	font-size: var(--text-base);
	font-weight: var(--fw-medium);
	color: var(--muted);
	list-style: none;
}
.card-more > summary::-webkit-details-marker {
	display: none;
}
.card-more > summary::before {
	content: "▸ ";
	color: var(--weak);
}
.card-more[open] > summary::before {
	content: "▾ ";
}
.card-more > summary:hover {
	color: var(--ink);
}
.editor-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 12px 14px;
	margin: 12px 0;
}
.devices,
.members {
	margin-top: 12px;
	border-top: 1px solid var(--border-subtle);
	padding-top: 10px;
	display: grid;
	gap: 8px;
}
.devices-title {
	font-size: var(--text-xs);
	font-weight: var(--fw-semibold);
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--muted);
}
.member-row,
.member-add {
	display: grid;
	grid-template-columns: minmax(160px, 1.4fr) minmax(110px, 0.7fr) minmax(90px, 0.5fr) auto;
	gap: 8px;
	align-items: center;
	color: var(--ink-3);
	font-size: var(--text-base);
}
.member-add input,
.member-add select {
	height: 30px;
	padding: 0 8px;
}
.member-actions {
	display: flex;
	gap: 6px;
	justify-content: flex-end;
}
.device-row {
	display: grid;
	grid-template-columns: minmax(120px, 1fr) minmax(120px, 0.7fr) minmax(120px, 0.9fr) auto;
	gap: 8px;
	align-items: center;
	color: var(--ink-3);
	font-size: var(--text-base);
}
.device-row code {
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	padding: 3px 6px;
	border-radius: var(--radius-xs);
	background: var(--surface-2);
	color: var(--ink-3);
}
.admin-main {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
	gap: 10px;
	align-items: end;
}
.admin-tags {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	margin-top: 6px;
}
.admin-note {
	grid-column: 1 / -1;
	margin: 4px 0 0;
	color: var(--weak);
	font-size: var(--text-sm);
	line-height: 1.45;
}
.admin-card.is-self {
	border-color: var(--accent-soft-border);
}
details.exception {
	margin: 4px 0 10px;
	padding: 10px 12px;
	border: 1px dashed var(--border);
	border-radius: var(--radius-md);
	background: var(--surface);
	display: grid;
	gap: 8px;
}
details.exception > summary {
	cursor: pointer;
	font-size: var(--text-sm);
	font-weight: var(--fw-semibold);
	color: var(--muted);
}

/* ---------- tabela de atividade ---------- */
.table-wrap {
	overflow-x: auto;
	margin: -16px -18px;
}
.data-table {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--text-base);
}
.data-table th {
	text-align: left;
	background: var(--surface);
	color: var(--muted);
	font-size: var(--text-xs);
	font-weight: var(--fw-semibold);
	letter-spacing: 0.04em;
	text-transform: uppercase;
	padding: 8px 16px;
	border-bottom: 1px solid var(--border-subtle);
	white-space: nowrap;
}
.data-table td {
	padding: 10px 16px;
	border-bottom: 1px solid var(--border-subtle-2);
	color: var(--ink);
	vertical-align: top;
}
.data-table tbody tr:hover {
	background: color-mix(in srgb, var(--ink) 2.5%, transparent);
}
.data-table .cell-when,
.data-table .cell-who {
	white-space: nowrap;
	color: var(--muted);
	font-family: var(--font-mono);
	font-size: var(--text-xs);
}
.data-table .cell-detail {
	color: var(--muted);
}
.list-panel .empty {
	border: 0;
	background: transparent;
	padding: 24px;
}

/* ---------- modais (= overlays do Studio) ---------- */
body.modal-open {
	overflow: hidden;
}
.modal-backdrop {
	position: fixed;
	inset: 0;
	z-index: 60;
	display: grid;
	place-items: center;
	padding: 24px;
	background: rgba(15, 15, 18, 0.45);
	backdrop-filter: blur(2px);
	animation: fade-in 120ms ease;
}
.modal {
	width: min(560px, 100%);
	max-height: min(88dvh, 900px);
	display: flex;
	flex-direction: column;
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	background: var(--panel);
	box-shadow: var(--shadow-lg);
	animation: modal-in 160ms ease;
}
.modal-wide {
	width: min(720px, 100%);
}
.modal-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	padding: 20px 22px 12px;
}
.modal-title {
	margin: 0 0 3px;
	font-size: var(--text-lg);
	font-weight: var(--fw-semibold);
	letter-spacing: -0.01em;
}
.modal-head .muted {
	margin: 0;
	font-size: var(--text-base);
	color: var(--weak);
}
.modal-body {
	display: grid;
	gap: 12px;
	padding: 4px 22px 20px;
	overflow-y: auto;
}
.modal-foot {
	display: flex;
	align-items: center;
	gap: 8px;
	padding-top: 12px;
	margin-top: 4px;
	border-top: 1px solid var(--border-subtle);
}
.spacer {
	flex: 1;
}
#issued-token {
	display: block;
	text-align: center;
	font-family: var(--font-mono);
	font-size: var(--text-lg);
	font-weight: var(--fw-bold);
	letter-spacing: 0.06em;
	padding: 16px;
	border-radius: var(--radius-sm);
	background: var(--surface);
	border: 1px solid var(--border);
	user-select: all;
}
@keyframes fade-in {
	from { opacity: 0; }
	to { opacity: 1; }
}
@keyframes modal-in {
	from { opacity: 0; transform: translateY(8px) scale(0.99); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- assistente de nova empresa (= passos do EntryShell) ---------- */
.steps {
	display: flex;
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 0 22px 12px;
}
.step {
	display: flex;
	align-items: center;
	gap: 7px;
	flex: 1;
	color: var(--weak);
	font-size: var(--text-sm);
	font-weight: var(--fw-semibold);
}
.step-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	border: 2px solid var(--border);
	background: var(--panel);
	flex-shrink: 0;
}
.step.is-current {
	color: var(--accent);
}
.step.is-current .step-dot {
	border-color: var(--accent);
	background: var(--accent);
	box-shadow: 0 0 0 4px var(--accent-soft);
}
.step.is-done {
	color: var(--ink);
}
.step.is-done .step-dot {
	border-color: var(--success);
	background: var(--success);
}
.wizard-step {
	display: grid;
	gap: 14px;
	border: none;
	margin: 0;
	padding: 0;
	min-width: 0;
}
.step-question {
	margin: 0;
	font-size: var(--text-md);
	font-weight: var(--fw-semibold);
}
.step-block {
	display: grid;
	gap: 8px;
}
.big-field input {
	height: 42px;
	font-size: var(--text-md);
	border-radius: var(--radius-md);
}
.field-row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 12px;
	align-items: end;
}
.input-with-button {
	display: flex;
	gap: 6px;
	align-items: center;
}
.logo-field {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
}
.logo-field .hint {
	flex-basis: 100%;
}
.logo-preview {
	width: 40px;
	height: 40px;
	border-radius: var(--radius-sm);
	object-fit: cover;
	border: 1px solid var(--border);
	background: var(--panel);
}
.logo-pick {
	cursor: pointer;
}
.choice-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 10px;
}
.choice-grid-3 {
	grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.choice {
	position: relative;
	display: grid;
	gap: 5px;
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	background: var(--panel);
	padding: 14px 16px;
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.choice:hover {
	border-color: var(--weak);
}
.choice input[type="radio"] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}
.choice-title {
	font-size: var(--text-base);
	font-weight: var(--fw-semibold);
	color: var(--ink);
}
.choice-text {
	color: var(--muted);
	font-size: var(--text-sm);
	font-weight: var(--fw-regular);
	line-height: 1.5;
}
.choice.is-selected {
	border-color: var(--accent);
	background: var(--accent-soft);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}
.choice.is-selected .choice-title::after {
	content: " ✓";
	color: var(--accent);
}
.plan-picker {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
	gap: 10px;
}
.plan-option {
	position: relative;
	display: grid;
	gap: 3px;
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	background: var(--panel);
	padding: 12px 14px;
	cursor: pointer;
	color: var(--ink);
	transition: border-color 0.15s, background 0.15s;
}
.plan-option:hover {
	border-color: var(--weak);
}
.plan-option input[type="radio"] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}
.plan-option-title {
	font-size: var(--text-base);
	font-weight: var(--fw-semibold);
}
.plan-option-meta {
	color: var(--muted);
	font-size: var(--text-sm);
	font-weight: var(--fw-regular);
}
.plan-option.is-selected {
	border-color: var(--accent);
	background: var(--accent-soft);
}
.summary-box {
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	background: var(--surface);
	padding: 14px 16px;
	display: grid;
	gap: 5px;
}
.summary-title {
	font-size: var(--text-xs);
	font-weight: var(--fw-semibold);
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--muted);
	margin-bottom: 3px;
}
.summary-line {
	font-size: var(--text-base);
	color: var(--ink);
}
details.advanced {
	border: 1px dashed var(--border);
	border-radius: var(--radius-md);
	background: var(--surface);
	padding: 10px 14px;
}
details.advanced > summary {
	cursor: pointer;
	font-size: var(--text-base);
	font-weight: var(--fw-medium);
	color: var(--muted);
}
details.advanced[open] > summary {
	margin-bottom: 12px;
}
details.advanced > *:not(summary) {
	margin-bottom: 10px;
}
#skill-form textarea[name="body"] {
	font-family: var(--font-mono);
	font-size: var(--text-base);
	line-height: 1.5;
}
.company-picker {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 8px;
	max-height: 260px;
	overflow: auto;
	padding: 2px;
}
.company-choice {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background: var(--panel);
	padding: 10px 12px;
	cursor: pointer;
	font-weight: var(--fw-regular);
	color: var(--ink);
}
.company-choice:hover {
	border-color: var(--weak);
}
.company-choice input[type="checkbox"] {
	margin-top: 2px;
}
.company-choice-name {
	font-size: var(--text-base);
	font-weight: var(--fw-semibold);
}
.company-choice-meta {
	display: block;
	color: var(--muted);
	font-size: var(--text-sm);
}
.company-choice.is-selected {
	border-color: var(--accent);
	background: var(--accent-soft);
}

/* ---------- toast ---------- */
.toast {
	position: fixed;
	left: 50%;
	bottom: 24px;
	transform: translateX(-50%);
	max-width: min(560px, calc(100vw - 32px));
	padding: 10px 16px;
	border-radius: var(--radius-sm);
	background: var(--solid-bg);
	color: var(--solid-fg);
	font-size: var(--text-base);
	font-weight: var(--fw-medium);
	box-shadow: var(--shadow-md);
	z-index: 80;
	animation: toast-in 160ms ease;
}
.toast.error {
	background: var(--red-text);
	color: #ffffff;
}
@keyframes toast-in {
	from { opacity: 0; transform: translate(-50%, 8px); }
	to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------- telas estreitas ---------- */
@media (max-width: 720px) {
	.shell {
		padding: 0 14px 48px;
	}
	.topbar {
		margin: 0 -14px 16px;
		padding: 0 14px;
	}
	.page-tools input[type="search"] {
		width: 100%;
	}
	.member-row,
	.member-add,
	.device-row {
		grid-template-columns: 1fr 1fr;
	}
	.card-stats {
		grid-template-columns: 1fr 1fr;
	}
	.topnav {
		display: none;
	}
}
