/* ==========================================================================
   Unlockify · sistema visual
   - Tokens (color, radios, sombras) en :root, con modo oscuro automatico.
   - Tipografia Inter servida por la propia app (/fonts/file/Inter/...).
   - Glassmorphism en sidebar y tarjetas, micro-interacciones y animaciones
     de entrada escalonadas; todo respeta prefers-reduced-motion.
   Las clases e ids que consulta el JS (designer.js, document-form.js, vault.js,
   scan-text.js) se mantienen con el mismo nombre.
   ========================================================================== */

@font-face { font-family: "Inter UI"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/file/Inter/400-normal.ttf") format("truetype"); }
@font-face { font-family: "Inter UI"; font-weight: 500; font-style: normal; font-display: swap; src: url("/fonts/file/Inter/500-normal.ttf") format("truetype"); }
@font-face { font-family: "Inter UI"; font-weight: 600; font-style: normal; font-display: swap; src: url("/fonts/file/Inter/600-normal.ttf") format("truetype"); }
@font-face { font-family: "Inter UI"; font-weight: 700; font-style: normal; font-display: swap; src: url("/fonts/file/Inter/700-normal.ttf") format("truetype"); }
@font-face { font-family: "Inter UI"; font-weight: 800; font-style: normal; font-display: swap; src: url("/fonts/file/Inter/800-normal.ttf") format("truetype"); }

/* ------------------------------------------------------------------ tokens */
:root {
	color-scheme: light;
	--bg: #f3f5fb;
	--bg-2: #e9edf8;
	--surface: #ffffff;
	--surface-2: #f4f6fb;
	--surface-glass: rgba(255, 255, 255, .72);
	--border: #e2e7f1;
	--border-strong: #c9d2e3;
	--text: #141a2b;
	--text-2: #3b4458;
	--muted: #68728a;

	--primary: #4f46e5;
	--primary-2: #7c3aed;
	--primary-3: #06b6d4;
	--primary-dark: #3f37c9;
	--primary-soft: #eceafd;
	--primary-rgb: 79, 70, 229;
	--grad: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #06b6d4 130%);
	--grad-text: linear-gradient(100deg, #4f46e5, #a21caf 60%, #0891b2);

	--danger: #d4283c; --danger-soft: #fde8ec;
	--success: #0f9d6a; --success-soft: #dff7ec;
	--warn: #b45309; --warn-soft: #fff1d6;
	--info: #0369a1; --info-soft: #e0f2fe;

	--radius: 16px; --radius-sm: 10px; --radius-xs: 7px;
	--sidebar: 256px;
	--font: "Inter UI", Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--mono: ui-monospace, "Cascadia Mono", "JetBrains Mono", Consolas, monospace;

	--shadow-xs: 0 1px 2px rgba(20, 26, 43, .05);
	--shadow-sm: 0 2px 6px rgba(20, 26, 43, .06), 0 1px 2px rgba(20, 26, 43, .04);
	--shadow-md: 0 10px 30px -10px rgba(20, 26, 43, .18), 0 2px 6px rgba(20, 26, 43, .05);
	--shadow-lg: 0 24px 60px -18px rgba(20, 26, 43, .28), 0 6px 16px -8px rgba(20, 26, 43, .1);
	--shadow-primary: 0 10px 24px -8px rgba(var(--primary-rgb), .55);
	--ring: 0 0 0 4px rgba(var(--primary-rgb), .18);

	--ease: cubic-bezier(.2, .8, .2, 1);
	--ease-spring: cubic-bezier(.34, 1.56, .64, 1);
	--dur: .22s;

	--sidebar-bg: linear-gradient(180deg, rgba(14, 18, 38, .96), rgba(22, 20, 56, .96));
	--sidebar-text: #c9d0e6;
	--sidebar-muted: #8e97b3;
	--canvas-bg: #e6eaf4;
	--code-bg: #eef1f8;
	--table-head: #f6f8fc;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		color-scheme: dark;
		--bg: #0b0e1a;
		--bg-2: #121631;
		--surface: #151a2e;
		--surface-2: #1c2240;
		--surface-glass: rgba(21, 26, 46, .72);
		--border: #262d4a;
		--border-strong: #37406a;
		--text: #eef0fb;
		--text-2: #c3c9e2;
		--muted: #8d95b5;
		--primary: #818cf8;
		--primary-2: #a78bfa;
		--primary-3: #22d3ee;
		--primary-dark: #a5b4fc;
		--primary-soft: rgba(129, 140, 248, .16);
		--primary-rgb: 129, 140, 248;
		--grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #06b6d4 130%);
		--grad-text: linear-gradient(100deg, #a5b4fc, #e879f9 60%, #67e8f9);
		--danger: #fb7185; --danger-soft: rgba(251, 113, 133, .14);
		--success: #34d399; --success-soft: rgba(52, 211, 153, .14);
		--warn: #fbbf24; --warn-soft: rgba(251, 191, 36, .14);
		--info: #38bdf8; --info-soft: rgba(56, 189, 248, .14);
		--shadow-xs: 0 1px 2px rgba(0, 0, 0, .3);
		--shadow-sm: 0 2px 8px rgba(0, 0, 0, .35);
		--shadow-md: 0 12px 32px -10px rgba(0, 0, 0, .6);
		--shadow-lg: 0 28px 70px -20px rgba(0, 0, 0, .75);
		--shadow-primary: 0 10px 28px -8px rgba(99, 102, 241, .55);
		--sidebar-bg: linear-gradient(180deg, rgba(10, 12, 28, .9), rgba(16, 14, 40, .9));
		--canvas-bg: #0f1326;
		--code-bg: #1c2240;
		--table-head: #1a2039;
	}
}
:root[data-theme="dark"] {
	color-scheme: dark;
	--bg: #0b0e1a; --bg-2: #121631; --surface: #151a2e; --surface-2: #1c2240; --surface-glass: rgba(21, 26, 46, .72);
	--border: #262d4a; --border-strong: #37406a; --text: #eef0fb; --text-2: #c3c9e2; --muted: #8d95b5;
	--primary: #818cf8; --primary-2: #a78bfa; --primary-3: #22d3ee; --primary-dark: #a5b4fc; --primary-soft: rgba(129, 140, 248, .16); --primary-rgb: 129, 140, 248;
	--grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #06b6d4 130%); --grad-text: linear-gradient(100deg, #a5b4fc, #e879f9 60%, #67e8f9);
	--danger: #fb7185; --danger-soft: rgba(251, 113, 133, .14); --success: #34d399; --success-soft: rgba(52, 211, 153, .14);
	--warn: #fbbf24; --warn-soft: rgba(251, 191, 36, .14); --info: #38bdf8; --info-soft: rgba(56, 189, 248, .14);
	--shadow-xs: 0 1px 2px rgba(0, 0, 0, .3); --shadow-sm: 0 2px 8px rgba(0, 0, 0, .35); --shadow-md: 0 12px 32px -10px rgba(0, 0, 0, .6); --shadow-lg: 0 28px 70px -20px rgba(0, 0, 0, .75);
	--shadow-primary: 0 10px 28px -8px rgba(99, 102, 241, .55); --sidebar-bg: linear-gradient(180deg, rgba(10, 12, 28, .9), rgba(16, 14, 40, .9));
	--canvas-bg: #0f1326; --code-bg: #1c2240; --table-head: #1a2039;
}

/* ------------------------------------------------------------- animaciones */
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { opacity: 0; transform: scale(.94) translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes slide-right { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
@keyframes blob-a { 0% { transform: translate(0, 0) scale(1); } 33% { transform: translate(6vw, -4vh) scale(1.15); } 66% { transform: translate(-4vw, 6vh) scale(.95); } 100% { transform: translate(0, 0) scale(1); } }
@keyframes blob-b { 0% { transform: translate(0, 0) scale(1); } 33% { transform: translate(-7vw, 5vh) scale(1.1); } 66% { transform: translate(5vw, -5vh) scale(1.2); } 100% { transform: translate(0, 0) scale(1); } }
@keyframes blob-c { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(4vw, 7vh) scale(1.25); } 100% { transform: translate(0, 0) scale(1); } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 rgba(var(--primary-rgb), .45); } 100% { box-shadow: 0 0 0 14px rgba(var(--primary-rgb), 0); } }
@keyframes gradient-pan { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes bar-indeterminate { 0% { transform: translateX(-100%) scaleX(.3); } 50% { transform: translateX(40%) scaleX(.6); } 100% { transform: translateX(260%) scaleX(.3); } }
@keyframes cube-spin { 0% { transform: rotateX(-24deg) rotateY(0deg); } 100% { transform: rotateX(-24deg) rotateY(360deg); } }
@keyframes orbit { to { transform: rotateZ(360deg); } }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 3px var(--primary); } 100% { box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0); } }

/* --------------------------------------------------------------- base */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
	font-family: var(--font); font-size: 14px; color: var(--text); background: var(--bg); line-height: 1.5;
	-webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
	font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}
body::before {
	content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
	background:
		radial-gradient(900px 520px at 85% -10%, rgba(var(--primary-rgb), .14), transparent 60%),
		radial-gradient(700px 480px at -10% 100%, rgba(6, 182, 212, .12), transparent 60%);
}
a { color: var(--primary); text-decoration: none; transition: color var(--dur) var(--ease); }
a:hover { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
h1 { font-size: 27px; margin: 0 0 4px; font-weight: 750; letter-spacing: -.025em; line-height: 1.15; }
h2 { font-size: 16.5px; margin: 0 0 12px; font-weight: 700; letter-spacing: -.012em; }
h3 { font-size: 14px; margin: 14px 0 6px; font-weight: 650; }
p { margin: 0 0 8px; }
code { font-family: var(--mono); font-size: 12px; background: var(--code-bg); padding: 2px 6px; border-radius: 5px; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }
.small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.right { text-align: right; }
.center { text-align: center; }
.req { color: var(--danger); margin-left: 2px; }
.text-danger { color: var(--danger); }
::selection { background: rgba(var(--primary-rgb), .25); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

/* -------------------------------------------------------------- shell */
.shell { display: flex; min-height: 100vh; }
.sidebar {
	width: var(--sidebar); flex: 0 0 var(--sidebar); color: var(--sidebar-text);
	display: flex; flex-direction: column; gap: 4px; padding: 20px 14px;
	position: sticky; top: 0; height: 100vh; overflow-y: auto; overflow-x: hidden;
	background: var(--sidebar-bg); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
	border-right: 1px solid rgba(255, 255, 255, .06); z-index: 20;
	animation: slide-right .5s var(--ease) both;
}
.sidebar::before {
	content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
	background: radial-gradient(420px 260px at 20% 0%, rgba(124, 58, 237, .35), transparent 70%),
		radial-gradient(360px 300px at 100% 100%, rgba(6, 182, 212, .25), transparent 70%);
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 999px; }

.brand { display: flex; align-items: center; gap: 11px; color: #fff; font-weight: 800; font-size: 19px; padding: 4px 8px 18px; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand-mark {
	display: inline-flex; width: 34px; height: 34px; border-radius: 10px; color: #fff; align-items: center; justify-content: center; font-weight: 900;
	background: var(--grad); background-size: 200% 200%; animation: gradient-pan 6s ease infinite;
	box-shadow: 0 6px 18px -6px rgba(124, 58, 237, .7), inset 0 1px 0 rgba(255, 255, 255, .35);
	transition: transform var(--dur) var(--ease-spring);
}
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.08); }
.brand-lg { justify-content: center; font-size: 24px; }
.brand-lg .brand-mark { width: 44px; height: 44px; border-radius: 13px; font-size: 22px; }

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav a {
	position: relative; display: flex; align-items: center; gap: 10px; color: var(--sidebar-text); padding: 9px 12px 9px 14px;
	border-radius: var(--radius-sm); font-weight: 500; font-size: 13.5px;
	transition: background var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.nav a::before {
	content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .35; flex: none;
	transition: all var(--dur) var(--ease);
}
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; transform: translateX(2px); }
.nav a:hover::before { opacity: .8; transform: scale(1.3); }
.nav a.active { background: rgba(255, 255, 255, .1); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), 0 4px 14px -6px rgba(0, 0, 0, .5); }
.nav a.active::before { background: var(--grad); opacity: 1; box-shadow: 0 0 10px 2px rgba(124, 58, 237, .5); }
.nav-platform { margin-top: 18px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .08); }
.nav-heading { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--sidebar-muted); padding: 0 12px 6px; display: block; font-weight: 700; }
.nav-count { display: inline-block; min-width: 20px; text-align: center; background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #3a2600; border-radius: 999px; font-size: 11px; font-weight: 800; padding: 1px 6px; margin-left: auto; box-shadow: 0 2px 8px -2px rgba(245, 158, 11, .8); }

.sidebar-footer { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid rgba(255, 255, 255, .08); display: flex; flex-direction: column; gap: 8px; }
.user-block { display: flex; flex-direction: column; gap: 1px; padding-left: 40px; position: relative; min-height: 34px; justify-content: center; }
.user-block::before {
	content: ""; position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%;
	background: var(--grad); box-shadow: 0 0 0 2px rgba(255, 255, 255, .15);
}
.user-name { color: #fff; font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta { font-size: 11.5px; color: var(--sidebar-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-muted { color: var(--muted); font-size: 12.5px; }
.sidebar .link-muted { color: var(--sidebar-muted); }
.sidebar .link-muted:hover { color: #fff; }

.main { flex: 1; min-width: 0; padding: 30px 40px 70px; max-width: 1440px; animation: fade-up .45s var(--ease) both; }

/* --------------------------------------------------- selector de organizacion */
.org-switcher { margin: 0 0 14px; position: relative; }
.org-switcher summary {
	list-style: none; cursor: pointer; padding: 10px 12px 10px 14px; border-radius: 12px; display: block; position: relative;
	background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08);
	transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.org-switcher summary::-webkit-details-marker { display: none; }
.org-switcher summary::after {
	content: ""; position: absolute; right: 14px; top: 50%; width: 7px; height: 7px; margin-top: -5px;
	border-right: 1.5px solid var(--sidebar-muted); border-bottom: 1.5px solid var(--sidebar-muted); transform: rotate(45deg);
	transition: transform var(--dur) var(--ease);
}
.org-switcher[open] summary::after { transform: rotate(-135deg); margin-top: -1px; }
.org-switcher summary:hover { background: rgba(255, 255, 255, .11); border-color: rgba(255, 255, 255, .16); }
.org-label { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--sidebar-muted); font-weight: 700; }
.org-name { display: block; color: #fff; font-weight: 650; font-size: 14px; line-height: 1.25; margin-top: 3px; padding-right: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-role { display: block; font-size: 11.5px; color: var(--sidebar-muted); }
.org-menu {
	position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border);
	border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; max-height: 340px; overflow-y: auto; color: var(--text);
	animation: pop-in .2s var(--ease) both; transform-origin: top center;
}
.org-menu form { margin: 0; }
.org-option { width: 100%; text-align: left; background: none; border: 0; border-radius: 8px; padding: 8px 10px; cursor: pointer; font: inherit; color: var(--text); transition: background var(--dur) var(--ease); }
.org-option:hover { background: var(--surface-2); }
.org-option small { display: block; color: var(--muted); font-size: 11.5px; }
.org-option.current { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.org-menu-foot { border-top: 1px solid var(--border); margin-top: 5px; padding: 8px 10px 4px; display: flex; flex-direction: column; gap: 5px; }
.org-menu-foot a { font-size: 12.5px; }
.org-empty { padding: 8px 9px; }

.sidebar-usage { margin-top: auto; padding: 12px 13px; border-radius: 12px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); display: flex; flex-direction: column; gap: 7px; }
.sidebar-usage-head { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--sidebar-text); font-weight: 600; }
.sidebar-usage .usage-bar { background: rgba(255, 255, 255, .14); }
.sidebar-usage a { color: var(--sidebar-muted); }
.sidebar-footer + .sidebar-usage, .sidebar-usage + .sidebar-footer { margin-top: 10px; }

/* ----------------------------------------------------------------- page */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; animation: fade-up .5s var(--ease) both; }
.page-head > div:first-child { min-width: 0; }
.page-head h1 { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; width: fit-content; max-width: 100%; }
.page-head .actions, .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.page-head .actions form, .actions form { margin: 0; }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--primary); }

.card {
	position: relative; background: var(--surface-glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
	border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 16px;
	box-shadow: var(--shadow-sm); transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
	animation: fade-up .55s var(--ease) both;
}
.card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.card-info { background: linear-gradient(135deg, rgba(var(--primary-rgb), .09), rgba(6, 182, 212, .07)); border-color: rgba(var(--primary-rgb), .25); }
.card-warn { background: linear-gradient(135deg, var(--warn-soft), rgba(251, 191, 36, .05)); border-color: rgba(245, 158, 11, .35); }
.card-link { display: block; color: inherit; }
.card-link:hover { border-color: var(--primary); text-decoration: none; transform: translateY(-4px); box-shadow: var(--shadow-md), 0 0 0 1px rgba(var(--primary-rgb), .3); }
.card-link h3 { margin-top: 0; font-size: 15.5px; }
.narrow { max-width: 580px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }

/* cascada: tarjetas, filas y tarjetas de lista aparecen escalonadas */
.two-col > *, .grid-cards > *, .stats > *, .billing-grid > *, .method-grid > *, .pricing-grid > *, .vault-grid > *, .faq-grid > *, .main > .card {
	animation: fade-up .55s var(--ease) both;
}
.two-col > :nth-child(2), .grid-cards > :nth-child(2), .stats > :nth-child(2), .billing-grid > :nth-child(2), .method-grid > :nth-child(2), .pricing-grid > :nth-child(2), .vault-grid > :nth-child(2), .faq-grid > :nth-child(2), .main > .card:nth-of-type(2) { animation-delay: .07s; }
.grid-cards > :nth-child(3), .stats > :nth-child(3), .method-grid > :nth-child(3), .pricing-grid > :nth-child(3), .vault-grid > :nth-child(3), .faq-grid > :nth-child(3), .main > .card:nth-of-type(3) { animation-delay: .14s; }
.grid-cards > :nth-child(4), .stats > :nth-child(4), .method-grid > :nth-child(4), .pricing-grid > :nth-child(4), .vault-grid > :nth-child(4), .faq-grid > :nth-child(4), .main > .card:nth-of-type(4) { animation-delay: .21s; }
.grid-cards > :nth-child(n+5), .vault-grid > :nth-child(n+5), .main > .card:nth-of-type(n+5) { animation-delay: .28s; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 16px; }
.stat {
	position: relative; overflow: hidden; background: var(--surface-glass); backdrop-filter: blur(14px); border: 1px solid var(--border); border-radius: var(--radius);
	padding: 20px 22px; box-shadow: var(--shadow-sm); transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.stat::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--grad); background-size: 200% 100%; animation: gradient-pan 5s ease infinite; }
.stat::after { content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle, rgba(var(--primary-rgb), .18), transparent 70%); pointer-events: none; }
.stat:nth-child(2)::before { background: linear-gradient(135deg, #06b6d4, #4f46e5); }
.stat:nth-child(3)::before { background: linear-gradient(135deg, #f59e0b, #ec4899); }
.stat:nth-child(3)::after { background: radial-gradient(circle, rgba(236, 72, 153, .16), transparent 70%); }
.stat:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.stat-value { font-size: 36px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: 12.5px; font-weight: 500; margin-top: 4px; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 6px; border-top: 1px solid var(--border); border-radius: 8px; transition: background var(--dur) var(--ease); animation: fade-up .45s var(--ease) both; }
.list li:hover { background: var(--surface-2); }
.list li:first-child { border-top: 0; }
.list li:nth-child(2) { animation-delay: .05s; } .list li:nth-child(3) { animation-delay: .1s; } .list li:nth-child(4) { animation-delay: .15s; } .list li:nth-child(5) { animation-delay: .2s; } .list li:nth-child(n+6) { animation-delay: .25s; }
.list li .muted { display: block; font-size: 12.5px; }
.list-compact li { padding: 7px 4px; }
.steps { padding-left: 0; list-style: none; counter-reset: step; display: flex; flex-direction: column; gap: 12px; }
.steps li { position: relative; padding-left: 40px; counter-increment: step; }
.steps li::before {
	content: counter(step); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center;
	font-size: 12.5px; font-weight: 800; color: #fff; background: var(--grad); box-shadow: var(--shadow-primary);
}
.dl { display: grid; grid-template-columns: 160px 1fr; gap: 6px 12px; margin: 0 0 8px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 500; }
.notes { white-space: pre-wrap; font-family: inherit; margin: 6px 0 0; font-size: 13px; }
.pager { display: flex; align-items: center; gap: 14px; justify-content: center; margin: 16px 0; font-size: 13px; color: var(--muted); }

/* ---------------------------------------------------------------- flash */
.flash { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; border: 1px solid transparent; animation: pop-in .35s var(--ease-spring) both; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow-sm); }
.flash-success { background: var(--success-soft); color: var(--success); border-color: rgba(15, 157, 106, .3); }
.flash-error { background: var(--danger-soft); color: var(--danger); border-color: rgba(212, 40, 60, .3); }
.flash code { display: block; margin-top: 4px; font-size: 12px; word-break: break-all; background: rgba(0, 0, 0, .06); }
.banner-admin { background: linear-gradient(135deg, rgba(var(--primary-rgb), .12), rgba(6, 182, 212, .08)); color: var(--primary-dark); border: 1px solid rgba(var(--primary-rgb), .3); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 16px; font-size: 13.5px; animation: fade-up .4s var(--ease) both; }
.banner-warn { background: var(--warn-soft); color: var(--warn); border-color: rgba(245, 158, 11, .35); }

/* ---------------------------------------------------------------- forms */
.stack { display: flex; flex-direction: column; gap: 14px; }
label { display: flex; flex-direction: column; gap: 5px; font-weight: 550; font-size: 13px; color: var(--text-2); }
label.check { flex-direction: row; align-items: center; gap: 8px; }
label .muted { font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=file], input[type=url], select, textarea {
	font: inherit; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); width: 100%;
	transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
	box-shadow: var(--shadow-xs);
}
input[type=file] { padding: 8px 10px; cursor: pointer; }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; font-size: 12.5px; padding: 6px 12px; border-radius: 8px; border: 0; margin-right: 12px; cursor: pointer; color: #fff; background: var(--grad); box-shadow: var(--shadow-primary); }
input:hover, select:hover, textarea:hover { border-color: var(--border-strong); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
input[type=checkbox], input[type=radio] { accent-color: var(--primary); width: 16px; height: 16px; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
textarea { resize: vertical; }
textarea.code { font-family: var(--mono); font-size: 12px; min-height: 520px; height: 100%; white-space: pre; line-height: 1.45; }
input.short { width: 90px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px 16px; }
.form-grid .span-2 { grid-column: span 2; }
.inline-form { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.inline-form input { width: 360px; max-width: 100%; }
.inline-label { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--muted); }
.inline-label input { width: 90px; padding: 6px 8px; }
.actions-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.actions-row form { margin: 0; }
.sticky-actions {
	position: sticky; bottom: 12px; z-index: 6; background: var(--surface-glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
	border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
	box-shadow: var(--shadow-lg); margin-bottom: 16px;
}
.check { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; }
.check input { margin-top: 2px; }

/* -------------------------------------------------------------- buttons */
.btn {
	position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; font-size: 13.5px;
	padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text);
	cursor: pointer; white-space: nowrap; box-shadow: var(--shadow-xs); overflow: hidden;
	transition: transform var(--dur) var(--ease-spring), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.btn:hover { background: var(--surface-2); text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.btn:active { transform: translateY(0) scale(.98); box-shadow: var(--shadow-xs); }
.btn-primary { background: var(--grad); background-size: 200% 200%; border-color: transparent; color: #fff; box-shadow: var(--shadow-primary); }
.btn-primary::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .28) 50%, transparent 70%); background-size: 250% 100%; background-position: 200% 0; transition: background-position .6s var(--ease); }
/* Se repite el fondo: .btn:hover pone el de superficie y dejaria el boton blanco con texto blanco. */
.btn-primary:hover, .btn-primary:active, .btn-primary:focus { background: var(--grad); background-size: 200% 200%; background-position: 100% 50%; color: #fff; border-color: transparent; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -8px rgba(var(--primary-rgb), .6); }
.btn-primary:hover::after { background-position: -50% 0; }
.btn-danger { color: var(--danger); border-color: rgba(212, 40, 60, .3); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-ghost { background: transparent; border-color: rgba(255, 255, 255, .18); color: var(--sidebar-text); box-shadow: none; }
.btn-ghost:hover { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .3); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }
.btn-icon { padding: 4px 9px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .6; cursor: progress; transform: none !important; box-shadow: var(--shadow-xs) !important; }
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading::before { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn:not(.btn-primary).is-loading::before { border-color: rgba(var(--primary-rgb), .25); border-top-color: var(--primary); }

/* --------------------------------------------------------------- tables */
.table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface-glass); backdrop-filter: blur(14px); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); margin-bottom: 16px; animation: fade-up .5s var(--ease) both; }
.table th, .table td { text-align: left; padding: 12px 14px; border-top: 1px solid var(--border); vertical-align: middle; }
.table thead th { border-top: 0; background: var(--table-head); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.table tbody tr { transition: background var(--dur) var(--ease); animation: fade-up .45s var(--ease) both; }
.table tbody tr:hover { background: rgba(var(--primary-rgb), .05); }
.table tbody tr:nth-child(1) { animation-delay: .04s; } .table tbody tr:nth-child(2) { animation-delay: .08s; } .table tbody tr:nth-child(3) { animation-delay: .12s; }
.table tbody tr:nth-child(4) { animation-delay: .16s; } .table tbody tr:nth-child(5) { animation-delay: .2s; } .table tbody tr:nth-child(6) { animation-delay: .24s; }
.table tbody tr:nth-child(7) { animation-delay: .28s; } .table tbody tr:nth-child(8) { animation-delay: .32s; } .table tbody tr:nth-child(n+9) { animation-delay: .36s; }
.table td a:not(.btn) { font-weight: 600; }
.table td .actions, .table td form { margin: 0; display: inline-flex; }
.table td .actions { gap: 6px; justify-content: flex-end; }
.table td.right { white-space: nowrap; }
.table td.right .btn + .btn, .table td.right .btn + form, .table td.right form + .btn { margin-left: 4px; }
.table-compact th, .table-compact td { padding: 7px 10px; font-size: 12.5px; }
.table-compact input, .table-compact select { padding: 5px 8px; font-size: 13px; }
.table td.idx, .table th.idx { width: 36px; color: var(--muted); }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 16px; border-radius: var(--radius); }
.table-scroll > .table { margin-bottom: 0; }
.card .table-scroll { margin-bottom: 0; }
.table-scroll + .pager { margin-top: 0; }
.card .table { background: var(--surface); backdrop-filter: none; box-shadow: none; margin-bottom: 0; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: .01em; background: var(--surface-2); color: var(--muted); border: 1px solid transparent; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge-draft { background: var(--warn-soft); color: var(--warn); }
.badge-published { background: var(--success-soft); color: var(--success); }
.badge-published::before { box-shadow: 0 0 0 0 currentColor; animation: pulse-ring 2s ease-out infinite; }
.badge-archived { background: var(--surface-2); color: var(--muted); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.pay-pending, .sub-pending_payment { background: var(--surface-2); color: var(--muted); }
.pay-pending_review, .pay-info_requested, .sub-pending_review { background: var(--warn-soft); color: var(--warn); }
.pay-approved, .sub-active { background: var(--success-soft); color: var(--success); }
.pay-rejected, .pay-cancelled, .pay-expired, .sub-cancelled, .sub-expired, .sub-suspended { background: var(--danger-soft); color: var(--danger); }
.pay-refunded { background: var(--info-soft); color: var(--info); }
.role-pill { font-size: 11.5px; font-weight: 650; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); margin-left: 6px; }
.role-pill.director { background: var(--primary-soft); color: var(--primary); }
.roles-help { list-style: none; padding: 0; margin: 12px 0 0; font-size: 12.5px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.roles-help b { color: var(--text); }
.scope-switch { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); padding: 3px; gap: 2px; box-shadow: var(--shadow-xs); }
.scope-switch a { padding: 6px 13px; font-size: 13px; font-weight: 600; color: var(--muted); border-radius: 7px; transition: all var(--dur) var(--ease); }
.scope-switch a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.scope-switch a.active { background: var(--grad); color: #fff; box-shadow: var(--shadow-primary); }

/* ------------------------------------------------------------- etiquetas */
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 11px; border-radius: 999px; font-size: 12px; font-weight: 650; background: var(--surface-2); color: var(--muted); border: 1px solid transparent; line-height: 1.7; transition: all var(--dur) var(--ease); }
.tag-list { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.tag-c0 { background: #e8edfb; color: #3b47c9; } .tag-c1 { background: #dff7ec; color: #0f7a52; } .tag-c2 { background: #fff1d6; color: #9a5a00; } .tag-c3 { background: #fde8ec; color: #b42336; }
.tag-c4 { background: #efe6fb; color: #6b32b8; } .tag-c5 { background: #dff5f9; color: #0d6a7d; } .tag-c6 { background: #fdeaf4; color: #a81e6d; } .tag-c7 { background: #eceff3; color: #44506a; }
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .tag-c0 { background: rgba(99, 102, 241, .2); color: #a5b4fc; } :root:not([data-theme="light"]) .tag-c1 { background: rgba(52, 211, 153, .18); color: #6ee7b7; }
	:root:not([data-theme="light"]) .tag-c2 { background: rgba(251, 191, 36, .18); color: #fcd34d; } :root:not([data-theme="light"]) .tag-c3 { background: rgba(251, 113, 133, .18); color: #fda4af; }
	:root:not([data-theme="light"]) .tag-c4 { background: rgba(167, 139, 250, .2); color: #c4b5fd; } :root:not([data-theme="light"]) .tag-c5 { background: rgba(34, 211, 238, .18); color: #67e8f9; }
	:root:not([data-theme="light"]) .tag-c6 { background: rgba(244, 114, 182, .18); color: #f9a8d4; } :root:not([data-theme="light"]) .tag-c7 { background: rgba(148, 163, 184, .18); color: #cbd5e1; }
}
.tag-pick { cursor: pointer; user-select: none; font-family: inherit; white-space: nowrap; position: relative; }
.tag-pick input { position: absolute; opacity: 0; width: 0; height: 0; }
.tag-pick.on { border-color: currentColor; box-shadow: 0 0 0 1px currentColor inset; font-weight: 750; }
.tag-pick:hover { filter: brightness(.96); transform: translateY(-1px); }
.tag-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: var(--surface-glass); backdrop-filter: blur(14px); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px; box-shadow: var(--shadow-sm); animation: fade-up .5s var(--ease) both; }
.tag-filter-head { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.tag-match { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; flex-direction: row; }
.tag-match select { padding: 5px 28px 5px 9px; font-size: 12.5px; width: auto; }
.tag-editor { display: block; }
.form-grid .tag-editor { grid-column: 1 / -1; }
.tag-suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }

/* ----------------------------------------------------------------- editor */
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mock-preview { border: 1px solid var(--border); border-radius: 10px; overflow: auto; max-height: 420px; background: var(--canvas-bg); }
.mock-preview img { display: block; width: 100%; height: auto; }
.table-block { border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-bottom: 12px; background: var(--surface); }
.table-block-head { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 10px; }
.table-block-head label { flex-direction: column; }
.table-block-head label input { width: 180px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; min-height: 560px; }
.split-pane { min-width: 0; display: flex; flex-direction: column; }
.split-pane-wide { grid-column: 1; }
.preview-frame { width: 100%; flex: 1; min-height: 560px; border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); }
/* Previsualizacion del PDF de prueba: todas las paginas apiladas, como al abrir el PDF. */
.preview-pages { flex: 1; display: flex; flex-direction: column; min-height: 560px; max-height: 80vh; border: 1px solid var(--border); border-radius: 12px; background: #e9ecf1; box-shadow: var(--shadow-sm); overflow: hidden; }
.preview-pages-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; background: #fff; border-bottom: 1px solid var(--border); font-size: 13px; }
.preview-pages-list { flex: 1; overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.preview-page { position: relative; width: 100%; max-width: 820px; }
.preview-page img { display: block; width: 100%; height: auto; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.18), 0 6px 18px rgba(0,0,0,.08); }
.preview-page-num { position: absolute; right: 8px; bottom: 8px; padding: 2px 8px; border-radius: 999px; background: rgba(17,24,39,.72); color: #fff; font-size: 11px; }
.pdf-frame { width: 100%; min-height: 80vh; border: 1px solid var(--border); border-radius: 12px; background: #3a3f52; box-shadow: var(--shadow-md); }

/* pestanas */
.tabs { display: flex; gap: 4px; margin-bottom: 18px; padding: 4px; background: var(--surface-glass); backdrop-filter: blur(14px); border: 1px solid var(--border); border-radius: 12px; width: fit-content; max-width: 100%; box-shadow: var(--shadow-sm); overflow-x: auto; animation: fade-up .5s var(--ease) both; }
.tab { font: inherit; font-weight: 600; font-size: 13.5px; padding: 8px 18px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; white-space: nowrap; transition: all var(--dur) var(--ease); }
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab.active { background: var(--grad); color: #fff; box-shadow: var(--shadow-primary); }
.tab-panel { margin-bottom: 16px; animation: fade-in .3s var(--ease) both; }

/* editor visual */
.designer { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-md); animation: fade-up .5s var(--ease) both; }
.designer-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-glass); backdrop-filter: blur(14px); flex-wrap: wrap; position: relative; z-index: 3; }
.designer-bar .sep { width: 1px; height: 22px; background: var(--border); margin: 0 2px; }
.designer-bar .btn-sm { box-shadow: none; }
.designer-bar label.check { font-size: 12.5px; color: var(--muted); }
#zoom-label { min-width: 42px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 12.5px; }
#save-state { font-size: 12.5px; }
.designer-body { display: grid; grid-template-columns: 228px 1fr 272px; min-height: 640px; }
.designer-side, .designer-props { padding: 14px; overflow-y: auto; max-height: 78vh; }
.designer-side { border-right: 1px solid var(--border); background: var(--surface); }
.designer-props { border-left: 1px solid var(--border); background: var(--surface-2); }
.designer-side h3, .designer-props h3 { margin: 16px 0 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.designer-side h3:first-child { margin-top: 0; }
.designer-canvas {
	overflow: auto; padding: 24px; max-height: 78vh; position: relative;
	background-color: var(--canvas-bg);
	background-image: radial-gradient(rgba(var(--primary-rgb), .18) 1px, transparent 1px);
	background-size: 18px 18px;
}
#canvas { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }

.cv-page { position: relative; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .1), 0 18px 40px -16px rgba(20, 26, 43, .4); overflow: hidden; flex: none; border-radius: 2px; transition: box-shadow var(--dur) var(--ease); }
.cv-el { position: absolute; box-sizing: border-box; }
.cv-text { white-space: nowrap; line-height: 1; overflow: visible; }
.cv-el:hover { outline: 1px solid rgba(var(--primary-rgb), .5); }
.cv-el.sel { outline: 1.5px solid var(--primary); box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .16); }
.cv-el.cv-inrow { outline: 1px dashed rgba(var(--primary-rgb), .4); }
.cv-cell { position: absolute; white-space: nowrap; line-height: 1; }
.cv-cell:hover { outline: 1px dotted var(--primary); }
.cv-cell.sel { outline: 1.5px solid var(--primary); background: rgba(var(--primary-rgb), .1); }
.cv-table { outline: 1px dashed #b9c0cd; }
.cv-table-tag { position: absolute; top: -15px; left: 0; opacity: 0; transition: opacity .12s; font: 10px/1.4 var(--font); color: #fff; background: var(--primary); padding: 0 6px; border-radius: 3px; white-space: nowrap; }
.cv-table:hover .cv-table-tag, .cv-table.sel .cv-table-tag { opacity: 1; }
.mk { background: rgba(79, 70, 229, .13); border-radius: 2px; box-shadow: inset 0 -1px 0 rgba(79, 70, 229, .5); }
.mk.empty { color: #777; font-style: italic; }
.mk.plain { background: transparent; box-shadow: none; }
.cv-handle { position: absolute; width: 10px; height: 10px; background: #fff; border: 1.5px solid var(--primary); border-radius: 3px; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.cv-handle-e { right: -5px; top: 50%; margin-top: -5px; cursor: ew-resize; }
.cv-handle-s { bottom: -5px; left: 50%; margin-left: -5px; cursor: ns-resize; }
.cv-handle-se { right: -5px; bottom: -5px; cursor: nwse-resize; }
.cv-page-label { font-size: 11.5px; color: var(--muted); margin: 4px 0 -6px; font-weight: 600; }
.cv-page-label.active { color: var(--primary); }
.cv-page.active { box-shadow: 0 0 0 2px var(--primary), 0 0 0 6px rgba(var(--primary-rgb), .18), 0 18px 40px -16px rgba(20, 26, 43, .4); }
.cv-line::before { content: ""; position: absolute; inset: -5px; }
.cv-ghost { outline: 1px dashed #b9c0cd; }
.shape-picker { position: relative; }
.shape-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; min-width: 230px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 5px; display: flex; flex-direction: column; animation: pop-in .18s var(--ease) both; transform-origin: top left; }
.shape-menu[hidden] { display: none; }
.shape-menu button { display: flex; align-items: center; gap: 10px; font: inherit; font-size: 13px; text-align: left; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text); cursor: pointer; transition: background var(--dur) var(--ease); }
.shape-menu button:hover, .shape-menu button:focus-visible { background: var(--primary-soft); outline: none; }
.shape-menu svg { width: 28px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; }
.shape-menu svg .filled { fill: rgba(var(--primary-rgb), .3); }
.cv-guide { position: absolute; display: none; background: #f43f5e; z-index: 50; pointer-events: none; }
.cv-guide-v { top: 0; bottom: 0; width: 1px; }
.cv-guide-h { left: 0; right: 0; height: 1px; }
body.dragging { user-select: none; cursor: grabbing; }

.chips { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.chip { display: flex; align-items: center; gap: 6px; padding: 6px 9px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); cursor: grab; font-size: 12.5px; transition: all var(--dur) var(--ease); box-shadow: var(--shadow-xs); }
.chip:hover { border-color: var(--primary); transform: translateX(2px); box-shadow: var(--shadow-sm); }
.chip.placed { opacity: .55; }
.chip-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-key { color: var(--muted); font-size: 11px; font-family: var(--mono); }
.chip.has-action { flex-wrap: wrap; row-gap: 2px; }
.chip.has-action .chip-label { flex: 1 1 100%; }
.chip.has-action .chip-key { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.chip .btn { padding: 1px 7px; font-size: 11.5px; box-shadow: none; }
.chip-group { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 8px; padding-left: 2px; }
.chip-group:first-child { margin-top: 0; }
.chip.drop-before { box-shadow: inset 0 2px 0 var(--primary); }
.chip.drop-after { box-shadow: inset 0 -2px 0 var(--primary); }
.grip { color: var(--muted); cursor: grab; user-select: none; font-size: 13px; line-height: 1; opacity: .7; }
.grip:active { cursor: grabbing; }

/* campos del modelo */
.review { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.review-title { font-size: 12.5px; margin-right: 2px; font-weight: 600; }
.review-chip { font-family: inherit; font-size: 12px; padding: 3px 11px; border-radius: 999px; border: 1px solid rgba(245, 158, 11, .4); background: var(--warn-soft); color: var(--warn); cursor: pointer; transition: all var(--dur) var(--ease); }
.review-chip.plain { cursor: default; }
.review-chip:hover { filter: brightness(.97); transform: translateY(-1px); }
.review-chip.on { border-color: var(--warn); box-shadow: 0 0 0 1px var(--warn) inset; font-weight: 700; }
.review-ok { font-size: 12.5px; font-weight: 600; color: var(--success); background: var(--success-soft); border-radius: 999px; padding: 3px 12px; }
.fld.reviewed { border-color: rgba(15, 157, 106, .4); }
.fld.reviewed .fld-label { color: var(--muted); }
.fld.flash, .cv-el.flash { animation: flash 1.5s ease-out; }

.modal { position: fixed; inset: 0; background: rgba(10, 12, 28, .55); backdrop-filter: blur(6px); display: flex; align-items: flex-start; justify-content: center; padding: 30px 16px; z-index: 50; overflow: auto; animation: fade-in .2s var(--ease) both; }
.modal-box { background: var(--bg); border-radius: var(--radius); width: min(900px, 100%); box-shadow: var(--shadow-lg); animation: pop-in .3s var(--ease-spring) both; border: 1px solid var(--border); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; position: sticky; top: 0; z-index: 2; }
.modal-body { padding: 16px; }
.modal-body .card { margin-bottom: 12px; animation: none; }

.fields-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.fields-bar input[type=search] { flex: 1; min-width: 200px; padding: 7px 11px; }
.fields-bulk { position: sticky; top: 8px; z-index: 4; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--surface-glass); backdrop-filter: blur(14px); border: 1px solid rgba(var(--primary-rgb), .35); border-radius: var(--radius-sm); padding: 8px 12px; margin-bottom: 10px; box-shadow: var(--shadow-md); animation: pop-in .25s var(--ease) both; }
.fields-bulk strong { font-size: 12.5px; color: var(--primary); }
.bulk-select { padding: 4px 26px 4px 8px; font-size: 12.5px; width: auto; }
.fld.picked { border-color: var(--primary); background: rgba(var(--primary-rgb), .06); }
.fld-pick { margin: 0 2px 0 0; }
.fields { display: flex; flex-direction: column; gap: 10px; }
.fgroup { border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); overflow: hidden; transition: box-shadow var(--dur) var(--ease); }
.fgroup.drop-before { box-shadow: inset 0 3px 0 var(--primary); }
.fgroup.drop-after { box-shadow: inset 0 -3px 0 var(--primary); }
.fgroup-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); cursor: grab; background: var(--surface); }
.fgroup-head:active { cursor: grabbing; }
.fgroup-head strong { font-size: 13px; }
.fgroup-head .spacer { flex: 1; }
.fgroup-body { display: flex; flex-direction: column; gap: 6px; padding: 8px; min-height: 16px; }
.fgroup-body.drop-into { background: var(--primary-soft); }
.fld { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 7px 9px 8px; transition: all var(--dur) var(--ease); }
.fld:hover { border-color: var(--border-strong); box-shadow: var(--shadow-xs); }
.fld.dragging { opacity: .4; }
.fld.drop-before { box-shadow: inset 0 2px 0 var(--primary); }
.fld.drop-after { box-shadow: inset 0 -2px 0 var(--primary); }
.fld-main { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fld-main .fld-label { flex: 1; min-width: 90px; font-weight: 600; }
.fld-main select { width: auto; }
.fld-flag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--warn); background: var(--warn-soft); border-radius: 999px; padding: 1px 7px; white-space: nowrap; }
.fld-actions { display: inline-flex; gap: 3px; margin-left: auto; }
.fld-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 5px; }
.fld-meta label { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); flex-direction: row; }
.fld-meta label.grow { flex: 1; min-width: 180px; }
.fld-meta label.grow input { flex: 1; }
.fld-meta input[type=text], .fld-meta select { font-size: 12px; padding: 3px 7px; }
.fld-meta label.check { gap: 4px; }

/* panel de propiedades (solo estilos) */
.prop { display: flex; flex-direction: column; gap: 3px; font-size: 12px; font-weight: 550; margin-bottom: 9px; color: var(--text-2); }
.prop.check { flex-direction: row; align-items: center; gap: 6px; }
.prop input, .prop select, .prop textarea { padding: 6px 8px; font-size: 12.5px; border-radius: 8px; }
.prop select { padding-right: 26px; }
.prop input[type=color] { padding: 2px; height: 30px; border-radius: 8px; cursor: pointer; }
.prop select.font-select { font-size: 14px; }
.prop-row { display: flex; gap: 8px; }
.prop-row .prop { flex: 1; min-width: 0; }
.prop-buttons { margin-bottom: 8px; display: flex; gap: 4px; }
.prop-buttons .btn { flex: 1; box-shadow: none; }
.prop-wrap { display: flex; flex-direction: column; gap: 4px; }
.prop-wrap .btn { text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; box-shadow: none; }
.prop-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.prop-head strong { font-size: 13px; }
.prop-text { font-family: var(--mono); font-size: 12px; }

/* ---------------------------------------------------------- login / error */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px 16px; position: relative; overflow: hidden; background: var(--bg); }
.login-card {
	position: relative; z-index: 1; background: var(--surface-glass); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
	border: 1px solid rgba(255, 255, 255, .5); border-radius: 24px; padding: 36px 34px; width: 400px; max-width: 100%; text-align: center;
	box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, .6); animation: pop-in .6s var(--ease-spring) both;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .login-card { border-color: rgba(255, 255, 255, .1); box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, .08); } }
.login-card .brand { color: var(--text); animation: float 6s ease-in-out infinite; }
.login-card > .muted { margin-bottom: 8px; }
.login-card form { text-align: left; margin-top: 18px; }
.login-card .btn-block { margin-top: 4px; padding: 11px 16px; font-size: 14px; }
.login-links { margin-top: 16px; text-align: center; }
.login-card h2 { font-size: 20px; }

/* fondo animado compartido por login, registro y tarifa */
.bg-blobs { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.bg-blobs span { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; will-change: transform; }
.bg-blobs span:nth-child(1) { width: 52vw; height: 52vw; left: -14vw; top: -18vw; background: #7c3aed; animation: blob-a 22s ease-in-out infinite; }
.bg-blobs span:nth-child(2) { width: 44vw; height: 44vw; right: -12vw; top: 8vh; background: #06b6d4; animation: blob-b 26s ease-in-out infinite; }
.bg-blobs span:nth-child(3) { width: 40vw; height: 40vw; left: 28vw; bottom: -22vw; background: #ec4899; animation: blob-c 30s ease-in-out infinite; opacity: .4; }
.bg-blobs::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .5) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .5) 1px, transparent 1px); background-size: 48px 48px; mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%); opacity: .35; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bg-blobs span { opacity: .32; } :root:not([data-theme="light"]) .bg-blobs::after { background-image: linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px); } }

/* -------------------------------------------------------- paginas publicas */
.public-body { background: var(--bg); position: relative; min-height: 100vh; }
.public-body > * { position: relative; z-index: 1; }
.public-body > .bg-blobs, .login-body > .bg-blobs { position: fixed; z-index: 0; }
.public-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 32px; background: var(--surface-glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; animation: fade-in .5s var(--ease) both; }
.public-head .brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); padding: 0; }
.public-nav { display: flex; align-items: center; gap: 20px; font-size: 13.5px; font-weight: 550; }
.public-nav a:not(.btn) { color: var(--text-2); }
.public-nav a:not(.btn):hover { color: var(--primary); text-decoration: none; }
.public-main { max-width: 1100px; margin: 0 auto; padding: 56px 24px 72px; }
.public-foot { max-width: 1100px; margin: 0 auto; padding: 20px 24px 40px; display: flex; gap: 18px; justify-content: space-between; font-size: 12.5px; }
.pricing-intro { text-align: center; max-width: 680px; margin: 0 auto 44px; animation: fade-up .6s var(--ease) both; }
.pricing-intro h1 { font-size: clamp(30px, 5vw, 46px); letter-spacing: -.035em; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: 12px; }
.pricing-intro p { font-size: 15.5px; line-height: 1.6; }
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(258px, 1fr)); gap: 18px; align-items: stretch; }
.plan-card {
	position: relative; background: var(--surface-glass); backdrop-filter: blur(16px); border: 1px solid var(--border); border-radius: 20px; padding: 26px 22px; display: flex; flex-direction: column; gap: 10px;
	box-shadow: var(--shadow-sm); transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.plan-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: rgba(var(--primary-rgb), .4); }
.plan-card.plan-popular { border-color: transparent; box-shadow: var(--shadow-md); background-clip: padding-box; }
.plan-card.plan-popular::before { content: ""; position: absolute; inset: -1px; z-index: -1; border-radius: 21px; background: var(--grad); background-size: 200% 200%; animation: gradient-pan 6s ease infinite; }
.plan-card.plan-popular::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 20px; background: var(--surface); }
.plan-card.plan-current { border-color: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.plan-tag { position: absolute; top: -12px; left: 20px; background: var(--grad); color: #fff; font-size: 11px; font-weight: 700; padding: 4px 11px; border-radius: 999px; box-shadow: var(--shadow-primary); letter-spacing: .02em; }
.plan-card.plan-current .plan-tag { background: var(--success); box-shadow: 0 6px 16px -6px rgba(15, 157, 106, .6); }
.plan-card h2 { margin: 0; font-size: 20px; }
.plan-tagline { margin: 0; font-size: 12.5px; min-height: 34px; }
.plan-price { margin: 8px 0 4px; display: flex; align-items: baseline; gap: 5px; flex-wrap: wrap; }
.plan-amount { font-size: 38px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.plan-currency { font-size: 13px; font-weight: 700; color: var(--muted); }
.plan-period { font-size: 12.5px; color: var(--muted); }
.plan-features { list-style: none; padding: 0; margin: 6px 0 14px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; flex: 1; }
.plan-features li { padding-left: 26px; position: relative; }
.plan-features li::before { content: ""; position: absolute; left: 0; top: 1px; width: 17px; height: 17px; border-radius: 50%; background: var(--success-soft); }
.plan-features li::after { content: ""; position: absolute; left: 6px; top: 4px; width: 4px; height: 8px; border-right: 2px solid var(--success); border-bottom: 2px solid var(--success); transform: rotate(40deg); }
.plan-note { margin: 6px 0 0; text-align: center; }
.plan-card form { margin: 0; }
.pricing-table, .pricing-faq { margin-top: 56px; animation: fade-up .6s var(--ease) both; }
.pricing-table h2, .pricing-faq h2 { font-size: 22px; letter-spacing: -.02em; margin-bottom: 18px; }
.faq-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.faq-grid > div { background: var(--surface-glass); border: 1px solid var(--border); border-radius: 16px; padding: 18px 20px; box-shadow: var(--shadow-sm); transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.faq-grid > div:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.faq-grid h3 { margin-top: 0; font-size: 14.5px; }
.register-main { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.register-form { padding: 30px 28px; border-radius: 22px; }
.register-form h1 { font-size: 28px; }
.register-plans { display: flex; flex-direction: column; gap: 10px; animation: fade-up .6s .15s var(--ease) both; }
.plan-mini { background: var(--surface-glass); backdrop-filter: blur(14px); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; transition: all var(--dur) var(--ease); }
.plan-mini:hover { transform: translateX(3px); border-color: var(--border-strong); }
.plan-mini.selected { border-color: var(--primary); background: var(--primary-soft); box-shadow: var(--ring); }
.plan-mini-head { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.plan-mini p { margin: 3px 0 0; }
.small-heading { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 18px 0 6px; font-weight: 700; }

/* ------------------------------------------------------------- facturacion */
.billing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; margin-bottom: 16px; }
.billing-plan-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.billing-plan-head h2 { margin: 2px 0 0; font-size: 22px; }
.data-list { margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.data-list > div { display: flex; justify-content: space-between; gap: 14px; border-bottom: 1px dashed var(--border); padding-bottom: 7px; }
.data-list dt { color: var(--muted); font-size: 12.5px; margin: 0; }
.data-list dd { margin: 0; font-size: 13.5px; font-weight: 600; text-align: right; }
.usage-count { margin: 4px 0 10px; }
.usage-used { font-size: 38px; font-weight: 800; line-height: 1; letter-spacing: -.03em; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.usage-bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .06); }
.usage-bar-sm { height: 6px; }
.usage-fill { height: 100%; background: var(--grad); background-size: 200% 100%; border-radius: 999px; transform-origin: left; animation: grow-x 1.1s .2s var(--ease) both, gradient-pan 4s ease infinite; position: relative; }
.usage-fill::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent); background-size: 200% 100%; animation: shimmer 2.2s linear infinite; }
.usage-fill.over { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.notice { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--primary-soft); border: 1px solid rgba(var(--primary-rgb), .3); color: var(--primary-dark); border-radius: var(--radius-sm); padding: 11px 14px; margin-top: 14px; font-size: 13px; }
.notice-warn { background: var(--warn-soft); border-color: rgba(245, 158, 11, .35); color: var(--warn); }
.notice form.inline { margin: 0; }
.checkout-summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.checkout-summary h2 { margin: 2px 0 2px; font-size: 22px; }
.checkout-amount { text-align: right; display: flex; flex-direction: column; gap: 2px; align-items: flex-end; }
.checkout-amount strong { font-size: 30px; font-weight: 800; letter-spacing: -.03em; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.method-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(236px, 1fr)); gap: 14px; margin-bottom: 16px; }
.method-card { display: flex; flex-direction: column; gap: 8px; }
.method-card h3 { margin: 0; font-size: 15px; }
.method-card button { margin-top: auto; }
.method-detail { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 3px; word-break: break-all; }
.code-block { background: var(--code-bg); border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; font-family: var(--mono); font-size: 11.5px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
.timeline { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.timeline li { position: relative; display: grid; grid-template-columns: 130px 150px 1fr; gap: 10px; align-items: baseline; border-left: 2px solid var(--border); padding-left: 16px; animation: slide-right .4s var(--ease) both; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 0 3px var(--surface); }
.timeline li:nth-child(2) { animation-delay: .06s; } .timeline li:nth-child(3) { animation-delay: .12s; } .timeline li:nth-child(n+4) { animation-delay: .18s; }
.timeline-when { color: var(--muted); font-size: 12px; }
.timeline-what { font-weight: 600; font-size: 13px; }

/* ---------------------------------------------------------------- vault */
.decoder-row { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.decoder-input { flex: 1; min-width: 280px; }
.decoder-input input { font-family: var(--mono); font-size: 15px; letter-spacing: .06em; }
.decoder-advanced { min-width: 160px; padding-top: 24px; }
.decoder-advanced summary, .advanced summary { cursor: pointer; color: var(--primary); font-size: 13px; font-weight: 600; }
.advanced[open] summary { margin-bottom: 10px; }
.decoder-options { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.decoder-options label { width: 110px; }
.decoder-result { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; max-width: 560px; animation: pop-in .3s var(--ease-spring) both; }
.otp { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.otp-code { font-family: var(--mono); font-size: 32px; font-weight: 700; letter-spacing: .14em; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1.1; transition: color var(--dur) var(--ease); }
.otp-lg .otp-code { font-size: 42px; }
.otp-code.urgent { color: var(--danger); }
.otp-code.stale { color: var(--muted); }
.otp-bar { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.otp-fill { height: 100%; width: 100%; background: var(--grad); border-radius: 999px; transition: width .25s linear; }
.otp-fill.urgent { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.otp-meta { display: flex; gap: 14px; align-items: center; font-size: 12.5px; flex-wrap: wrap; }
.secret-input { font-family: var(--mono); font-size: 13px; }
.vault-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.vault-card { display: flex; flex-direction: column; gap: 10px; margin-bottom: 0; }
.vault-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.vault-title h3 { margin: 0; font-size: 15.5px; }
.vault-title p { margin: 2px 0 0; word-break: break-all; }
.vault-card .notes { margin: 0; color: var(--muted); }
.vault-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); }
.vault-foot form.inline { margin: 0; }
.vault-reveal { display: flex; flex-direction: column; gap: 4px; }
.vault-reveal-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 4px; }
.vault-reveal-row { display: flex; gap: 8px; align-items: flex-start; }
.vault-reveal-row .code-block { flex: 1; margin: 0; }

/* ----------------------------------------------------- texto del escaneo */
.st-bar { position: sticky; top: 8px; z-index: 5; display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: space-between; background: var(--surface-glass); backdrop-filter: blur(16px); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; box-shadow: var(--shadow-md); }
.st-presets, .st-submit, .st-legend { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.st-legend { gap: 14px; color: var(--muted); }
.st-key { display: inline-flex; align-items: center; gap: 6px; }
.st-key::before { content: ""; width: 18px; height: 11px; border-radius: 3px; }
.st-key-on::before { background: rgba(var(--primary-rgb), .22); border: 1.5px solid var(--primary); }
.st-key-off::before { border: 1.5px dashed #9aa3b2; }
.st-key-data::before { width: 4px; background: var(--success); }
.st-count { font-weight: 600; font-variant-numeric: tabular-nums; margin-right: 4px; }
.st-help { margin: 10px 2px 14px; }
.st-wait { margin: 8px 2px; }
.st-pages { display: flex; flex-direction: column; gap: 22px; margin-bottom: 24px; }
.st-page-head { margin: 0 0 6px; }
.st-sheet { position: relative; max-width: 1000px; background: #fff; border: 1px solid var(--border); border-radius: 6px; box-shadow: var(--shadow-md); overflow: hidden; }
.st-sheet img { position: absolute; inset: 0; width: 100%; height: 100%; user-select: none; }
.st-layer { position: absolute; inset: 0; cursor: crosshair; user-select: none; }
.st-run { position: absolute; padding: 0; margin: 0; border: 1.5px dashed rgba(102, 112, 127, .55); border-radius: 3px; background: transparent; cursor: pointer; transition: background-color .12s, border-color .12s; }
.st-run:hover, .st-run.hover { border-style: solid; border-color: var(--primary); background: rgba(var(--primary-rgb), .08); }
.st-run.on { border: 1.5px solid var(--primary); background: rgba(var(--primary-rgb), .2); }
.st-run.on:hover, .st-run.on.hover { background: rgba(var(--primary-rgb), .3); }
.st-run.data { box-shadow: inset 4px 0 0 var(--success); }
.st-run.table { cursor: not-allowed; border-style: solid; border-color: rgba(var(--primary-rgb), .45); background: repeating-linear-gradient(135deg, rgba(var(--primary-rgb), .14) 0 6px, rgba(var(--primary-rgb), .06) 6px 12px); }
.st-run:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.st-marquee { position: absolute; border: 1.5px solid var(--primary); background: rgba(var(--primary-rgb), .08); pointer-events: none; }

/* ------------------------------------------------- loader global (ui.js) */
.ui-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 1000; pointer-events: none; opacity: 0; transition: opacity .3s var(--ease); }
.ui-progress.on { opacity: 1; }
.ui-progress::before { content: ""; position: absolute; inset: 0; width: 40%; background: var(--grad); box-shadow: 0 0 12px rgba(var(--primary-rgb), .8); animation: bar-indeterminate 1.3s var(--ease) infinite; transform-origin: left; }

.ui-loader { position: fixed; inset: 0; z-index: 999; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; background: rgba(10, 12, 28, .62); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); opacity: 0; pointer-events: none; transition: opacity .35s var(--ease); color: #fff; text-align: center; padding: 24px; }
.ui-loader.on { opacity: 1; pointer-events: auto; }
.ui-loader-title { font-size: 18px; font-weight: 700; letter-spacing: -.01em; animation: fade-up .5s .2s var(--ease) both; }
.ui-loader-sub { font-size: 13px; color: rgba(255, 255, 255, .7); margin-top: 4px; min-height: 18px; animation: fade-up .5s .3s var(--ease) both; }
.ui-loader-dots::after { content: ""; display: inline-block; width: 1.2em; text-align: left; animation: dots 1.4s steps(4, end) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
.ui-scene { width: 120px; height: 120px; perspective: 700px; perspective-origin: 50% 40%; animation: pop-in .5s var(--ease-spring) both; position: relative; }
.ui-cube { position: absolute; inset: 0; transform-style: preserve-3d; animation: cube-spin 3.2s linear infinite; }
.ui-cube i { position: absolute; left: 30px; top: 30px; width: 60px; height: 60px; border-radius: 10px; border: 1.5px solid rgba(255, 255, 255, .55); background: linear-gradient(135deg, rgba(124, 58, 237, .75), rgba(6, 182, 212, .55)); box-shadow: inset 0 0 24px rgba(255, 255, 255, .15), 0 0 30px rgba(124, 58, 237, .35); backface-visibility: visible; }
.ui-cube i:nth-child(1) { transform: rotateY(0deg) translateZ(30px); }
.ui-cube i:nth-child(2) { transform: rotateY(90deg) translateZ(30px); background: linear-gradient(135deg, rgba(79, 70, 229, .8), rgba(236, 72, 153, .5)); }
.ui-cube i:nth-child(3) { transform: rotateY(180deg) translateZ(30px); }
.ui-cube i:nth-child(4) { transform: rotateY(-90deg) translateZ(30px); background: linear-gradient(135deg, rgba(6, 182, 212, .8), rgba(124, 58, 237, .5)); }
.ui-cube i:nth-child(5) { transform: rotateX(90deg) translateZ(30px); background: rgba(255, 255, 255, .35); }
.ui-cube i:nth-child(6) { transform: rotateX(-90deg) translateZ(30px); background: rgba(14, 18, 38, .8); }
.ui-orbit { position: absolute; inset: -14px; border-radius: 50%; border: 1.5px dashed rgba(255, 255, 255, .25); animation: orbit 7s linear infinite; }
.ui-orbit::before { content: ""; position: absolute; top: -5px; left: 50%; width: 9px; height: 9px; margin-left: -4px; border-radius: 50%; background: #22d3ee; box-shadow: 0 0 14px 3px rgba(34, 211, 238, .8); }
.ui-orbit.b { inset: -30px; animation-duration: 11s; animation-direction: reverse; border-color: rgba(255, 255, 255, .14); }
.ui-orbit.b::before { background: #f472b6; box-shadow: 0 0 14px 3px rgba(244, 114, 182, .8); }
.ui-loader-steps { display: flex; gap: 8px; align-items: center; animation: fade-up .5s .4s var(--ease) both; }
.ui-loader-steps span { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, .25); transition: all .4s var(--ease); }
.ui-loader-steps span.done { background: #fff; box-shadow: 0 0 10px 2px rgba(255, 255, 255, .5); transform: scale(1.2); }

/* tilt 3D de tarjetas (ui.js solo pone variables) */
[data-tilt], .stat[data-tilt]:hover, .card-link[data-tilt]:hover { transform: perspective(900px) rotateX(var(--tilt-x, 0)) rotateY(var(--tilt-y, 0)) translateY(var(--tilt-lift, 0)); transition: transform .25s var(--ease), box-shadow .25s var(--ease); }

/* -------------------------------------------------------------- responsive */
@media (max-width: 1250px) { .designer-body { grid-template-columns: 190px 1fr 240px; } }
@media (max-width: 1100px) {
	.editor-grid, .split, .two-col { grid-template-columns: 1fr; }
	.main { padding: 26px 26px 60px; }
}
@media (max-width: 960px) { .designer-body { grid-template-columns: 1fr; } .designer-side, .designer-props { max-height: none; border: 0; border-bottom: 1px solid var(--border); } .designer-canvas { max-height: 70vh; } }
@media (max-width: 860px) { .tag-match { margin-left: 0; } .register-main { grid-template-columns: 1fr; } .timeline li { grid-template-columns: 1fr; gap: 2px; } }
@media (max-width: 800px) {
	.shell { flex-direction: column; }
	.sidebar { width: auto; flex: none; height: auto; position: static; padding: 14px 16px; animation: fade-in .4s var(--ease) both; }
	.nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
	.nav a { padding: 7px 11px; font-size: 13px; }
	.nav-platform { margin-top: 10px; padding-top: 10px; }
	.nav-heading { width: 100%; }
	.sidebar-footer { margin-top: 12px; padding-top: 12px; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 10px 14px; }
	.user-block { flex: 1; min-width: 160px; }
	.sidebar-usage { margin-top: 12px; }
	.main { padding: 18px 16px 60px; }
	h1 { font-size: 23px; }
	.page-head { margin-bottom: 16px; }
	.card { padding: 16px; border-radius: 14px; }
	.table th, .table td { padding: 10px 12px; }
	.form-grid { grid-template-columns: 1fr; }
	.form-grid .span-2 { grid-column: auto; }
	.inline-form input { width: 100%; }
	.public-head { padding: 12px 16px; }
	.public-main { padding: 32px 16px 56px; }
	.login-card { padding: 28px 22px; border-radius: 20px; }
	.sticky-actions { bottom: 8px; }
	.st-bar { position: static; }
	.st-layer { cursor: default; }
	.ui-scene { width: 96px; height: 96px; }
	.split { min-height: 0; }
	.pdf-frame { min-height: 60vh; }
	.designer-bar { padding: 8px 10px; }
	.designer-canvas { padding: 12px; }
	.checkout-amount { align-items: flex-start; text-align: left; }
	.modal { padding: 12px 8px; }
}

/* ------------------------------------------------------ reduced motion */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
	.ui-cube, .ui-orbit, .bg-blobs span, .brand-mark, .usage-fill, .usage-fill::after, .stat::before { animation: none !important; }
	.ui-progress::before { width: 100%; }
}
